fix edge id for elk

This commit is contained in:
Ashish Jain
2024-08-05 15:48:53 +02:00
parent 61100d81b1
commit cef45c023f

View File

@@ -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;