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

adjust edge spacing/minimum length #1214

Open
gavin-ts opened this issue Apr 17, 2023 · 2 comments
Open

adjust edge spacing/minimum length #1214

gavin-ts opened this issue Apr 17, 2023 · 2 comments
Labels
good first issue Good for newcomers improvement Something can be better layout

Comments

@gavin-ts
Copy link
Contributor

should consider edge label dimensions, source/target arrowheads (and labels) to adjust how far apart edges need to be from each other, and how long they must be at a minimum

dagre and elk will need to be configured accordingly, dagre will likely need this to be set globally (max of all edges), but maybe elk can do this per-edge

@alixander
Copy link
Collaborator

do you have an example d2? @gavin-ts

@gavin-ts
Copy link
Contributor Author

Here's an example, it should adjust min edge length according to all of these factors

direction: right

0: no label {
  x -> y
}

1: label {
  x -> y: 1234567890
}

2: arrowhead label {
  a -> b: {
    target-arrowhead: 1234567890
  }
}

3: large arrowhead {
  a -> b: {
    target-arrowhead.shape: diamond
    style.stroke-width: 10
  }
}

Screen Shot 2023-04-27 at 7 30 07 PM

https://play.d2lang.com/?script=gkevlUIRKDi5uAysFPLyFcABp1DNpaBQoaBrp1DJVcvFZWiFIWylYGhkbGJqZm5haQBSYmSlAHcjkuJEkOIkKzBbQQHdMyiGKCjUggwyBtlVlJ6KZBxhg_TAkWSlkJKZmJuflwJWAw5OPeRQtlIwhFkDCAAA__8%3D&layout=elk&

@alixander alixander added the good first issue Good for newcomers label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Something can be better layout
Projects
Status: No status
Development

No branches or pull requests

3 participants
@alixander @gavin-ts and others