mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-10 02:49:40 +02:00
Fixed nodes duplicates
This commit is contained in:
@@ -17,10 +17,12 @@
|
|||||||
<h2>Simple flow</h2>
|
<h2>Simple flow</h2>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
sankey
|
sankey
|
||||||
node_a->10->node_b;
|
a->28->b->10->c
|
||||||
node_c->20->node_b;
|
a->11->b
|
||||||
node_b->15->node_d;
|
k->18->b->35->d->13->e->43->dd11
|
||||||
node_a-> 7->node_d;
|
d->5->e
|
||||||
|
d->10->c
|
||||||
|
k->25->e
|
||||||
</pre>
|
</pre>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import mermaid from './mermaid.esm.mjs';
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
@@ -92,12 +92,14 @@ class Node {
|
|||||||
*/
|
*/
|
||||||
const addNode = function(ID: string): Node {
|
const addNode = function(ID: string): Node {
|
||||||
ID = common.sanitizeText(ID, configApi.getConfig());
|
ID = common.sanitizeText(ID, configApi.getConfig());
|
||||||
|
let node: Node;
|
||||||
if (nodesHash[ID] === undefined) {
|
if (nodesHash[ID] === undefined) {
|
||||||
nodesHash[ID] = new Node(ID);
|
node = new Node(ID);
|
||||||
|
nodesHash[ID] = node;
|
||||||
|
nodes.push(node);
|
||||||
|
} else {
|
||||||
|
node = nodesHash[ID];
|
||||||
}
|
}
|
||||||
const node = nodesHash[ID];
|
|
||||||
nodes.push(node);
|
|
||||||
// debugger;
|
|
||||||
return node;
|
return node;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -99,7 +99,6 @@ export const draw = function (text: string, id: string, _version: string, diagOb
|
|||||||
graph.links.push({source: link.source.ID, target: link.target.ID, value: link.value});
|
graph.links.push({source: link.source.ID, target: link.target.ID, value: link.value});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
debugger;
|
debugger;
|
||||||
// const graph = {
|
// const graph = {
|
||||||
// nodes: [
|
// nodes: [
|
||||||
|
Reference in New Issue
Block a user