mermaid
mermaid copied to clipboard
Add `package` to class diagram
Is your feature request related to a problem? Please describe.
Hello! Иon-native English speaker warning
I'm relative frequently drawing class diagrams. For now I'm using MagicDraw but I would like to try text-to-scheme solution.
I like your syntax for class diagrams and I would be very happy to use it for my work but I frequently using packages
in my schemes. Like class A
goes to package X
and associated with class B
that laying in package Y
.
Describe the solution you'd like
I would like to have a package
extension for current syntax like:
package Sales {
class Product {
+int id
}
Product o-- Employees.Manager
package Employees {
class Manager {
+int id
}
}
Describe alternatives you've considered Do not see any
Additional context None
Perhaps namespace instead or package?
Well, I just sticked to MagicDraw and Java terms. Its absolutely okay if this thing will be called "namespace"
How does this look in MagicDraw? Could you provide a screenshot of the resulting diagram?
There is two packages - "Специалист" ("Specialist") и "Ядро" (Kernel). They are modules in my app.
Cool, that might be a slightly bigger task, if someone is up to grab it. Should packages be nestable?
As for my task it's not required, because I use them as modules. Modules in my applications structure shouldn't be nested. However I believe that somebody would be happy with nested packages.
So, answering your question - I think that it depends on how hard it will be to implement nested modules. If it creates significant technical complexity then don't do it :)
Desperately need this feature 😂
I would like to take this on, if no one is opposed...
I would like to take this on, if no one is opposed...
Great. Love to see how active you are!
Would it be possible to re-open this issue? I think this is highly important and required feature when modeling real life/large information models. Could a quick fix be to enable Subgraphs from Flowchart for Class Diagrams as well?
This issue is still open.
Due to some issues that I ran into when trying to implement this, I decided to wait until the new rendering engine is ready to continue. However, Im not sure when that will be, so maybe I should start working on this again :)
Ive been on "hiatus" from the project the past month or so to deal with other issues. You know, just some random things going on with family, the world, whatever ;)
Im getting ready to start up again, and this is one of the main issues I intend to come back to
👍 would love to see this in mermaid... lack of this feature had me going back to plantuml...
Should packages be nestable? I would like to have nestable packages / namespaces. My use case is related to representing packages or submodules inside microservices. I also want to represent microservices as packages / namespaces and annotate them with stereotypes. I will try to add examples in the future.
Any update on this?
Sorry, no - I had put the work on hold until the new version of rendering engine was completed. Now that this is in place I will get back to this item
Cool, thanks for the reply!
Hi @jgreywolf, have you made any progress on this?
First things first: Thanks for Mermaid! Just want to chime in that this would be a great option to have!
Would also like to bump this, would love to see this feature.
Mermaid is amazing. This feature would make me say the same thing but in ALL CAPS. Cheers
I need this, please help!
Hi,
I'd like a feature which seems to be related to this, but is likely simpler: Just group some related classes together, so they keep together when layouting. I don't have a need of actually drawing a package box around them, but I don't want those classes be spread around randomly in my diagram.
Of course, this could also be implemented with the package box, and then just hiding it.
to implement this function, need to extend specification of class-diagrams syntax. who does define specification?
Does anyone know latest updates about this feature?
Hey,
I would like to express how much I enjoy using mermaid over other tools for diagramming. Its great to be able to version code and documentation next to each other in the same folder.
My current project really needs this feature, so I have set up a bounty for it here: https://app.bountysource.com/issues/83273957-add-package-to-class-diagram
If you decide to work on it, please call it "namespace" instead of "package". Also I would appriciate it very much to be nestable like so:
namespace Factory {
namespace Employees {
class Technician {
+int id
}
}
}
I hope this convinces someone to built the feature, keep on rocking Mermaid! :)
+1
Hi! I discovered recently this amazing tool to draw diagrams, which I liked very much, and I'm eager to see when the package/namespace feature will be implemented!
+1
+1