import { type PropType, type VNode } from "vue"; export type ForceGraphTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8"; export type ForceGraphNodeShape = "dot" | "circle" | "diamond" | "star" | "hexagon" | "box" | "square" | "roundedbox" | "triangle"; /** Stroke dash style for typed edges. */ export type ForceGraphEdgeDash = "solid" | "dashed" | "dotted" | "long-dash"; export type ForceGraphNode = { /** Stable identifier; referenced by edges. */ id: string; /** Visible label (falls back to id). */ label?: string; /** * Grouping key (e.g. node type or community). Nodes sharing a group get * the same tone when `tone` is not set explicitly. */ group?: string | number; /** Explicit data-vis tone; overrides the group-derived tone. */ tone?: ForceGraphTone; /** Relative node radius weight (defaults to 1). */ weight?: number; /** Pin the node to a fixed position (ignored by the simulation). */ fx?: number; fy?: number; /** * Visual shape for the node. Defaults to 'dot' (circle). * Supported: 'dot'|'circle', 'diamond', 'star', 'hexagon', 'box'|'square', 'triangle'. */ shape?: ForceGraphNodeShape; }; export type ForceGraphEdge = { /** Source node id. */ source: string; /** Target node id. */ target: string; /** Optional relation label, surfaced in the tooltip on hover/focus. */ relation?: string; /** * When true the link renders as a dashed/faded "weak" link. Lets callers * map a confidence dimension onto link strength without extra props. * Equivalent to `dash: "dashed"` plus a faded stroke (kept for back-compat). */ weak?: boolean; /** * Typed dash pattern for the stroke. Independent of `weak`. * "solid" = none, "dashed" = "6 4", "dotted" = "1 4", "long-dash" = "12 6". * When omitted, falls back to the `weak` styling. */ dash?: ForceGraphEdgeDash; /** * Emphasise the edge (e.g. a reconciliation/match relation) with a thicker, * fully-opaque stroke. Defaults to false. */ emphasis?: boolean; /** Explicit stroke width override in px. Takes precedence over `emphasis`. */ width?: number; }; export type ForceGraphLegendEntry = { /** Label shown in the legend. */ label: string; /** Shape for this entry (node legend). Absent = line-style legend entry. */ shape?: ForceGraphNodeShape; /** Tone for this entry. Defaults to category1. */ tone?: ForceGraphTone; /** When true, renders as a dashed line (edge legend). */ weak?: boolean; /** * Typed dash pattern for an edge legend swatch. Independent of `weak`. * When set, the swatch line uses the matching dash-array. */ dash?: ForceGraphEdgeDash; }; export type ForceGraphProps = { nodes: ForceGraphNode[]; edges: ForceGraphEdge[]; label?: string; width?: number; height?: number; nodeRadius?: number; showLabels?: boolean; iterations?: number; selectedIds?: string[]; focusId?: string | null; legend?: ForceGraphLegendEntry[]; edgeCurve?: number; /** * Repulsion multiplier controlling how spread out the layout is. * >1 = graphe plus aéré, <1 = plus compact. Defaults to 1, clamped to * [0.1, 10] internally. Does not affect the fit-to-content framing. */ repulsion?: number; onSelect?: (id: string) => void; onOpenEntity?: (id: string) => void; onEdgeHover?: (edge: ForceGraphEdge) => void; /** * Called when the user hovers (or keyboard-focuses) a node, and again with * null when the hover/focus ends. Intended for syncing an external panel. */ onNodeHover?: (node: ForceGraphNode | null) => void; /** * Reconciliation merge animation (CLIENT-ONLY — driven by a `watch`, which * never runs during SSR, so no merge is animated or resolved server-side). * * Pass a `{ id, from, into }` where both `from` and `into` exist in `nodes`: * the `from` node animates toward the position of `into` while fading out (the * node and its incident edges), then `onMergeComplete(pair)` fires exactly * ONCE for that `id`. Purely visual — the component never mutates the data; * the consumer removes `from` from `nodes` after the callback. * * Idempotent on `id`: re-passing the SAME `id` (even with a new identity for * the object) is a no-op — the animation/callback are not replayed. Passing a * NEW `id` (re)plays the merge, even for the same `from`/`into` pair. After * completion the `from` node stays MASKED (hidden) until the consumer removes * it or a new `mergePair` is supplied, so it does not flash back when the prop * returns to null. Pass null (the default) for no merge in flight. */ mergePair?: { id: string; from: string; into: string; } | null; /** * Fired once the merge animation for the current `mergePair` completes (or * immediately, on a microtask, under reduced motion). Fires at most ONCE per * `id`. Receives the same pair so the consumer can drop `from` from the data. */ onMergeComplete?: (pair: { id: string; from: string; into: string; }) => void; /** Accessible label for the "reset view" button (i18n). */ resetViewLabel?: string; class?: string; }; /** * Maps a dash style (or the legacy `weak` flag) to an SVG stroke-dasharray. * Returns null for a solid stroke. */ export declare function edgeDashArray(dash: ForceGraphEdgeDash | undefined, weak?: boolean): string | null; export declare function nodeShapePath(shape: ForceGraphNodeShape | undefined, r: number): string | null; export declare const ForceGraph: import("vue").DefineComponent; required: true; }; edges: { type: PropType; required: true; }; label: { type: StringConstructor; default: string; }; width: { type: NumberConstructor; default: number; }; height: { type: NumberConstructor; default: number; }; nodeRadius: { type: NumberConstructor; default: number; }; showLabels: { type: BooleanConstructor; default: boolean; }; iterations: { type: NumberConstructor; default: number; }; selectedIds: { type: PropType; default: () => never[]; }; focusId: { type: PropType; default: null; }; legend: { type: PropType; default: undefined; }; edgeCurve: { type: NumberConstructor; default: number; }; /** * Repulsion multiplier controlling how spread out the layout is. * >1 = graphe plus aéré, <1 = plus compact ; multiplie la force de * répulsion sans toucher au fit-to-content. Defaults to 1. Clamped to * [0.1, 10] internally to avoid layout explosions/collapses. */ repulsion: { type: NumberConstructor; default: number; }; onSelect: { type: PropType<(id: string) => void>; default: undefined; }; onOpenEntity: { type: PropType<(id: string) => void>; default: undefined; }; onEdgeHover: { type: PropType<(edge: ForceGraphEdge) => void>; default: undefined; }; /** * Called when the user hovers (or keyboard-focuses) a node, and again with * null when the hover/focus ends. Intended for syncing an external panel. */ onNodeHover: { type: PropType<(node: ForceGraphNode | null) => void>; default: undefined; }; /** * Reconciliation merge animation (CLIENT-ONLY): a new valid `{ id, from, * into }` glides the `from` node toward `into` while fading out, then fires * `onMergeComplete` exactly once per `id`. Idempotent on `id`; the `from` * node stays masked after completion until removed. Pass null for no merge. */ mergePair: { type: PropType<{ id: string; from: string; into: string; } | null>; default: null; }; /** * Fired once the merge animation completes (or immediately, on a microtask, * under reduced motion). At most ONCE per `id`. Receives the same pair. */ onMergeComplete: { type: PropType<(pair: { id: string; from: string; into: string; }) => void>; default: undefined; }; /** Accessible label for the "reset view" button (i18n). */ resetViewLabel: { type: StringConstructor; default: string; }; /** Accessible label for the legend overlay (i18n). */ legendLabel: { type: StringConstructor; default: string; }; class: { type: StringConstructor; default: undefined; }; }>, () => VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { select: (_id: string) => true; openEntity: (_id: string) => true; edgeHover: (_edge: ForceGraphEdge) => true; nodeHover: (_node: ForceGraphNode | null) => true; mergeComplete: (_pair: { id: string; from: string; into: string; }) => true; }, string, import("vue").PublicProps, Readonly; required: true; }; edges: { type: PropType; required: true; }; label: { type: StringConstructor; default: string; }; width: { type: NumberConstructor; default: number; }; height: { type: NumberConstructor; default: number; }; nodeRadius: { type: NumberConstructor; default: number; }; showLabels: { type: BooleanConstructor; default: boolean; }; iterations: { type: NumberConstructor; default: number; }; selectedIds: { type: PropType; default: () => never[]; }; focusId: { type: PropType; default: null; }; legend: { type: PropType; default: undefined; }; edgeCurve: { type: NumberConstructor; default: number; }; /** * Repulsion multiplier controlling how spread out the layout is. * >1 = graphe plus aéré, <1 = plus compact ; multiplie la force de * répulsion sans toucher au fit-to-content. Defaults to 1. Clamped to * [0.1, 10] internally to avoid layout explosions/collapses. */ repulsion: { type: NumberConstructor; default: number; }; onSelect: { type: PropType<(id: string) => void>; default: undefined; }; onOpenEntity: { type: PropType<(id: string) => void>; default: undefined; }; onEdgeHover: { type: PropType<(edge: ForceGraphEdge) => void>; default: undefined; }; /** * Called when the user hovers (or keyboard-focuses) a node, and again with * null when the hover/focus ends. Intended for syncing an external panel. */ onNodeHover: { type: PropType<(node: ForceGraphNode | null) => void>; default: undefined; }; /** * Reconciliation merge animation (CLIENT-ONLY): a new valid `{ id, from, * into }` glides the `from` node toward `into` while fading out, then fires * `onMergeComplete` exactly once per `id`. Idempotent on `id`; the `from` * node stays masked after completion until removed. Pass null for no merge. */ mergePair: { type: PropType<{ id: string; from: string; into: string; } | null>; default: null; }; /** * Fired once the merge animation completes (or immediately, on a microtask, * under reduced motion). At most ONCE per `id`. Receives the same pair. */ onMergeComplete: { type: PropType<(pair: { id: string; from: string; into: string; }) => void>; default: undefined; }; /** Accessible label for the "reset view" button (i18n). */ resetViewLabel: { type: StringConstructor; default: string; }; /** Accessible label for the legend overlay (i18n). */ legendLabel: { type: StringConstructor; default: string; }; class: { type: StringConstructor; default: undefined; }; }>> & Readonly<{ onSelect?: ((_id: string) => any) | undefined; onOpenEntity?: ((_id: string) => any) | undefined; onEdgeHover?: ((_edge: ForceGraphEdge) => any) | undefined; onNodeHover?: ((_node: ForceGraphNode | null) => any) | undefined; onMergeComplete?: ((_pair: { id: string; from: string; into: string; }) => any) | undefined; }>, { class: string; label: string; legend: ForceGraphLegendEntry[]; onSelect: (id: string) => void; height: number; width: number; nodeRadius: number; showLabels: boolean; iterations: number; selectedIds: string[]; focusId: string | null; edgeCurve: number; repulsion: number; onOpenEntity: (id: string) => void; onEdgeHover: (edge: ForceGraphEdge) => void; onNodeHover: (node: ForceGraphNode | null) => void; mergePair: { id: string; from: string; into: string; } | null; onMergeComplete: (pair: { id: string; from: string; into: string; }) => void; resetViewLabel: string; legendLabel: string; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; //# sourceMappingURL=ForceGraph.d.ts.map