mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
#5237 Support for default link styles
This commit is contained in:
@@ -888,6 +888,10 @@ export const getData = () => {
|
|||||||
const e = getEdges();
|
const e = getEdges();
|
||||||
e.forEach((rawEdge, index) => {
|
e.forEach((rawEdge, index) => {
|
||||||
const { arrowTypeStart, arrowTypeEnd } = destructEdgeType(rawEdge.type);
|
const { arrowTypeStart, arrowTypeEnd } = destructEdgeType(rawEdge.type);
|
||||||
|
const styles = e.defaultStyle || [];
|
||||||
|
if (rawEdge.style) {
|
||||||
|
styles.push(...rawEdge.style);
|
||||||
|
}
|
||||||
const edge: Edge = {
|
const edge: Edge = {
|
||||||
id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: 'edge' }),
|
id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: 'edge' }),
|
||||||
start: rawEdge.start,
|
start: rawEdge.start,
|
||||||
@@ -901,8 +905,8 @@ export const getData = () => {
|
|||||||
arrowTypeStart,
|
arrowTypeStart,
|
||||||
arrowTypeEnd,
|
arrowTypeEnd,
|
||||||
arrowheadStyle: 'fill: #333',
|
arrowheadStyle: 'fill: #333',
|
||||||
labelStyle: rawEdge.style,
|
labelStyle: styles,
|
||||||
style: rawEdge.style,
|
style: styles,
|
||||||
pattern: rawEdge.stroke,
|
pattern: rawEdge.stroke,
|
||||||
look: config.look,
|
look: config.look,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user