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

[feature request] component and tab shapes #2228

Open
pmoura opened this issue Nov 22, 2024 · 8 comments
Open

[feature request] component and tab shapes #2228

pmoura opened this issue Nov 22, 2024 · 8 comments

Comments

@pmoura
Copy link

pmoura commented Nov 22, 2024

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.

@alixander
Copy link
Collaborator

alixander commented Dec 6, 2024

@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?

@pmoura
Copy link
Author

pmoura commented Dec 6, 2024

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.

@alixander
Copy link
Collaborator

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?

@pmoura
Copy link
Author

pmoura commented Dec 6, 2024

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.

@alixander
Copy link
Collaborator

Would this feature suffice? (#1081 (comment))

Basically adding a <<type>> to objects, distinct from label.

@pmoura
Copy link
Author

pmoura commented Dec 6, 2024

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

@alixander
Copy link
Collaborator

That's not a d2 diagram. I thought you were looking for a feature in d2 diagrams for your use case.

@pmoura
Copy link
Author

pmoura commented Dec 7, 2024

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.

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

No branches or pull requests

2 participants