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

Fix dagre error with child named "id" #1610

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

gavin-ts
Copy link
Contributor

@gavin-ts gavin-ts commented Sep 22, 2023

Summary

Create object mapper for dagre and create safe integer ids for dagre to use during layout.

Details

  • fixes dagre: barfs on "id" child nodes #1605
  • adds dagre_child_id_id test
  • dagre has problems with certain strings such asx.id as an id, so we just give it nice integers to use
  • dagre order now based on g.Objects order instead of ID strings (dagre would put id: 1 before id: 2 even if you defined id: 2 first see ovals/people tests)
    • Note: I think this was from js numbers and object key iteration which always iterates ints first (in-order):
Screenshot 2023-09-22 at 2 03 28 PM

test now successful

Screenshot 2023-09-22 at 1 07 03 PM

e2ereport

Screenshot 2023-09-22 at 1 08 22 PM

@gavin-ts gavin-ts marked this pull request as ready for review September 22, 2023 20:20
d2layouts/d2dagrelayout/layout.go Outdated Show resolved Hide resolved
@gavin-ts gavin-ts merged commit 91eb672 into terrastruct:master Sep 25, 2023
2 checks passed
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.

dagre: barfs on "id" child nodes
2 participants