restore attribute
This commit is contained in:
@@ -8,10 +8,19 @@ type SymbolProps = Omit<EdgeMarker, 'type'>;
|
||||
const ArrowSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) => {
|
||||
const style = {
|
||||
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) => {
|
||||
@@ -20,7 +29,15 @@ const ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }: SymbolProps) =>
|
||||
...(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 = {
|
||||
|
||||
@@ -26,16 +26,17 @@
|
||||
>
|
||||
{#if type === MarkerType.Arrow}
|
||||
<polyline
|
||||
class="arrow"
|
||||
style:stroke={color}
|
||||
style:fill={'none'}
|
||||
fill="none"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width={strokeWidth}
|
||||
fill="none"
|
||||
points="-5,-4 0,0 -5,4"
|
||||
/>
|
||||
{:else if type === MarkerType.ArrowClosed}
|
||||
<polyline
|
||||
class="arrowclosed"
|
||||
style:stroke={color}
|
||||
style:fill={color}
|
||||
stroke-linecap="round"
|
||||
|
||||
@@ -168,10 +168,13 @@
|
||||
|
||||
/* Arrowhead marker styles - use CSS custom properties as default */
|
||||
.xy-flow__arrowhead polyline {
|
||||
fill: 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 {
|
||||
pointer-events: none;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user