chore(react): cleanup base edge
This commit is contained in:
@@ -2,10 +2,9 @@ import { isNumeric } from '@xyflow/system';
|
|||||||
import cc from 'classcat';
|
import cc from 'classcat';
|
||||||
|
|
||||||
import { EdgeText } from './EdgeText';
|
import { EdgeText } from './EdgeText';
|
||||||
import type { BaseEdgeProps, EdgeComponentWithPathOptions, EdgeProps } from '../../types';
|
import type { BaseEdgeProps } from '../../types';
|
||||||
|
|
||||||
export function BaseEdge({
|
export function BaseEdge({
|
||||||
id,
|
|
||||||
path,
|
path,
|
||||||
labelX,
|
labelX,
|
||||||
labelY,
|
labelY,
|
||||||
@@ -15,23 +14,12 @@ export function BaseEdge({
|
|||||||
labelBgStyle,
|
labelBgStyle,
|
||||||
labelBgPadding,
|
labelBgPadding,
|
||||||
labelBgBorderRadius,
|
labelBgBorderRadius,
|
||||||
markerEnd,
|
|
||||||
markerStart,
|
|
||||||
className,
|
|
||||||
interactionWidth = 20,
|
interactionWidth = 20,
|
||||||
...props
|
...props
|
||||||
}: BaseEdgeProps) {
|
}: BaseEdgeProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<path
|
<path {...props} d={path} fill="none" className={cc(['react-flow__edge-path', props.className])} />
|
||||||
{...props}
|
|
||||||
id={id}
|
|
||||||
d={path}
|
|
||||||
fill="none"
|
|
||||||
className={cc(['react-flow__edge-path', className])}
|
|
||||||
markerEnd={markerEnd}
|
|
||||||
markerStart={markerStart}
|
|
||||||
/>
|
|
||||||
{interactionWidth && (
|
{interactionWidth && (
|
||||||
<path
|
<path
|
||||||
d={path}
|
d={path}
|
||||||
|
|||||||
@@ -130,14 +130,6 @@ export type BaseEdgeProps = Omit<SVGAttributes<SVGPathElement>, 'd'> &
|
|||||||
labelX?: number;
|
labelX?: number;
|
||||||
/** The y position of edge label */
|
/** The y position of edge label */
|
||||||
labelY?: number;
|
labelY?: number;
|
||||||
/** Marker at start of edge
|
|
||||||
* @example 'url(#arrow)'
|
|
||||||
*/
|
|
||||||
markerStart?: string;
|
|
||||||
/** Marker at end of edge
|
|
||||||
* @example 'url(#arrow)'
|
|
||||||
*/
|
|
||||||
markerEnd?: string;
|
|
||||||
/** SVG path of the edge */
|
/** SVG path of the edge */
|
||||||
path: string;
|
path: string;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user