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

Multi-colored text #1001

Closed
Filip-K opened this issue Mar 8, 2023 · 3 comments
Closed

Multi-colored text #1001

Filip-K opened this issue Mar 8, 2023 · 3 comments

Comments

@Filip-K
Copy link

Filip-K commented Mar 8, 2023

Hi! I'm trying to create a legend which explains the colors used in my diagram, but I'm a bit at loss with creating colored text that does not overlap. Here's as far as I could get (link to the playground)
d2

Close enough, but the legend entries foo and bar overlap. Any ideas?

@cyborg-ts cyborg-ts added this to D2 Mar 8, 2023
@alixander
Copy link
Collaborator

@Filip-K ah, yeah multiple near set to the same constant will overlap.

The way to do this will be to put both items in a container and then set the near on just that container. But that's currently a TODO. We'll get to this in the next week or so. #848

https://play.d2lang.com/?l=&script=jJExDsIwDEV3n-Ij5iLB6IGJvUsvQKlpK0EipR5aUO6O7KiwMHRM9Oxvvf91zkgmhmhGdcbCeBPgGYcSzeiTSKBMtBjy-ock6Qx4SC-hK8AezTBOGCfoIGjqS73zX_PJaKNqfFY3CSqJAG_tyLjH6NOAC2WozFreHvireL0LyLQuODHaa9q8wK628UyfAAAA__8%3D&

@Filip-K
Copy link
Author

Filip-K commented Mar 8, 2023

I see, thanks! The trick with putting a legend into a container is already pretty good, even if it cannot be set near yet. Feel free to close this issue now or when #848 is done.

@alixander
Copy link
Collaborator

great to hear! I'll close this then in favor of that one

@github-project-automation github-project-automation bot moved this to Done in D2 Mar 8, 2023
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

No branches or pull requests

2 participants