#5237 Support for invisisblwe links

This commit is contained in:
Knut Sveidqvist
2024-06-25 16:22:56 +02:00
parent aa9f4a7760
commit c3423beeda
4 changed files with 12 additions and 9 deletions

View File

@@ -901,9 +901,12 @@ export const getData = () => {
labelpos: 'c',
thickness: rawEdge.stroke,
minlen: rawEdge.length,
classes: 'edge-thickness-normal edge-pattern-solid flowchart-link',
arrowTypeStart,
arrowTypeEnd,
classes:
rawEdge?.stroke === 'invisible'
? ''
: 'edge-thickness-normal edge-pattern-solid flowchart-link',
arrowTypeStart: rawEdge?.stroke === 'invisible' ? 'none' : arrowTypeStart,
arrowTypeEnd: rawEdge?.stroke === 'invisible' ? 'none' : arrowTypeEnd,
arrowheadStyle: 'fill: #333',
labelStyle: styles,
style: styles,

View File

@@ -35,10 +35,7 @@ const rect = async (parent, node) => {
// const text = label
// .node()
// .appendChild(createLabel(node.label, node.labelStyle, undefined, true));
const text =
node.labelType === 'markdown'
? await createText(labelEl, node.label, { style: node.labelStyle, useHtmlLabels })
: labelEl.node().appendChild(await createLabel(node.label, node.labelStyle, undefined, true));
const text = await createText(labelEl, node.label, { style: node.labelStyle, useHtmlLabels });
// Get the size of the label
let bbox = text.getBBox();

View File

@@ -569,7 +569,7 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, startNod
strokeClasses = 'edge-thickness-thick';
break;
case 'invisible':
strokeClasses = 'edge-thickness-thick';
strokeClasses = 'edge-thickness-invisible';
break;
default:
strokeClasses = 'edge-thickness-normal';

View File

@@ -47,7 +47,10 @@ const getStyles = (
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}