feat: accept any path element attribute as a prop

This commit is contained in:
Matt Huggins
2024-11-28 17:18:01 -06:00
parent 616d266523
commit 23b3fb64c5
6 changed files with 16 additions and 7 deletions
@@ -20,10 +20,12 @@ export function BaseEdge({
markerStart,
className,
interactionWidth = 20,
...props
}: BaseEdgeProps) {
return (
<>
<path
{...props}
id={id}
style={style}
d={path}
@@ -26,6 +26,7 @@ function createBezierEdge(params: { isInternal: boolean }) {
markerStart,
pathOptions,
interactionWidth,
...props
}: BezierEdgeProps) => {
const [path, labelX, labelY] = getBezierPath({
sourceX,
@@ -41,6 +42,7 @@ function createBezierEdge(params: { isInternal: boolean }) {
return (
<BaseEdge
{...props}
id={_id}
path={path}
labelX={labelX}
@@ -92,6 +92,7 @@ function createSimpleBezierEdge(params: { isInternal: boolean }) {
markerEnd,
markerStart,
interactionWidth,
...props
}: SimpleBezierEdgeProps) => {
const [path, labelX, labelY] = getSimpleBezierPath({
sourceX,
@@ -106,6 +107,7 @@ function createSimpleBezierEdge(params: { isInternal: boolean }) {
return (
<BaseEdge
{...props}
id={_id}
path={path}
labelX={labelX}
@@ -26,6 +26,7 @@ function createSmoothStepEdge(params: { isInternal: boolean }) {
markerStart,
pathOptions,
interactionWidth,
...props
}: SmoothStepEdgeProps) => {
const [path, labelX, labelY] = getSmoothStepPath({
sourceX,
@@ -42,6 +43,7 @@ function createSmoothStepEdge(params: { isInternal: boolean }) {
return (
<BaseEdge
{...props}
id={_id}
path={path}
labelX={labelX}
@@ -23,6 +23,7 @@ function createStraightEdge(params: { isInternal: boolean }) {
markerEnd,
markerStart,
interactionWidth,
...props
}: StraightEdgeProps) => {
const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY });
@@ -30,6 +31,7 @@ function createStraightEdge(params: { isInternal: boolean }) {
return (
<BaseEdge
{...props}
id={_id}
path={path}
labelX={labelX}
@@ -44,6 +46,7 @@ function createStraightEdge(params: { isInternal: boolean }) {
markerEnd={markerEnd}
markerStart={markerStart}
interactionWidth={interactionWidth}
{...props}
/>
);
}