@d3plus/core 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +728 -1454
- package/es/index.js.map +1 -1
- package/es/internal.js +5 -0
- package/es/internal.js.map +1 -1
- package/es/src/charts/Chord/index.js +2 -0
- package/es/src/charts/Chord/index.js.map +1 -1
- package/es/src/charts/Geomap/applyLayout.js +3 -1
- package/es/src/charts/Geomap/applyLayout.js.map +1 -1
- package/es/src/charts/Geomap/index.js +3 -1
- package/es/src/charts/Geomap/index.js.map +1 -1
- package/es/src/charts/Matrix/emit.js +5 -4
- package/es/src/charts/Matrix/emit.js.map +1 -1
- package/es/src/charts/Network/index.js +4 -0
- package/es/src/charts/Network/index.js.map +1 -1
- package/es/src/charts/Pack/emit.js +6 -6
- package/es/src/charts/Pack/emit.js.map +1 -1
- package/es/src/charts/Pack/index.js +2 -0
- package/es/src/charts/Pack/index.js.map +1 -1
- package/es/src/charts/Pie/emit.js +5 -6
- package/es/src/charts/Pie/emit.js.map +1 -1
- package/es/src/charts/Pie/index.js +2 -0
- package/es/src/charts/Pie/index.js.map +1 -1
- package/es/src/charts/Plot/index.js +15 -1
- package/es/src/charts/Plot/index.js.map +1 -1
- package/es/src/charts/Plot/insetRegion.js +21 -0
- package/es/src/charts/Plot/insetRegion.js.map +1 -0
- package/es/src/charts/Plot/sharedHover.js +117 -16
- package/es/src/charts/Plot/sharedHover.js.map +1 -1
- package/es/src/charts/Plot/sharedTooltip.js +35 -15
- package/es/src/charts/Plot/sharedTooltip.js.map +1 -1
- package/es/src/charts/Plot/trendLines.js +140 -38
- package/es/src/charts/Plot/trendLines.js.map +1 -1
- package/es/src/charts/Plot/trendProjection.js +120 -0
- package/es/src/charts/Plot/trendProjection.js.map +1 -0
- package/es/src/charts/Plot/trendScene.js +33 -19
- package/es/src/charts/Plot/trendScene.js.map +1 -1
- package/es/src/charts/Plot/trendTooltip.js +79 -17
- package/es/src/charts/Plot/trendTooltip.js.map +1 -1
- package/es/src/charts/Priestley/emit.js +3 -4
- package/es/src/charts/Priestley/emit.js.map +1 -1
- package/es/src/charts/RadialMatrix/emit.js +4 -4
- package/es/src/charts/RadialMatrix/emit.js.map +1 -1
- package/es/src/charts/Rings/index.js +5 -1
- package/es/src/charts/Rings/index.js.map +1 -1
- package/es/src/charts/Sankey/index.js +2 -0
- package/es/src/charts/Sankey/index.js.map +1 -1
- package/es/src/charts/Tree/index.js +2 -0
- package/es/src/charts/Tree/index.js.map +1 -1
- package/es/src/charts/Treemap/emit.js +3 -4
- package/es/src/charts/Treemap/emit.js.map +1 -1
- package/es/src/charts/definition/ChartDefinition.js.map +1 -1
- package/es/src/charts/definition/makeChart.js +8 -2
- package/es/src/charts/definition/makeChart.js.map +1 -1
- package/es/src/charts/drawSteps/bottomRightControls.js +3 -0
- package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -1
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +135 -4
- package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -1
- package/es/src/charts/drawSteps/searchControlsMarkup.js +15 -38
- package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -1
- package/es/src/charts/events/click.legend.js +10 -5
- package/es/src/charts/events/click.legend.js.map +1 -1
- package/es/src/charts/events/mousemove.shape.js +8 -1
- package/es/src/charts/events/mousemove.shape.js.map +1 -1
- package/es/src/charts/features/emitHelpers.js +19 -5
- package/es/src/charts/features/emitHelpers.js.map +1 -1
- package/es/src/charts/features/features.js +3 -108
- package/es/src/charts/features/features.js.map +1 -1
- package/es/src/charts/features/featuresColorScale.js +161 -0
- package/es/src/charts/features/featuresColorScale.js.map +1 -0
- package/es/src/charts/features/featuresLegend.js +145 -32
- package/es/src/charts/features/featuresLegend.js.map +1 -1
- package/es/src/charts/features/insetState.js +174 -0
- package/es/src/charts/features/insetState.js.map +1 -0
- package/es/src/charts/features/sceneBounds.js +271 -0
- package/es/src/charts/features/sceneBounds.js.map +1 -0
- package/es/src/charts/features/tooltipSwatch.js +73 -0
- package/es/src/charts/features/tooltipSwatch.js.map +1 -0
- package/es/src/charts/pipeline/insetPlacement.js +406 -0
- package/es/src/charts/pipeline/insetPlacement.js.map +1 -0
- package/es/src/charts/pipeline/runVizPipeline.js +6 -2
- package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
- package/es/src/charts/viz/Viz.js +18 -3
- package/es/src/charts/viz/Viz.js.map +1 -1
- package/es/src/charts/viz/VizBaseConfig.js +20 -24
- package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
- package/es/src/charts/viz/interactionOpacity.js +21 -13
- package/es/src/charts/viz/interactionOpacity.js.map +1 -1
- package/es/src/charts/viz/linkGroup.js +386 -0
- package/es/src/charts/viz/linkGroup.js.map +1 -0
- package/es/src/charts/viz/sceneRows.js +33 -0
- package/es/src/charts/viz/sceneRows.js.map +1 -0
- package/es/src/charts/viz/vizDefaults.js +13 -8
- package/es/src/charts/viz/vizDefaults.js.map +1 -1
- package/es/src/charts/viz/vizTypes.js.map +1 -1
- package/es/src/components/Axis/AxisBottom.js +1 -1
- package/es/src/components/Axis/AxisBottom.js.map +1 -1
- package/es/src/components/Axis/AxisLeft.js +1 -1
- package/es/src/components/Axis/AxisLeft.js.map +1 -1
- package/es/src/components/Axis/AxisRight.js +1 -1
- package/es/src/components/Axis/AxisRight.js.map +1 -1
- package/es/src/components/Axis/AxisTop.js +1 -1
- package/es/src/components/Axis/AxisTop.js.map +1 -1
- package/es/src/components/Axis/axisLayoutLabels.js +13 -1
- package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
- package/es/src/components/ColorScale/ColorScale.js.map +1 -1
- package/es/src/components/Legend/legendConfig.js +2 -1
- package/es/src/components/Legend/legendConfig.js.map +1 -1
- package/es/src/components/Legend/legendRender.js +42 -5
- package/es/src/components/Legend/legendRender.js.map +1 -1
- package/es/src/components/TextBox.js +1 -1
- package/es/src/components/TextBox.js.map +1 -1
- package/es/src/shapes/Bar.js +1 -1
- package/es/src/shapes/Bar.js.map +1 -1
- package/es/src/shapes/Box.js +1 -1
- package/es/src/shapes/Box.js.map +1 -1
- package/es/src/shapes/Rect.js +1 -1
- package/es/src/shapes/Rect.js.map +1 -1
- package/es/src/shapes/Shape.js +9 -36
- package/es/src/shapes/Shape.js.map +1 -1
- package/es/src/shapes/Whisker.js +1 -1
- package/es/src/shapes/Whisker.js.map +1 -1
- package/es/src/shapes/textureKey.js +104 -0
- package/es/src/shapes/textureKey.js.map +1 -0
- package/es/src/utils/D3plusConfig.js.map +1 -1
- package/package.json +10 -9
- package/types/index.d.ts +1 -0
- package/types/internal.d.ts +7 -0
- package/types/src/charts/Plot/index.d.ts +8 -0
- package/types/src/charts/Plot/insetRegion.d.ts +4 -0
- package/types/src/charts/Plot/sharedHover.d.ts +5 -0
- package/types/src/charts/Plot/sharedTooltip.d.ts +10 -0
- package/types/src/charts/Plot/trendLines.d.ts +23 -3
- package/types/src/charts/Plot/trendProjection.d.ts +28 -0
- package/types/src/charts/Plot/trendScene.d.ts +2 -1
- package/types/src/charts/Plot/trendTooltip.d.ts +16 -5
- package/types/src/charts/definition/ChartDefinition.d.ts +9 -0
- package/types/src/charts/definition/makeChart.d.ts +2 -2
- package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +2 -0
- package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +7 -5
- package/types/src/charts/features/emitHelpers.d.ts +10 -4
- package/types/src/charts/features/features.d.ts +1 -8
- package/types/src/charts/features/featuresColorScale.d.ts +24 -0
- package/types/src/charts/features/featuresLegend.d.ts +15 -0
- package/types/src/charts/features/insetState.d.ts +95 -0
- package/types/src/charts/features/sceneBounds.d.ts +18 -0
- package/types/src/charts/features/tooltipSwatch.d.ts +31 -0
- package/types/src/charts/pipeline/insetPlacement.d.ts +45 -0
- package/types/src/charts/pipeline/runVizPipeline.d.ts +2 -1
- package/types/src/charts/viz/Viz.d.ts +9 -1
- package/types/src/charts/viz/VizBaseConfig.d.ts +8 -12
- package/types/src/charts/viz/linkGroup.d.ts +96 -0
- package/types/src/charts/viz/sceneRows.d.ts +13 -0
- package/types/src/charts/viz/vizTypes.d.ts +17 -0
- package/types/src/components/Axis/AxisBottom.d.ts +1 -1
- package/types/src/components/Axis/AxisLeft.d.ts +1 -1
- package/types/src/components/Axis/AxisRight.d.ts +1 -1
- package/types/src/components/Axis/AxisTop.d.ts +1 -1
- package/types/src/components/ColorScale/ColorScale.d.ts +4 -4
- package/types/src/components/Legend/legendRender.d.ts +1 -1
- package/types/src/components/TextBox.d.ts +1 -1
- package/types/src/shapes/Bar.d.ts +1 -1
- package/types/src/shapes/Box.d.ts +1 -1
- package/types/src/shapes/Rect.d.ts +1 -1
- package/types/src/shapes/Whisker.d.ts +1 -1
- package/types/src/shapes/textureKey.d.ts +9 -0
- package/types/src/utils/D3plusConfig.d.ts +42 -1
- package/umd/d3plus-core.full.js +2393 -594
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +1945 -1601
- package/umd/d3plus-core.js +1744 -404
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +1401 -1087
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/charts/viz/Viz.ts"],"sourcesContent":["import {select} from \"d3-selection\";\n\nimport {date, getSize} from \"@d3plus/dom\";\n\nimport {computeTrailCatchup} from \"./trailCatchup.js\";\nimport type {DataPoint} from \"@d3plus/data\";\nimport {CanvasRenderer, SvgRenderer} from \"@d3plus/render\";\nimport type {PickResult, Renderer, Scene, SceneEvent, SceneNode, Transform} from \"@d3plus/render\";\n\nimport VizBase from \"./VizBase.js\";\nimport type {ColorScale, Legend, Timeline} from \"../../components/index.js\";\nimport type {SizeLegendScale} from \"../../components/SizeLegend/sizeLegendLayout.js\";\nimport type Shape from \"../../shapes/Shape.js\";\nimport {applyColorScaleBucketOpacity, applyInteractionOpacity} from \"./interactionOpacity.js\";\nimport {chartAreaRect} from \"../features/chartGeometry.js\";\nimport {applyZoomPointerEvents, bindCanvasZoom} from \"../drawSteps/zoomControls.js\";\nimport {initVizDefaults} from \"./vizDefaults.js\";\nimport {vizRender} from \"./vizRender.js\";\nimport {vizDraw} from \"../pipeline/vizDraw.js\";\nimport {vizPreDraw} from \"../pipeline/vizPreDraw.js\";\nimport type {VizInstance} from \"./vizTypes.js\";\n\n/**\n Stamps `interactionGroup` onto a component's scene subtree so the pointer\n bridge can route its nodes to component-scoped handlers (e.g. legend) on\n every backend — including Canvas, where there is no per-shape DOM to walk.\n*/\nfunction tagInteractionGroup(node: SceneNode, group: string): void {\n (node as {interactionGroup?: string}).interactionGroup = group;\n const kids = (node as {children?: SceneNode[]}).children;\n if (kids) for (const child of kids) tagInteractionGroup(child, group);\n}\n\n/**\n Resolves the element a renderer mounts into. A `<canvas>` cannot paint inside\n an `<svg>`, so when the scene target is the compute svg, the canvas mounts\n into that svg's parent (the user's element); the emptied, position:absolute\n compute svg overlays the same top-left box. SVG mounts into the target as-is.\n*/\nfunction mountTargetFor(kind: string, target: Element): Element {\n if (\n kind === \"canvas\" &&\n typeof Element !== \"undefined\" &&\n target instanceof Element &&\n target.tagName.toLowerCase() === \"svg\"\n )\n return (target.parentNode as Element | null) ?? target;\n return target;\n}\n\n/**\n Creates an x/y plot based on an array of data. See [this example](https://d3plus.org/examples/d3plus-treemap/getting-started/) for help getting started using the treemap generator.\n*/\nexport default class Viz extends VizBase {\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n */\n constructor() {\n super();\n initVizDefaults(this);\n }\n\n /**\n Called by draw before anything is drawn. Formats the data and performs preparations for draw.\n @private\n */\n _preDraw(): void {\n vizPreDraw(this as unknown as VizInstance);\n }\n\n /**\n Composes a backend-agnostic scene graph from the shapes/features produced\n by the most recent render. Combines:\n - `_chartScene` (cells from `chartDef.emit`, or `Plot._paint` for the\n paint-driven Plot family) wrapped in viz-chart-cells\n - `_shapes` (still used by some charts) — each shape's toScene\n - chart-level components (Legend/ColorScale/Timeline) via their toScene\n - `_featurePanels` (from FeatureModule layouts) wrapped in viz-features\n */\n toScene(): Scene {\n const children: SceneNode[] = [];\n // Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for\n // data-driven charts, or `Plot._paint` for the paint-driven Plot family.\n // Wraps in three groups:\n // viz-chart-cells (clip window, untransformed)\n // viz-zoom (zoom transform — pan/scale from d3-zoom)\n // viz-chart-body (chart-positioning transform)\n // … chart scene children\n // This lets zoom apply to the chart content WITHOUT moving legend/\n // title/total/etc. (which live in sibling viz-* groups, not under\n // viz-chart-cells). The zoom transform sits above the chart transform so\n // it lives in the same surface space d3-zoom measures the pointer in —\n // a wheel zoom stays anchored under the cursor regardless of margins or\n // a chart's own centering transform (Pie, Radar, …).\n if (this._chartScene && this._chartScene.length) {\n const sliced = applyInteractionOpacity(\n this._chartScene,\n this as unknown as VizInstance,\n );\n // Always emit the viz-zoom group (identity transform when no zoom is\n // active) so its key is stable across the first zoom. Otherwise the first\n // zoom adds a brand-new group → the renderer treats the chart cells as\n // exit+enter (teardown/rebuild) instead of tweening the group transform,\n // so the zoom snaps in instead of animating.\n const zoomNode = [{\n type: \"group\" as const,\n key: \"viz-zoom\",\n transform: this._zoomTransform ?? {x: 0, y: 0, scale: 1},\n children: [{\n type: \"group\" as const,\n key: \"viz-chart-body\",\n ...(this._chartTransform ? {transform: this._chartTransform} : {}),\n children: sliced,\n }],\n }];\n // Fixed clip window (e.g. Geomap's map rect): stays put in scene space\n // while the viz-zoom child transform pans/scales content beneath it.\n // Any zoomable chart without its own clip is clipped to the chart area,\n // so zoomed content can't spill over the legend/title/timeline.\n const clip = this._chartClip ?? (this.schema.zoom && this._margin ? chartAreaRect(this as unknown as VizInstance) : undefined);\n children.push({\n type: \"group\",\n key: \"viz-chart-cells\",\n ...(clip ? {clip} : {}),\n children: zoomNode,\n });\n }\n // `_shapes` collection (Treemap/Pack/etc. route through `_chartScene`\n // instead, as does Plot's `absorbShapeIntoChartScene`). Any caller\n // pushing into `_shapes` gets its `toScene()` walked here; we read the\n // shape's `_select` transform via d3's transform baseVal if present,\n // otherwise emit without a transform.\n (this._shapes || []).forEach((shape: Shape, si: number) => {\n if (!shape || typeof shape.toScene !== \"function\") return;\n const group = shape.toScene();\n let transform: Transform | undefined;\n const sel = shape._select;\n if (sel && typeof sel.attr === \"function\") {\n // Parse `translate(x, y)` from the selection's transform attr.\n // Falls back to undefined for non-translate transforms — the\n // `_shapes` path only uses translate.\n const t = sel.attr(\"transform\");\n if (typeof t === \"string\") {\n const m = t.match(/translate\\(\\s*(-?[\\d.]+)[, ]\\s*(-?[\\d.]+)\\s*\\)/);\n if (m) transform = {x: parseFloat(m[1]), y: parseFloat(m[2])};\n }\n }\n children.push({\n type: \"group\",\n key: `${group.key || \"shape\"}-${si}`,\n ...(transform ? {transform} : {}),\n children: group.children,\n });\n });\n // Chart-level components that have their own toScene.\n const components: [string, Legend | ColorScale | Timeline | undefined][] = [\n [\"legend\", this._legendClass],\n [\"colorScale\", this._colorScaleClass],\n [\"timeline\", this._timelineClass],\n ];\n for (const [name, comp] of components) {\n if (\n comp &&\n typeof comp.toScene === \"function\" &&\n comp._select &&\n typeof comp._select.node === \"function\" &&\n comp._select.node()\n ) {\n let compScene: SceneNode = comp.toScene();\n // Tag the legend subtree so its swatches route to legend handlers via\n // the node stamp (renderer-independent), not just SVG DOM ancestry.\n if (name === \"legend\") {\n tagInteractionGroup(compScene, \"legend\");\n // Hovering a legend swatch dims the others, like the chart marks:\n // run the legend subtree through the same interaction-opacity pass\n // (a no-op when no hover/active predicate is set).\n compScene = applyInteractionOpacity(\n [compScene],\n this as unknown as VizInstance,\n )[0];\n }\n // Hovering a colorScale swatch (or a data shape) dims the sibling\n // swatches by bucket color — leaving the colorScale title/axis/gradient\n // untouched. Not tagged \"legend\": colorScale swatches keep the shape\n // event path (range-based tooltip + hover), unlike groupBy legend items.\n else if (name === \"colorScale\") {\n compScene = applyColorScaleBucketOpacity(\n [compScene],\n this as unknown as VizInstance,\n )[0];\n }\n // Tag the timeline subtree so its ticks/labels are exempt from shape\n // tooltips and hover/active dimming (it's chrome, not data marks).\n else if (name === \"timeline\") tagInteractionGroup(compScene, \"timeline\");\n children.push({\n type: \"group\",\n key: `viz-${name}`,\n children: [compScene],\n });\n }\n }\n // E2: FeatureModule.layout() panels (title/subtitle/total, plus the\n // zoom/top-left-controls/attribution overlays appended post-draw).\n if (this._featurePanels && this._featurePanels.length) {\n children.push({type: \"group\", key: \"viz-features\", children: this._featurePanels});\n }\n return {\n width: this.schema.width,\n height: this.schema.height,\n root: {type: \"group\", key: \"viz-root\", children},\n };\n }\n\n /**\n Called by render once all checks are passed.\n @private\n */\n _draw(): void {\n vizDraw(this as unknown as VizInstance);\n }\n\n /**\n The chart's size-legend radius scale (see `ChartDefinition.sizeLegendScale`).\n Charts that size marks override this; the base chart sizes nothing.\n @private\n */\n _sizeLegendScale(_available: {width: number; height: number}): SizeLegendScale | null {\n return null;\n }\n\n /**\n * Applies the threshold algorithm according to the type of chart used.\n * @param {Array} data The data to process.\n * @private\n */\n _thresholdFunction(data: DataPoint[], _tree?: unknown): DataPoint[] {\n return data;\n }\n\n /**\n * Detects width and height and sets SVG properties\n * @private\n */\n _setSVGSize(width?: number, height?: number): void {\n let [w, h] =\n width && height\n ? [width, height]\n : getSize(this._select.node().parentNode);\n w! -= parseFloat(this._select.style(\"border-left-width\"));\n w! -= parseFloat(this._select.style(\"border-right-width\"));\n h! -= parseFloat(this._select.style(\"border-top-width\"));\n h! -= parseFloat(this._select.style(\"border-bottom-width\"));\n \n if (this._autoWidth && this.schema.width !== w) {\n this.width(w);\n this._select\n .style(\"width\", `${this.schema.width}px`)\n .attr(\"width\", `${this.schema.width}px`);\n }\n if (this._autoHeight && this.schema.height !== h) {\n this.height(h);\n this._select\n .style(\"height\", `${this.schema.height}px`)\n .attr(\"height\", `${this.schema.height}px`);\n }\n }\n\n /**\n Draws the visualization given the specified configuration.\n @param callback Optional callback invoked after rendering completes.\n */\n render(callback?: () => void): this {\n return vizRender(this, callback) as this;\n }\n\n /**\n Serializes the most recently rendered output to an SVG string. Returns\n `\"\"` if the chart has not been rendered yet. Both backends support this:\n the SVG backend returns its live `<svg>`, the canvas backend re-renders the\n retained scene through a throwaway SVG backend. Primarily used for\n server-side rendering (see `@d3plus/ssr`).\n */\n toSVGString(): string {\n return this._sceneRenderer?.toSVGString?.() ?? \"\";\n }\n\n /**\n Returns the underlying canvas element of the most recent render when the\n canvas backend is active (`renderer(\"canvas\")`), or `undefined` otherwise.\n Server-side callers cast this to their native canvas to encode a raster\n (see `@d3plus/ssr`).\n */\n toCanvas(): unknown {\n return this._renderer === \"canvas\"\n ? this._sceneRenderer?.toCanvas?.()\n : undefined;\n }\n\n /**\n Selects which @d3plus/render backend paints the visible output.\n `\"svg\"` = SvgRenderer (default), `\"canvas\"` = CanvasRenderer.\n Boolean arguments both normalize to `\"svg\"`.\n */\n renderer(): \"svg\" | \"canvas\";\n renderer(_: \"svg\" | \"canvas\" | true | false): this;\n renderer(_?: \"svg\" | \"canvas\" | true | false): \"svg\" | \"canvas\" | this {\n if (!arguments.length) return this._renderer;\n this._renderer = _ === \"canvas\" ? \"canvas\" : \"svg\";\n return this;\n }\n\n /**\n \"full\" runs the DOM enter/update/exit for every shape; \"compute\"\n skips DOM work and only populates the scene data (`_textData`,\n `_shapes[i]._select`, etc.) for `toScene()` to read. Set automatically by\n `renderScene` callers; users can also opt-in.\n */\n renderMode(): \"full\" | \"compute\";\n renderMode(_: \"full\" | \"compute\"): this;\n renderMode(_?: \"full\" | \"compute\"): \"full\" | \"compute\" | this {\n if (!arguments.length) return this._renderMode || \"full\";\n this._renderMode = _!;\n return this;\n }\n\n /**\n Public entry point that renders this chart through the @d3plus/render\n pluggable backends. The compute pass happens via render() (in an svg\n auto-created inside the target div); SvgRenderer/CanvasRenderer paints\n the scene to the target. Returns `{renderer, scene}` so callers can\n interact with the renderer (e.g. for picking) or read the scene data.\n */\n async renderScene(\n target: Element,\n opts?: {kind?: \"svg\" | \"canvas\"},\n ): Promise<{renderer: Renderer; scene: Scene}> {\n const kind = opts?.kind || (this._renderer === \"canvas\" ? \"canvas\" : \"svg\");\n this._sceneTarget = target;\n this._renderer = kind;\n this.select(target as HTMLElement);\n await new Promise<void>(resolve => this.render(() => resolve()));\n return {\n renderer: this._sceneRenderer as Renderer,\n scene: this._lastSceneRendered as Scene,\n };\n }\n\n /**\n Renders this chart through the @d3plus/render pluggable backends. Called\n automatically by `render()`. The compute pass draws into `this._select`\n (an auto-created svg INSIDE the user's target div) — that svg is the\n off-stage detached compute svg. SvgRenderer mounts to the user's target\n div (the parent), as a sibling to the detached compute svg. The compute\n svg's children get cleared so only the scene output is visible.\n */\n _drawSceneToTarget(durationOverride?: number): void {\n const kind = this._renderer === \"canvas\" ? \"canvas\" : \"svg\";\n const computeSvg = this._select && this._select.node ? this._select.node() : null;\n if (!computeSvg) return;\n // Mount renderer INSIDE the user's `_select` (svg or div). Tests like\n // `svgA.querySelector('[data-key=\"viz-legend\"]')` need the scene output\n // to live inside the user's container, not as a sibling.\n const userTarget = this._sceneTarget || computeSvg;\n if (!userTarget) return;\n const mountTarget = mountTargetFor(kind, userTarget as Element);\n const scene = this.toScene();\n const w = this.schema.width || 400;\n const h = this.schema.height || 300;\n // Reuse the renderer instance if it matches the kind, to avoid mount\n // churn. `target()` is the public Renderer-interface method (no\n // reaching into renderer-private slots). It's optional on the\n // interface; third-party renderers without it fall through to\n // remount on every draw — correct but with mount churn.\n const currentContainer = this._sceneRenderer?.target\n ? this._sceneRenderer.target()?.container\n : undefined;\n const containerChanged = this._sceneRenderer?.target\n ? currentContainer !== mountTarget\n : false;\n if (\n !this._sceneRenderer ||\n this._sceneRenderer.kind !== kind ||\n containerChanged\n ) {\n // Tear down the outgoing renderer before mounting a fresh one. It owns\n // its own DOM (canvas/svg + overlay host), pointer listeners, and\n // transition timers; without this, switching kind (svg<->canvas) or\n // container orphans that DOM in the user's element, stacking the old\n // mode's output behind the new one and accumulating on every switch.\n if (this._sceneRenderer && typeof this._sceneRenderer.destroy === \"function\")\n this._sceneRenderer.destroy();\n const Ctor = kind === \"canvas\" ? CanvasRenderer : SvgRenderer;\n this._sceneRenderer = new Ctor();\n // `_scenePixelRatio`, when set (e.g. by @d3plus/ssr for hi-res PNG output),\n // fixes the canvas backing-store scale; otherwise the renderer falls back\n // to `devicePixelRatio`.\n this._sceneRenderer.mount({\n container: mountTarget,\n width: w,\n height: h,\n pixelRatio: this._scenePixelRatio,\n });\n // Bridge renderer pointer events → viz.schema.on handlers. Without this,\n // tooltips never fire on the v4 scene-rendered path because\n // `shape.on(evt, fn)` in plotPaint only wires d3-selection\n // listeners on DOM nodes the scene renderer doesn't create.\n // Renderer events carry the picked scene node; the routing lives in\n // `_routeSceneEvent` (kept out of this method so the mount path stays\n // readable). `_lastScenePick` remembers the most recently hovered node\n // so `mouseleave` — fired with a null pick — can still tell the matching\n // handlers which shape/legend item was left (so the tooltip clears).\n this._lastScenePick = null;\n this._sceneRenderer.on((event: SceneEvent) => this._routeSceneEvent(event));\n } else {\n this._sceneRenderer.resize(w, h);\n }\n // `durationOverride` defaults to the chart's `_duration` for normal\n // re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to\n // skip the transition machinery — animating every wheel/drag tick\n // accumulates `setTimeout(duration+10)` per event.\n const drawDuration =\n durationOverride !== undefined\n ? durationOverride\n : this._instantNextDraw\n ? 0\n : this.schema.duration;\n // A duration>0 render (drill-down, zoom, re-center) must win over any\n // pending coalesced duration-0 repaint — otherwise that repaint fires on\n // the next frame and interrupts this transition, snapping shapes to their\n // final geometry.\n if (drawDuration > 0 && this._sceneRepaintRAF != null) {\n cancelAnimationFrame(this._sceneRepaintRAF);\n this._sceneRepaintRAF = undefined;\n }\n // Mark the window during which an animated transition is in flight, so the\n // pointer bridge can ignore interaction until it settles. A hover/click\n // mid-transition would schedule a duration-0 repaint that interrupts the\n // running transition and snaps it to its end (the glitchy jump). Matches\n // the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small\n // buffer so events re-enable just after the paint completes.\n if (drawDuration > 0)\n this._transitionEndsAt = Date.now() + drawDuration + 30;\n // Order persistent motion trails in time by the current timeline period, so\n // they grow only as playback moves forward and rewind when it steps back.\n // Only when the timeline selects a single period (`brushing: false`): a range\n // selection has no single \"current time\", which would scramble the step\n // logic, so we withhold the sequence and trails fall back to ephemeral.\n // Normalize to milliseconds via `date()` — the selection mixes Date objects\n // (brush/initial) and raw period numbers (playback), which compare on wildly\n // different scales otherwise, scrambling the forward/backward test.\n const sel = this._timelineSelection;\n const brushing = this._timelineClass\n ? (this._timelineClass.schema as {brushing?: boolean}).brushing !== false\n : true;\n const sequence = !brushing && Array.isArray(sel) && sel.length\n ? Math.max(...sel.map(v => Number(date(Number(v)))))\n : undefined;\n // A forward jump that skips periods (manual click, not single-step play) draws\n // one coarse segment; compute the marks' real positions at the skipped periods\n // so the trail bends through them (see render commitTrailCatchups).\n const trailCatchup =\n sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq\n ? computeTrailCatchup(this as unknown as VizInstance, scene, this._trailSeq, sequence)\n : undefined;\n if (sequence !== undefined) this._trailSeq = sequence;\n this._sceneRenderer.drawScene(scene, {\n duration: drawDuration, sequence, trailCatchup,\n // The drill-down morph's resolved boxes for this draw, if a drill\n // click armed one (resolveDrillMorph, run just before this method via\n // runVizPipeline). One-shot: cleared right below so a later repaint\n // that reaches this method by some OTHER path (a zoom/pan tick, a\n // coalesced hover repaint, Rings' click-to-recenter) never inherits a\n // stale box from an earlier drill click.\n enterFrom: this._resolvedEnterFrom, enterFromBody: this._resolvedEnterFromBody,\n exitTo: this._resolvedExitTo, exitToBody: this._resolvedExitToBody,\n instantExitKey: this._resolvedInstantExitKey,\n reunionEnterKey: this._resolvedReunionEnterKey,\n reunionEnterFrom: this._resolvedReunionEnterFrom,\n instantExitAll: this._resolvedInstantExitAll,\n });\n this._resolvedEnterFrom = undefined;\n this._resolvedEnterFromBody = undefined;\n this._resolvedExitTo = undefined;\n this._resolvedExitToBody = undefined;\n this._resolvedInstantExitKey = undefined;\n this._resolvedReunionEnterKey = undefined;\n this._resolvedReunionEnterFrom = undefined;\n this._resolvedInstantExitAll = undefined;\n this._lastSceneRendered = scene;\n\n // Canvas backend: the compute <svg> (`_select`) is an emptied overlay\n // sitting on top of the <canvas>. An svg root hit-tests its whole box, so\n // even empty it swallows the pointer events the canvas needs for\n // tooltip/hover/legend picking — the symptom being \"renders fine, no\n // tooltips.\" Make the overlay transparent to pointer events so the canvas\n // is the sole interaction surface. The only interactive DOM that still\n // lives in this svg is the timeline's d3-brush (the canvas can't host the\n // native brush handles), so re-enable events on just that group. On the\n // SVG backend `_select` IS the scene host, so events must stay enabled\n // (except while the zoom brush is active — see `applyZoomPointerEvents`).\n applyZoomPointerEvents(this);\n if (this._select && kind === \"canvas\")\n this._select\n .select(\"g.d3plus-viz-timeline\")\n .style(\"pointer-events\", \"auto\");\n if (kind === \"canvas\") bindCanvasZoom(this);\n\n // The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in\n // the outer svg) must paint above the scene-rendered timeline buttons/ticks\n // so its selection tint + handles sit on top of them (matching v3). The\n // renderer appends its scene <svg> last, so without this the brush layer\n // ends up behind it — the selection's translucent fill is then hidden by\n // the opaque buttons and only the edge handles peek out.\n if (kind === \"svg\") {\n const host =\n userTarget && typeof (userTarget as Element).querySelector === \"function\"\n ? (userTarget as Element)\n : null;\n const tlGroup = host\n ? host.querySelector(\":scope > g.d3plus-viz-timeline\")\n : null;\n if (tlGroup) host!.appendChild(tlGroup);\n // Likewise the zoom brush, so its selection box draws over the shapes.\n const zoomBrush = host ? host.querySelector(\":scope > g.d3plus-zoom-brush\") : null;\n if (zoomBrush && zoomBrush !== host!.lastElementChild) host!.appendChild(zoomBrush);\n }\n }\n\n /**\n Resolves the `(d, i, x)` a picked scene node reports to interaction\n handlers (tooltip, click, user `on` handlers). `pick.datum` is the raw\n scene datum; for a Plot shape that's the wrapped record `{data, i}`, which\n handlers expect unwrapped to `(d.data, d.i, wrapped)`. The base does that\n unwrap; Plot overrides this to report the point nearest the cursor for\n multi-point shapes (Line/Area) so a series tooltip reflects the hovered\n x rather than the whole-series aggregate.\n @private\n */\n _interactionDatum(\n pick: PickResult,\n _event: SceneEvent,\n ): {d: unknown; i: number; x: unknown} {\n const rawDatum = pick.datum as {data?: unknown; i?: number} | null | undefined;\n const sourceDatum = rawDatum && rawDatum.data ? rawDatum.data : rawDatum;\n const sourceIndex =\n rawDatum && typeof rawDatum.i === \"number\" ? rawDatum.i : pick.index ?? 0;\n return {d: sourceDatum, i: sourceIndex, x: rawDatum};\n }\n\n /**\n Pointer hook run by `_routeSceneEvent` before any handler routing, for\n every event including ones over empty space. No-op here; Plot overrides\n it to drive the shared multi-series tooltip and crosshair.\n @private\n */\n _sharedHover(_event: SceneEvent): void {}\n\n /**\n Routes a renderer pointer event to the matching `viz.schema.on` handlers.\n Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where\n compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`\n listeners never fire. We look up the appropriate `on` key from the picked\n scene node: legend swatches route to legend handlers, chart shapes to\n shape (+ shape-class-scoped) handlers, and chrome (axis/timeline/back) is\n excluded. Split out of `_drawSceneToTarget` to keep that method small.\n @private\n */\n _routeSceneEvent(event: SceneEvent): void {\n // Ignore all pointer interaction while an animated transition (zoom,\n // re-center, drill-down, entrance) is in flight. Hovering or clicking a\n // shape mid-transition would fire a handler that schedules a duration-0\n // repaint, interrupting the running transition and snapping it to its end\n // — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`\n // for the transition's duration; it lapses on its own, so interaction\n // resumes the instant the transition settles.\n // Runs for every event, picked or not, so a chart can track the pointer\n // across empty space (Plot's shared tooltip + crosshair) — and ahead of\n // the transition guard below, so leaving mid-transition still clears it.\n this._sharedHover(event);\n if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;\n const pick = event.pick;\n // Dispatch helper shared by the live-pick path and the leave path.\n const fire = (\n key: string,\n d: unknown,\n i: number,\n x: unknown,\n ): void => {\n const fn = this.schema.on && this.schema.on[key];\n if (typeof fn === \"function\") {\n try {\n fn.call(this, d, i, x, event.nativeEvent);\n } catch {\n // swallow per-event errors so one bad handler doesn't\n // break subsequent events.\n }\n }\n };\n if (event.type === \"mouseleave\") {\n const lastPick = this._lastScenePick;\n if (lastPick) {\n fire(\n `mouseleave.${lastPick.isLegend ? \"legend\" : \"shape\"}`,\n lastPick.d,\n lastPick.i,\n lastPick.x,\n );\n if (!lastPick.isLegend && lastPick.shapeType)\n fire(`mouseleave.${lastPick.shapeType}`, lastPick.d, lastPick.i, lastPick.x);\n fire(\"mouseleave\", lastPick.d, lastPick.i, lastPick.x);\n }\n this._lastScenePick = null;\n // Cleared here, then re-set by the enter/move the renderer fires\n // synchronously when the pointer crosses to an adjacent node — so a\n // shape→label hand-off leaves `_hoverDatum` pointing at the new node\n // (same datum), which `mouseleave` reads to suppress a flicker.\n this._hoverDatum = null;\n return;\n }\n if (!pick || !pick.node) return;\n // Scene nodes carry interaction metadata stamped by Viz.toScene.\n const nodeAny = pick.node as {\n interactionGroup?: string;\n shapeType?: string;\n };\n // Axis ticks/labels, the timeline, and Plot's trend lines are chrome —\n // they carry data but are not chart shapes, so they must not fire shape\n // tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).\n if (\n nodeAny.interactionGroup === \"axis\" ||\n nodeAny.interactionGroup === \"timeline\" ||\n nodeAny.interactionGroup === \"trend\"\n )\n return;\n // Prefer the node's stamped interaction group (set by Viz.toScene), so\n // legend swatches route to legend handlers on Canvas too — where the\n // single canvas element has no per-shape DOM to walk. Fall back to SVG\n // DOM ancestry for nodes the stamp didn't reach.\n const target =\n event.nativeEvent && (event.nativeEvent as Event).target;\n const isLegendNode =\n nodeAny.interactionGroup === \"legend\" ||\n (target && typeof (target as Element).closest === \"function\"\n ? !!(target as Element).closest('[data-key=\"viz-legend\"]')\n : false);\n const suffix = isLegendNode ? \"legend\" : \"shape\";\n const handlerKey = `${event.type}.${suffix}`;\n // Resolve the datum + index this pick reports to handlers, ONCE, and reuse\n // it for every handler fired below so tooltip/click/user handlers agree on\n // which datum the pointer is over. The base unwraps the node's raw datum to\n // its source row; Plot overrides `_interactionDatum` to report the point\n // nearest the cursor for multi-point shapes (Line/Area).\n const {d: sourceDatum, i: sourceIndex, x: rawDatum} = this._interactionDatum(\n pick,\n event,\n );\n const shapeType =\n typeof nodeAny.shapeType === \"string\" ? nodeAny.shapeType : null;\n this._lastScenePick = {\n d: sourceDatum, i: sourceIndex, x: rawDatum, isLegend: isLegendNode, shapeType,\n // The live picked node's own geometry, read synchronously by clickShape\n // (before the drill-down re-render replaces this frame) to arm the\n // forward drill-down morph.\n node: pick.node,\n };\n this._hoverDatum = rawDatum;\n fire(handlerKey, sourceDatum, sourceIndex, rawDatum);\n // Shape-class-scoped handlers (`\"click.Bar\"`, `\"mousemove.Circle\"`). The\n // emitting shape stamps its type onto the node; on the scene path this is\n // the only place these fire (compute-mode shapes wire no DOM listeners).\n // Legend nodes are excluded so a legend swatch's shape type can't\n // masquerade as a chart-shape handler.\n if (!isLegendNode && shapeType) {\n fire(`${event.type}.${shapeType}`, sourceDatum, sourceIndex, rawDatum);\n }\n // Also fire the un-suffixed handler (e.g. \"mousemove\") so user-registered\n // global handlers see the event too.\n fire(event.type, sourceDatum, sourceIndex, rawDatum);\n }\n\n /**\n Coalesces interaction-driven scene repaints (hover/active dimming) into a\n single paint per animation frame. A fast pointer sweep across a dense\n chart fires a hover transition per shape crossed; painting each one\n synchronously rebuilt the whole scene back-to-back, saturating the main\n thread (~200ms stalls) so the tooltip couldn't reposition and appeared\n stuck at its last spot. Only the latest hover state is visible, so the\n intermediate paints are wasted — collapse them to one rAF-scheduled draw.\n */\n _scheduleSceneRepaint(): void {\n if (!this._sceneRenderer) return;\n if (typeof requestAnimationFrame !== \"function\") {\n this._drawSceneToTarget(0);\n return;\n }\n if (this._sceneRepaintRAF != null) return;\n this._sceneRepaintRAF = requestAnimationFrame(() => {\n this._sceneRepaintRAF = undefined;\n this._drawSceneToTarget(0);\n });\n }\n\n /**\n Tears down the visualization: disconnects the ResizeObserver, stops listening for web font loads, and removes DOM event listeners. Call this when unmounting to avoid memory leaks.\n */\n destroy(): this {\n this._resizeObserver?.disconnect();\n this._fontsUnsubscribe?.();\n this._fontsUnsubscribe = undefined;\n this._tooltipClass.data([]).render();\n select(\"body\").on(`touchstart.${this._uuid}`, null);\n // Clear the visibility/resize/scroll poll timers + scroll listener\n // so a destroyed chart doesn't keep firing intervals/timeouts that\n // hold the entire viz instance alive. Without this, an SPA that\n // mounts/unmounts charts on tab switches leaks the scene tree +\n // a 200ms-interval timer per leaked chart.\n if (this._visiblePoll) {\n this._visiblePoll = clearInterval(this._visiblePoll) as never;\n }\n if (this._resizePoll) {\n this._resizePoll = clearTimeout(this._resizePoll) as never;\n }\n if (this._scrollPoll) {\n this._scrollPoll = clearTimeout(this._scrollPoll) as never;\n }\n this._visibleUnobserve?.();\n this._visibleUnobserve = undefined;\n this._unloadUnobserve?.();\n this._unloadUnobserve = undefined;\n if (this._sceneRepaintRAF != null) {\n if (typeof cancelAnimationFrame === \"function\")\n cancelAnimationFrame(this._sceneRepaintRAF);\n this._sceneRepaintRAF = undefined;\n }\n if (this.schema.scrollContainer)\n select(this.schema.scrollContainer).on(`scroll.${this._uuid}`, null);\n // Destroy the active scene renderer (clears its own pointer-rect\n // listeners, overlay host, canvas/svg DOM, timers).\n if (this._sceneRenderer && typeof this._sceneRenderer.destroy === \"function\") {\n this._sceneRenderer.destroy();\n this._sceneRenderer = undefined;\n }\n return this;\n }\n\n}\n"],"names":["select","date","getSize","computeTrailCatchup","CanvasRenderer","SvgRenderer","VizBase","applyColorScaleBucketOpacity","applyInteractionOpacity","chartAreaRect","applyZoomPointerEvents","bindCanvasZoom","initVizDefaults","vizRender","vizDraw","vizPreDraw","tagInteractionGroup","node","group","interactionGroup","kids","children","child","mountTargetFor","kind","target","Element","tagName","toLowerCase","parentNode","Viz","_preDraw","toScene","_chartScene","length","sliced","zoomNode","type","key","transform","_zoomTransform","x","y","scale","_chartTransform","clip","_chartClip","schema","zoom","_margin","undefined","push","_shapes","forEach","shape","si","sel","_select","attr","t","m","match","parseFloat","components","_legendClass","_colorScaleClass","_timelineClass","name","comp","compScene","_featurePanels","width","height","root","_draw","_sizeLegendScale","_available","_thresholdFunction","data","_tree","_setSVGSize","w","h","style","_autoWidth","_autoHeight","render","callback","toSVGString","_sceneRenderer","toCanvas","_renderer","renderer","_","arguments","renderMode","_renderMode","renderScene","opts","_sceneTarget","Promise","resolve","scene","_lastSceneRendered","_drawSceneToTarget","durationOverride","Math","computeSvg","userTarget","mountTarget","currentContainer","container","containerChanged","destroy","Ctor","mount","pixelRatio","_scenePixelRatio","_lastScenePick","on","event","_routeSceneEvent","resize","drawDuration","_instantNextDraw","duration","_sceneRepaintRAF","cancelAnimationFrame","_transitionEndsAt","Date","now","_timelineSelection","brushing","sequence","Array","isArray","max","map","v","Number","trailCatchup","_trailSeq","drawScene","enterFrom","_resolvedEnterFrom","enterFromBody","_resolvedEnterFromBody","exitTo","_resolvedExitTo","exitToBody","_resolvedExitToBody","instantExitKey","_resolvedInstantExitKey","reunionEnterKey","_resolvedReunionEnterKey","reunionEnterFrom","_resolvedReunionEnterFrom","instantExitAll","_resolvedInstantExitAll","host","querySelector","tlGroup","appendChild","zoomBrush","lastElementChild","_interactionDatum","pick","_event","rawDatum","datum","sourceDatum","sourceIndex","i","index","d","_sharedHover","fire","fn","call","nativeEvent","lastPick","isLegend","shapeType","_hoverDatum","nodeAny","isLegendNode","closest","suffix","handlerKey","_scheduleSceneRepaint","requestAnimationFrame","_resizeObserver","disconnect","_fontsUnsubscribe","_tooltipClass","_uuid","_visiblePoll","clearInterval","_resizePoll","clearTimeout","_scrollPoll","_visibleUnobserve","_unloadUnobserve","scrollContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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iBAAiB,GAAGvJ;iBACzB,yBAAA,CAAA,SAAA,IAAI,EAACwJ,gBAAgB,cAArB,6CAAA,4BAAA;gBACA,IAAI,CAACA,gBAAgB,GAAGxJ;gBACxB,IAAI,IAAI,CAAC4E,gBAAgB,IAAI,MAAM;oBACjC,IAAI,OAAOC,yBAAyB,YAClCA,qBAAqB,IAAI,CAACD,gBAAgB;oBAC5C,IAAI,CAACA,gBAAgB,GAAG5E;gBAC1B;gBACA,IAAI,IAAI,CAACH,MAAM,CAAC4J,eAAe,EAC7B3M,OAAO,IAAI,CAAC+C,MAAM,CAAC4J,eAAe,EAAEpF,EAAE,CAAC,AAAC,UAAoB,OAAX,IAAI,CAAC4E,KAAK,GAAI;gBACjE,iEAAiE;gBACjE,oDAAoD;gBACpD,IAAI,IAAI,CAAC1G,cAAc,IAAI,OAAO,IAAI,CAACA,cAAc,CAACwB,OAAO,KAAK,YAAY;oBAC5E,IAAI,CAACxB,cAAc,CAACwB,OAAO;oBAC3B,IAAI,CAACxB,cAAc,GAAGvC;gBACxB;gBACA,OAAO,IAAI;YACb;;;WAprBmBpB;EAAYxB;AAHjC;;AAEA,GACA,SAAqBwB,iBAsrBpB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/viz/Viz.ts"],"sourcesContent":["import {select} from \"d3-selection\";\n\nimport {date, getSize} from \"@d3plus/dom\";\n\nimport {computeTrailCatchup} from \"./trailCatchup.js\";\nimport type {DataPoint} from \"@d3plus/data\";\nimport {CanvasRenderer, SvgRenderer} from \"@d3plus/render\";\nimport type {PickResult, Renderer, Scene, SceneEvent, SceneNode, Transform} from \"@d3plus/render\";\n\nimport VizBase from \"./VizBase.js\";\nimport type {ColorScale, Legend, Timeline} from \"../../components/index.js\";\nimport type {SizeLegendScale} from \"../../components/SizeLegend/sizeLegendLayout.js\";\nimport type Shape from \"../../shapes/Shape.js\";\nimport {applyColorScaleBucketOpacity, applyInteractionOpacity} from \"./interactionOpacity.js\";\nimport {chartAreaRect} from \"../features/chartGeometry.js\";\nimport {initInsetDefaults, insetComponentScene} from \"../features/insetState.js\";\nimport type {InsetKey, InsetRegion} from \"../features/insetState.js\";\nimport {applyZoomPointerEvents, bindCanvasZoom} from \"../drawSteps/zoomControls.js\";\nimport {initVizDefaults} from \"./vizDefaults.js\";\nimport {unregisterLink} from \"./linkGroup.js\";\nimport {vizRender} from \"./vizRender.js\";\nimport {vizDraw} from \"../pipeline/vizDraw.js\";\nimport {vizPreDraw} from \"../pipeline/vizPreDraw.js\";\nimport type {VizInstance} from \"./vizTypes.js\";\n\n/**\n Stamps `interactionGroup` onto a component's scene subtree so the pointer\n bridge can route its nodes to component-scoped handlers (e.g. legend) on\n every backend — including Canvas, where there is no per-shape DOM to walk.\n*/\nfunction tagInteractionGroup(node: SceneNode, group: string): void {\n (node as {interactionGroup?: string}).interactionGroup = group;\n const kids = (node as {children?: SceneNode[]}).children;\n if (kids) for (const child of kids) tagInteractionGroup(child, group);\n}\n\n/**\n Resolves the element a renderer mounts into. A `<canvas>` cannot paint inside\n an `<svg>`, so when the scene target is the compute svg, the canvas mounts\n into that svg's parent (the user's element); the emptied, position:absolute\n compute svg overlays the same top-left box. SVG mounts into the target as-is.\n*/\nfunction mountTargetFor(kind: string, target: Element): Element {\n if (\n kind === \"canvas\" &&\n typeof Element !== \"undefined\" &&\n target instanceof Element &&\n target.tagName.toLowerCase() === \"svg\"\n )\n return (target.parentNode as Element | null) ?? target;\n return target;\n}\n\n/**\n The base class every d3plus chart extends. Owns the shared configuration surface (data, groupBy, size and color accessors, title, legend, tooltip, timeline, zoom, table view) and the render lifecycle that each chart type's definition plugs its layout into. Not used directly; see the chart classes (BarChart, Treemap, …).\n*/\nexport default class Viz extends VizBase {\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n */\n constructor() {\n super();\n initVizDefaults(this);\n initInsetDefaults(this as unknown as VizInstance);\n }\n\n /**\n Called by draw before anything is drawn. Formats the data and performs preparations for draw.\n @private\n */\n _preDraw(): void {\n vizPreDraw(this as unknown as VizInstance);\n }\n\n /**\n Composes a backend-agnostic scene graph from the shapes/features produced\n by the most recent render. Combines:\n - `_chartScene` (cells from `chartDef.emit`, or `Plot._paint` for the\n paint-driven Plot family) wrapped in viz-chart-cells\n - `_shapes` (still used by some charts) — each shape's toScene\n - chart-level components (Legend/ColorScale/Timeline) via their toScene\n - `_featurePanels` (from FeatureModule layouts) wrapped in viz-features\n */\n toScene(): Scene {\n const children: SceneNode[] = [];\n // Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for\n // data-driven charts, or `Plot._paint` for the paint-driven Plot family.\n // Wraps in three groups:\n // viz-chart-cells (clip window, untransformed)\n // viz-zoom (zoom transform — pan/scale from d3-zoom)\n // viz-chart-body (chart-positioning transform)\n // … chart scene children\n // This lets zoom apply to the chart content WITHOUT moving legend/\n // title/total/etc. (which live in sibling viz-* groups, not under\n // viz-chart-cells). The zoom transform sits above the chart transform so\n // it lives in the same surface space d3-zoom measures the pointer in —\n // a wheel zoom stays anchored under the cursor regardless of margins or\n // a chart's own centering transform (Pie, Radar, …).\n if (this._chartScene && this._chartScene.length) {\n const sliced = applyInteractionOpacity(\n this._chartScene,\n this as unknown as VizInstance,\n );\n // Always emit the viz-zoom group (identity transform when no zoom is\n // active) so its key is stable across the first zoom. Otherwise the first\n // zoom adds a brand-new group → the renderer treats the chart cells as\n // exit+enter (teardown/rebuild) instead of tweening the group transform,\n // so the zoom snaps in instead of animating.\n const zoomNode = [{\n type: \"group\" as const,\n key: \"viz-zoom\",\n transform: this._zoomTransform ?? {x: 0, y: 0, scale: 1},\n children: [{\n type: \"group\" as const,\n key: \"viz-chart-body\",\n ...(this._chartTransform ? {transform: this._chartTransform} : {}),\n children: sliced,\n }],\n }];\n // Fixed clip window (e.g. Geomap's map rect): stays put in scene space\n // while the viz-zoom child transform pans/scales content beneath it.\n // Any zoomable chart without its own clip is clipped to the chart area,\n // so zoomed content can't spill over the legend/title/timeline.\n const clip = this._chartClip ?? (this.schema.zoom && this._margin ? chartAreaRect(this as unknown as VizInstance) : undefined);\n children.push({\n type: \"group\",\n key: \"viz-chart-cells\",\n ...(clip ? {clip} : {}),\n children: zoomNode,\n });\n }\n // `_shapes` collection (Treemap/Pack/etc. route through `_chartScene`\n // instead, as does Plot's `absorbShapeIntoChartScene`). Any caller\n // pushing into `_shapes` gets its `toScene()` walked here; we read the\n // shape's `_select` transform via d3's transform baseVal if present,\n // otherwise emit without a transform.\n (this._shapes || []).forEach((shape: Shape, si: number) => {\n if (!shape || typeof shape.toScene !== \"function\") return;\n const group = shape.toScene();\n let transform: Transform | undefined;\n const sel = shape._select;\n if (sel && typeof sel.attr === \"function\") {\n // Parse `translate(x, y)` from the selection's transform attr.\n // Falls back to undefined for non-translate transforms — the\n // `_shapes` path only uses translate.\n const t = sel.attr(\"transform\");\n if (typeof t === \"string\") {\n const m = t.match(/translate\\(\\s*(-?[\\d.]+)[, ]\\s*(-?[\\d.]+)\\s*\\)/);\n if (m) transform = {x: parseFloat(m[1]), y: parseFloat(m[2])};\n }\n }\n children.push({\n type: \"group\",\n key: `${group.key || \"shape\"}-${si}`,\n ...(transform ? {transform} : {}),\n children: group.children,\n });\n });\n // Chart-level components that have their own toScene.\n const components: [string, Legend | ColorScale | Timeline | undefined][] = [\n [\"legend\", this._legendClass],\n [\"colorScale\", this._colorScaleClass],\n [\"timeline\", this._timelineClass],\n ];\n for (const [name, comp] of components) {\n if (\n comp &&\n typeof comp.toScene === \"function\" &&\n comp._select &&\n typeof comp._select.node === \"function\" &&\n comp._select.node()\n ) {\n let compScene: SceneNode = comp.toScene();\n // Tag the legend subtree so its swatches route to legend handlers via\n // the node stamp (renderer-independent), not just SVG DOM ancestry.\n if (name === \"legend\") {\n tagInteractionGroup(compScene, \"legend\");\n // Hovering a legend swatch dims the others, like the chart marks:\n // run the legend subtree through the same interaction-opacity pass\n // (a no-op when no hover/active predicate is set).\n compScene = applyInteractionOpacity(\n [compScene],\n this as unknown as VizInstance,\n )[0];\n }\n // Hovering a colorScale swatch (or a data shape) dims the sibling\n // swatches by bucket color — leaving the colorScale title/axis/gradient\n // untouched. Not tagged \"legend\": colorScale swatches keep the shape\n // event path (range-based tooltip + hover), unlike groupBy legend items.\n else if (name === \"colorScale\") {\n compScene = applyColorScaleBucketOpacity(\n [compScene],\n this as unknown as VizInstance,\n )[0];\n }\n // Tag the timeline subtree so its ticks/labels are exempt from shape\n // tooltips and hover/active dimming (it's chrome, not data marks).\n else if (name === \"timeline\") tagInteractionGroup(compScene, \"timeline\");\n children.push({\n type: \"group\",\n key: `viz-${name}`,\n children: name === \"timeline\"\n ? [compScene]\n : insetComponentScene(this as unknown as VizInstance, name as InsetKey, compScene, (comp as Legend | ColorScale).outerBounds()),\n });\n }\n }\n // E2: FeatureModule.layout() panels (title/subtitle/total, plus the\n // zoom/top-left-controls/attribution overlays appended post-draw).\n if (this._featurePanels && this._featurePanels.length) {\n children.push({type: \"group\", key: \"viz-features\", children: this._featurePanels});\n }\n return {\n width: this.schema.width,\n height: this.schema.height,\n root: {type: \"group\", key: \"viz-root\", children},\n };\n }\n\n /**\n Called by render once all checks are passed.\n @private\n */\n _draw(): void {\n vizDraw(this as unknown as VizInstance);\n }\n\n /**\n The chart's size-legend radius scale (see `ChartDefinition.sizeLegendScale`).\n Charts that size marks override this; the base chart sizes nothing.\n @private\n */\n _sizeLegendScale(_available: {width: number; height: number}): SizeLegendScale | null {\n return null;\n }\n\n /**\n The region chart chrome may be drawn inside, with the chart's mark boxes\n as obstacles (see `ChartDefinition.insetRegion`). Charts that leave\n negative space override this; the base chart offers none.\n @private\n */\n _insetRegion(): InsetRegion | null {\n return null;\n }\n\n /**\n * Applies the threshold algorithm according to the type of chart used.\n * @param {Array} data The data to process.\n * @private\n */\n _thresholdFunction(data: DataPoint[], _tree?: unknown): DataPoint[] {\n return data;\n }\n\n /**\n * Detects width and height and sets SVG properties\n * @private\n */\n _setSVGSize(width?: number, height?: number): void {\n let [w, h] =\n width && height\n ? [width, height]\n : getSize(this._select.node().parentNode);\n w! -= parseFloat(this._select.style(\"border-left-width\"));\n w! -= parseFloat(this._select.style(\"border-right-width\"));\n h! -= parseFloat(this._select.style(\"border-top-width\"));\n h! -= parseFloat(this._select.style(\"border-bottom-width\"));\n \n if (this._autoWidth && this.schema.width !== w) {\n this.width(w);\n this._select\n .style(\"width\", `${this.schema.width}px`)\n .attr(\"width\", `${this.schema.width}px`);\n }\n if (this._autoHeight && this.schema.height !== h) {\n this.height(h);\n this._select\n .style(\"height\", `${this.schema.height}px`)\n .attr(\"height\", `${this.schema.height}px`);\n }\n }\n\n /**\n Draws the visualization given the specified configuration.\n @param callback Optional callback invoked after rendering completes.\n */\n render(callback?: () => void): this {\n return vizRender(this, callback) as this;\n }\n\n /**\n Serializes the most recently rendered output to an SVG string. Returns\n `\"\"` if the chart has not been rendered yet. Both backends support this:\n the SVG backend returns its live `<svg>`, the canvas backend re-renders the\n retained scene through a throwaway SVG backend. Primarily used for\n server-side rendering (see `@d3plus/ssr`).\n */\n toSVGString(): string {\n return this._sceneRenderer?.toSVGString?.() ?? \"\";\n }\n\n /**\n Returns the underlying canvas element of the most recent render when the\n canvas backend is active (`renderer(\"canvas\")`), or `undefined` otherwise.\n Server-side callers cast this to their native canvas to encode a raster\n (see `@d3plus/ssr`).\n */\n toCanvas(): unknown {\n return this._renderer === \"canvas\"\n ? this._sceneRenderer?.toCanvas?.()\n : undefined;\n }\n\n /**\n Selects which @d3plus/render backend paints the visible output.\n `\"svg\"` = SvgRenderer (default), `\"canvas\"` = CanvasRenderer.\n Boolean arguments both normalize to `\"svg\"`.\n */\n renderer(): \"svg\" | \"canvas\";\n renderer(_: \"svg\" | \"canvas\" | true | false): this;\n renderer(_?: \"svg\" | \"canvas\" | true | false): \"svg\" | \"canvas\" | this {\n if (!arguments.length) return this._renderer;\n this._renderer = _ === \"canvas\" ? \"canvas\" : \"svg\";\n return this;\n }\n\n /**\n \"full\" runs the DOM enter/update/exit for every shape; \"compute\"\n skips DOM work and only populates the scene data (`_textData`,\n `_shapes[i]._select`, etc.) for `toScene()` to read. Set automatically by\n `renderScene` callers; users can also opt-in.\n */\n renderMode(): \"full\" | \"compute\";\n renderMode(_: \"full\" | \"compute\"): this;\n renderMode(_?: \"full\" | \"compute\"): \"full\" | \"compute\" | this {\n if (!arguments.length) return this._renderMode || \"full\";\n this._renderMode = _!;\n return this;\n }\n\n /**\n Public entry point that renders this chart through the @d3plus/render\n pluggable backends. The compute pass happens via render() (in an svg\n auto-created inside the target div); SvgRenderer/CanvasRenderer paints\n the scene to the target. Returns `{renderer, scene}` so callers can\n interact with the renderer (e.g. for picking) or read the scene data.\n */\n async renderScene(\n target: Element,\n opts?: {kind?: \"svg\" | \"canvas\"},\n ): Promise<{renderer: Renderer; scene: Scene}> {\n const kind = opts?.kind || (this._renderer === \"canvas\" ? \"canvas\" : \"svg\");\n this._sceneTarget = target;\n this._renderer = kind;\n this.select(target as HTMLElement);\n await new Promise<void>(resolve => this.render(() => resolve()));\n return {\n renderer: this._sceneRenderer as Renderer,\n scene: this._lastSceneRendered as Scene,\n };\n }\n\n /**\n Renders this chart through the @d3plus/render pluggable backends. Called\n automatically by `render()`. The compute pass draws into `this._select`\n (an auto-created svg INSIDE the user's target div) — that svg is the\n off-stage detached compute svg. SvgRenderer mounts to the user's target\n div (the parent), as a sibling to the detached compute svg. The compute\n svg's children get cleared so only the scene output is visible.\n */\n _drawSceneToTarget(durationOverride?: number): void {\n const kind = this._renderer === \"canvas\" ? \"canvas\" : \"svg\";\n const computeSvg = this._select && this._select.node ? this._select.node() : null;\n if (!computeSvg) return;\n // Mount renderer INSIDE the user's `_select` (svg or div). Tests like\n // `svgA.querySelector('[data-key=\"viz-legend\"]')` need the scene output\n // to live inside the user's container, not as a sibling.\n const userTarget = this._sceneTarget || computeSvg;\n if (!userTarget) return;\n const mountTarget = mountTargetFor(kind, userTarget as Element);\n const scene = this.toScene();\n const w = this.schema.width || 400;\n const h = this.schema.height || 300;\n // Reuse the renderer instance if it matches the kind, to avoid mount\n // churn. `target()` is the public Renderer-interface method (no\n // reaching into renderer-private slots). It's optional on the\n // interface; third-party renderers without it fall through to\n // remount on every draw — correct but with mount churn.\n const currentContainer = this._sceneRenderer?.target\n ? this._sceneRenderer.target()?.container\n : undefined;\n const containerChanged = this._sceneRenderer?.target\n ? currentContainer !== mountTarget\n : false;\n if (\n !this._sceneRenderer ||\n this._sceneRenderer.kind !== kind ||\n containerChanged\n ) {\n // Tear down the outgoing renderer before mounting a fresh one. It owns\n // its own DOM (canvas/svg + overlay host), pointer listeners, and\n // transition timers; without this, switching kind (svg<->canvas) or\n // container orphans that DOM in the user's element, stacking the old\n // mode's output behind the new one and accumulating on every switch.\n if (this._sceneRenderer && typeof this._sceneRenderer.destroy === \"function\")\n this._sceneRenderer.destroy();\n const Ctor = kind === \"canvas\" ? CanvasRenderer : SvgRenderer;\n this._sceneRenderer = new Ctor();\n // `_scenePixelRatio`, when set (e.g. by @d3plus/ssr for hi-res PNG output),\n // fixes the canvas backing-store scale; otherwise the renderer falls back\n // to `devicePixelRatio`.\n this._sceneRenderer.mount({\n container: mountTarget,\n width: w,\n height: h,\n pixelRatio: this._scenePixelRatio,\n });\n // Bridge renderer pointer events → viz.schema.on handlers. Without this,\n // tooltips never fire on the v4 scene-rendered path because\n // `shape.on(evt, fn)` in plotPaint only wires d3-selection\n // listeners on DOM nodes the scene renderer doesn't create.\n // Renderer events carry the picked scene node; the routing lives in\n // `_routeSceneEvent` (kept out of this method so the mount path stays\n // readable). `_lastScenePick` remembers the most recently hovered node\n // so `mouseleave` — fired with a null pick — can still tell the matching\n // handlers which shape/legend item was left (so the tooltip clears).\n this._lastScenePick = null;\n this._sceneRenderer.on((event: SceneEvent) => this._routeSceneEvent(event));\n } else {\n this._sceneRenderer.resize(w, h);\n }\n // `durationOverride` defaults to the chart's `_duration` for normal\n // re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to\n // skip the transition machinery — animating every wheel/drag tick\n // accumulates `setTimeout(duration+10)` per event.\n const drawDuration =\n durationOverride !== undefined\n ? durationOverride\n : this._instantNextDraw\n ? 0\n : this.schema.duration;\n // A duration>0 render (drill-down, zoom, re-center) must win over any\n // pending coalesced duration-0 repaint — otherwise that repaint fires on\n // the next frame and interrupts this transition, snapping shapes to their\n // final geometry.\n if (drawDuration > 0 && this._sceneRepaintRAF != null) {\n cancelAnimationFrame(this._sceneRepaintRAF);\n this._sceneRepaintRAF = undefined;\n }\n // Mark the window during which an animated transition is in flight, so the\n // pointer bridge can ignore interaction until it settles. A hover/click\n // mid-transition would schedule a duration-0 repaint that interrupts the\n // running transition and snaps it to its end (the glitchy jump). Matches\n // the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small\n // buffer so events re-enable just after the paint completes.\n if (drawDuration > 0)\n this._transitionEndsAt = Date.now() + drawDuration + 30;\n // Order persistent motion trails in time by the current timeline period, so\n // they grow only as playback moves forward and rewind when it steps back.\n // Only when the timeline selects a single period (`brushing: false`): a range\n // selection has no single \"current time\", which would scramble the step\n // logic, so we withhold the sequence and trails fall back to ephemeral.\n // Normalize to milliseconds via `date()` — the selection mixes Date objects\n // (brush/initial) and raw period numbers (playback), which compare on wildly\n // different scales otherwise, scrambling the forward/backward test.\n const sel = this._timelineSelection;\n const brushing = this._timelineClass\n ? (this._timelineClass.schema as {brushing?: boolean}).brushing !== false\n : true;\n const sequence = !brushing && Array.isArray(sel) && sel.length\n ? Math.max(...sel.map(v => Number(date(Number(v)))))\n : undefined;\n // A forward jump that skips periods (manual click, not single-step play) draws\n // one coarse segment; compute the marks' real positions at the skipped periods\n // so the trail bends through them (see render commitTrailCatchups).\n const trailCatchup =\n sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq\n ? computeTrailCatchup(this as unknown as VizInstance, scene, this._trailSeq, sequence)\n : undefined;\n if (sequence !== undefined) this._trailSeq = sequence;\n this._sceneRenderer.drawScene(scene, {\n duration: drawDuration, sequence, trailCatchup,\n // The drill-down morph's resolved boxes for this draw, if a drill\n // click armed one (resolveDrillMorph, run just before this method via\n // runVizPipeline). One-shot: cleared right below so a later repaint\n // that reaches this method by some OTHER path (a zoom/pan tick, a\n // coalesced hover repaint, Rings' click-to-recenter) never inherits a\n // stale box from an earlier drill click.\n enterFrom: this._resolvedEnterFrom, enterFromBody: this._resolvedEnterFromBody,\n exitTo: this._resolvedExitTo, exitToBody: this._resolvedExitToBody,\n instantExitKey: this._resolvedInstantExitKey,\n reunionEnterKey: this._resolvedReunionEnterKey,\n reunionEnterFrom: this._resolvedReunionEnterFrom,\n instantExitAll: this._resolvedInstantExitAll,\n });\n this._resolvedEnterFrom = undefined;\n this._resolvedEnterFromBody = undefined;\n this._resolvedExitTo = undefined;\n this._resolvedExitToBody = undefined;\n this._resolvedInstantExitKey = undefined;\n this._resolvedReunionEnterKey = undefined;\n this._resolvedReunionEnterFrom = undefined;\n this._resolvedInstantExitAll = undefined;\n this._lastSceneRendered = scene;\n\n // Canvas backend: the compute <svg> (`_select`) is an emptied overlay\n // sitting on top of the <canvas>. An svg root hit-tests its whole box, so\n // even empty it swallows the pointer events the canvas needs for\n // tooltip/hover/legend picking — the symptom being \"renders fine, no\n // tooltips.\" Make the overlay transparent to pointer events so the canvas\n // is the sole interaction surface. The only interactive DOM that still\n // lives in this svg is the timeline's d3-brush (the canvas can't host the\n // native brush handles), so re-enable events on just that group. On the\n // SVG backend `_select` IS the scene host, so events must stay enabled\n // (except while the zoom brush is active — see `applyZoomPointerEvents`).\n applyZoomPointerEvents(this);\n if (this._select && kind === \"canvas\")\n this._select\n .select(\"g.d3plus-viz-timeline\")\n .style(\"pointer-events\", \"auto\");\n if (kind === \"canvas\") bindCanvasZoom(this);\n\n // The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in\n // the outer svg) must paint above the scene-rendered timeline buttons/ticks\n // so its selection tint + handles sit on top of them (matching v3). The\n // renderer appends its scene <svg> last, so without this the brush layer\n // ends up behind it — the selection's translucent fill is then hidden by\n // the opaque buttons and only the edge handles peek out.\n if (kind === \"svg\") {\n const host =\n userTarget && typeof (userTarget as Element).querySelector === \"function\"\n ? (userTarget as Element)\n : null;\n const tlGroup = host\n ? host.querySelector(\":scope > g.d3plus-viz-timeline\")\n : null;\n if (tlGroup) host!.appendChild(tlGroup);\n // Likewise the zoom brush, so its selection box draws over the shapes.\n const zoomBrush = host ? host.querySelector(\":scope > g.d3plus-zoom-brush\") : null;\n if (zoomBrush && zoomBrush !== host!.lastElementChild) host!.appendChild(zoomBrush);\n }\n }\n\n /**\n Resolves the `(d, i, x)` a picked scene node reports to interaction\n handlers (tooltip, click, user `on` handlers). `pick.datum` is the raw\n scene datum; for a Plot shape that's the wrapped record `{data, i}`, which\n handlers expect unwrapped to `(d.data, d.i, wrapped)`. The base does that\n unwrap; Plot overrides this to report the point nearest the cursor for\n multi-point shapes (Line/Area) so a series tooltip reflects the hovered\n x rather than the whole-series aggregate.\n @private\n */\n _interactionDatum(\n pick: PickResult,\n _event: SceneEvent,\n ): {d: unknown; i: number; x: unknown} {\n const rawDatum = pick.datum as {data?: unknown; i?: number} | null | undefined;\n const sourceDatum = rawDatum && rawDatum.data ? rawDatum.data : rawDatum;\n const sourceIndex =\n rawDatum && typeof rawDatum.i === \"number\" ? rawDatum.i : pick.index ?? 0;\n return {d: sourceDatum, i: sourceIndex, x: rawDatum};\n }\n\n /**\n Pointer hook run by `_routeSceneEvent` before any handler routing, for\n every event including ones over empty space. No-op here; Plot overrides\n it to drive the shared multi-series tooltip and crosshair.\n @private\n */\n _sharedHover(_event: SceneEvent): void {}\n\n /**\n Routes a renderer pointer event to the matching `viz.schema.on` handlers.\n Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where\n compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`\n listeners never fire. We look up the appropriate `on` key from the picked\n scene node: legend swatches route to legend handlers, chart shapes to\n shape (+ shape-class-scoped) handlers, and chrome (axis/timeline/back) is\n excluded. Split out of `_drawSceneToTarget` to keep that method small.\n @private\n */\n _routeSceneEvent(event: SceneEvent): void {\n // Ignore all pointer interaction while an animated transition (zoom,\n // re-center, drill-down, entrance) is in flight. Hovering or clicking a\n // shape mid-transition would fire a handler that schedules a duration-0\n // repaint, interrupting the running transition and snapping it to its end\n // — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`\n // for the transition's duration; it lapses on its own, so interaction\n // resumes the instant the transition settles.\n // Runs for every event, picked or not, so a chart can track the pointer\n // across empty space (Plot's shared tooltip + crosshair) — and ahead of\n // the transition guard below, so leaving mid-transition still clears it.\n this._sharedHover(event);\n if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;\n const pick = event.pick;\n // Dispatch helper shared by the live-pick path and the leave path.\n const fire = (\n key: string,\n d: unknown,\n i: number,\n x: unknown,\n ): void => {\n const fn = this.schema.on && this.schema.on[key];\n if (typeof fn === \"function\") {\n try {\n fn.call(this, d, i, x, event.nativeEvent);\n } catch {\n // swallow per-event errors so one bad handler doesn't\n // break subsequent events.\n }\n }\n };\n if (event.type === \"mouseleave\") {\n const lastPick = this._lastScenePick;\n if (lastPick) {\n fire(\n `mouseleave.${lastPick.isLegend ? \"legend\" : \"shape\"}`,\n lastPick.d,\n lastPick.i,\n lastPick.x,\n );\n if (!lastPick.isLegend && lastPick.shapeType)\n fire(`mouseleave.${lastPick.shapeType}`, lastPick.d, lastPick.i, lastPick.x);\n fire(\"mouseleave\", lastPick.d, lastPick.i, lastPick.x);\n }\n this._lastScenePick = null;\n // Cleared here, then re-set by the enter/move the renderer fires\n // synchronously when the pointer crosses to an adjacent node — so a\n // shape→label hand-off leaves `_hoverDatum` pointing at the new node\n // (same datum), which `mouseleave` reads to suppress a flicker.\n this._hoverDatum = null;\n return;\n }\n if (!pick || !pick.node) return;\n // Scene nodes carry interaction metadata stamped by Viz.toScene.\n const nodeAny = pick.node as {\n interactionGroup?: string;\n shapeType?: string;\n };\n // Axis ticks/labels, the timeline, and Plot's trend lines are chrome —\n // they carry data but are not chart shapes, so they must not fire shape\n // tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).\n if (\n nodeAny.interactionGroup === \"axis\" ||\n nodeAny.interactionGroup === \"timeline\" ||\n nodeAny.interactionGroup === \"trend\"\n )\n return;\n // Prefer the node's stamped interaction group (set by Viz.toScene), so\n // legend swatches route to legend handlers on Canvas too — where the\n // single canvas element has no per-shape DOM to walk. Fall back to SVG\n // DOM ancestry for nodes the stamp didn't reach.\n const target =\n event.nativeEvent && (event.nativeEvent as Event).target;\n const isLegendNode =\n nodeAny.interactionGroup === \"legend\" ||\n (target && typeof (target as Element).closest === \"function\"\n ? !!(target as Element).closest('[data-key=\"viz-legend\"]')\n : false);\n const suffix = isLegendNode ? \"legend\" : \"shape\";\n const handlerKey = `${event.type}.${suffix}`;\n // Resolve the datum + index this pick reports to handlers, ONCE, and reuse\n // it for every handler fired below so tooltip/click/user handlers agree on\n // which datum the pointer is over. The base unwraps the node's raw datum to\n // its source row; Plot overrides `_interactionDatum` to report the point\n // nearest the cursor for multi-point shapes (Line/Area).\n const {d: sourceDatum, i: sourceIndex, x: rawDatum} = this._interactionDatum(\n pick,\n event,\n );\n const shapeType =\n typeof nodeAny.shapeType === \"string\" ? nodeAny.shapeType : null;\n this._lastScenePick = {\n d: sourceDatum, i: sourceIndex, x: rawDatum, isLegend: isLegendNode, shapeType,\n // The live picked node's own geometry, read synchronously by clickShape\n // (before the drill-down re-render replaces this frame) to arm the\n // forward drill-down morph.\n node: pick.node,\n };\n this._hoverDatum = rawDatum;\n fire(handlerKey, sourceDatum, sourceIndex, rawDatum);\n // Shape-class-scoped handlers (`\"click.Bar\"`, `\"mousemove.Circle\"`). The\n // emitting shape stamps its type onto the node; on the scene path this is\n // the only place these fire (compute-mode shapes wire no DOM listeners).\n // Legend nodes are excluded so a legend swatch's shape type can't\n // masquerade as a chart-shape handler.\n if (!isLegendNode && shapeType) {\n fire(`${event.type}.${shapeType}`, sourceDatum, sourceIndex, rawDatum);\n }\n // Also fire the un-suffixed handler (e.g. \"mousemove\") so user-registered\n // global handlers see the event too.\n fire(event.type, sourceDatum, sourceIndex, rawDatum);\n }\n\n /**\n Coalesces interaction-driven scene repaints (hover/active dimming) into a\n single paint per animation frame. A fast pointer sweep across a dense\n chart fires a hover transition per shape crossed; painting each one\n synchronously rebuilt the whole scene back-to-back, saturating the main\n thread (~200ms stalls) so the tooltip couldn't reposition and appeared\n stuck at its last spot. Only the latest hover state is visible, so the\n intermediate paints are wasted — collapse them to one rAF-scheduled draw.\n */\n _scheduleSceneRepaint(): void {\n if (!this._sceneRenderer) return;\n if (typeof requestAnimationFrame !== \"function\") {\n this._drawSceneToTarget(0);\n return;\n }\n if (this._sceneRepaintRAF != null) return;\n this._sceneRepaintRAF = requestAnimationFrame(() => {\n this._sceneRepaintRAF = undefined;\n this._drawSceneToTarget(0);\n });\n }\n\n /**\n Tears down the visualization: disconnects the ResizeObserver, stops listening for web font loads, and removes DOM event listeners. Call this when unmounting to avoid memory leaks.\n */\n destroy(): this {\n unregisterLink(this as unknown as VizInstance);\n this._resizeObserver?.disconnect();\n this._fontsUnsubscribe?.();\n this._fontsUnsubscribe = undefined;\n this._tooltipClass.data([]).render();\n select(\"body\").on(`touchstart.${this._uuid}`, null);\n // Clear the visibility/resize/scroll poll timers + scroll listener\n // so a destroyed chart doesn't keep firing intervals/timeouts that\n // hold the entire viz instance alive. Without this, an SPA that\n // mounts/unmounts charts on tab switches leaks the scene tree +\n // a 200ms-interval timer per leaked chart.\n if (this._visiblePoll) {\n this._visiblePoll = clearInterval(this._visiblePoll) as never;\n }\n if (this._resizePoll) {\n this._resizePoll = clearTimeout(this._resizePoll) as never;\n }\n if (this._scrollPoll) {\n this._scrollPoll = clearTimeout(this._scrollPoll) as never;\n }\n this._visibleUnobserve?.();\n this._visibleUnobserve = undefined;\n this._unloadUnobserve?.();\n this._unloadUnobserve = undefined;\n if (this._sceneRepaintRAF != null) {\n if (typeof cancelAnimationFrame === \"function\")\n cancelAnimationFrame(this._sceneRepaintRAF);\n this._sceneRepaintRAF = undefined;\n }\n if (this.schema.scrollContainer)\n select(this.schema.scrollContainer).on(`scroll.${this._uuid}`, null);\n // Destroy the active scene renderer (clears its own pointer-rect\n // listeners, overlay host, canvas/svg DOM, timers).\n if (this._sceneRenderer && typeof this._sceneRenderer.destroy === \"function\") {\n this._sceneRenderer.destroy();\n this._sceneRenderer = undefined;\n }\n return this;\n }\n\n}\n"],"names":["select","date","getSize","computeTrailCatchup","CanvasRenderer","SvgRenderer","VizBase","applyColorScaleBucketOpacity","applyInteractionOpacity","chartAreaRect","initInsetDefaults","insetComponentScene","applyZoomPointerEvents","bindCanvasZoom","initVizDefaults","unregisterLink","vizRender","vizDraw","vizPreDraw","tagInteractionGroup","node","group","interactionGroup","kids","children","child","mountTargetFor","kind","target","Element","tagName","toLowerCase","parentNode","Viz","_preDraw","toScene","_chartScene","length","sliced","zoomNode","type","key","transform","_zoomTransform","x","y","scale","_chartTransform","clip","_chartClip","schema","zoom","_margin","undefined","push","_shapes","forEach","shape","si","sel","_select","attr","t","m","match","parseFloat","components","_legendClass","_colorScaleClass","_timelineClass","name","comp","compScene","outerBounds","_featurePanels","width","height","root","_draw","_sizeLegendScale","_available","_insetRegion","_thresholdFunction","data","_tree","_setSVGSize","w","h","style","_autoWidth","_autoHeight","render","callback","toSVGString","_sceneRenderer","toCanvas","_renderer","renderer","_","arguments","renderMode","_renderMode","renderScene","opts","_sceneTarget","Promise","resolve","scene","_lastSceneRendered","_drawSceneToTarget","durationOverride","Math","computeSvg","userTarget","mountTarget","currentContainer","container","containerChanged","destroy","Ctor","mount","pixelRatio","_scenePixelRatio","_lastScenePick","on","event","_routeSceneEvent","resize","drawDuration","_instantNextDraw","duration","_sceneRepaintRAF","cancelAnimationFrame","_transitionEndsAt","Date","now","_timelineSelection","brushing","sequence","Array","isArray","max","map","v","Number","trailCatchup","_trailSeq","drawScene","enterFrom","_resolvedEnterFrom","enterFromBody","_resolvedEnterFromBody","exitTo","_resolvedExitTo","exitToBody","_resolvedExitToBody","instantExitKey","_resolvedInstantExitKey","reunionEnterKey","_resolvedReunionEnterKey","reunionEnterFrom","_resolvedReunionEnterFrom","instantExitAll","_resolvedInstantExitAll","host","querySelector","tlGroup","appendChild","zoomBrush","lastElementChild","_interactionDatum","pick","_event","rawDatum","datum","sourceDatum","sourceIndex","i","index","d","_sharedHover","fire","fn","call","nativeEvent","lastPick","isLegend","shapeType","_hoverDatum","nodeAny","isLegendNode","closest","suffix","handlerKey","_scheduleSceneRepaint","requestAnimationFrame","_resizeObserver","disconnect","_fontsUnsubscribe","_tooltipClass","_uuid","_visiblePoll","clearInterval","_resizePoll","clearTimeout","_scrollPoll","_visibleUnobserve","_unloadUnobserve","scrollContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,MAAM,QAAO,eAAe;AAEpC,SAAQC,IAAI,EAAEC,OAAO,QAAO,cAAc;AAE1C,SAAQC,mBAAmB,QAAO,oBAAoB;AAEtD,SAAQC,cAAc,EAAEC,WAAW,QAAO,iBAAiB;AAG3D,OAAOC,aAAa,eAAe;AAInC,SAAQC,4BAA4B,EAAEC,uBAAuB,QAAO,0BAA0B;AAC9F,SAAQC,aAAa,QAAO,+BAA+B;AAC3D,SAAQC,iBAAiB,EAAEC,mBAAmB,QAAO,4BAA4B;AAEjF,SAAQC,sBAAsB,EAAEC,cAAc,QAAO,+BAA+B;AACpF,SAAQC,eAAe,QAAO,mBAAmB;A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gBACjE,oDAAoD;gBACpD,IAAI,IAAI,CAAC1G,cAAc,IAAI,OAAO,IAAI,CAACA,cAAc,CAACwB,OAAO,KAAK,YAAY;oBAC5E,IAAI,CAACxB,cAAc,CAACwB,OAAO;oBAC3B,IAAI,CAACxB,cAAc,GAAGzC;gBACxB;gBACA,OAAO,IAAI;YACb;;;WAlsBmBpB;EAAY3B;AAHjC;;AAEA,GACA,SAAqB2B,iBAosBpB"}
|
|
@@ -84,6 +84,7 @@ import { addToQueue, unique } from "@d3plus/data";
|
|
|
84
84
|
import { assign } from "@d3plus/dom";
|
|
85
85
|
import { fontFamilyStringify } from "@d3plus/text";
|
|
86
86
|
import { accessor, BaseClass, constant } from "../../utils/index.js";
|
|
87
|
+
import { broadcastLink } from "./linkGroup.js";
|
|
87
88
|
var VizBaseConfig = /*#__PURE__*/ function(BaseClass) {
|
|
88
89
|
"use strict";
|
|
89
90
|
_inherits(VizBaseConfig, BaseClass);
|
|
@@ -107,6 +108,7 @@ var VizBaseConfig = /*#__PURE__*/ function(BaseClass) {
|
|
|
107
108
|
// interaction-opacity pass, so repaint to apply/clear active state.
|
|
108
109
|
if (this._sceneRenderer) this._scheduleSceneRepaint();
|
|
109
110
|
}
|
|
111
|
+
broadcastLink(this, "active", _);
|
|
110
112
|
return this;
|
|
111
113
|
}
|
|
112
114
|
},
|
|
@@ -288,30 +290,6 @@ Defaults to an empty array (`[]`).
|
|
|
288
290
|
},
|
|
289
291
|
{
|
|
290
292
|
/**
|
|
291
|
-
Shows a button that allows for downloading the current visualization.
|
|
292
|
-
*/ key: "downloadButton",
|
|
293
|
-
value: function downloadButton(_) {
|
|
294
|
-
return arguments.length ? (this.schema.downloadButton = _, this) : this.schema.downloadButton;
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
/**
|
|
299
|
-
Sets specific options of the saveElement function used when downloading the visualization.
|
|
300
|
-
*/ key: "downloadConfig",
|
|
301
|
-
value: function downloadConfig(_) {
|
|
302
|
-
return arguments.length ? (this.schema.downloadConfig = assign(this.schema.downloadConfig, _), this) : this.schema.downloadConfig;
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
/**
|
|
307
|
-
Defines which control group to add the download button into.
|
|
308
|
-
*/ key: "downloadPosition",
|
|
309
|
-
value: function downloadPosition(_) {
|
|
310
|
-
return arguments.length ? (this.schema.downloadPosition = _, this) : this.schema.downloadPosition;
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
/**
|
|
315
293
|
The font family used throughout the visualization.
|
|
316
294
|
*/ key: "fontFamily",
|
|
317
295
|
value: function fontFamily(_) {
|
|
@@ -450,6 +428,7 @@ Defaults to an empty array (`[]`).
|
|
|
450
428
|
// to one paint per frame so a fast pointer sweep doesn't saturate the main
|
|
451
429
|
// thread.
|
|
452
430
|
if (this._sceneRenderer && _ !== undefined && (this.schema.shapeConfig.hoverOpacity !== 1 || this._hoverBucket)) this._scheduleSceneRepaint();
|
|
431
|
+
broadcastLink(this, "hover", _);
|
|
453
432
|
return this;
|
|
454
433
|
}
|
|
455
434
|
},
|
|
@@ -467,6 +446,7 @@ Defaults to an empty array (`[]`).
|
|
|
467
446
|
// Scene-rendered charts express de-emphasis via the scene's
|
|
468
447
|
// interaction-opacity pass, so repaint to apply/clear the gray treatment.
|
|
469
448
|
if (this._sceneRenderer) this._scheduleSceneRepaint();
|
|
449
|
+
broadcastLink(this, "highlight", _);
|
|
470
450
|
return this;
|
|
471
451
|
}
|
|
472
452
|
},
|
|
@@ -506,6 +486,22 @@ Defaults to an empty array (`[]`).
|
|
|
506
486
|
},
|
|
507
487
|
{
|
|
508
488
|
/**
|
|
489
|
+
Whether the chart may draw one of its legends inside the empty space around its marks instead of in a margin, for charts that leave room (Plot, Network, Pack, Pie, Rings, Tree, and Geomap). After the chart lays out, the size legend is tried first, then the legend, then the colorScale; the first that fits is drawn over a semi-transparent box (see `legendInsetConfig`), and any others keep their margins. Space enclosed by the marks, like the middle of a ring of points, is never used. A legend or colorScale whose position was set explicitly stays in that margin. Defaults to `true`; also accepts a function that receives the resolved chart config and returns a boolean.
|
|
490
|
+
*/ key: "legendInset",
|
|
491
|
+
value: function legendInset(_) {
|
|
492
|
+
return arguments.length ? (this.schema.legendInset = _, this) : this.schema.legendInset;
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
/**
|
|
497
|
+
Style of the box drawn behind a legend placed inside the chart (see `legendInset`): `fill` (defaults to the chart's background color), `fillOpacity` (0.85), `stroke` (defaults to a faint contrasting line), `strokeWidth` (1), `rx` (corner radius, 4), `margin` (space between the box's edge and the legend, 6), and `padding` (space kept between the box and the chart's marks and edges, 10).
|
|
498
|
+
*/ key: "legendInsetConfig",
|
|
499
|
+
value: function legendInsetConfig(_) {
|
|
500
|
+
return arguments.length ? (this.schema.legendInsetConfig = assign(this.schema.legendInsetConfig, _), this) : this.schema.legendInsetConfig;
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
/**
|
|
509
505
|
Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.
|
|
510
506
|
*/ key: "legendPadding",
|
|
511
507
|
value: function legendPadding(_) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/charts/viz/VizBaseConfig.ts"],"sourcesContent":["import {merge as arrayMerge} from \"d3-array\";\n\nimport {addToQueue, unique} from \"@d3plus/data\";\nimport {assign} from \"@d3plus/dom\";\nimport {fontFamilyStringify} from \"@d3plus/text\";\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport {accessor, BaseClass, constant} from \"../../utils/index.js\";\nimport type VizBase from \"./VizBase.js\";\n\n/**\n First half of the fluent config accessors shared by every Viz chart\n (`active` through `legendTooltip`). Split from `VizBase` purely so each\n file stays under the `max-lines` budget; the methods remain real prototype\n methods, so `BaseClass.config()` reflection and polymorphic `this` chaining\n are unchanged.\n*/\nexport default class VizBaseConfig extends BaseClass {\n // installFluent generates the config accessors (data, sum, x, …) and the\n // pipeline stamps derived `_`-prefixed state at runtime; the index signature\n // lets the chart code reach both through the type (same rationale as the\n // shape/component classes).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n\n /**\n The active callback function for highlighting shapes.\n*/\n active(\n _?: ((d: DataPoint, i: number) => boolean) | false,\n ): this | ((d: DataPoint, i: number) => boolean) | false {\n this._active = _;\n\n if (this.schema.shapeConfig.activeOpacity !== 1) {\n this._shapes.forEach((s: {active: (...args: unknown[]) => unknown}) => s.active(_));\n if (this.schema.legend) this._legendClass.active(_);\n // See hover(): scene-rendered charts dim via the scene's\n // interaction-opacity pass, so repaint to apply/clear active state.\n if (this._sceneRenderer) this._scheduleSceneRepaint();\n }\n\n return this;\n }\n\n /**\n Custom aggregation methods for each data key.\n*/\n aggs(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.aggs = assign(this.schema.aggs, _!)), this)\n : this.schema.aggs;\n }\n\n /**\n Sets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).\n*/\n attribution(_?: string | boolean): this | string | boolean {\n return arguments.length\n ? ((this.schema.attribution = _), this)\n : this.schema.attribution;\n }\n\n /**\n Overrides the \"ⓘ\" icon a long attribution collapses to (see `attribution`), which otherwise renders as an inline SVG. Accepts an HTML string — used as the toggle button's content — or a mount function, `(el: HTMLElement) => void | (() => void)`, called once with the button's reserved icon slot so a live component (a React tree via `createRoot(el).render(...)`, or anything else imperative) can be mounted into it. A returned cleanup function runs right before that slot is discarded, which happens whenever the credit's markup regenerates (its text or theme changes), not just once per chart.\n*/\n attributionIcon(\n _?: string | ((el: HTMLElement) => void | (() => void)),\n ): this | string | ((el: HTMLElement) => void | (() => void)) | undefined {\n return arguments.length\n ? ((this.schema.attributionIcon = _), this)\n : (this.schema.attributionIcon as\n | string\n | ((el: HTMLElement) => void | (() => void))\n | undefined);\n }\n\n /**\n Configuration object for the attribution style.\n*/\n attributionStyle(\n _?: Record<string, unknown>,\n ): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.attributionStyle = assign(this.schema.attributionStyle, _!)), this)\n : this.schema.attributionStyle;\n }\n\n /**\n Configuration object for the back button. Superseded by\n `.backControlStyle()`/`.backControlClassName()` for the button's\n appearance (it renders as a real `<button>`, like the zoom/search\n controls, not a configurable text node) — kept for backwards\n compatibility, but no longer affects how the button looks.\n*/\n backConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.backConfig = assign(this.schema.backConfig, _!)), this)\n : this.schema.backConfig;\n }\n\n /**\n An additional CSS class name (or space-separated list of class names) applied to the back button, alongside its fixed `back-control` class. Setting this automatically disables d3plus's built-in inline `backControlStyle` default (as long as you haven't already customized it yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.\n*/\n backControlClassName(_?: string): this | string {\n return arguments.length\n ? ((this.schema.backControlClassName = _), this)\n : this.schema.backControlClassName;\n }\n\n /**\n An object containing CSS key/value pairs that is used to style the back button. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.backControlClassName(...)` is set, unless you've explicitly customized this yourself.\n*/\n backControlStyle(\n _?: Record<string, unknown> | false,\n ): this | Record<string, unknown> | false {\n return arguments.length\n ? ((this.schema.backControlStyle = _), this)\n : this.schema.backControlStyle;\n }\n\n /**\n Defines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.\n*/\n color(\n _?:\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false,\n ):\n | this\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false {\n return arguments.length\n ? ((this.schema.color = !_ || typeof _ === \"function\" ? _ : accessor(_)), this)\n : this.schema.color;\n }\n\n /**\n Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point.\n*/\n colorScale(\n _?:\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false,\n ):\n | this\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false {\n return arguments.length\n ? ((this.schema.colorScale = !_ || typeof _ === \"function\" ? _ : accessor(_)),\n this)\n : this.schema.colorScale;\n }\n\n /**\n A pass-through to the config method of ColorScale.\n*/\n colorScaleConfig(\n _?: Record<string, unknown>,\n ): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.colorScaleConfig = assign(this.schema.colorScaleConfig, _!)), this)\n : this.schema.colorScaleConfig;\n }\n\n /**\n Tells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.\n*/\n colorScalePadding(\n _?: boolean | ((viz: VizBase) => boolean),\n ): this | boolean | ((viz: VizBase) => boolean) {\n return arguments.length\n ? ((this.schema.colorScalePadding = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.colorScalePadding;\n }\n\n /**\n Defines which side of the visualization to anchor the color scale. Acceptable values are `\"top\"`, `\"bottom\"`, `\"left\"`, `\"right\"`, and `false`. A `false` value will cause the color scale to not be displayed, but will still color shapes based on the scale.\n*/\n colorScalePosition(\n _?: string | boolean | (() => string | boolean),\n ): this | string | boolean | (() => string | boolean) {\n return arguments.length\n ? ((this.schema.colorScalePosition = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.colorScalePosition;\n }\n\n /**\n The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.\n*/\n colorScaleMaxSize(_?: number): this | number {\n return arguments.length\n ? ((this.schema.colorScaleMaxSize = _), this)\n : this.schema.colorScaleMaxSize;\n }\n\n /**\n The primary data array used to draw the visualization. The value passed should be an *Array* of objects or a *String* representing a filepath or URL to be loaded. The following filetypes are supported: `csv`, `tsv`, `txt`, and `json`.\n\nIf your data URL needs specific headers to be set, an Object with \"url\" and \"headers\" keys may also be passed.\n\nAdditionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final array of obejcts to be used as the primary data array. For example, some JSON APIs return the headers split from the data values to save bandwidth. These would need be joined using a custom formatter.\n\nIf you would like to specify certain configuration options based on the yet-to-be-loaded data, you can also return a full `config` object from the data formatter (including the new `data` array as a key in the object).\n\nDefaults to an empty array (`[]`).\n @param f The data array or a URL string to load data from.\n */\n data(\n _?: DataPoint[] | string | {url: string; headers: Record<string, string>},\n f?: (data: DataPoint[]) => DataPoint[] | Record<string, unknown>,\n ): this | DataPoint[] {\n if (arguments.length) {\n addToQueue.bind(this as unknown as ThisParameterType<typeof addToQueue>)(\n _!,\n f,\n \"data\",\n );\n this._hidden = [];\n this._solo = [];\n if (\n this._userData &&\n JSON.stringify(_) !== JSON.stringify(this._userData)\n ) {\n this.schema.timeFilter = false;\n this._timelineSelection = false;\n }\n this._userData = _;\n return this;\n }\n return this._data;\n }\n\n /**\n If the width and/or height of a Viz is not user-defined, it is determined by the size of it's parent element. When this method is set to `true`, the Viz will listen for the `window.onresize` event and adjust it's dimensions accordingly.\n*/\n detectResize(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.detectResize = _), this)\n : this.schema.detectResize;\n }\n\n /**\n When resizing the browser window, this is the millisecond delay to trigger the resize event.\n*/\n detectResizeDelay(_?: number): this | number {\n return arguments.length\n ? ((this.schema.detectResizeDelay = _), this)\n : this.schema.detectResizeDelay;\n }\n\n /**\n Toggles whether or not the Viz should try to detect if it visible in the current viewport. When this method is set to `true`, the Viz will only be rendered when it has entered the viewport either through scrolling or if it's display or visibility is changed.\n*/\n detectVisible(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.detectVisible = _), this)\n : this.schema.detectVisible;\n }\n\n /**\n The interval, in milliseconds, for checking if the visualization is visible on the page. When `detectVisible` defers a render until the visualization scrolls into view, this is also how long it must stay in view before it renders, so visualizations scrolled past quickly are never drawn.\n*/\n detectVisibleInterval(_?: number): this | number {\n return arguments.length\n ? ((this.schema.detectVisibleInterval = _), this)\n : this.schema.detectVisibleInterval;\n }\n\n /**\n When `true` (the default) and `detectVisible` is enabled, the Viz releases its DOM and scene while it is scrolled out of view and redraws when it returns, keeping the page light when there are many visualizations. Data and configuration are retained; interaction state such as zoom or selection is not, so set this to `false` to keep it. With `detectVisible` enabled, each chart's `<svg>` is also given `content-visibility: auto`, so the browser skips rendering its contents while it is far off-screen (this matters most when this is `false` and charts are kept). For a larger saving you can also apply `content-visibility: auto` and a `contain-intrinsic-size` to the container element yourself; that adds paint containment to an element you own, so it is not done automatically. Requires `IntersectionObserver`.\n*/\n detectVisibleUnload(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.detectVisibleUnload = _), this)\n : this.schema.detectVisibleUnload;\n }\n\n /**\n Shows a button that allows for downloading the current visualization.\n*/\n downloadButton(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.downloadButton = _), this)\n : this.schema.downloadButton;\n }\n\n /**\n Sets specific options of the saveElement function used when downloading the visualization.\n*/\n downloadConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.downloadConfig = assign(this.schema.downloadConfig, _!)), this)\n : this.schema.downloadConfig;\n }\n\n /**\n Defines which control group to add the download button into.\n*/\n downloadPosition(_?: string): this | string {\n return arguments.length\n ? ((this.schema.downloadPosition = _), this)\n : this.schema.downloadPosition;\n }\n\n /**\n The font family used throughout the visualization.\n*/\n fontFamily(_?: string | string[]): this | string | string[] {\n if (arguments.length) {\n const labelConfig = {fontFamily: _};\n\n const axisConfig = {titleConfig: labelConfig, shapeConfig: {labelConfig}};\n\n this.shapeConfig({labelConfig});\n this.colorScaleConfig({axisConfig});\n\n [\"axis\", \"column\", \"row\", \"timeline\", \"x\", \"y\", \"x2\", \"y2\"].forEach(\n (axis: string) => {\n const method = `${axis}Config`;\n if (this[method]) this[method](axisConfig);\n },\n );\n [\"back\", \"title\", \"total\", \"subtitle\"].forEach((label: string) => {\n const method = `${label}Config`;\n if (this[method]) this[method](labelConfig);\n });\n\n this.tooltipConfig({\n tooltipStyle: {\"font-family\": fontFamilyStringify(_!)},\n });\n\n this.schema.fontFamily = _;\n return this;\n }\n return this.schema.fontFamily;\n }\n\n /**\n Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is \"id\"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.\n*/\n groupBy(\n _?:\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | (string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]))[],\n ): this | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])[] {\n if (!arguments.length) return this.schema.groupBy;\n this._groupByRaw = _;\n const arr: (string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]))[] =\n _ instanceof Array ? _ : [_!];\n return (\n (this.schema.groupBy = arr.map(\n (\n k: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]),\n ) => {\n if (typeof k === \"function\") return k;\n else {\n if (!this.schema.aggs[k]) {\n this.schema.aggs[k] = (\n a: DataPoint[],\n c: (d: DataPoint) => DataPoint[keyof DataPoint],\n ) => {\n const v = unique(a.map(c));\n return v.length === 1 ? v[0] : v;\n };\n }\n return accessor(k);\n }\n },\n )),\n this\n );\n }\n\n /**\n Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).\n*/\n hiddenColor(\n _?: string | ((d: DataPoint, i: number) => string),\n ): this | string | ((d: DataPoint, i: number) => string) {\n return arguments.length\n ? ((this.schema.hiddenColor = typeof _ === \"function\" ? _ : constant(_)), this)\n : this.schema.hiddenColor;\n }\n\n /**\n Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).\n*/\n hiddenOpacity(\n _?: number | ((d: DataPoint, i: number) => number),\n ): this | number | ((d: DataPoint, i: number) => number) {\n return arguments.length\n ? ((this.schema.hiddenOpacity = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.hiddenOpacity;\n }\n\n /**\n The hover callback function for highlighting shapes on mouseover.\n*/\n hover(_?: ((d: DataPoint, i: number) => boolean) | false): this {\n let hoverFunction = (this._hover = _);\n\n if (this.schema.shapeConfig.hoverOpacity !== 1 && _ !== undefined) {\n if (typeof _ === \"function\") {\n let shapeData = arrayMerge(\n this._shapes.map((s: {data: () => DataPoint[]}) => s.data()),\n );\n shapeData = shapeData.concat(this._legendClass.data());\n const activeData = _ ? (shapeData as DataPoint[]).filter(_ as (d: DataPoint) => boolean) : [];\n\n // Build a Set<string> of activeIds for O(1) membership lookup.\n // Previously `activeIds.filter((id, i) => activeIds.indexOf(id) === i)`\n // was O(N²) dedup, and the hover predicate did `activeIds.includes(...)`\n // — also O(N) per datum per repaint. With ~5k segments, hover\n // dispatch was ~250 ms on a 2023 laptop; Set drops it to <5 ms.\n const activeIds = new Set<string>();\n (activeData.map(this._ids) as string[][]).forEach((ids: string[]) => {\n for (let x = 1; x <= ids.length; x++) {\n activeIds.add(JSON.stringify(ids.slice(0, x)));\n }\n });\n\n if (activeIds.size)\n hoverFunction = (d: DataPoint, i: number) =>\n activeIds.has(JSON.stringify(this._ids(d, i)));\n }\n\n this._shapes.forEach((s: {hover: (...args: unknown[]) => unknown}) => s.hover(hoverFunction));\n if (this.schema.legend) this._legendClass.hover(hoverFunction);\n }\n\n // Scene-rendered charts emit into `_chartScene` (not `_shapes`), so the\n // forEach above is a no-op for them. Repaint so the scene's\n // interaction-opacity pass re-reads `_hover` and dims the non-matching\n // nodes (or restores them when `_` is `false`). Also repaint for a\n // colorScale-bucket hover even when per-shape dimming is off\n // (`hoverOpacity: 1`, e.g. Geomap): the bucket highlight is applied by that\n // same pass, so without a repaint the map would never re-compose. Coalesced\n // to one paint per frame so a fast pointer sweep doesn't saturate the main\n // thread.\n if (\n this._sceneRenderer &&\n _ !== undefined &&\n (this.schema.shapeConfig.hoverOpacity !== 1 || this._hoverBucket)\n )\n this._scheduleSceneRepaint();\n\n return this;\n }\n\n /**\n Persistently emphasizes the data points matching the given predicate: the\n matching marks keep their color while every other mark is de-emphasized to\n a neutral gray (the \"emphasis\" form — highlight one series, gray the rest).\n Unlike `hover`/`active` (transient, opacity-based), `highlight` is a\n standing state that survives pointer movement. Pass `false` to clear it.\n*/\n highlight(\n _?: ((d: DataPoint, i: number) => boolean) | false,\n ): this | ((d: DataPoint, i: number) => boolean) | false | undefined {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n // Scene-rendered charts express de-emphasis via the scene's\n // interaction-opacity pass, so repaint to apply/clear the gray treatment.\n if (this._sceneRenderer) this._scheduleSceneRepaint();\n return this;\n }\n\n /**\n Accessor function, or a constant string applied to every data point's\n label (unlike `value`/`nodeId`/etc., a string here is not treated as a\n per-datum object key — pass a function for that).\n*/\n label(\n _?: string | ((d: DataPoint, i: number) => string),\n ): this | string | ((d: DataPoint, i: number) => string) {\n return arguments.length\n ? ((this.schema.label = typeof _ === \"function\" ? _ : constant(_)), this)\n : this.schema.label;\n }\n\n /**\n Whether to display the legend.\n*/\n legend(\n _?:\n | boolean\n | ((config: Record<string, unknown>, arr: DataPoint[]) => boolean),\n ):\n | this\n | boolean\n | ((config: Record<string, unknown>, arr: DataPoint[]) => boolean) {\n return arguments.length\n ? ((this.schema.legend = typeof _ === \"function\" ? _ : constant(_)), this)\n : this.schema.legend;\n }\n\n /**\n Configuration object passed to the legend's config method.\n*/\n legendConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.legendConfig = assign(this.schema.legendConfig, _!)), this)\n : this.schema.legendConfig;\n }\n\n /**\n Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking with solo that category and shift+clicking will hide that category.\n*/\n legendFilterInvert(\n _?: boolean | ((viz: VizBase) => boolean),\n ): this | boolean | ((viz: VizBase) => boolean) {\n return arguments.length\n ? ((this.schema.legendFilterInvert = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.legendFilterInvert;\n }\n\n /**\n Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.\n*/\n legendPadding(\n _?: boolean | ((viz: VizBase) => boolean),\n ): this | boolean | ((viz: VizBase) => boolean) {\n return arguments.length\n ? ((this.schema.legendPadding = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.legendPadding;\n }\n\n /**\n Defines which side of the visualization to anchor the legend. Expected values are `\"top\"`, `\"bottom\"`, `\"left\"`, and `\"right\"`.\n*/\n legendPosition(_?: string | (() => string)): this | string | (() => string) {\n return arguments.length\n ? ((this.schema.legendPosition = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.legendPosition;\n }\n\n /**\n Configuration object for the legend tooltip.\n*/\n legendTooltip(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.legendTooltip = assign(this.schema.legendTooltip, _!)), this)\n : this.schema.legendTooltip;\n }\n}\n"],"names":["merge","arrayMerge","addToQueue","unique","assign","fontFamilyStringify","accessor","BaseClass","constant","VizBaseConfig","active","_","_active","schema","shapeConfig","activeOpacity","_shapes","forEach","s","legend","_legendClass","_sceneRenderer","_scheduleSceneRepaint","aggs","arguments","length","attribution","attributionIcon","attributionStyle","backConfig","backControlClassName","backControlStyle","color","colorScale","colorScaleConfig","colorScalePadding","colorScalePosition","colorScaleMaxSize","data","f","bind","_hidden","_solo","_userData","JSON","stringify","timeFilter","_timelineSelection","_data","detectResize","detectResizeDelay","detectVisible","detectVisibleInterval","detectVisibleUnload","downloadButton","downloadConfig","downloadPosition","fontFamily","labelConfig","axisConfig","titleConfig","axis","method","label","tooltipConfig","tooltipStyle","groupBy","_groupByRaw","arr","Array","map","k","a","c","v","hiddenColor","hiddenOpacity","hover","hoverFunction","_hover","hoverOpacity","undefined","shapeData","concat","activeData","filter","activeIds","Set","_ids","ids","x","add","slice","size","d","i","has","_hoverBucket","highlight","_highlight","legendConfig","legendFilterInvert","legendPadding","legendPosition","legendTooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,SAASC,UAAU,QAAO,WAAW;AAE7C,SAAQC,UAAU,EAAEC,MAAM,QAAO,eAAe;AAChD,SAAQC,MAAM,QAAO,cAAc;AACnC,SAAQC,mBAAmB,QAAO,eAAe;AAGjD,SAAQC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAO,uBAAuB;AAUpD,IAAA,AAAMC,8BAAN;;cAAMA;aAAAA;gCAAAA;QAAN,OAAA,kBAAMA;;kBAAAA;;YAQnB;;AAEF,GACEC,KAAAA;mBAAAA,SAAAA,OACEC,CAAkD;gBAElD,IAAI,CAACC,OAAO,GAAGD;gBAEf,IAAI,IAAI,CAACE,MAAM,CAACC,WAAW,CAACC,aAAa,KAAK,GAAG;oBAC/C,IAAI,CAACC,OAAO,CAACC,OAAO,CAAC,SAACC;+BAAiDA,EAAER,MAAM,CAACC;;oBAChF,IAAI,IAAI,CAACE,MAAM,CAACM,MAAM,EAAE,IAAI,CAACC,YAAY,CAACV,MAAM,CAACC;oBACjD,yDAAyD;oBACzD,oEAAoE;oBACpE,IAAI,IAAI,CAACU,cAAc,EAAE,IAAI,CAACC,qBAAqB;gBACrD;gBAEA,OAAO,IAAI;YACb;;;YAEA;;AAEF,GACEC,KAAAA;mBAAAA,SAAAA,KAAKZ,CAA2B;gBAC9B,OAAOa,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACZ,MAAM,CAACU,IAAI,GAAGnB,OAAO,IAAI,CAACS,MAAM,CAACU,IAAI,EAAEZ,IAAM,IAAI,AAAD,IAC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gBAEzC,OAAOa,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACZ,MAAM,CAACwF,kBAAkB,GAAG,OAAO1F,MAAM,aAAaA,IAAIH,SAASG,IAC1E,IAAI,AAAD,IACH,IAAI,CAACE,MAAM,CAACwF,kBAAkB;YACpC;;;YAEA;;AAEF,GACEC,KAAAA;mBAAAA,SAAAA,cACE3F,CAAyC;gBAEzC,OAAOa,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACZ,MAAM,CAACyF,aAAa,GAAG,OAAO3F,MAAM,aAAaA,IAAIH,SAASG,IACrE,IAAI,AAAD,IACH,IAAI,CAACE,MAAM,CAACyF,aAAa;YAC/B;;;YAEA;;AAEF,GACEC,KAAAA;mBAAAA,SAAAA,eAAe5F,CAA2B;gBACxC,OAAOa,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACZ,MAAM,CAAC0F,cAAc,GAAG,OAAO5F,MAAM,aAAaA,IAAIH,SAASG,IACtE,IAAI,AAAD,IACH,IAAI,CAACE,MAAM,CAAC0F,cAAc;YAChC;;;YAEA;;AAEF,GACEC,KAAAA;mBAAAA,SAAAA,cAAc7F,CAA2B;gBACvC,OAAOa,UAAUC,MAAM,GAClB,CAAA,AAAC,IAAI,CAACZ,MAAM,CAAC2F,aAAa,GAAGpG,OAAO,IAAI,CAACS,MAAM,CAAC2F,aAAa,EAAE7F,IAAM,IAAI,AAAD,IACzE,IAAI,CAACE,MAAM,CAAC2F,aAAa;YAC/B;;;WAzhBmB/F;EAAsBF;AAP3C;;;;;;AAMA,GACA,SAAqBE,2BA0hBpB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/charts/viz/VizBaseConfig.ts"],"sourcesContent":["import {merge as arrayMerge} from \"d3-array\";\n\nimport {addToQueue, unique} from \"@d3plus/data\";\nimport {assign} from \"@d3plus/dom\";\nimport {fontFamilyStringify} from \"@d3plus/text\";\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport {accessor, BaseClass, constant} from \"../../utils/index.js\";\nimport {broadcastLink} from \"./linkGroup.js\";\nimport type {VizInstance} from \"./vizTypes.js\";\nimport type VizBase from \"./VizBase.js\";\n\n/**\n First half of the fluent config accessors shared by every Viz chart\n (`active` through `legendTooltip`). Split from `VizBase` purely so each\n file stays under the `max-lines` budget; the methods remain real prototype\n methods, so `BaseClass.config()` reflection and polymorphic `this` chaining\n are unchanged.\n*/\nexport default class VizBaseConfig extends BaseClass {\n // installFluent generates the config accessors (data, sum, x, …) and the\n // pipeline stamps derived `_`-prefixed state at runtime; the index signature\n // lets the chart code reach both through the type (same rationale as the\n // shape/component classes).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n\n /**\n The active callback function for highlighting shapes.\n*/\n active(\n _?: ((d: DataPoint, i: number) => boolean) | false,\n ): this | ((d: DataPoint, i: number) => boolean) | false {\n this._active = _;\n\n if (this.schema.shapeConfig.activeOpacity !== 1) {\n this._shapes.forEach((s: {active: (...args: unknown[]) => unknown}) => s.active(_));\n if (this.schema.legend) this._legendClass.active(_);\n // See hover(): scene-rendered charts dim via the scene's\n // interaction-opacity pass, so repaint to apply/clear active state.\n if (this._sceneRenderer) this._scheduleSceneRepaint();\n }\n\n broadcastLink(this as unknown as VizInstance, \"active\", _);\n return this;\n }\n\n /**\n Custom aggregation methods for each data key.\n*/\n aggs(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.aggs = assign(this.schema.aggs, _!)), this)\n : this.schema.aggs;\n }\n\n /**\n Sets text to be shown positioned absolute on top of the visualization in the bottom-right corner. This is most often used in Geomaps to display the copyright of map tiles. The text is rendered as HTML, so any valid HTML string will render as expected (eg. anchor links work).\n*/\n attribution(_?: string | boolean): this | string | boolean {\n return arguments.length\n ? ((this.schema.attribution = _), this)\n : this.schema.attribution;\n }\n\n /**\n Overrides the \"ⓘ\" icon a long attribution collapses to (see `attribution`), which otherwise renders as an inline SVG. Accepts an HTML string — used as the toggle button's content — or a mount function, `(el: HTMLElement) => void | (() => void)`, called once with the button's reserved icon slot so a live component (a React tree via `createRoot(el).render(...)`, or anything else imperative) can be mounted into it. A returned cleanup function runs right before that slot is discarded, which happens whenever the credit's markup regenerates (its text or theme changes), not just once per chart.\n*/\n attributionIcon(\n _?: string | ((el: HTMLElement) => void | (() => void)),\n ): this | string | ((el: HTMLElement) => void | (() => void)) | undefined {\n return arguments.length\n ? ((this.schema.attributionIcon = _), this)\n : (this.schema.attributionIcon as\n | string\n | ((el: HTMLElement) => void | (() => void))\n | undefined);\n }\n\n /**\n Configuration object for the attribution style.\n*/\n attributionStyle(\n _?: Record<string, unknown>,\n ): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.attributionStyle = assign(this.schema.attributionStyle, _!)), this)\n : this.schema.attributionStyle;\n }\n\n /**\n Configuration object for the back button. Superseded by\n `.backControlStyle()`/`.backControlClassName()` for the button's\n appearance (it renders as a real `<button>`, like the zoom/search\n controls, not a configurable text node) — kept for backwards\n compatibility, but no longer affects how the button looks.\n*/\n backConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.backConfig = assign(this.schema.backConfig, _!)), this)\n : this.schema.backConfig;\n }\n\n /**\n An additional CSS class name (or space-separated list of class names) applied to the back button, alongside its fixed `back-control` class. Setting this automatically disables d3plus's built-in inline `backControlStyle` default (as long as you haven't already customized it yourself), so a host page's own button styling — Tailwind, Bootstrap, a design system — applies through the cascade with no other configuration needed.\n*/\n backControlClassName(_?: string): this | string {\n return arguments.length\n ? ((this.schema.backControlClassName = _), this)\n : this.schema.backControlClassName;\n }\n\n /**\n An object containing CSS key/value pairs that is used to style the back button. Passing `false` will remove all default styling. Automatically skipped (as if `false`) once `.backControlClassName(...)` is set, unless you've explicitly customized this yourself.\n*/\n backControlStyle(\n _?: Record<string, unknown> | false,\n ): this | Record<string, unknown> | false {\n return arguments.length\n ? ((this.schema.backControlStyle = _), this)\n : this.schema.backControlStyle;\n }\n\n /**\n Defines the main color to be used for each data point in a visualization. Can be either an accessor function or a string key to reference in each data point. If a color value is returned, it will be used as is. If a string is returned, a unique color will be assigned based on the string.\n*/\n color(\n _?:\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false,\n ):\n | this\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false {\n return arguments.length\n ? ((this.schema.color = !_ || typeof _ === \"function\" ? _ : accessor(_)), this)\n : this.schema.color;\n }\n\n /**\n Defines the value to be used for a color scale. Can be either an accessor function or a string key to reference in each data point.\n*/\n colorScale(\n _?:\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false,\n ):\n | this\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | false {\n return arguments.length\n ? ((this.schema.colorScale = !_ || typeof _ === \"function\" ? _ : accessor(_)),\n this)\n : this.schema.colorScale;\n }\n\n /**\n A pass-through to the config method of ColorScale.\n*/\n colorScaleConfig(\n _?: Record<string, unknown>,\n ): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.colorScaleConfig = assign(this.schema.colorScaleConfig, _!)), this)\n : this.schema.colorScaleConfig;\n }\n\n /**\n Tells the colorScale whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the colorScale appears centered above the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.\n*/\n colorScalePadding(\n _?: boolean | ((viz: VizBase) => boolean),\n ): this | boolean | ((viz: VizBase) => boolean) {\n return arguments.length\n ? ((this.schema.colorScalePadding = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.colorScalePadding;\n }\n\n /**\n Defines which side of the visualization to anchor the color scale. Acceptable values are `\"top\"`, `\"bottom\"`, `\"left\"`, `\"right\"`, and `false`. A `false` value will cause the color scale to not be displayed, but will still color shapes based on the scale.\n*/\n colorScalePosition(\n _?: string | boolean | (() => string | boolean),\n ): this | string | boolean | (() => string | boolean) {\n return arguments.length\n ? ((this.schema.colorScalePosition = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.colorScalePosition;\n }\n\n /**\n The maximum pixel size for drawing the color scale: width for horizontal scales and height for vertical scales.\n*/\n colorScaleMaxSize(_?: number): this | number {\n return arguments.length\n ? ((this.schema.colorScaleMaxSize = _), this)\n : this.schema.colorScaleMaxSize;\n }\n\n /**\n The primary data array used to draw the visualization. The value passed should be an *Array* of objects or a *String* representing a filepath or URL to be loaded. The following filetypes are supported: `csv`, `tsv`, `txt`, and `json`.\n\nIf your data URL needs specific headers to be set, an Object with \"url\" and \"headers\" keys may also be passed.\n\nAdditionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final array of obejcts to be used as the primary data array. For example, some JSON APIs return the headers split from the data values to save bandwidth. These would need be joined using a custom formatter.\n\nIf you would like to specify certain configuration options based on the yet-to-be-loaded data, you can also return a full `config` object from the data formatter (including the new `data` array as a key in the object).\n\nDefaults to an empty array (`[]`).\n @param f The data array or a URL string to load data from.\n */\n data(\n _?: DataPoint[] | string | {url: string; headers: Record<string, string>},\n f?: (data: DataPoint[]) => DataPoint[] | Record<string, unknown>,\n ): this | DataPoint[] {\n if (arguments.length) {\n addToQueue.bind(this as unknown as ThisParameterType<typeof addToQueue>)(\n _!,\n f,\n \"data\",\n );\n this._hidden = [];\n this._solo = [];\n if (\n this._userData &&\n JSON.stringify(_) !== JSON.stringify(this._userData)\n ) {\n this.schema.timeFilter = false;\n this._timelineSelection = false;\n }\n this._userData = _;\n return this;\n }\n return this._data;\n }\n\n /**\n If the width and/or height of a Viz is not user-defined, it is determined by the size of it's parent element. When this method is set to `true`, the Viz will listen for the `window.onresize` event and adjust it's dimensions accordingly.\n*/\n detectResize(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.detectResize = _), this)\n : this.schema.detectResize;\n }\n\n /**\n When resizing the browser window, this is the millisecond delay to trigger the resize event.\n*/\n detectResizeDelay(_?: number): this | number {\n return arguments.length\n ? ((this.schema.detectResizeDelay = _), this)\n : this.schema.detectResizeDelay;\n }\n\n /**\n Toggles whether or not the Viz should try to detect if it visible in the current viewport. When this method is set to `true`, the Viz will only be rendered when it has entered the viewport either through scrolling or if it's display or visibility is changed.\n*/\n detectVisible(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.detectVisible = _), this)\n : this.schema.detectVisible;\n }\n\n /**\n The interval, in milliseconds, for checking if the visualization is visible on the page. When `detectVisible` defers a render until the visualization scrolls into view, this is also how long it must stay in view before it renders, so visualizations scrolled past quickly are never drawn.\n*/\n detectVisibleInterval(_?: number): this | number {\n return arguments.length\n ? ((this.schema.detectVisibleInterval = _), this)\n : this.schema.detectVisibleInterval;\n }\n\n /**\n When `true` (the default) and `detectVisible` is enabled, the Viz releases its DOM and scene while it is scrolled out of view and redraws when it returns, keeping the page light when there are many visualizations. Data and configuration are retained; interaction state such as zoom or selection is not, so set this to `false` to keep it. With `detectVisible` enabled, each chart's `<svg>` is also given `content-visibility: auto`, so the browser skips rendering its contents while it is far off-screen (this matters most when this is `false` and charts are kept). For a larger saving you can also apply `content-visibility: auto` and a `contain-intrinsic-size` to the container element yourself; that adds paint containment to an element you own, so it is not done automatically. Requires `IntersectionObserver`.\n*/\n detectVisibleUnload(_?: boolean): this | boolean {\n return arguments.length\n ? ((this.schema.detectVisibleUnload = _), this)\n : this.schema.detectVisibleUnload;\n }\n\n /**\n The font family used throughout the visualization.\n*/\n fontFamily(_?: string | string[]): this | string | string[] {\n if (arguments.length) {\n const labelConfig = {fontFamily: _};\n\n const axisConfig = {titleConfig: labelConfig, shapeConfig: {labelConfig}};\n\n this.shapeConfig({labelConfig});\n this.colorScaleConfig({axisConfig});\n\n [\"axis\", \"column\", \"row\", \"timeline\", \"x\", \"y\", \"x2\", \"y2\"].forEach(\n (axis: string) => {\n const method = `${axis}Config`;\n if (this[method]) this[method](axisConfig);\n },\n );\n [\"back\", \"title\", \"total\", \"subtitle\"].forEach((label: string) => {\n const method = `${label}Config`;\n if (this[method]) this[method](labelConfig);\n });\n\n this.tooltipConfig({\n tooltipStyle: {\"font-family\": fontFamilyStringify(_!)},\n });\n\n this.schema.fontFamily = _;\n return this;\n }\n return this.schema.fontFamily;\n }\n\n /**\n Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is \"id\"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.\n*/\n groupBy(\n _?:\n | string\n | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])\n | (string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]))[],\n ): this | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint])[] {\n if (!arguments.length) return this.schema.groupBy;\n this._groupByRaw = _;\n const arr: (string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]))[] =\n _ instanceof Array ? _ : [_!];\n return (\n (this.schema.groupBy = arr.map(\n (\n k: string | ((d: DataPoint, i: number) => DataPoint[keyof DataPoint]),\n ) => {\n if (typeof k === \"function\") return k;\n else {\n if (!this.schema.aggs[k]) {\n this.schema.aggs[k] = (\n a: DataPoint[],\n c: (d: DataPoint) => DataPoint[keyof DataPoint],\n ) => {\n const v = unique(a.map(c));\n return v.length === 1 ? v[0] : v;\n };\n }\n return accessor(k);\n }\n },\n )),\n this\n );\n }\n\n /**\n Defines the color used for legend shapes when the corresponding grouping is hidden from display (by clicking on the legend).\n*/\n hiddenColor(\n _?: string | ((d: DataPoint, i: number) => string),\n ): this | string | ((d: DataPoint, i: number) => string) {\n return arguments.length\n ? ((this.schema.hiddenColor = typeof _ === \"function\" ? _ : constant(_)), this)\n : this.schema.hiddenColor;\n }\n\n /**\n Defines the opacity used for legend labels when the corresponding grouping is hidden from display (by clicking on the legend).\n*/\n hiddenOpacity(\n _?: number | ((d: DataPoint, i: number) => number),\n ): this | number | ((d: DataPoint, i: number) => number) {\n return arguments.length\n ? ((this.schema.hiddenOpacity = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.hiddenOpacity;\n }\n\n /**\n The hover callback function for highlighting shapes on mouseover.\n*/\n hover(_?: ((d: DataPoint, i: number) => boolean) | false): this {\n let hoverFunction = (this._hover = _);\n\n if (this.schema.shapeConfig.hoverOpacity !== 1 && _ !== undefined) {\n if (typeof _ === \"function\") {\n let shapeData = arrayMerge(\n this._shapes.map((s: {data: () => DataPoint[]}) => s.data()),\n );\n shapeData = shapeData.concat(this._legendClass.data());\n const activeData = _ ? (shapeData as DataPoint[]).filter(_ as (d: DataPoint) => boolean) : [];\n\n // Build a Set<string> of activeIds for O(1) membership lookup.\n // Previously `activeIds.filter((id, i) => activeIds.indexOf(id) === i)`\n // was O(N²) dedup, and the hover predicate did `activeIds.includes(...)`\n // — also O(N) per datum per repaint. With ~5k segments, hover\n // dispatch was ~250 ms on a 2023 laptop; Set drops it to <5 ms.\n const activeIds = new Set<string>();\n (activeData.map(this._ids) as string[][]).forEach((ids: string[]) => {\n for (let x = 1; x <= ids.length; x++) {\n activeIds.add(JSON.stringify(ids.slice(0, x)));\n }\n });\n\n if (activeIds.size)\n hoverFunction = (d: DataPoint, i: number) =>\n activeIds.has(JSON.stringify(this._ids(d, i)));\n }\n\n this._shapes.forEach((s: {hover: (...args: unknown[]) => unknown}) => s.hover(hoverFunction));\n if (this.schema.legend) this._legendClass.hover(hoverFunction);\n }\n\n // Scene-rendered charts emit into `_chartScene` (not `_shapes`), so the\n // forEach above is a no-op for them. Repaint so the scene's\n // interaction-opacity pass re-reads `_hover` and dims the non-matching\n // nodes (or restores them when `_` is `false`). Also repaint for a\n // colorScale-bucket hover even when per-shape dimming is off\n // (`hoverOpacity: 1`, e.g. Geomap): the bucket highlight is applied by that\n // same pass, so without a repaint the map would never re-compose. Coalesced\n // to one paint per frame so a fast pointer sweep doesn't saturate the main\n // thread.\n if (\n this._sceneRenderer &&\n _ !== undefined &&\n (this.schema.shapeConfig.hoverOpacity !== 1 || this._hoverBucket)\n )\n this._scheduleSceneRepaint();\n\n broadcastLink(this as unknown as VizInstance, \"hover\", _);\n return this;\n }\n\n /**\n Persistently emphasizes the data points matching the given predicate: the\n matching marks keep their color while every other mark is de-emphasized to\n a neutral gray (the \"emphasis\" form — highlight one series, gray the rest).\n Unlike `hover`/`active` (transient, opacity-based), `highlight` is a\n standing state that survives pointer movement. Pass `false` to clear it.\n*/\n highlight(\n _?: ((d: DataPoint, i: number) => boolean) | false,\n ): this | ((d: DataPoint, i: number) => boolean) | false | undefined {\n if (!arguments.length) return this._highlight;\n this._highlight = _;\n // Scene-rendered charts express de-emphasis via the scene's\n // interaction-opacity pass, so repaint to apply/clear the gray treatment.\n if (this._sceneRenderer) this._scheduleSceneRepaint();\n broadcastLink(this as unknown as VizInstance, \"highlight\", _);\n return this;\n }\n\n /**\n Accessor function, or a constant string applied to every data point's\n label (unlike `value`/`nodeId`/etc., a string here is not treated as a\n per-datum object key — pass a function for that).\n*/\n label(\n _?: string | ((d: DataPoint, i: number) => string),\n ): this | string | ((d: DataPoint, i: number) => string) {\n return arguments.length\n ? ((this.schema.label = typeof _ === \"function\" ? _ : constant(_)), this)\n : this.schema.label;\n }\n\n /**\n Whether to display the legend.\n*/\n legend(\n _?:\n | boolean\n | ((config: Record<string, unknown>, arr: DataPoint[]) => boolean),\n ):\n | this\n | boolean\n | ((config: Record<string, unknown>, arr: DataPoint[]) => boolean) {\n return arguments.length\n ? ((this.schema.legend = typeof _ === \"function\" ? _ : constant(_)), this)\n : this.schema.legend;\n }\n\n /**\n Configuration object passed to the legend's config method.\n*/\n legendConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.legendConfig = assign(this.schema.legendConfig, _!)), this)\n : this.schema.legendConfig;\n }\n\n /**\n Defines the click functionality of categorical legend squares. When set to false, clicking will hide that category and shift+clicking will solo that category. When set to true, clicking with solo that category and shift+clicking will hide that category.\n*/\n legendFilterInvert(\n _?: boolean | ((viz: VizBase) => boolean),\n ): this | boolean | ((viz: VizBase) => boolean) {\n return arguments.length\n ? ((this.schema.legendFilterInvert = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.legendFilterInvert;\n }\n\n /**\n Whether the chart may draw one of its legends inside the empty space around its marks instead of in a margin, for charts that leave room (Plot, Network, Pack, Pie, Rings, Tree, and Geomap). After the chart lays out, the size legend is tried first, then the legend, then the colorScale; the first that fits is drawn over a semi-transparent box (see `legendInsetConfig`), and any others keep their margins. Space enclosed by the marks, like the middle of a ring of points, is never used. A legend or colorScale whose position was set explicitly stays in that margin. Defaults to `true`; also accepts a function that receives the resolved chart config and returns a boolean.\n*/\n legendInset(\n _?: boolean | ((config: Record<string, unknown>) => boolean),\n ): this | boolean | ((config: Record<string, unknown>) => boolean) {\n return arguments.length\n ? ((this.schema.legendInset = _), this)\n : this.schema.legendInset;\n }\n\n /**\n Style of the box drawn behind a legend placed inside the chart (see `legendInset`): `fill` (defaults to the chart's background color), `fillOpacity` (0.85), `stroke` (defaults to a faint contrasting line), `strokeWidth` (1), `rx` (corner radius, 4), `margin` (space between the box's edge and the legend, 6), and `padding` (space kept between the box and the chart's marks and edges, 10).\n*/\n legendInsetConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.legendInsetConfig = assign(this.schema.legendInsetConfig, _!)), this)\n : this.schema.legendInsetConfig;\n }\n\n /**\n Tells the legend whether or not to use the internal padding defined by the visualization in it's positioning. For example, d3plus-plot will add padding on the left so that the legend appears centered underneath the x-axis. By default, this padding is only applied on screens larger than 600 pixels wide.\n*/\n legendPadding(\n _?: boolean | ((viz: VizBase) => boolean),\n ): this | boolean | ((viz: VizBase) => boolean) {\n return arguments.length\n ? ((this.schema.legendPadding = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.legendPadding;\n }\n\n /**\n Defines which side of the visualization to anchor the legend. Expected values are `\"top\"`, `\"bottom\"`, `\"left\"`, and `\"right\"`.\n*/\n legendPosition(_?: string | (() => string)): this | string | (() => string) {\n return arguments.length\n ? ((this.schema.legendPosition = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this.schema.legendPosition;\n }\n\n /**\n Configuration object for the legend tooltip.\n*/\n legendTooltip(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this.schema.legendTooltip = assign(this.schema.legendTooltip, _!)), this)\n : this.schema.legendTooltip;\n }\n}\n"],"names":["merge","arrayMerge","addToQueue","unique","assign","fontFamilyStringify","accessor","BaseClass","constant","broadcastLink","VizBaseConfig","active","_","_active","schema","shapeConfig","activeOpacity","_shapes","forEach","s","legend","_legendClass","_sceneRenderer","_scheduleSceneRepaint","aggs","arguments","length","attribution","attributionIcon","attributionStyle","backConfig","backControlClassName","backControlStyle","color","colorScale","colorScaleConfig","colorScalePadding","colorScalePosition","colorScaleMaxSize","data","f","bind","_hidden","_solo","_userData","JSON","stringify","timeFilter","_timelineSelection","_data","detectResize","detectResizeDelay","detectVisible","detectVisibleInterval","detectVisibleUnload","fontFamily","labelConfig","axisConfig","titleConfig","axis","method","label","tooltipConfig","tooltipStyle","groupBy","_groupByRaw","arr","Array","map","k","a","c","v","hiddenColor","hiddenOpacity","hover","hoverFunction","_hover","hoverOpacity","undefined","shapeData","concat","activeData","filter","activeIds","Set","_ids","ids","x","add","slice","size","d","i","has","_hoverBucket","highlight","_highlight","legendConfig","legendFilterInvert","legendInset","legendInsetConfig","legendPadding","legendPosition","legendTooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,SAASC,UAAU,QAAO,WAAW;AAE7C,SAAQC,UAAU,EAAEC,MAAM,QAAO,eAAe;AAChD,SAAQC,MAAM,QAAO,cAAc;AACnC,SAAQC,mBAAmB,QAAO,eAAe;AAGjD,SAAQC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAO,uBAAuB;AACnE,SAAQC,aAAa,QAAO,iBAAiB;AAW9B,IAAA,AAAMC,8BAAN;;cAAMA;aAAAA;gCAAA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