#5237 fix for duplicate nodes for join fork

This commit is contained in:
Ashish Jain 2024-05-08 09:43:01 +02:00
parent 7529db8254
commit fbe13f4e9e
2 changed files with 12 additions and 8 deletions

View File

@ -754,6 +754,9 @@ const dataFetcher = (parent, parsedItem, diagramStates, nodes, edges, altFlag, u
* @param nodeData
*/
function insertOrUpdateNode(nodes, nodeData) {
if (!nodeData.id || nodeData.id === '</join></fork>') {
return;
}
const existingNodeData = nodes.find((node) => node.id === nodeData.id);
if (existingNodeData) {
//update the existing nodeData

View File

@ -13,13 +13,15 @@ interface Node {
label?: string;
parentId?: string;
position?: string;
styles?: string;
classes?: string;
styles?: string; // Pick one, don't need both `styles` & `style`, or have (nodeStyle + labelStyle)
style?: string;
classes?: string; // Pick one `classes` vs `class`
class?: string;
// Flowchart specific properties
labelType?: string;
labelType?: string; // Always use markdown string?
domId: string;
// Rendering specific properties for both Flowchart and State Diagram nodes
dir?: string;
dir?: string; // Only relevant for isGroup true, i.e. a sub-graph or composite state.
haveCallback?: boolean;
labelStyle?: string;
labelText?: string;
@ -31,15 +33,14 @@ interface Node {
ry?: number;
shape?: string;
tooltip?: string;
type: string;
type: string; // replace with isGroup: boolean, default false
width?: number;
height?: number;
// Specific properties for State Diagram nodes TODO remove and use generic properties
intersect?: (point: any) => any;
style?: string;
class?: string;
borders?: string;
borders?: string; //Maybe have it similar to nodeStyle, labelStyle, have it as borderStyle (check the usage)
useRough?: boolean;
}