Skip to content

Line labelling #332

Description

@FalseProtagonist

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions