Comments (6)
I think it'd be neat to programmatically use mermaid, in node. Maybe call it "mermaid-serverside".
The idea of mermaid-serverside is cool. However, mermaid currently cannot work without a browser (either a normal browser or a headless browser such as puppeteer). So mermaid could not be a pure node.js library (which doesn't depend on browsers)
I'd like to make an img-url parser, so you can inline the source of the graph in the URL and get an image.
We have something similar: https://mermaidjs.github.io/mermaid-live-editor/#/view/Z3JhcGggVEQKQVtDaHJpc3RtYXNdIC0tPnxHZXQgbW9uZXl8IEIoR28gc2hvcHBpbmcpCkIgLS0-IEN7TGV0IG1lIHRoaW5rfQpDIC0tPnxPbmV8IERbTGFwdG9wXQpDIC0tPnxUd298IEVbaVBob25lXQpDIC0tPnxUaHJlZXwgRltDYXJdCg
It would also mean that I can pre-render graphs, so there is no flash of graph-source on pages (I made a gatsby plugin, for example, that has some hacks to make it work browser-only, but I'd prefer they were pre-built.)
As I said above, pre-render without a browser is currently impossible. But if you know how to make it possible, that would be super great! I used to try jsdom but failed.
If we had this, it'd be really simple to just wrap the CLI around that bit. If there is interest, I'd be happy to write it, and make a PR for this project to use the lib.
I don't know if this is helpful. Because this library needs a browser to work. So there is no pre-render in memory only. And it is not a pure node library which doesn't depend on browsers.
Please feel free to post more comments. I will leave this issue open for now.
from mermaid.cli.
We have something similar:
That's cool, but I meant like this, with source inline in image-link, so you can use it directly:
As I said above, pre-render without a browser is currently impossible
Yeh, I get that, but I mean in the same way you use puppeteer to create a chrome-headless client, render it, and return it. I dunno, maybe it makes no sense to integrate with this. The CLI is pretty light, maybe I should just make a separate library that works the same way, based on your great work. At some point, if I get a wild hair, maybe I'll do some realy node-space rendering though, as mermaid uses d3, and there is a node d3.
from mermaid.cli.
It will be super cool if you can make mermaid a pure node.js library. Actually I think it is possible, just more investigation is needed.
from mermaid.cli.
Yep, totally agreed. I think it's very close with node-d3, but in the interim, I could wrap puppeteer, as you have, to make a server-side renderer (which was my original thought.)
If I have some time, I will investigate this week, and see what it would take to make it render in node-d3. If nothing else, it'd give us a list to work through for things needed to support that.
from mermaid.cli.
@konsumer If you dont mind, Any solution now?
Sent from my PRO 6 using FastHub
from mermaid.cli.
Please read this thread: mermaid-js/mermaid#559
I will close it for now.
from mermaid.cli.
Related Issues (20)
- How customize tick class HOT 1
- Actually customize a theme HOT 1
- Cannot export erDiagram HOT 1
- Error not found: mmdc
- No output file generated HOT 1
- Cannot export mermaid script with "autonumber" tag HOT 1
- Error Incorrect usage of "merge". HOT 2
- Pipe to stdout ? HOT 1
- How to include native mermaid files into an html template HOT 1
- Idea: export to xml (mxGraphModel) HOT 1
- Pie Chart not supported? HOT 4
- How to generate png with transparent background? HOT 1
- Having issues with building .mmd with rect HOT 1
- Deterministic SVGs? HOT 3
- Gantt can't set date if DateFormat set HOT 1
- No arrowheads showing under v8.4.8, svg has bad marker-end url HOT 1
- Open an existing diagram in live editor HOT 1
- Custom css not working HOT 3
- Issues in an Apple Silicon Mac
- Support verbatim multiline text in node labels HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mermaid.cli.