#5237 Fix for issue with setting up data for subgraphs

This commit is contained in:
Knut Sveidqvist 2024-06-20 11:03:09 +02:00
parent 6ae5fe7f17
commit a35e62db14

View File

@ -843,10 +843,10 @@ export const getData = () => {
const edges: Edge[] = [];
const subGraphs = getSubGraphs();
log.info('Subgraphs - APA12', subGraphs);
const parentDB = new Map<string, string>();
const subGraphDB = new Map<string, boolean>();
// Setup the subgraph data for adding nodes
for (let i = subGraphs.length - 1; i >= 0; i--) {
const subGraph = subGraphs[i];
if (subGraph.nodes.length > 0) {
@ -855,6 +855,11 @@ export const getData = () => {
subGraph.nodes.forEach((id) => {
parentDB.set(id, subGraph.id);
});
}
// Data is setup, add the nodes
for (let i = subGraphs.length - 1; i >= 0; i--) {
const subGraph = subGraphs[i];
nodes.push({
id: subGraph.id,
label: subGraph.title,