/** * @license * Copyright 2025-2026 Open Home Foundation * SPDX-License-Identifier: Apache-2.0 */ import type { MatterNode } from "@matter-server/ws-client"; import { LitElement } from "lit"; import { DataSet, Network } from "vis-network/standalone"; import type { NetworkGraphEdge, NetworkGraphNode } from "./network-types.js"; /** * Base class for network graph components (Thread and WiFi). * Provides shared vis.js network initialization, highlighting, and theme support. */ export declare abstract class BaseNetworkGraph extends LitElement { nodes: Record; protected _selectedNodeId: number | string | null; protected _physicsEnabled: boolean; protected _network?: Network; protected _nodesDataSet?: DataSet; protected _edgesDataSet?: DataSet; protected _container?: HTMLDivElement; protected _resizeObserver?: ResizeObserver; protected _themeUnsubscribe?: () => void; protected _updateDebounceTimer?: ReturnType; protected _autoFreezeTimer?: ReturnType; /** Whether auto-freeze has already been applied (to avoid re-freezing after user unfreezes) */ private _autoFreezeApplied; /** Whether initial fit has been done (to preserve user's zoom/pan after first load) */ private _initialFitDone; /** Store original edge colors for restoration after highlighting */ private _originalEdgeColors; protected _getFontColor(): string; protected _getDimmedEdgeColor(): string; /** * Returns physics options for the network. Override in subclasses for different behavior. */ protected _getPhysicsOptions(): any; updated(changedProperties: Map): void; /** * Try to find and attach the graph container if it wasn't available before. * This handles the case where empty state was rendered initially. */ private _tryAttachContainer; /** Debounced graph update to avoid excessive redraws */ protected _debouncedUpdateGraph(): void; firstUpdated(): void; disconnectedCallback(): void; protected _initializeNetwork(): void; /** * Returns true if the graph is initialized and ready for interaction. */ isReady(): boolean; /** * Fits all nodes into view. */ fit(): void; /** * Zooms in by 20%. */ zoomIn(): void; /** * Zooms out by 20%. */ zoomOut(): void; /** * Returns whether physics simulation is currently enabled. */ get physicsEnabled(): boolean; /** * Enables or disables physics simulation (node movement/settling). * When disabled, nodes freeze in place; when enabled, they resume settling. * @param enabled Whether to enable physics * @param isManual If true, cancels any pending auto-freeze (user manually toggled) */ setPhysicsEnabled(enabled: boolean, isManual?: boolean): void; /** * Starts the auto-freeze timer. Physics will be disabled after 5 seconds * unless the user manually toggles physics or the timer is cancelled. */ private _startAutoFreezeTimer; /** * Cancels any pending auto-freeze timer. */ private _cancelAutoFreezeTimer; /** * Selects a node by ID and focuses on it. */ selectNode(nodeId: number | string): void; /** * Deselects all nodes, clears highlights, and restores default styling. */ deselectAll(): void; protected _dispatchNodeSelected(nodeId: number | string | null): void; /** * Highlights edges connected to the selected node and makes neighbor nodes more prominent. */ protected _highlightConnections(nodeId: number | string): void; /** * Clears all highlights and restores default styling. */ protected _clearHighlights(): void; /** * Clear stored edge colors when graph is updated (edges are recreated). */ protected _clearOriginalEdgeColors(): void; /** * Abstract method to be implemented by subclasses for graph-specific updates. */ protected abstract _updateGraph(): void; static styles: import("lit").CSSResult; } //# sourceMappingURL=base-network-graph.d.ts.map