From 1c0cb8b2d736d9a8cc8015e9bcccdcebbac0dc14 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Mon, 22 Jul 2024 11:00:51 +0200 Subject: [PATCH 1/2] Adding base theme to config.schema --- packages/mermaid/src/schemas/config.schema.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/schemas/config.schema.yaml b/packages/mermaid/src/schemas/config.schema.yaml index 3f3d8bbcc..1bed31e64 100644 --- a/packages/mermaid/src/schemas/config.schema.yaml +++ b/packages/mermaid/src/schemas/config.schema.yaml @@ -61,8 +61,9 @@ properties: type: string enum: - default - - forest + - base - dark + - forest - neutral - 'null' # should this be a `null`-type? meta:enum: From c4ce8543d339e2f2b573d2bb79888c1362d1e42d Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 31 Jul 2024 15:03:25 +0200 Subject: [PATCH 2/2] 5237 Fix for edges to diamond shapes --- packages/mermaid-layout-elk/src/render.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/mermaid-layout-elk/src/render.ts b/packages/mermaid-layout-elk/src/render.ts index d2fdb6c09..37f56a53a 100644 --- a/packages/mermaid-layout-elk/src/render.ts +++ b/packages/mermaid-layout-elk/src/render.ts @@ -503,7 +503,7 @@ export const render = async (data4Layout: LayoutData, svg, element, algorithm) = // we will position the nodes when we get the layout from elkjs elkGraph = await addVertices(nodeEl, data4Layout.nodes, elkGraph); // Time for the edges, we start with adding an element in the node to hold the edges - const edgesEl = svg.insert('g').attr('class', 'edges edgePath'); + const edgesEl = svg.insert('g').attr('class', 'edges edgePaths'); // Add the edges to the elk graph, this will entail creating the actual edges elkGraph = await addEdges(data4Layout, elkGraph, svg); @@ -638,13 +638,18 @@ export const render = async (data4Layout: LayoutData, svg, element, algorithm) = x: startNode.x + startNode.width / 2 + offset.x, y: startNode.y + startNode.height / 2 + offset.y, }); - } - if (startNode.shape === 'diamond') { edge.points.push({ x: endNode.x + endNode.width / 2 + offset.x, y: endNode.y + endNode.height / 2 + offset.y, }); } + if (endNode.shape === 'diamond') { + edge.points.push({ + x: endNode.x + endNode.width / 2 + offset.x, + y: endNode.y + endNode.height / 2 + offset.y, + }); + } + edge.points = cutPathAtIntersect( edge.points.reverse(), {