Fix for arrow point

This commit is contained in:
Knut Sveidqvist
2024-12-20 15:28:08 +01:00
parent 9bf2bda539
commit 0bf4aa3e82
3 changed files with 17 additions and 17 deletions

View File

@@ -128,7 +128,7 @@ flowchart LR
A --> B A --> B
</pre </pre
> >
<pre id="diagram4" class="mermaid2"> <pre id="diagram4" class="mermaid">
--- ---
config: config:
look: neo look: neo

View File

@@ -158,33 +158,33 @@ const point = (elem, type, id) => {
.append('marker') .append('marker')
.attr('id', id + '_' + type + '-pointEnd') .attr('id', id + '_' + type + '-pointEnd')
.attr('class', 'marker ' + type) .attr('class', 'marker ' + type)
.attr('viewBox', '0 0 10 10') .attr('viewBox', '0 0 11.5 14')
.attr('refX', 5) .attr('refX', 11.5) // Adjust to position the arrowhead relative to the line
.attr('refY', 5) .attr('refY', 7) // Half of 14 for vertical center
.attr('markerUnits', 'userSpaceOnUse') .attr('markerUnits', 'userSpaceOnUse')
.attr('markerWidth', 8) .attr('markerWidth', 11.5)
.attr('markerHeight', 8) .attr('markerHeight', 14)
.attr('orient', 'auto') .attr('orient', 'auto')
.append('path') .append('path')
.attr('d', 'M 0 0 L 10 5 L 0 10 z') .attr('d', 'M 0 0 L 11.5 7 L 0 14 z')
.attr('class', 'arrowMarkerPath') .attr('class', 'arrowMarkerPath')
.style('stroke-width', 1) .style('stroke-width', 0)
.style('stroke-dasharray', '1,0'); .style('stroke-dasharray', '1,0');
elem elem
.append('marker') .append('marker')
.attr('id', id + '_' + type + '-pointStart') .attr('id', id + '_' + type + '-pointStart')
.attr('class', 'marker ' + type) .attr('class', 'marker ' + type)
.attr('viewBox', '0 0 10 10') .attr('viewBox', '0 0 11.5 14')
.attr('refX', 4.5) .attr('refX', 0)
.attr('refY', 5) .attr('refY', 7)
.attr('markerUnits', 'userSpaceOnUse') .attr('markerUnits', 'userSpaceOnUse')
.attr('markerWidth', 8) .attr('markerWidth', 11.5)
.attr('markerHeight', 8) .attr('markerHeight', 14)
.attr('orient', 'auto') .attr('orient', 'auto')
.append('path') .append('polygon')
.attr('d', 'M 0 5 L 10 10 L 10 0 z') .attr('points', '0,7 11.5,14 11.5,0')
.attr('class', 'arrowMarkerPath') .attr('class', 'arrowMarkerPath')
.style('stroke-width', 1) .style('stroke-width', 0)
.style('stroke-dasharray', '1,0'); .style('stroke-dasharray', '1,0');
}; };
const circle = (elem, type, id) => { const circle = (elem, type, id) => {

View File

@@ -22,7 +22,7 @@ export const markerOffsets2 = {
composition: 18, composition: 18,
dependency: 6, dependency: 6,
lollipop: 13.5, lollipop: 13.5,
arrow_point: 4, arrow_point: 8,
arrow_cross: 12.5, arrow_cross: 12.5,
} as const; } as const;