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

Add labelLocation option #358

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

futpib
Copy link

@futpib futpib commented Mar 27, 2019

No description provided.

@lutzroeder
Copy link
Contributor

Can you provide some context why this is needed and how it is used?

@futpib
Copy link
Author

futpib commented May 13, 2019

  1. Before this patch label position was always derived from label's bbox. I don't want this, I want to position the label "manually" (in my code), as my labels have unpredictable bboxes (I exclusively use the new labelLocation: 'origin' now). Even when all labels have equal bboxes and they don't change between updates, the positioning can be weird, like in this example: https://dagrejs.github.io/project/dagre-d3/latest/demo/etl-status.html, even when it stabilizes, zooming or resizing the window will make labels jump all over the place again)
  2. Before this patch there was no way to set any label position except the default "center". You can check this by searching for addLabel calls: all values passed as the 3rd location argument are: node.clusterLabelPos, 0 and undefined (while the switch had "top" and "bottom" cases). I had to add node.labelLocation the the switch to make it work without clusters

@lutzroeder lutzroeder force-pushed the master branch 2 times, most recently from d380990 to 3e26aa2 Compare June 22, 2019 04:56
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

Successfully merging this pull request may close these issues.

None yet

2 participants