chore(custom-minimap-node-example): cleanup

This commit is contained in:
moklick
2023-03-13 13:08:29 +01:00
parent 8b9f2a8f01
commit 84ffe34f87
@@ -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;