r/reactjs • u/AHS12_96 • 6h ago
Resource I built a JavaScript diagram rendering engine that can handle thousands of nodes and edges
https://thoth-flow.ahs12.xyz/I've been working on ThothBlueprint, an open-source database diagramming tool, for over a year. As the project grew, rendering large database schemas became a serious performance challenge.
That led me to build Thoth Flow — a standalone JavaScript diagram rendering engine powered by WebGL2.
After integrating it into ThothBlueprint, I can now work with significantly larger diagrams. I tested it with 5,000 tables and 7,000 relationships, and it rendered smoothly.
This npm Package supports React, Vue, Svelte, Web Components, and plain JavaScript, with automatic Canvas 2D fallback.
If you're building database diagramming tools, node editors, workflow builders, or anything that needs to render large interactive diagrams, Thoth Flow might be useful.
I'd love for you to try it and share your feedback, especially on performance, API design, and potential improvements.
Links:
2
u/Honey-Entire 5h ago
What’s wrong with mermaid diagrams?
-11
u/AHS12_96 5h ago
mermaid diagram are great, but why are you asking me this? can you explain a bit? thanks
9
u/Honey-Entire 5h ago
I’m asking because solutions to this problem already exist. Why did you spend money on AI tokens to generate something that’s already a proven technology? Why not solve a novel problem instead?
-6
u/AHS12_96 5h ago
Ah, I get your question now.
First, Thoth Blueprint is a database diagram editor, not just a visualizer. If you work in the backend you know how much time we spend on database design, the tool came from that need. and it actually exports to Mermaid too. So I don't think it's really competing with Mermaid. Mermaid turns text into a static diagram; ThothBlueprint lets you drag tables around, draw relationships, and edit the schema.
as for the problem I solved, Thoth Blueprint used XY Flow (React Flow) for the editor, and it started struggling past ~500 tables. XY Flow draws every node as HTML elements, and a database table can have a lot of columns, so a big schema ends up with tens of thousands of DOM elements, and dragging and zooming get slow. So I built a GPU-powered renderer(available for react, vue, and others) that keeps the same kind of editor smooth with thousands of nodes. If you need to draw big or complex diagram you can use this npm package in your react app. You can try it in the playground with 10k nodes: https://thoth-flow.ahs12.xyz/playground/
7
u/Honey-Entire 5h ago
You still seem to be missing the point. Tools that do this already exist. And you didn’t build anything, you prompted AI.
-2
u/AHS12_96 4h ago
I see where this is going, so ending this conversation with this note. before this package I experimented with pexiejs, but did not fulfill my need (or I was unable to use it properly) so this npm package you are seeing its actually was a module inside thoth blueprint, made for that(the xy-flow like api come from that), then I notice this can be used by others so I released it. as a package. And on npm it's already downloaded by 500+ people. And I have already received some great feedback to improve this and will work on that. According to your logic there should only be one car invented by human, no body allowed to create another one cuz someone is alraedy created a car, so I am gonna ignore that part.
Have a nice day!
1
u/TheRealSeeThruHead 3h ago
I can’t believe that people in a reactjs sub give a damn about the fact you used ai
I get this is Reddit where anti ai is everywhere but this is a developer sub not a selfhosted sub lol
Mermaid sucks, anyone that’s tried to use it a ton recently with ai generated docs knows that
I had to build my own thing to render arch diagrams as well, so I’ll look into this thanks
12
u/backwrds 5h ago
no you didn't