mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
#5574 Fixed issue linkStyles
This commit is contained in:
parent
9b00f1f2fb
commit
c153d0455f
@ -297,9 +297,6 @@ export const updateLink = function (positions: ('default' | number)[], style: st
|
|||||||
if (pos === 'default') {
|
if (pos === 'default') {
|
||||||
edges.defaultStyle = style;
|
edges.defaultStyle = style;
|
||||||
} else {
|
} else {
|
||||||
// if (utils.isSubstringInArray('fill', style) === -1) {
|
|
||||||
// style.push('fill:none');
|
|
||||||
// }
|
|
||||||
edges[pos].style = style;
|
edges[pos].style = style;
|
||||||
// if edges[pos].style does have fill not set, set it to none
|
// if edges[pos].style does have fill not set, set it to none
|
||||||
if (
|
if (
|
||||||
|
@ -429,7 +429,6 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
let pointsHasChanged = false;
|
let pointsHasChanged = false;
|
||||||
const tail = startNode;
|
const tail = startNode;
|
||||||
var head = endNode;
|
var head = endNode;
|
||||||
|
|
||||||
const edgeClassStyles = [];
|
const edgeClassStyles = [];
|
||||||
for (const key in edge.cssCompiledStyles) {
|
for (const key in edge.cssCompiledStyles) {
|
||||||
if (isLabelStyle(key)) {
|
if (isLabelStyle(key)) {
|
||||||
@ -510,6 +509,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
let svgPath;
|
let svgPath;
|
||||||
let linePath = lineFunction(lineData);
|
let linePath = lineFunction(lineData);
|
||||||
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
|
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
|
||||||
|
|
||||||
if (edge.look === 'handDrawn') {
|
if (edge.look === 'handDrawn') {
|
||||||
const rc = rough.svg(elem);
|
const rc = rough.svg(elem);
|
||||||
Object.assign([], lineData);
|
Object.assign([], lineData);
|
||||||
@ -531,7 +531,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
elem.node().appendChild(svgPath.node());
|
elem.node().appendChild(svgPath.node());
|
||||||
} else {
|
} else {
|
||||||
const stylesFromClasses = edgeClassStyles.join(';');
|
const stylesFromClasses = edgeClassStyles.join(';');
|
||||||
const styles = edge.edgeStyles ? edgeStyles.reduce((acc, style) => acc + ';' + style, '') : '';
|
const styles = edgeStyles ? edgeStyles.reduce((acc, style) => acc + style + ';', '') : '';
|
||||||
let animationClass = '';
|
let animationClass = '';
|
||||||
if (edge.animate) {
|
if (edge.animate) {
|
||||||
animationClass = ' edge-animation-fast';
|
animationClass = ' edge-animation-fast';
|
||||||
@ -550,7 +550,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
|
|||||||
(edge.classes ? ' ' + edge.classes : '') +
|
(edge.classes ? ' ' + edge.classes : '') +
|
||||||
(animationClass ? animationClass : '')
|
(animationClass ? animationClass : '')
|
||||||
)
|
)
|
||||||
.attr('style', stylesFromClasses + ';' + styles);
|
.attr('style', stylesFromClasses ? stylesFromClasses + ';' + styles + ';' : styles);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEBUG code, DO NOT REMOVE
|
// DEBUG code, DO NOT REMOVE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user