mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-25 08:54:07 +02:00
code refactor
This commit is contained in:
@@ -2,4 +2,4 @@
|
|||||||
'mermaid': patch
|
'mermaid': patch
|
||||||
---
|
---
|
||||||
|
|
||||||
Fix: Support edge animation in hand drawn look
|
fix: Support edge animation in hand drawn look
|
||||||
|
|||||||
@@ -567,10 +567,10 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
|
|
||||||
let animationClass = '';
|
let animationClass = '';
|
||||||
if (edge.animate) {
|
if (edge.animate) {
|
||||||
animationClass = ' edge-animation-fast';
|
animationClass = 'edge-animation-fast';
|
||||||
}
|
}
|
||||||
if (edge.animation) {
|
if (edge.animation) {
|
||||||
animationClass = ' edge-animation-' + edge.animation;
|
animationClass = 'edge-animation-' + edge.animation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edge.look === 'handDrawn') {
|
if (edge.look === 'handDrawn') {
|
||||||
@@ -589,7 +589,10 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
.attr('id', edge.id)
|
.attr('id', edge.id)
|
||||||
.attr(
|
.attr(
|
||||||
'class',
|
'class',
|
||||||
' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : '') + (animationClass ?? '')
|
' ' +
|
||||||
|
strokeClasses +
|
||||||
|
(edge.classes ? ' ' + edge.classes : '') +
|
||||||
|
(animationClass ? ' ' + animationClass : '')
|
||||||
)
|
)
|
||||||
.attr('style', edgeStyles ? edgeStyles.reduce((acc, style) => acc + ';' + style, '') : '');
|
.attr('style', edgeStyles ? edgeStyles.reduce((acc, style) => acc + ';' + style, '') : '');
|
||||||
let d = svgPath.attr('d');
|
let d = svgPath.attr('d');
|
||||||
@@ -606,7 +609,10 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
.attr('id', edge.id)
|
.attr('id', edge.id)
|
||||||
.attr(
|
.attr(
|
||||||
'class',
|
'class',
|
||||||
' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : '') + (animationClass ?? '')
|
' ' +
|
||||||
|
strokeClasses +
|
||||||
|
(edge.classes ? ' ' + edge.classes : '') +
|
||||||
|
(animationClass ? ' ' + animationClass : '')
|
||||||
)
|
)
|
||||||
.attr('style', pathStyle);
|
.attr('style', pathStyle);
|
||||||
strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
|
strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user