mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 03:49:43 +02:00
Fix for arrow point
This commit is contained in:
@@ -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
|
||||||
|
@@ -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) => {
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user