Add node id to MiniMapNodeProps and MiniMapNode in Svelte Flow.
This commit is contained in:
@@ -121,6 +121,7 @@
|
||||
{#if node && nodeHasDimensions(node) && !node.hidden}
|
||||
{@const nodeDimesions = getNodeDimensions(node)}
|
||||
<MinimapNode
|
||||
id={node.id}
|
||||
x={node.internals.positionAbsolute.x}
|
||||
y={node.internals.positionAbsolute.y}
|
||||
{...nodeDimesions}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import type { MiniMapNodeProps } from './types';
|
||||
|
||||
let {
|
||||
id,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
@@ -17,6 +18,7 @@
|
||||
class: className,
|
||||
nodeComponent
|
||||
}: {
|
||||
id: string;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
@@ -36,6 +38,7 @@
|
||||
{@const CustomComponent = nodeComponent}
|
||||
|
||||
<CustomComponent
|
||||
{id}
|
||||
{x}
|
||||
{y}
|
||||
{width}
|
||||
|
||||
@@ -11,6 +11,7 @@ export type GetMiniMapNodeAttribute = (node: Node) => string;
|
||||
* @public
|
||||
*/
|
||||
export type MiniMapNodeProps = {
|
||||
id: string;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
|
||||
Reference in New Issue
Block a user