-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Migrate flowchart from dagre to elkjs #1969
Comments
Dagre itself was recently declared unmaintained. In its issue tracker, people recommend elkjs or springy as alternatives. |
Looking at the elkjs issue tracker, modularisation is definitely on their radar, but far from trivial due to the tooling used and other factors. |
I think we should start with lazy loading in mermaid, this opens up for use of larger libraries |
I'm having an issue with a site built with Vite, looks like it stems from this line in dagre's "greedy-fas" file: var Graph = require("./graphlib").Graph; This results in "Uncaught TypeError: Cannot read properties of undefined (reading 'Graph')". Could be related to this issue. If so, I'd be willing to load the extra 100KB if it means I can keep using Mermaid. For now, I've had to remove it from my build, so my online docs have no fancy diagrams. |
FYI dagre is depreacted and lack of maintainers.
ref: https://github.com/dagrejs/dagre Does mermaid dev will continue to maintain it ? (or you should drop this deps and find an alternative...) |
In May 2022, a dagre contributor merged a couple of PRs from a new developer (build-related stuff). No announcement or undeprecation notice yet, but at least that is counter to "there won’t be any support or attention to pull requests" :) elkjs is also still active and releases are being tagged. |
https://github.com/eclipse/sprotty might provide an alternative. |
Another issue with depending on dagre-d3 is it needs a browser env to run. Migrating away from dagre might solve this issue. |
It appears elkjs is being used from version 9.4.0 and up. However, since elkjs has an Eclipse Public License 2.0 (which is a copyleft license), this forces us (and any commercial closed source users) to use an older version of mermaid-js. Is there no alternative? |
The alternative is to fork |
I am facing the same issue right now. |
We could move elkjs out to be an external diagram. This would make it possible for a site integrator to add elkjs by registering it when mermaid is initialized. I am no legal expert but though, perhaps naively, that the copyleft license only would apply if you go in and make changes in the elkjs code. And that you then need to make those changes available to the original project. |
I'm also not a legal expert. But I think if you put the usage of the Elk library into a separate npm package, that would solve the issue. In order to avoid the Copyleft license, you would just install the main package. And not the Elk "plugin". Of course, that would mean that the main package must be usable and useful without the plugin. I'm not familiar enough with mermaid-js to know if that would be possible or not. |
This seems like the consensus here. I am not a legal expert but from what I can gather we can use elk in commercial software but any modifications to elk must be made public. |
Looks like |
Hello, I was playing around with flowchart and really big diagram and find out that
dagre
has a lot issues with blocks positioning (like some blocks that has only one edge to other block in some subgroup unexpectedly far from that group, like across hole diagram) and with edges drawing which goes through other blocks.I found good solution - elkjs it lot more configurable, smarter and can draw edges around a blocks
The text was updated successfully, but these errors were encountered: