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

Container labels don't respect margins in Dagre and TALA #1812

Open
villesalmela opened this issue Jan 22, 2024 · 1 comment
Open

Container labels don't respect margins in Dagre and TALA #1812

villesalmela opened this issue Jan 22, 2024 · 1 comment

Comments

@villesalmela
Copy link

In short

It appears to me that in Dagre and TALA layouts, container labels have no margin or don't respect them. All works as expected, until you put something inside a shape, thus making it a container.

I'm pretty sure this isn't expected behavior, but correct me if I'm wrong.

ELK handles all the cases I've tested without issues.

Details

  • With plain shapes, the label does not cross the shape outline. This is expected.
  • With containers, the label can cross the shape outline and overlap with other objects. Sometimes the label doesn't fit the view and part of it gets cut off. This is unexpected.

TALA usually avoids the issue due to its creative, more flexible label positioning. However, if you use label.near, then TALA loses its advantage and starts behaving like Dagre (in the context of this issue).

Demonstration

Compiled using v0.6.3, sketch mode enabled. The images have not been cropped.

Plain shapes ✅

*.label.near: top-left
a: "Internal Corporate Network"
b: "External Partner Network"
a -> b

Dagre
test_shape_dagre
TALA
test_shape_tala

Containers without label.near ⚠️

a: "Internal Corporate Network"
b: "External Partner Network"
a.VLAN1
b.VLAN2

Dagre
test_container_dagre2

Containers with label.near ⚠️

*.label.near: top-left
a: "Internal Corporate Network"
b: "External Partner Network"
a.VLAN1 -> b.VLAN2

Dagre
test_container_dagre
TALA
test_container_tala

@cyborg-ts cyborg-ts added this to D2 Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants