Spaces:
Configuration error
Configuration error
zack
commited on
Commit
·
bee606f
1
Parent(s):
b39e95b
chore: remove src/components/Edges/Custom.js 🧹
Browse files
frontend/src/components/Edges/Custom.js
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
import React from 'react';
|
2 |
-
import {BiX} from 'react-icons/bi'
|
3 |
-
import { getBezierPath, getEdgeCenter } from 'react-flow-renderer';
|
4 |
-
|
5 |
-
import '../../css/dist/output.css';
|
6 |
-
|
7 |
-
const foreignObjectSize = 40;
|
8 |
-
|
9 |
-
const onEdgeClick = (evt, id) => {
|
10 |
-
evt(id)
|
11 |
-
};
|
12 |
-
|
13 |
-
export default function CustomEdge({
|
14 |
-
id,
|
15 |
-
sourceX,
|
16 |
-
sourceY,
|
17 |
-
targetX,
|
18 |
-
targetY,
|
19 |
-
sourcePosition,
|
20 |
-
targetPosition,
|
21 |
-
markerEnd,
|
22 |
-
data
|
23 |
-
}) {
|
24 |
-
const edgePath = getBezierPath({
|
25 |
-
sourceX,
|
26 |
-
sourceY,
|
27 |
-
sourcePosition,
|
28 |
-
targetX,
|
29 |
-
targetY,
|
30 |
-
targetPosition,
|
31 |
-
});
|
32 |
-
const [edgeCenterX, edgeCenterY] = getEdgeCenter({
|
33 |
-
sourceX,
|
34 |
-
sourceY,
|
35 |
-
targetX,
|
36 |
-
targetY,
|
37 |
-
});
|
38 |
-
|
39 |
-
return (
|
40 |
-
<>
|
41 |
-
<path
|
42 |
-
id={id}
|
43 |
-
style={{stroke : "#00FF4A", strokeWidth : "6"}}
|
44 |
-
className="react-flow__edge-path"
|
45 |
-
d={edgePath}
|
46 |
-
markerEnd={markerEnd}
|
47 |
-
/>
|
48 |
-
<foreignObject
|
49 |
-
width={foreignObjectSize}
|
50 |
-
height={200}
|
51 |
-
x={edgeCenterX - foreignObjectSize / 2}
|
52 |
-
y={edgeCenterY - foreignObjectSize / 2}
|
53 |
-
className="edgebutton-foreignobject"
|
54 |
-
requiredExtensions="http://www.w3.org/1999/xhtml"
|
55 |
-
>
|
56 |
-
<div className=" flex w-10 h-10 dark:bg-black bg-white border-2 rounded-xl hover:shadow-lg text-center duration-200" onClick={() => onEdgeClick(data.delete, id)}>
|
57 |
-
<BiX className=' flex-1 w-9 h-9 text-black dark:text-white'/>
|
58 |
-
</div>
|
59 |
-
</foreignObject>
|
60 |
-
</>
|
61 |
-
);
|
62 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|