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

layout=dagre: container labels are too close to the top edge of "multiple" style containers #1339

Closed
emteelb opened this issue May 23, 2023 · 8 comments · Fixed by #1340
Closed
Assignees

Comments

@emteelb
Copy link

emteelb commented May 23, 2023

Compare the "Node" container label in this Dagre rendered diagram with the same label in this ELK rendered diagram.

I would just use the ELK layout engine for rendering my diagram but the above example is only a part of my diagram. My actual diagram has more connections and containers and I prefer the Dagre-rendered layout for that.

Is there a way to influence the padding of container labels that I might have missed in the documentation?

Thanks in advance for your time and help.

@cyborg-ts cyborg-ts added this to D2 May 23, 2023
@alixander
Copy link
Collaborator

thanks for reporting @emteelb

related: #63

we should fix this for multiple, should be quite easy. @gavin-ts can you get both this and the related issue in one?

@emteelb
Copy link
Author

emteelb commented May 24, 2023

Thanks for the fast response. I appreciate the acknowledgement and work. Enjoying using this tool so far!

@emteelb
Copy link
Author

emteelb commented May 31, 2023

Thanks for the work here. I git clone-ed this repo, ran the install.sh script and renamed the resulting d2 binary d2-new to avoid conflict w/ the d2 binary installed by my system's package manager.

I used the d2-new binary to generate a diagram (Dagre layout) that I was seeing this issue with earlier. I still see the issue where a text label is too close to a "multiple" style object.

I ran git log locally to verify that I see gavin-ts's commit there. I do. d2-new --version shows v0.4.2.

Is there anything else I can do here to verify that I am indeed running the latest, "fixed" version. Or something I am not doing but should be as relates to generating my diagram?

Thanks in advance for your time and help.

20230531-09:34:09_469x513_screengrab

@alixander
Copy link
Collaborator

alixander commented May 31, 2023

@emteelb
Copy link
Author

emteelb commented May 31, 2023

if you copy paste your code into playground, does it show correctly?

It does indeed. Thanks for the hint. So... something going on with my local environment then? I'm on Arch Linux, just updated today. If you have another hint for me, would take it, otherwise, I can use the Playground to get by in the meantime.

20230531-14:08:30_122x131_screengrab

@gavin-ts
Copy link
Contributor

hmm if something isn't working with the install script you can try go build . and ./d2 --version in the d2 root directory

@alixander
Copy link
Collaborator

@emteelb it actually shouldn't say 0.4.2 for the build-by-source d2. it should say 0.4.2-head. https://github.com/terrastruct/d2/blob/master/lib/version/version.go#L6

the install script doesn't build from source, it fetches latest. it's a todo to pass in an --edge flag to build latest

@emteelb
Copy link
Author

emteelb commented May 31, 2023

hmm if something isn't working with the install script you can try go build . and ./d2 --version in the d2 root directory

This worked perfectly and I see the text label looking nicely offset from the "multiple" object now after rendering my .d2 file with the Go-built binary.

Thanks to you both for the help and clarifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants