What is a (the?) suggested approach for laying out edges that have labels on the edges, and using Webcola to include these labels in the layout?
Features I was thinking of:
label is drawn as close as possible to the midpoint of a line (with maybe a choice to place on the right hand side?)
label does not overlay a line (to aid readability)
label is rotated (?)
Rotation seems quite far away, requiring non-square shapes and dynamic rotation based on graph layout (?)
Label being close the the midpoint and above/below I thought of a pseudocode solution:
identify the midpoint with a zero-width zero-height node with same or smaller ideal link length to the two nodes containing the label-edge as the link length between those two nodes
create your real-width real-height label node with a tiny link size to the midpoint pseudonode and maybe a constraint to be below it
that doesn't solve the issue of avoiding overlap with the line, if we use avoidOverlaps or a constraint to avoid the midpoint pseudo-node it would be less likely but in order to guarantee it the only approach I can think of is to generate N pseudo-nodes along the link line by generalizing the above approach, but now we're really going hard on the pseudonodes.
What is a (the?) suggested approach for laying out edges that have labels on the edges, and using Webcola to include these labels in the layout?
Features I was thinking of:
label is drawn as close as possible to the midpoint of a line (with maybe a choice to place on the right hand side?)
label does not overlay a line (to aid readability)
label is rotated (?)
Rotation seems quite far away, requiring non-square shapes and dynamic rotation based on graph layout (?)
Label being close the the midpoint and above/below I thought of a pseudocode solution:
identify the midpoint with a zero-width zero-height node with same or smaller ideal link length to the two nodes containing the label-edge as the link length between those two nodes
create your real-width real-height label node with a tiny link size to the midpoint pseudonode and maybe a constraint to be below it
that doesn't solve the issue of avoiding overlap with the line, if we use avoidOverlaps or a constraint to avoid the midpoint pseudo-node it would be less likely but in order to guarantee it the only approach I can think of is to generate N pseudo-nodes along the link line by generalizing the above approach, but now we're really going hard on the pseudonodes.