mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 08:50:13 +02:00
Fix double circle shape neo look for flowchart
This commit is contained in:
@@ -79,18 +79,35 @@
|
|||||||
flowchart
|
flowchart
|
||||||
node
|
node
|
||||||
id1([This is the text in the box])
|
id1([This is the text in the box])
|
||||||
|
id2((circle))
|
||||||
|
id1(((double circle)))
|
||||||
|
|
||||||
|
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
---
|
||||||
|
config:
|
||||||
|
theme: default
|
||||||
|
look: classic
|
||||||
|
---
|
||||||
|
flowchart
|
||||||
|
node
|
||||||
|
id1([This is the text in the box])
|
||||||
|
id2((circle))
|
||||||
|
id1(((double circle)))
|
||||||
|
|
||||||
|
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
stateDiagram
|
stateDiagram
|
||||||
node
|
[*] --> Active
|
||||||
|
Active --> Inactive
|
||||||
|
Inactive --> Active
|
||||||
|
Active --> [*]
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</pre
|
|
||||||
>
|
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
flowchart
|
flowchart
|
||||||
a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
|
a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
|
||||||
|
@@ -9,8 +9,9 @@ import rough from 'roughjs';
|
|||||||
export const doublecircle = async (parent: SVGAElement, node: Node): Promise<SVGAElement> => {
|
export const doublecircle = async (parent: SVGAElement, node: Node): Promise<SVGAElement> => {
|
||||||
const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
const gap = 5;
|
const gap = 5;
|
||||||
const outerRadius = bbox.width / 2 + halfPadding + gap;
|
const labelPadding = node.look === 'neo' ? halfPadding * 2 : halfPadding;
|
||||||
const innerRadius = bbox.width / 2 + halfPadding;
|
const outerRadius = bbox.width / 2 + labelPadding + gap;
|
||||||
|
const innerRadius = bbox.width / 2 + labelPadding;
|
||||||
|
|
||||||
let circleGroup;
|
let circleGroup;
|
||||||
const { cssStyles } = node;
|
const { cssStyles } = node;
|
||||||
@@ -32,8 +33,9 @@ export const doublecircle = async (parent: SVGAElement, node: Node): Promise<SVG
|
|||||||
circleGroup.node()?.appendChild(innerRoughNode);
|
circleGroup.node()?.appendChild(innerRoughNode);
|
||||||
} else {
|
} else {
|
||||||
circleGroup = shapeSvg.insert('g', ':first-child');
|
circleGroup = shapeSvg.insert('g', ':first-child');
|
||||||
const outerCircle = circleGroup.insert('circle', ':first-child');
|
|
||||||
const innerCircle = circleGroup.insert('circle', ':first-child');
|
const innerCircle = circleGroup.insert('circle', ':first-child');
|
||||||
|
const outerCircle = circleGroup.insert('circle', ':first-child');
|
||||||
|
|
||||||
circleGroup.attr('class', 'basic label-container').attr('style', cssStyles);
|
circleGroup.attr('class', 'basic label-container').attr('style', cssStyles);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user