mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
#5237 fix for duplicate nodes for join fork
This commit is contained in:
parent
7529db8254
commit
fbe13f4e9e
@ -754,6 +754,9 @@ const dataFetcher = (parent, parsedItem, diagramStates, nodes, edges, altFlag, u
|
|||||||
* @param nodeData
|
* @param nodeData
|
||||||
*/
|
*/
|
||||||
function insertOrUpdateNode(nodes, nodeData) {
|
function insertOrUpdateNode(nodes, nodeData) {
|
||||||
|
if (!nodeData.id || nodeData.id === '</join></fork>') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const existingNodeData = nodes.find((node) => node.id === nodeData.id);
|
const existingNodeData = nodes.find((node) => node.id === nodeData.id);
|
||||||
if (existingNodeData) {
|
if (existingNodeData) {
|
||||||
//update the existing nodeData
|
//update the existing nodeData
|
||||||
|
17
packages/mermaid/src/rendering-util/types.d.ts
vendored
17
packages/mermaid/src/rendering-util/types.d.ts
vendored
@ -13,13 +13,15 @@ interface Node {
|
|||||||
label?: string;
|
label?: string;
|
||||||
parentId?: string;
|
parentId?: string;
|
||||||
position?: string;
|
position?: string;
|
||||||
styles?: string;
|
styles?: string; // Pick one, don't need both `styles` & `style`, or have (nodeStyle + labelStyle)
|
||||||
classes?: string;
|
style?: string;
|
||||||
|
classes?: string; // Pick one `classes` vs `class`
|
||||||
|
class?: string;
|
||||||
// Flowchart specific properties
|
// Flowchart specific properties
|
||||||
labelType?: string;
|
labelType?: string; // Always use markdown string?
|
||||||
domId: string;
|
domId: string;
|
||||||
// Rendering specific properties for both Flowchart and State Diagram nodes
|
// 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;
|
haveCallback?: boolean;
|
||||||
labelStyle?: string;
|
labelStyle?: string;
|
||||||
labelText?: string;
|
labelText?: string;
|
||||||
@ -31,15 +33,14 @@ interface Node {
|
|||||||
ry?: number;
|
ry?: number;
|
||||||
shape?: string;
|
shape?: string;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
type: string;
|
type: string; // replace with isGroup: boolean, default false
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
|
|
||||||
// Specific properties for State Diagram nodes TODO remove and use generic properties
|
// Specific properties for State Diagram nodes TODO remove and use generic properties
|
||||||
intersect?: (point: any) => any;
|
intersect?: (point: any) => any;
|
||||||
style?: string;
|
|
||||||
class?: string;
|
borders?: string; //Maybe have it similar to nodeStyle, labelStyle, have it as borderStyle (check the usage)
|
||||||
borders?: string;
|
|
||||||
useRough?: boolean;
|
useRough?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user