-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Comments
Hey, @Yash-Singh1 you seems to have many ideas! Ping me on slack if you want to be a member of the core team. |
@knsv , Yash has been an active contributor in live editor too.. Happy to have him onboard the team! |
We can still unlock issues when they are reopened, because that would be a bit useful. Ref #2456.
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. |
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? |
@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. |
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. |
Seems like a place where we can use a monorepo structure: https://yarnpkg.com/features/workspaces. |
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. |
mark |
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) |
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. |
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? |
@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 |
Thank you @brunolnetto - I'll give it a look. |
@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 |
@financelurker You understand correctly. Which diagram do you mean to integrate to Mermaid? |
@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). |
@financelurker I still do not comprehend if the desired diagrams are super-diagrams (categories of existing diagrams) or totally different ones. |
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). |
@financelurker @Yash-Singh1 What is the current status of this item? Should new issues be created for specific tasks remaining? |
I'm currently occupied with other projects, however, anyone interested in contributing is more than welcome to do so. |
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 So yeah, my suggestion is, along with the goals of improving the documentation, to document the config too. This includes documenting:
Sorry if this is not allowed in here, or if this comment is too messy, or insufferable, or anything. |
Ahh okay, thank you! |
It's a good idea to have some re-organize or refactor to such a big project at current stage. |
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).
I guess that could be resolved by doing the file part of this #4499 (comment). |
Closing as per comment from @Yokozuna59 |
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.I have seen the code having inconsistent code style in many places
lint:fix
script (enable eslint fix with prettier-plugin-jsdoc and eslint-plugin-jsdoc #2471)eslint-plugin-markdown
(lint markdown : enable eslint-plugin-markdown #2530)eslint-plugin-html
(lint html : enable eslint-plugin-html #2531)prettier
on all files (not onlysrc/**/*.js
)prettier
code-styleprettier-plugin-jsdoc
(enable eslint fix with prettier-plugin-jsdoc and eslint-plugin-jsdoc #2471).editorconfig
is followed using lintersstylelint
eslint-plugin-jsdoc
https://npmjs.com/package/eslint-plugin-jsdoc (enable eslint fix with prettier-plugin-jsdoc and eslint-plugin-jsdoc #2471)prettier-plugin-jsdoc
README
anddocs/README
(see https://github.com/Yash-Singh1/eslint-plugin-userscripts/blob/main/.github/workflows/readme-in-sync.yml)CHANGELOG
anddocs/CHANGELOG
diagrams-and-syntax-and-examples
and at root of docs and move all diagram documentation todiagrams-and-syntax-and-examples
theme_themed.css
landing
inside a newimg
foldermarkdownlint
so the documentation is more maintainablen00b-advanced.md
upgrading.md
andbreakingChanges.md
package.json
todo.md
somewhere elseROADMAP.md
would be betterdist/*
aslinguist-generated
mermaid-live-editor
)dist
to GitHubwebpack
filesescape
andunescape
to something elseThe text was updated successfully, but these errors were encountered: