We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a0fc562 + 62678fa commit 7d86c21Copy full SHA for 7d86c21
src/App.tsx
@@ -363,9 +363,17 @@ function parseText(text: string) {
363
if (parent) {
364
const source = getNodeId(lines[checkLine - 1], checkLine);
365
const target = linkMatch ? linkMatch : getNodeId(line, lineNumber);
366
+
367
+ // Find a unique id
368
+ let id = `${source}_${target}:0`;
369
+ while (elements.map(({ data: { id } }) => id).includes(id)) {
370
+ let [, count] = id.split(":");
371
+ count = (parseInt(count, 10) + 1).toString();
372
+ id = `${source}_${target}:${count}`;
373
+ }
374
elements.push({
375
data: {
- id: [source, target].join("_"),
376
+ id,
377
source,
378
target,
379
label: getEdgeLabel(line),
0 commit comments