From aa9f4a7760d063dc79e6c3e3be8a1cb96d13d294 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 25 Jun 2024 15:58:58 +0200 Subject: [PATCH] #5237 Support for default link styles --- packages/mermaid/src/diagrams/flowchart/flowDb.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.ts b/packages/mermaid/src/diagrams/flowchart/flowDb.ts index 4b81ace68..5ef74455f 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.ts @@ -888,6 +888,10 @@ export const getData = () => { const e = getEdges(); e.forEach((rawEdge, index) => { const { arrowTypeStart, arrowTypeEnd } = destructEdgeType(rawEdge.type); + const styles = e.defaultStyle || []; + if (rawEdge.style) { + styles.push(...rawEdge.style); + } const edge: Edge = { id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: 'edge' }), start: rawEdge.start, @@ -901,8 +905,8 @@ export const getData = () => { arrowTypeStart, arrowTypeEnd, arrowheadStyle: 'fill: #333', - labelStyle: rawEdge.style, - style: rawEdge.style, + labelStyle: styles, + style: styles, pattern: rawEdge.stroke, look: config.look, };