chore(custom-minimap-node-example): cleanup
This commit is contained in:
@@ -8,6 +8,7 @@ import ReactFlow, {
|
|||||||
Controls,
|
Controls,
|
||||||
Edge,
|
Edge,
|
||||||
MiniMap,
|
MiniMap,
|
||||||
|
MiniMapNodeProps,
|
||||||
Node,
|
Node,
|
||||||
ReactFlowInstance,
|
ReactFlowInstance,
|
||||||
useEdgesState,
|
useEdgesState,
|
||||||
@@ -25,6 +26,10 @@ const buttonStyle: CSSProperties = {
|
|||||||
zIndex: 4,
|
zIndex: 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const CustomMiniMapNode = ({ x, y, width, height, color }: MiniMapNodeProps) => (
|
||||||
|
<circle cx={x} cy={y} r={Math.max(width, height) / 2} fill={color} />
|
||||||
|
);
|
||||||
|
|
||||||
const CustomMiniMapNodeFlow = () => {
|
const CustomMiniMapNodeFlow = () => {
|
||||||
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
||||||
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
||||||
@@ -66,8 +71,4 @@ const CustomMiniMapNodeFlow = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const CustomMiniMapNode = ({ x, y, width, height }) => (
|
|
||||||
<circle cx={x} cy={y} r={Math.max(width, height)} />
|
|
||||||
)
|
|
||||||
|
|
||||||
export default CustomMiniMapNodeFlow;
|
export default CustomMiniMapNodeFlow;
|
||||||
|
|||||||
Reference in New Issue
Block a user