-
Notifications
You must be signed in to change notification settings - Fork 521
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
Default shape and style #1327
Comments
the way to do this in D2 will be with globs. it's being worked on.
|
Just out of curiosity, how will we set defaults for connections? |
|
It would be great to be able to specify that if the left side of a connection is of class sql_table and the right side of the connection is of type sql_table, then use the following decorators, something in the lines of
|
would this and "import" be a replacement for themes? |
@nhooyr pretty interesting for globs: #1327 (comment) |
@the42 it'll be done like so:
|
@bo-ku-ra that's a good point. theming currently has some rules for depth, but the selectors with globs should be able to get that too, so in theory, yeah this can completely cover themes. it should actually be more powerful than themes. because you can do things themes don't control, like adding borders etc Technically, themes are dictated by color codes: ![]() vars is currently under development and should be coming in the next release or so (#105). you should be able to customize themes by setting these codes.
|
Maybe my intention and your draft fulfil a different purpose though?
I know this is WIP and I might as well misinterpret your intention. |
@the42 the use-case is as you describe. |
does it work on v0.6.0? |
@bo-ku-ra not quite yet, but it will in 0.6.1 which will come this week hopefully. Right now, globs behavior only applies only to existing shapes. a
b
*.shape: circle
c
We plan to change it so that globs are lazy-evaluated and applied to each shape as they come in, so you can define the glob at the top, and |
i understand that d2 is not an interpreter language. and does it work on v0.6.0? |
As globs came a far way, I am aware of Given that, how would I style Does direction |
Is there a way to set the default shape and style for the diagram? I could not figure it out from the docs. If not, i think it is an important feature to be added.
Now, the default shape is a rectangle. If i need a simple diagram with ten connected circles, i'd have to add ten extra lines of code changing the shape of each one. And then the same with
style
to make them all green.The text was updated successfully, but these errors were encountered: