question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maintain the order of the nodes in Flowchart

See original GitHub issue

I have defined a graph as follows ->

graph TD
linkStyle default interpolate basis
subgraph 
A[gunung]-->B[NOUN]
C[Krakatau]--> D[NOUN]
E[Yang]-->F[PRON]
G[Pernah]-->H[ADV]
I[meletus] --> J[VERB]
K[mulai]-->L[VERB]
M[terbatuk-batuk] --> N[VERB]
end
subgraph 
  B --> O[FN]
  D --> O
  F --> O
  J --> O
  L --> P[FV]
  N --> P
end
subgraph 
  O --> Q[Subject]
  P --> R[Predicate]
end
subgraph 
 Q-->S[clause]
 R-->S
end

Editor Link I need to preserve the order of the nodes. I defined Pernah before Yang but it comes in the end. Please help, on how to maintain the order of the nodes. Thanks. It would really help me achieve everything I ever wanted :p.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:18
  • Comments:26 (1 by maintainers)

github_iconTop GitHub Comments

43reactions
ferrieuxcommented, Jun 8, 2021

@knsv

Is this still a problem? If so please reopen it.

Yes, it is a show stopper. I heavily invested on Mermaid for flowcharts, the idea is absolutely neat, but devil in details like this one end up killing the whole experience:

  • impossible to even predict (let alone force, as suggested here) node layout
  • same for arrows that randomly zigzag when crossing subnet boundaries
  • impossible to touch node padding (it is not a CSS attribute, it is hardcoded in SVG geometry)

I’d suggest replacing the complicated/unmaintainable algorithm with a simple, predictable and documented one: this way, granted, authors will need to work a bit more to reach their goals, but they’ll end up with the job done instead of banging their heads until they drop Mermaid.

12reactions
jpl-jengelkecommented, Jul 13, 2022

Why is this closed? Node ordering remains very broken.

The recent example by @jtbandes is a straightforward example of the problem. None of the workarounds are successful. (Although declaring nodes in order in subgraph clauses seems to work mostly for my use cases.) There are no commits nor planning discussions here that address this critical shortcoming.

Auto-closing tickets because they age doesn’t make the problem go away. …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ultimate Flowchart Guide 2022: Definition, Examples ...
INSTRUCTION: Follow the following steps. First, pick up an item, then ask yourself: “Does this item spark joy for me?”. If the answer...
Read more >
Mermaid change position of nodes / options Anyway to fix ...
Please let me know any way to fix these nodes or else great library for it. Thanks. css · flowchart · mermaid ·...
Read more >
Flowchart Guidelines to Avoid 15 Common Flowchart Mistakes
Maintaining a flowchart that is well proportioned is vital when it comes to avoiding a visual mess. As a rule of thumb, ensure...
Read more >
Basic overview of creating flowcharts using Mermaid - CKEditor
A flowchart is composed of nodes that are square-based and connected by lines with arrows. The inside of each square, aka node, can...
Read more >
Guide to Flowchart Symbols, from Basic to Advanced - Gliffy
As you know, flowcharts are made up of a sequence of actions, data, services, and/or materials. They illustrate where data is being input...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found