restore attribute

This commit is contained in:
Alessandro
2025-08-18 15:34:09 +02:00
parent 2e7c89c6c3
commit b4a8936009
3 changed files with 27 additions and 6 deletions

View File

@@ -8,10 +8,19 @@ type SymbolProps = Omit<EdgeMarker, 'type'>;
const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => { const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => {
const style = { const style = {
strokeWidth, strokeWidth,
...(color && { stroke: color, fill: 'none' }), ...(color && { stroke: color }),
}; };
return <polyline style={style} strokeLinecap="round" strokeLinejoin="round" fill="none" points="-5,-4 0,0 -5,4" />; return (
<polyline
className="arrow"
style={style}
strokeLinecap="round"
fill="none"
strokeLinejoin="round"
points="-5,-4 0,0 -5,4"
/>
);
}; };
const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => { const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => {
@@ -20,7 +29,15 @@ const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) =>
...(color && { stroke: color, fill: color }), ...(color && { stroke: color, fill: color }),
}; };
return <polyline style={style} strokeLinecap="round" strokeLinejoin="round" points="-5,-4 0,0 -5,4 -5,-4" />; return (
<polyline
className="arrowclosed"
style={style}
strokeLinecap="round"
strokeLinejoin="round"
points="-5,-4 0,0 -5,4 -5,-4"
/>
);
}; };
export const MarkerSymbols = { export const MarkerSymbols = {

View File

@@ -26,16 +26,17 @@
> >
{#if type === MarkerType.Arrow} {#if type === MarkerType.Arrow}
<polyline <polyline
class="arrow"
style:stroke={color} style:stroke={color}
style:fill={'none'} fill="none"
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"
stroke-width={strokeWidth} stroke-width={strokeWidth}
fill="none"
points="-5,-4 0,0 -5,4" points="-5,-4 0,0 -5,4"
/> />
{:else if type === MarkerType.ArrowClosed} {:else if type === MarkerType.ArrowClosed}
<polyline <polyline
class="arrowclosed"
style:stroke={color} style:stroke={color}
style:fill={color} style:fill={color}
stroke-linecap="round" stroke-linecap="round"

View File

@@ -168,10 +168,13 @@
/* Arrowhead marker styles - use CSS custom properties as default */ /* Arrowhead marker styles - use CSS custom properties as default */
.xy-flow__arrowhead polyline { .xy-flow__arrowhead polyline {
fill: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default)); stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
} }
.xy-flow__arrowhead polyline.arrowclosed {
fill: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.xy-flow__connection { .xy-flow__connection {
pointer-events: none; pointer-events: none;