-
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
render: support width/height on shapes #498
render: support width/height on shapes #498
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main thing here is handling containers. i think width
and height
only apply to non-containers for now?
8d8c826
to
397e14c
Compare
makes sense as TALA doesn't take it under consideration for proper placement. |
I think we could add a compiler warning for setting width or height on a container, but do we have currently have non-error warnings? I don't think setting the width or height to a value smaller than the minimum size should be a compiler warning, I think should just be the described behavior in the documentation. |
sounds nice but in practice it'd be annoying, because the container changes depending on layout. so from one compile to the next, the warning appears unpredictably |
The container structure should be the same regardless of layout, I think @ejulio-ts means always warning if you define width on a container shape, regardless of the value. |
yeah, for containers once you set, you get the error/warning. |
abe02fc
to
ae4e636
Compare
@@ -2,9 +2,11 @@ | |||
|
|||
- Tooltips can be set on shapes. See [https://d2lang.com/tour/tooltips](https://d2lang.com/tour/interactive). [#548](https://github.com/terrastruct/d2/pull/548) | |||
- Links can be set on shapes. See [https://d2lang.com/tour/tooltips](https://d2lang.com/tour/interactive). [#548](https://github.com/terrastruct/d2/pull/548) | |||
- The `width` and `height` attributes are no longer restricted to images and can be applied to non-container shapes. [#498](https://github.com/terrastruct/d2/pull/498) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-container shapes
Maybe, non-container objects as there're no such thing as container shapes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wanted to call every "node" a shape, as object is pretty all-encompassing. but i'm not 100% sure about that route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, from a changeling perspective, shape reminds me of shape
keyword and not the objects themselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from https://d2lang.com/tour/containers :
server
# Declares a shape inside of another shape
server.process
Summary
Support setting width/height on non-image shapes and handles classes/tables with an empty header.
Details
e2e test
unnamed class regression test