mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-15 02:04:08 +01:00
fix edge id for elk
This commit is contained in:
@@ -280,18 +280,22 @@ export const addEdges = async function (dataForLayout, graph, svg) {
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
edges.map(async function (edge) {
|
edges.map(async function (edge) {
|
||||||
// Identify Link
|
|
||||||
const linkIdBase = edge.id; // 'L-' + edge.start + '-' + edge.end;
|
if (!edge.id) {
|
||||||
// count the links from+to the same node to give unique id
|
// Identify Link
|
||||||
if (linkIdCnt[linkIdBase] === undefined) {
|
const linkIdBase = edge.id; // 'L-' + edge.start + '-' + edge.end;
|
||||||
linkIdCnt[linkIdBase] = 0;
|
// count the links from+to the same node to give unique id
|
||||||
log.info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]);
|
if (linkIdCnt[linkIdBase] === undefined) {
|
||||||
} else {
|
linkIdCnt[linkIdBase] = 0;
|
||||||
linkIdCnt[linkIdBase]++;
|
log.info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]);
|
||||||
log.info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]);
|
} else {
|
||||||
|
linkIdCnt[linkIdBase]++;
|
||||||
|
log.info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]);
|
||||||
|
}
|
||||||
|
const linkId = linkIdBase + '_' + linkIdCnt[linkIdBase];
|
||||||
|
edge.id = linkId;
|
||||||
}
|
}
|
||||||
const linkId = linkIdBase + '_' + linkIdCnt[linkIdBase];
|
|
||||||
edge.id = linkId;
|
|
||||||
log.info('abc78 new link id to be used is', linkIdBase, linkId, linkIdCnt[linkIdBase]);
|
log.info('abc78 new link id to be used is', linkIdBase, linkId, linkIdCnt[linkIdBase]);
|
||||||
const linkNameStart = 'LS_' + edge.start;
|
const linkNameStart = 'LS_' + edge.start;
|
||||||
const linkNameEnd = 'LE_' + edge.end;
|
const linkNameEnd = 'LE_' + edge.end;
|
||||||
|
|||||||
Reference in New Issue
Block a user