@ejfdelgado/ejflab-common 1.10.4 → 1.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -283,6 +283,26 @@ class FlowChartExec {
|
|
|
283
283
|
return response;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
removeIndexPathNodes(prefix) {
|
|
287
|
+
let count = 0;
|
|
288
|
+
const noPrefix = (node) => {
|
|
289
|
+
// Erase node ids...
|
|
290
|
+
delete this.nodesById[node.id];
|
|
291
|
+
let pased = node.prefix != prefix;
|
|
292
|
+
if (!pased) {
|
|
293
|
+
count++;
|
|
294
|
+
}
|
|
295
|
+
return pased;
|
|
296
|
+
};
|
|
297
|
+
this.flowchart.shapes = this.flowchart.shapes.filter(noPrefix);
|
|
298
|
+
this.flowchart.arrows = this.flowchart.arrows.filter(noPrefix);
|
|
299
|
+
console.log(`Removed ${count} nodes from flowchart with prefix ${prefix}`);
|
|
300
|
+
const foudPrefix = this.flowchart.prefixes.indexOf(prefix);
|
|
301
|
+
if (foudPrefix >= 0) {
|
|
302
|
+
this.flowchart.prefixes.splice(foudPrefix, 1);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
286
306
|
loadFlowChart(paths) {
|
|
287
307
|
return this.loadFlowChartInternal(paths, true);
|
|
288
308
|
}
|
|
@@ -318,6 +338,9 @@ class FlowChartExec {
|
|
|
318
338
|
const xmlFlowText = fs.readFileSync(path, 'utf8');
|
|
319
339
|
const parser = new XMLParser(options);
|
|
320
340
|
const xmlFlow = parser.parse(xmlFlowText);
|
|
341
|
+
// Previous clear old prefix
|
|
342
|
+
this.removeIndexPathNodes(prefix);
|
|
343
|
+
// Loads new nodes for prefix
|
|
321
344
|
const localFlowChart = this.processFlowChart(xmlFlow, prefix);
|
|
322
345
|
this.interpretColor(localFlowChart.shapes);
|
|
323
346
|
//
|
|
@@ -337,11 +360,15 @@ class FlowChartExec {
|
|
|
337
360
|
localFlowChart.arrows.forEach(placeMetadata);
|
|
338
361
|
const startingPoints = this.getNodesWithText("start", undefined, localFlowChart);
|
|
339
362
|
if (this.actualNodes instanceof Array && startingPoints instanceof Array) {
|
|
363
|
+
console.log(`Adding NEW #${startingPoints.length} starting points to flowchart`);
|
|
340
364
|
this.actualNodes.push(...startingPoints);
|
|
341
365
|
}
|
|
342
366
|
}
|
|
343
367
|
this.flowchart.shapes.push(...localFlowChart.shapes);
|
|
368
|
+
console.log(`Added ${localFlowChart.shapes.length} shapes with prefix ${prefix}`);
|
|
344
369
|
this.flowchart.arrows.push(...localFlowChart.arrows);
|
|
370
|
+
console.log(`Added ${localFlowChart.arrows.length} arrows with prefix ${prefix}`);
|
|
371
|
+
console.log(`Added ${localFlowChart.arrows.length + localFlowChart.shapes.length} nodes with prefix ${prefix}`);
|
|
345
372
|
this.flowchart.prefixes.push(prefix);
|
|
346
373
|
if (check.flux) {
|
|
347
374
|
for (let key in check.flux) {
|