Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line labelling #332

Open
FalseProtagonist opened this issue Apr 5, 2022 · 0 comments
Open

Line labelling #332

FalseProtagonist opened this issue Apr 5, 2022 · 0 comments

Comments

@FalseProtagonist
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant