TreeForm without overlap
I did this before, but never generalized the result.
rectOffset = {.25,.1};
fontSize = 10
TreeForm[list,
VertexRenderingFunction -> ({White, EdgeForm[Black],
Rectangle[#1 - rectOffset, #1 + rectOffset], Black,
Text[ Style[#2, fontSize], #1]} &)]
Edit With Tooltips
Using a "different approach"
Code is dirty, sorry no time to clean it up right now
rectOffset = {.33, .1};
fontSize = 9;
p = Cases[
Cases[MakeBoxes[TreeForm@list, StandardForm], TooltipBox[x__] -> x,
7, Heads -> True], TagBox[x__, y__] -> DisplayForm[First@{x}],
Heads -> True];
i = 0;
TreeForm[list,
VertexRenderingFunction -> ({White, EdgeForm[Black],
Rectangle[#1 - rectOffset, #1 + rectOffset], Black,
Tooltip[Text[Style[#2, fontSize], #1], p[[i++]]]} &)]
Output
Edit 2
I think this version is better:
Clear["Global`*"];
list = Hold[
GraphPlotHighlight[edges : {((_ -> _) | {_ -> _, _}) ...},
hl : {___} : {}, opts : OptionsPattern[]] :=
Module[{verts, coords, g, sub}, 5]];
myTreeForm[exp_] :=
Module[{ps, tooltipText, i},
ps[text_] := Rasterize[Text[Style[text]], "RasterSize"];
tooltipText =
Cases[Cases[MakeBoxes[TreeForm@list, StandardForm],
TooltipBox[x__] -> x, 7, Heads -> True],
TagBox[x__, y__] -> DisplayForm[First@{x}], Heads -> True];
i = 0;
TreeForm[list,
EdgeRenderingFunction -> ({Red, Line[#1]} &),
VertexRenderingFunction -> ({White, EdgeForm[Black], {}, Black,
Tooltip[
Inset[Rasterize[Text[" " <> ToString@#2 <> " "],
Background -> LightBlue], #1], tooltipText[[i++]]]} &)]
];
list // myTreeForm
Output:
Edit 4 ... and last one
Cleaned up code, remove spurious functions and variables that were there just to complicate things:
myTreeForm[list_] := Module[{tooltipText, i},
tooltipText =
Cases[Cases[MakeBoxes[TreeForm@list, StandardForm],
TooltipBox[x__] -> x, 7, Heads -> True],
TagBox[x__, y__] -> DisplayForm[First@{x}], Heads -> True];
i = 0;
TreeForm[list,
VertexRenderingFunction ->
({Tooltip[Inset[Rasterize[Text[" " <> ToString@#2 <> " "],
Background -> LightBlue], #1], tooltipText[[i++]]]} &)
]
];
HTH!