#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', labelpos: 'c',
thickness: rawEdge.stroke, thickness: rawEdge.stroke,
minlen: rawEdge.length, minlen: rawEdge.length,
classes: 'edge-thickness-normal edge-pattern-solid flowchart-link', classes:
arrowTypeStart, rawEdge?.stroke === 'invisible'
arrowTypeEnd, ? ''
: 'edge-thickness-normal edge-pattern-solid flowchart-link',
arrowTypeStart: rawEdge?.stroke === 'invisible' ? 'none' : arrowTypeStart,
arrowTypeEnd: rawEdge?.stroke === 'invisible' ? 'none' : arrowTypeEnd,
arrowheadStyle: 'fill: #333', arrowheadStyle: 'fill: #333',
labelStyle: styles, labelStyle: styles,
style: styles, style: styles,

View File

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

View File

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

View File

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