[feature request] component and tab shapes
It would be possible to provide a tab and component shapes as found in Graphviz (https://graphviz.org/doc/info/shapes.html)? This helps in generating similar diagrams when using d2 as an alternative to Graphviz.
@pmoura
The tab shape is too similar to package shape in D2.
The component shape imo is too UML-specific, and supporting UML is not a goal of D2. Can you just map those to rectangle in your tool?
Indeed I'm currently using d2 package shape as the alternative to the Graphviz tab shape.
But d2 rectangle shape is not (in my particular case) a good replacement for the Graphviz component shape. Btw, I don't use or generate UML diagrams as UML is too limited and fails to cover most of my language constructs.
So the only difference between rectangle and the component shape is the two mini rectangles on the left? It's my understanding that that's just an arbitrary symbol that UML bestows meaning to. If your goal also isn't UML, can you elaborate on why it's valuable?
I need a shape for a component (category in Logtalk lingo) that visually helps distinguish from objects and protocols (interfaces), which uses a box/rectangle shape. But I don't see this as related to UML at all. Providing similar shapes to Graphviz helps projects compatibility and migration when generating diagrams.
Would this feature suffice? (https://github.com/terrastruct/d2/issues/1081#issuecomment-2417317267)
Basically adding a <<type>> to objects, distinct from label.
My diagrams tool already supports an option that does just that. The text is printed below the label in a small font size. You can see an old example at:
https://logtalk.org/diagrams/tools/tools_directory_load_diagram.svg
That's not a d2 diagram. I thought you were looking for a feature in d2 diagrams for your use case.
I am. I just provided that old example to show that what you described as "adding a << type >> to objects, distinct from label" is already implemented by Logtalk's diagrams tool, which currently supports both Graphviz dot and d2 graph language output files. It's a Logtalk user choice which graph language to use. I just upload a d2 version of the same diagram at:
https://logtalk.org/diagrams/d2/tools_directory_load_diagram.svg
The tool supported for d2 is currently marked as experimental, with the main feature missing being links in edges.