Add node id to MiniMapNodeProps and MiniMapNode in Svelte Flow.
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
<script lang="ts">
|
||||
let {
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
selected,
|
||||
}: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
selected?: boolean;
|
||||
} = $props();
|
||||
import type { MiniMapNodeProps } from '@xyflow/svelte';
|
||||
|
||||
let { id, x, y, width, height, selected }: MiniMapNodeProps = $props();
|
||||
</script>
|
||||
|
||||
<circle
|
||||
<circle
|
||||
cx={x + width / 2}
|
||||
cy={y + height / 2}
|
||||
r={Math.min(width, height) - 2}
|
||||
fill={selected ? "#ff6b6b" : "#ffcc00"}
|
||||
/>
|
||||
cy={y + height / 2}
|
||||
r={Math.min(width, height) - 2}
|
||||
fill={selected ? '#ff6b6b' : '#ffcc00'}
|
||||
/>
|
||||
<text
|
||||
x={x + width / 2}
|
||||
y={y + height / 2}
|
||||
text-anchor="middle"
|
||||
dominant-baseline="middle"
|
||||
fill="blue"
|
||||
stroke-width="0.5"
|
||||
font-size="100"
|
||||
font-family="Arial, sans-serif"
|
||||
font-weight="bold"
|
||||
>
|
||||
{id}
|
||||
</text>
|
||||
|
||||
Reference in New Issue
Block a user