import type { ColumnDataMap } from "../../data/view-reader"; import type { WebGLContextManager } from "../../webgl/context-manager"; import { AbstractChart } from "../chart-base"; import { PlotLayout } from "../../layout/plot-layout"; import type { CategoricalLevel } from "../../axis/categorical-axis"; import type { FacetGrid } from "../../layout/facet-grid"; import type { AxisMode, NumericCategoryDomain } from "../common/category-axis-resolver"; import { type HeatmapCell, type HeatmapPipelineResult } from "./heatmap-build"; import { type HeatmapLocations } from "./heatmap-render"; /** * One heatmap in a facet-grid layout. Each facet corresponds to one * user-selected column in the `Color` slot; its `pipeline` holds the * cell data, and `layout` is the cell's `PlotLayout` from `buildFacetGrid`. * `instanceStart`/`instanceCount` give the range of the packed * cell/colorT buffers that belong to this facet. */ export interface HeatmapFacet { label: string; pipeline: HeatmapPipelineResult; layout: PlotLayout; instanceStart: number; instanceCount: number; /** * Origins used to rebase cell positions before f32 narrowing — * matches the per-axis convention in `SeriesChart._categoryOrigin`. * `0` for non-numeric axes; for numeric (especially datetime) axes * pinned to `xNumericDomain.min` / `yNumericDomain.min` so the * shader's projection matrix can be built in rebased space. */ xOrigin: number; yOrigin: number; } /** * Heatmap chart. `yIdx` maps 1:1 to the arrow column iteration order * (after skipping `__ROW_PATH_N__` metadata). `xIdx` is the row index * post-`rowOffset`. * * With one user column in the `Color` slot the chart renders a single * heatmap filling the canvas. With more than one, each column becomes * its own heatmap in a facet grid; all facets share a common color * scale and a single legend. */ export declare class HeatmapChart extends AbstractChart { _program: WebGLProgram | null; _locations: HeatmapLocations | null; _cornerBuffer: WebGLBuffer | null; _gradientCache: import("../../webgl/gradient-texture").GradientTextureCache | null; _xLevels: CategoricalLevel[]; _yLevels: CategoricalLevel[]; _yColumnNames: string[]; _numX: number; _numY: number; _rowOffset: number; _xAxisMode: AxisMode; _yAxisMode: AxisMode; _xPositions: Float64Array | null; _yPositions: Float64Array | null; _xNumericDomain: NumericCategoryDomain | null; _yNumericDomain: NumericCategoryDomain | null; /** * Single-plot rebase origins. Datetime numeric axes carry ~1.7e12 * timestamps which the f32 GPU pipeline cannot resolve below * ~256ms; the cell upload subtracts these and the projection * matrix is built with the same values so its `tx`/`ty` terms stay * small enough for f32 cancellation in the shader. `0` for * categorical or numeric-non-date axes. */ _xOrigin: number; _yOrigin: number; _cells: HeatmapCell[]; _cells2D: (HeatmapCell | null)[]; _uploadedCells: number; _colorMin: number; _colorMax: number; _aggName: string; _hoveredCell: HeatmapCell | null; _lastLayout: PlotLayout | null; /** * Last cursor position (canvas-CSS pixels) recorded by * `handleHeatmapHover`. Used as the tooltip anchor instead of the * cell center so the hover label tracks the mouse — necessary * because heatmap cells can be many pixels wide and a center-anchored * tooltip drifts away from the cursor. */ _hoveredMouseX: number; _hoveredMouseY: number; _facets: HeatmapFacet[]; _facetGrid: FacetGrid | null; _hoveredFacetIdx: number; /** * Bound accessor so the interact module can trigger a chrome redraw. */ _renderChromeOverlay: () => void; protected tooltipCallbacks(): { onHover: (mx: number, my: number) => void; onLeave: () => void; onPin: (mx: number, my: number) => void; onUnpin: () => void; }; /** * Resolve a clicked heatmap cell into a `PerspectiveClickDetail` * and emit both `perspective-click` and * `perspective-global-filter selected:true`. `xIdx` indexes the * outer (group-by) hierarchy; `yIdx` indexes the column-side * hierarchy (split-by + value-column splits). Each level is read * directly from the pre-resolved `_xLevels` / `_yLevels` labels. * * Representative source row: `xIdx + _rowOffset` — the row in the * pivoted view that owns this category. Sufficient for the * `row.{col}` lookups consumers typically do; not authoritative for * cells that aggregate across many source rows. */ private _emitHeatmapClickSelect; uploadAndRender(glManager: WebGLContextManager, columns: ColumnDataMap, startRow: number, endRow: number): Promise; _fullRender(glManager: WebGLContextManager): void; protected destroyInternal(): void; }