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

Organize Mermaid #2456

Closed
29 of 43 tasks
Yash-Singh1 opened this issue Nov 2, 2021 · 27 comments
Closed
29 of 43 tasks

Organize Mermaid #2456

Yash-Singh1 opened this issue Nov 2, 2021 · 27 comments
Labels

Comments

@Yash-Singh1
Copy link
Member

Yash-Singh1 commented Nov 2, 2021

I think that MermaidJS is a great idea, a language to write diagrams, but this repository needs some organizing because I have seen dead documentation and inconsistent code-style in many places.

Ideas

These are some ideas that I came up with to make mermaid a better project.

@Yash-Singh1 Yash-Singh1 added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Nov 2, 2021
@knsv knsv added Area: Development Status: Approved Is ready to be worked on and removed Status: Triage Needs to be verified, categorized, etc labels Nov 3, 2021
@knsv
Copy link
Collaborator

knsv commented Nov 3, 2021

Hey, @Yash-Singh1 you seems to have many ideas! Ping me on slack if you want to be a member of the core team.

@Yash-Singh1 Yash-Singh1 mentioned this issue Nov 7, 2021
3 tasks
@sidharthv96
Copy link
Member

@knsv , Yash has been an active contributor in live editor too.. Happy to have him onboard the team!

Yash-Singh1 added a commit that referenced this issue Nov 21, 2021
We can still unlock issues when they are reopened, because that would be
a bit useful. Ref #2456.
@mmorel-35 mmorel-35 pinned this issue Nov 30, 2021
@Andre601
Copy link
Contributor

I'm considering working on some issue templates, perhaps even incorporating GitHub's new Issue forms for a more consistent issue formatting.

On another note would I personally suggest to enable and use Discussions in this repositories. While you can use issues for general questions would Discussions be better suited for that, especially thanks to features such as marking a reply as answer, which can help in building a healthy knowledgebase over time.
Issues could also be converted to discussions.

@financelurker
Copy link

My understanding of extending mermaid with custom diagrams is, that they need to be placed in the "diagrams" folder before building your own package... If that's right so far, I'd see a mechanism where you can develop your diagrams in dedicated npm packages and mermaid can make use of it (when at runtime the libraries are loaded within the same context).

Like, some kind of "diagram plugin" mechanism. What's your take on that one?

@knsv
Copy link
Collaborator

knsv commented Apr 22, 2022

@financelurker thats a good idea. I think that we are reaching a point where the base package of mermaid needs to be split up. If you don't care about gantt charts why include and load them? I have been thinking about a lazy loading. This could be another way or even better a part of that setup.

There are some refactoring activities that need to happen first though. The code that initially handled two diagrams is not as clean when handling 10+ diagrams after"organic growth". We need to define what a diagram is so that mermaid can treat them all diagrams in the same way with a basic interface. This is high up on my prioritisation list and diagram organisation is a part of that.

@financelurker
Copy link

That sounds good to me. Tho, the magic in my opinion would be to extract all necessary information into an API package, which developers can import in their projects and code against, so that you can fully take care of quality assurance in your IDE or build process without the need to also pull the main library source itself.

@Yash-Singh1
Copy link
Member Author

@financelurker thats a good idea. I think that we are reaching a point where the base package of mermaid needs to be split up. If you don't care about gantt charts why include and load them? I have been thinking about a lazy loading. This could be another way or even better a part of that setup.

There are some refactoring activities that need to happen first though. The code that initially handled two diagrams is not as clean when handling 10+ diagrams after"organic growth". We need to define what a diagram is so that mermaid can treat them all diagrams in the same way with a basic interface. This is high up on my prioritisation list and diagram organisation is a part of that.

Seems like a place where we can use a monorepo structure: https://yarnpkg.com/features/workspaces.

@brunolnetto
Copy link

It seems an opportunity to show a structure up I found very adequate to what @financelurker described as "code against". At the end of the day, a developer wants either to find something easy to use or to build himself based on some prior imported knowledge. Code-based documentation is less visual than its IDE counterpart. In the long run, I see mermaid as a responsive react ad-hoc web application.

@sakurawald
Copy link

mark

@financelurker
Copy link

This isn't really the right spot, but I'm trying to get the mermaid-live-editor running with my own custom diagrams - that's a real pain (okay, and I gotta admit that I'm fairly new to node/npm development too). How do you customise your diagrams and test it? Such a development environment seems pretty complex in my eyes. (but again: this probably isn't the right spot to mention this)

@brunolnetto
Copy link

brunolnetto commented May 19, 2022

I just developed shortly a parser from an artifact we had at my previous job to a .mmd file. Their diagrams have similar structure to mermaid flowcharts/state diagrams, so I gave it a try. I divided the diagram into styles for nodes and edges. There are some samples to both Flowbuild and Mermaid diagrams here.

@financelurker
Copy link

And one major thing I would wish to see for Christmas: one should not need to extend Diagram.js, mermaidAPI.js, utils.js and config.js to register new diagram types. Or did I try a wrong approach to introduce a newly customised diagram type?

@brunolnetto
Copy link

@financelurker I described my approach on my last post for diagram customization. The main configuration file is here: https://github.com/dot-quiver/dot-quiver-api/blob/main/utils/workflow/diagramConfig.json

@financelurker
Copy link

Thank you @brunolnetto - I'll give it a look.

@financelurker
Copy link

@brunolnetto did I get it right from having a look on your library: that library composes a Graph and translates it into a mermaid "graph TD" diagram? That's not what I was meaning with "customising diagrams". What I meant is the challenge of adding completely new diagram types to mermaid.

@knsv I've created a dedicated issue, since I think it's going off-topic here (?): #3061

@brunolnetto
Copy link

@financelurker You understand correctly. Which diagram do you mean to integrate to Mermaid?

@financelurker
Copy link

financelurker commented May 20, 2022

@brunolnetto I'm thinking of UML component diagrams (with lollipop notation), deployment diagrams, cmmn diagrams, etc. (some "custom diagram types") which are not supported in mermaid by now. "Hacking" these semantics into existing supported diagram types would be okay for the start but in the long run isn't feasible for my users (because semantics in diagrams matter).

@brunolnetto
Copy link

brunolnetto commented May 20, 2022

@financelurker I still do not comprehend if the desired diagrams are super-diagrams (categories of existing diagrams) or totally different ones.

@financelurker
Copy link

financelurker commented May 20, 2022

Well, I don't know either. But having a look at #177 there's a lot of demand of different and new diagram types. And cleaning up the mermaid architecture (described in my issue here: #3061 ) could make adding new diagram types more easy and streamlined (especially for people who don't want to understand the orchestration-layer of mermaid).

@jgreywolf
Copy link
Contributor

jgreywolf commented Apr 6, 2023

@financelurker @Yash-Singh1 What is the current status of this item?

Should new issues be created for specific tasks remaining?

@Yash-Singh1
Copy link
Member Author

I'm currently occupied with other projects, however, anyone interested in contributing is more than welcome to do so.

@whinee
Copy link

whinee commented Apr 21, 2023

Hello, I would like to add to this (arguably) dead issue.

For background, I am making an electron app that takes mermaid.js config and an array of mermaid.js code from pipe, then renders those graphs, take a screenshot of the screen, then spits out the base64. this is due to the fact that mermaid.js cli requires a browser installed in a machine, while this solution does not. But I digress.

I have this python code that acts as an intermediary between that electron mess and the user, and I want that python code to validate the config for mermaid.js. And so, I got the default config then fed it into chatGPT, requesting to make a validation code. But you see, I saw a problem. For example, with the top-level key of theme, there are only 5 allowed strings: default, neutral, dark, forest, and base. You see, I also want to validate these types of things, but if I have not dug deep enough in the documentation, I would have not even knew of it in the first place.

So yeah, my suggestion is, along with the goals of improving the documentation, to document the config too.

This includes documenting:

  • what each key on the config does (behavior, scope, etc)
  • what each key's values are allowed, and its type

Sorry if this is not allowed in here, or if this comment is too messy, or insufferable, or anything.

@sidharthv96
Copy link
Member

@whinee we have an issue #3397, but that hasn't been prioritized yet.

@whinee
Copy link

whinee commented Apr 22, 2023

Ahh okay, thank you!

@xenkuo
Copy link

xenkuo commented Jun 18, 2023

It's a good idea to have some re-organize or refactor to such a big project at current stage.
I know there's still new diagram type support request, but to be honest, mermaid should be the most comprehensive diagram tool now as far as I know. Current priority should be the stability, performance and user experience.
In terms of user experience, one humble suggestion is: seems like there's no any dark theme could properly display all that diagram types, there's some color design conflict in some diagrams, like the C4 Diagram.
I tried all the dark theme, no one can display it well, even some of them can work, if you apply same theme to other type, most likely quite bad display.

@Yokozuna59
Copy link
Member

Yokozuna59 commented Jun 18, 2023

We're currently converting and standardizing diagram definitions, i.e., #4486 and #4501. There's an idea of creating a cli script that creates a skeleton for a new diagram following the new structure (it might be better to file an issue for better visibility, but the structure hasn't finalized yet). The discussed structure is in PR #4499, or at least that's what I'm following (because it hasn't been approved yet).

...there's some color design conflict in some diagrams, like the C4 Diagram.
I tried all the dark theme, no one can display it well, even some of them can work, if you apply same theme to other type, most likely quite bad display.

I guess that could be resolved by doing the file part of this #4499 (comment).

@knsv knsv unpinned this issue Jul 3, 2023
@jgreywolf
Copy link
Contributor

Closing as per comment from @Yokozuna59

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

No branches or pull requests