Comments (8)
Thanks!
The parser is available in the module 'parser/flow' and the data extracted from the text is stored in the graph object. So you can use the parser without rendering the graph as outlined below. Was it something like that you had mind?
Setup
var graph = require('./graphDb');
var flow = require('./parser/flow');
flow.parser.yy = graph;
Parsing
flow.parser.parse(text);
Data extraction
graph.getDirection();
graph.getVertices();
graph.getEdges();
from mermaid.
Yes, actually. Thanks!
Would it also be possible to add this to the docs somewhere for future inquirers?
from mermaid.
Sorry for bringing it up after such a long time but I believe answer is a bit outdated. Would it be possible to provide an up to date example of extracting object graph of mermaid code, as it was originally requested in this post?
from mermaid.
The code is still pretty correct except you need to adjust the require statements because files has been moved.
from mermaid.
@tylerlong Thanks for you reply. I have managed to make it work :)
from mermaid.
I had to change import graph from 'mermaid/src/diagrams/flowchart/graphDb
to import graph from 'mermaid/src/diagrams/flowchart/flowDb
from mermaid.
Hi.
I'm trying to use the parser as a way to specify a flowchart that I'd like to process as a graph in a downstream app. I'm trying to figure out how to access this within the current codebase and it looks like it's impossible.
Can anyone provide an indicator about how we might be able to do this?
Thanks!
Gully Burns
from mermaid.
@knsv I'm also interested in this. How would I import this from a yarn project?
from mermaid.
Related Issues (20)
- Recommended Vitest extension has been deprecated
- mermaid.ganttConfig custom colors based on RAG status
- Add documentation for Git Graph parallel commits HOT 1
- Not able to start mermaid container after docker compose
- Prettified HTML tables render with erroneous top blank space, whereas compacted do not.
- Website unavailable due to lack of DNSSEC HOT 4
- Block diagram self arrow rendering over box
- Subscripts are bunched in a corner in Safari
- A diagram that works in mermaidchart.com fails in Notion HOT 3
- Kanban Board HOT 1
- E2E testing isn't working for PR #5152 failing due to randomized commit ID HOT 2
- DOCS: C4, XY and Block diagrams have special icons with unclear meaning
- Support for 5-digit Unicode code points HOT 1
- Embedded HTML does not render inside Markdown ("`) strings.
- Timeline Diagram Comment Inconsistencies
- Cannot customize theme through cli and json config file HOT 2
- vite build failure for 10.9.0 HOT 2
- Control brackets around loopText and friends
- gitGraph: support for displaying orphaned branches and unrelated histories HOT 1
- Proposal: Cloud Architecture Diagram HOT 7
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.