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,6 +280,8 @@ export const addEdges = async function (dataForLayout, graph, svg) {
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
edges.map(async function (edge) {
|
edges.map(async function (edge) {
|
||||||
|
|
||||||
|
if (!edge.id) {
|
||||||
// Identify Link
|
// Identify Link
|
||||||
const linkIdBase = edge.id; // 'L-' + edge.start + '-' + edge.end;
|
const linkIdBase = edge.id; // 'L-' + edge.start + '-' + edge.end;
|
||||||
// count the links from+to the same node to give unique id
|
// count the links from+to the same node to give unique id
|
||||||
@@ -292,6 +294,8 @@ export const addEdges = async function (dataForLayout, graph, svg) {
|
|||||||
}
|
}
|
||||||
const linkId = linkIdBase + '_' + linkIdCnt[linkIdBase];
|
const linkId = linkIdBase + '_' + linkIdCnt[linkIdBase];
|
||||||
edge.id = linkId;
|
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