File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
mindy-website/www/src/components Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ import {
2+ getStraightPath ,
3+ type ConnectionLineComponentProps ,
4+ } from "@xyflow/react" ;
5+
6+ export default function BuildingLinkConnectionLine ( {
7+ fromX,
8+ fromY,
9+ toX,
10+ toY,
11+ connectionLineStyle,
12+ } : ConnectionLineComponentProps ) {
13+ const [ edgePath ] = getStraightPath ( {
14+ sourceX : fromX ,
15+ sourceY : fromY ,
16+ targetX : toX ,
17+ targetY : toY ,
18+ } ) ;
19+
20+ return (
21+ < g >
22+ < path
23+ style = { {
24+ stroke : "var(--mantine-color-dark-1)" ,
25+ ...connectionLineStyle ,
26+ } }
27+ fill = "none"
28+ d = { edgePath }
29+ />
30+ </ g >
31+ ) ;
32+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { ProcessorKind } from "mindy-website";
1717
1818import { useLogicVM } from "../hooks" ;
1919import { packPoint } from "../utils" ;
20+ import BuildingLinkConnectionLine from "./BuildingLinkConnectionLine" ;
2021import BuildingLinkEdge from "./BuildingLinkEdge" ;
2122import DisplayNode , { type DisplayNodeType } from "./nodes/DisplayNode" ;
2223import ProcessorNode , { type ProcessorNodeType } from "./nodes/ProcessorNode" ;
@@ -209,6 +210,7 @@ export default function LogicVMFlow() {
209210 onEdgesChange = { onEdgesChange }
210211 onBeforeDelete = { onBeforeDelete }
211212 onConnect = { onConnect }
213+ connectionLineComponent = { BuildingLinkConnectionLine }
212214 fitView
213215 >
214216 < Background variant = { BackgroundVariant . Dots } />
You can’t perform that action at this time.
0 commit comments