import type { View } from "@perspective-dev/client"; import type { IPerspectiveViewerPlugin, PluginStaticConfig } from "@perspective-dev/viewer"; import { ChartTypeConfig } from "./charts"; export declare class HTMLPerspectiveViewerWebGLPluginElement extends HTMLElement implements IPerspectiveViewerPlugin { _chartType: ChartTypeConfig; private _initialized; private _glCanvas; private _gridlineCanvas; private _chromeCanvas; private _renderer; private _rendererPromise; private _rawEventForwarder; private _generation; private _renderBlitMode; private _resetClickAbort; /** * Plugin-scoped global config. Seeded lazily from * `_effectiveDefaults()` (which folds * `_chartType.plugin_field_defaults` over `DEFAULT_PLUGIN_CONFIG`) * because base-class field initializers run before the subclass * `_chartType` assignment. `restore({ plugin_config })` merges * incoming values on top of the same effective defaults so fields * the host omits fall back to the chart-type default * (`include_zero = true` for Y Bar / Y Area / X Bar, `false` * elsewhere). Held on the element (not just inside the worker) so * a `_buildRenderer` triggered after a `restore` ships the * resolved values in the `InitMsg`. */ private _pluginConfigStore; private get _pluginConfig(); private set _pluginConfig(value); private _effectiveDefaults; connectedCallback(): void; private _buildCanvasStack; private _clearCanvasStack; /** * Fires when the host (``) removes this plugin * from the DOM on chart-type switch — see * `renderer/activate.rs::remove_inactive_plugin`. Without this, * inactive plugin instances retain their `RendererTransport` * (worker + WebGL context + compiled shader programs) until the * entire viewer is torn down, so a user cycling all 12 chart kinds * holds 12 GL contexts per viewer and routinely exceeds the * browser's per-page context cap (~16) in workspaces. */ disconnectedCallback(): void; /** * Lazy renderer construction. Memoizes the in-flight `init()` * promise so concurrent `draw()` calls during async setup await * the same initialization rather than racing. */ private _ensureRenderer; /** * Capture raw DOM events on the GL canvas with `RawEventForwarder` * and post them over the control channel. The renderer dispatches * them through its own resolver + `applyWheel` / `applyPan` for * zoom/pan, and through `TooltipController` virtual dispatch for * hover/click; `zoomChanged` updates push back so the reset-zoom * button visibility tracks the renderer-side state. * * The `zoomChanged` callback was wired at `RendererTransport` * construction time; here we just attach the event forwarder and * the reset-button click handler. */ private _setupInteraction; private _buildRenderer; setBlitMode(mode: "direct" | "blit"): void; get_static_config(): PluginStaticConfig; column_config_schema(column_type: string, _group: string | undefined, _column_name: string, current_value: Record | null, _viewer_config?: { group_by?: string[]; group_rollup_mode?: string; }): { fields: (Record & { kind: string; })[]; }; plugin_config_schema(_view_config?: { group_by?: string[]; group_rollup_mode?: string; }): { fields: (Record & { kind: string; })[]; }; draw(view: View): Promise; update(view: View): Promise; private _drawImpl; clear(): Promise; resize(): Promise; restyle(): number; render(view: View): Promise; restore(config: any, columns_config?: Record): void; delete(): void; }