Spaces:
Configuration error

File size: 512 Bytes
420bd16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { MarkerType } from 'reactflow';

export const LINE_TYPES = {
  SMOOTHSTEP: 'smoothstep',
  STRAIGHT: 'straight',
  BEZIER: 'bezier'
};

export const edgeDefaults = {
  type: 'smoothstep',
  animated: true,
  style: {
    stroke: '#3498db',
    strokeWidth: 2,
  },
  markerEnd: {
    type: MarkerType.ArrowClosed,
    width: 20,
    height: 20,
    color: '#3498db',
  },
};

export const getEdgeStyle = (edge, edgeTypes) => ({
  ...edgeDefaults,
  type: edgeTypes[edge.id] || LINE_TYPES.SMOOTHSTEP,
});