mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-29 20:29:40 +02:00
Clean-up to avoid code duplication. Corrected neo-optins according to stephs design
This commit is contained in:
@@ -89,7 +89,7 @@ stateDiagram-v2
|
||||
</pre
|
||||
>
|
||||
|
||||
<pre id="diagram" class="mermaid2">
|
||||
<pre id="diagram" class="mermaid">
|
||||
stateDiagram
|
||||
[*] --> Still
|
||||
Still --> [*]
|
||||
@@ -102,7 +102,7 @@ stateDiagram-v2
|
||||
|
||||
</pre>
|
||||
|
||||
<pre id="diagram" class="mermaid">
|
||||
<pre id="diagram" class="mermaid2">
|
||||
stateDiagram
|
||||
direction LR
|
||||
[*] --> A
|
||||
|
@@ -101,7 +101,7 @@ g.stateGroup line {
|
||||
}
|
||||
|
||||
.node circle.state-end {
|
||||
fill: ${options.innerEndBackground};
|
||||
fill: ${options.stateBkg || options.mainBkg};
|
||||
stroke: ${options.background};
|
||||
stroke-width: 1.5
|
||||
}
|
||||
|
@@ -44,26 +44,16 @@ export const drawRect = async (parent: SVGAElement, node: Node, options: RectOpt
|
||||
|
||||
rect = shapeSvg.insert(() => roughNode, ':first-child');
|
||||
rect.attr('class', 'basic label-container').attr('style', cssStyles);
|
||||
} else if (node.look === 'neo') {
|
||||
// TODO: Take theme and look into account
|
||||
rect = shapeSvg.insert('rect', ':first-child');
|
||||
|
||||
rect
|
||||
.attr('class', 'basic label-container state-shadow-neo')
|
||||
.attr('style', cssStyles)
|
||||
.attr('rx', rx)
|
||||
.attr('data-id', 'abc')
|
||||
.attr('data-et', 'node')
|
||||
.attr('ry', ry)
|
||||
.attr('x', x)
|
||||
.attr('y', y)
|
||||
.attr('width', totalWidth)
|
||||
.attr('height', totalHeight);
|
||||
} else {
|
||||
rect = shapeSvg.insert('rect', ':first-child');
|
||||
|
||||
let rectClass = 'basic label-container';
|
||||
if (node.look === 'neo') {
|
||||
rectClass += ' state-shadow-neo';
|
||||
}
|
||||
|
||||
rect
|
||||
.attr('class', 'basic label-container')
|
||||
.attr('class', rectClass)
|
||||
.attr('style', cssStyles)
|
||||
.attr('rx', rx)
|
||||
.attr('data-id', 'abc')
|
||||
|
@@ -6,8 +6,8 @@ export const roundedRect = async (parent: SVGAElement, node: Node) => {
|
||||
const { look } = getConfig();
|
||||
node.look = look;
|
||||
const options = {
|
||||
rx: node.look === 'neo' ? 1 : 5,
|
||||
ry: node.look === 'neo' ? 1 : 5,
|
||||
rx: node.look === 'neo' ? 3 : 5,
|
||||
ry: node.look === 'neo' ? 3 : 5,
|
||||
|
||||
labelPaddingX: node.padding * 2,
|
||||
labelPaddingY: node.padding * 1,
|
||||
|
@@ -7,8 +7,8 @@ export const state = async (parent: SVGAElement, node: Node) => {
|
||||
node.look = look;
|
||||
|
||||
const options = {
|
||||
rx: node.look === 'neo' ? 2 : 5,
|
||||
ry: node.look === 'neo' ? 2 : 5,
|
||||
rx: node.look === 'neo' ? 3 : 5,
|
||||
ry: node.look === 'neo' ? 3 : 5,
|
||||
classes: 'flowchart-node',
|
||||
};
|
||||
return drawRect(parent, node, options);
|
||||
|
Reference in New Issue
Block a user