@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.
Files changed (172) hide show
  1. package/README.md +728 -1454
  2. package/es/index.js.map +1 -1
  3. package/es/internal.js +5 -0
  4. package/es/internal.js.map +1 -1
  5. package/es/src/charts/Chord/index.js +2 -0
  6. package/es/src/charts/Chord/index.js.map +1 -1
  7. package/es/src/charts/Geomap/applyLayout.js +3 -1
  8. package/es/src/charts/Geomap/applyLayout.js.map +1 -1
  9. package/es/src/charts/Geomap/index.js +3 -1
  10. package/es/src/charts/Geomap/index.js.map +1 -1
  11. package/es/src/charts/Matrix/emit.js +5 -4
  12. package/es/src/charts/Matrix/emit.js.map +1 -1
  13. package/es/src/charts/Network/index.js +4 -0
  14. package/es/src/charts/Network/index.js.map +1 -1
  15. package/es/src/charts/Pack/emit.js +6 -6
  16. package/es/src/charts/Pack/emit.js.map +1 -1
  17. package/es/src/charts/Pack/index.js +2 -0
  18. package/es/src/charts/Pack/index.js.map +1 -1
  19. package/es/src/charts/Pie/emit.js +5 -6
  20. package/es/src/charts/Pie/emit.js.map +1 -1
  21. package/es/src/charts/Pie/index.js +2 -0
  22. package/es/src/charts/Pie/index.js.map +1 -1
  23. package/es/src/charts/Plot/index.js +15 -1
  24. package/es/src/charts/Plot/index.js.map +1 -1
  25. package/es/src/charts/Plot/insetRegion.js +21 -0
  26. package/es/src/charts/Plot/insetRegion.js.map +1 -0
  27. package/es/src/charts/Plot/sharedHover.js +117 -16
  28. package/es/src/charts/Plot/sharedHover.js.map +1 -1
  29. package/es/src/charts/Plot/sharedTooltip.js +35 -15
  30. package/es/src/charts/Plot/sharedTooltip.js.map +1 -1
  31. package/es/src/charts/Plot/trendLines.js +140 -38
  32. package/es/src/charts/Plot/trendLines.js.map +1 -1
  33. package/es/src/charts/Plot/trendProjection.js +120 -0
  34. package/es/src/charts/Plot/trendProjection.js.map +1 -0
  35. package/es/src/charts/Plot/trendScene.js +33 -19
  36. package/es/src/charts/Plot/trendScene.js.map +1 -1
  37. package/es/src/charts/Plot/trendTooltip.js +79 -17
  38. package/es/src/charts/Plot/trendTooltip.js.map +1 -1
  39. package/es/src/charts/Priestley/emit.js +3 -4
  40. package/es/src/charts/Priestley/emit.js.map +1 -1
  41. package/es/src/charts/RadialMatrix/emit.js +4 -4
  42. package/es/src/charts/RadialMatrix/emit.js.map +1 -1
  43. package/es/src/charts/Rings/index.js +5 -1
  44. package/es/src/charts/Rings/index.js.map +1 -1
  45. package/es/src/charts/Sankey/index.js +2 -0
  46. package/es/src/charts/Sankey/index.js.map +1 -1
  47. package/es/src/charts/Tree/index.js +2 -0
  48. package/es/src/charts/Tree/index.js.map +1 -1
  49. package/es/src/charts/Treemap/emit.js +3 -4
  50. package/es/src/charts/Treemap/emit.js.map +1 -1
  51. package/es/src/charts/definition/ChartDefinition.js.map +1 -1
  52. package/es/src/charts/definition/makeChart.js +8 -2
  53. package/es/src/charts/definition/makeChart.js.map +1 -1
  54. package/es/src/charts/drawSteps/bottomRightControls.js +3 -0
  55. package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -1
  56. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +135 -4
  57. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -1
  58. package/es/src/charts/drawSteps/searchControlsMarkup.js +15 -38
  59. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -1
  60. package/es/src/charts/events/click.legend.js +10 -5
  61. package/es/src/charts/events/click.legend.js.map +1 -1
  62. package/es/src/charts/events/mousemove.shape.js +8 -1
  63. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  64. package/es/src/charts/features/emitHelpers.js +19 -5
  65. package/es/src/charts/features/emitHelpers.js.map +1 -1
  66. package/es/src/charts/features/features.js +3 -108
  67. package/es/src/charts/features/features.js.map +1 -1
  68. package/es/src/charts/features/featuresColorScale.js +161 -0
  69. package/es/src/charts/features/featuresColorScale.js.map +1 -0
  70. package/es/src/charts/features/featuresLegend.js +145 -32
  71. package/es/src/charts/features/featuresLegend.js.map +1 -1
  72. package/es/src/charts/features/insetState.js +174 -0
  73. package/es/src/charts/features/insetState.js.map +1 -0
  74. package/es/src/charts/features/sceneBounds.js +271 -0
  75. package/es/src/charts/features/sceneBounds.js.map +1 -0
  76. package/es/src/charts/features/tooltipSwatch.js +73 -0
  77. package/es/src/charts/features/tooltipSwatch.js.map +1 -0
  78. package/es/src/charts/pipeline/insetPlacement.js +406 -0
  79. package/es/src/charts/pipeline/insetPlacement.js.map +1 -0
  80. package/es/src/charts/pipeline/runVizPipeline.js +6 -2
  81. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
  82. package/es/src/charts/viz/Viz.js +18 -3
  83. package/es/src/charts/viz/Viz.js.map +1 -1
  84. package/es/src/charts/viz/VizBaseConfig.js +20 -24
  85. package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
  86. package/es/src/charts/viz/interactionOpacity.js +21 -13
  87. package/es/src/charts/viz/interactionOpacity.js.map +1 -1
  88. package/es/src/charts/viz/linkGroup.js +386 -0
  89. package/es/src/charts/viz/linkGroup.js.map +1 -0
  90. package/es/src/charts/viz/sceneRows.js +33 -0
  91. package/es/src/charts/viz/sceneRows.js.map +1 -0
  92. package/es/src/charts/viz/vizDefaults.js +13 -8
  93. package/es/src/charts/viz/vizDefaults.js.map +1 -1
  94. package/es/src/charts/viz/vizTypes.js.map +1 -1
  95. package/es/src/components/Axis/AxisBottom.js +1 -1
  96. package/es/src/components/Axis/AxisBottom.js.map +1 -1
  97. package/es/src/components/Axis/AxisLeft.js +1 -1
  98. package/es/src/components/Axis/AxisLeft.js.map +1 -1
  99. package/es/src/components/Axis/AxisRight.js +1 -1
  100. package/es/src/components/Axis/AxisRight.js.map +1 -1
  101. package/es/src/components/Axis/AxisTop.js +1 -1
  102. package/es/src/components/Axis/AxisTop.js.map +1 -1
  103. package/es/src/components/Axis/axisLayoutLabels.js +13 -1
  104. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
  105. package/es/src/components/ColorScale/ColorScale.js.map +1 -1
  106. package/es/src/components/Legend/legendConfig.js +2 -1
  107. package/es/src/components/Legend/legendConfig.js.map +1 -1
  108. package/es/src/components/Legend/legendRender.js +42 -5
  109. package/es/src/components/Legend/legendRender.js.map +1 -1
  110. package/es/src/components/TextBox.js +1 -1
  111. package/es/src/components/TextBox.js.map +1 -1
  112. package/es/src/shapes/Bar.js +1 -1
  113. package/es/src/shapes/Bar.js.map +1 -1
  114. package/es/src/shapes/Box.js +1 -1
  115. package/es/src/shapes/Box.js.map +1 -1
  116. package/es/src/shapes/Rect.js +1 -1
  117. package/es/src/shapes/Rect.js.map +1 -1
  118. package/es/src/shapes/Shape.js +9 -36
  119. package/es/src/shapes/Shape.js.map +1 -1
  120. package/es/src/shapes/Whisker.js +1 -1
  121. package/es/src/shapes/Whisker.js.map +1 -1
  122. package/es/src/shapes/textureKey.js +104 -0
  123. package/es/src/shapes/textureKey.js.map +1 -0
  124. package/es/src/utils/D3plusConfig.js.map +1 -1
  125. package/package.json +10 -9
  126. package/types/index.d.ts +1 -0
  127. package/types/internal.d.ts +7 -0
  128. package/types/src/charts/Plot/index.d.ts +8 -0
  129. package/types/src/charts/Plot/insetRegion.d.ts +4 -0
  130. package/types/src/charts/Plot/sharedHover.d.ts +5 -0
  131. package/types/src/charts/Plot/sharedTooltip.d.ts +10 -0
  132. package/types/src/charts/Plot/trendLines.d.ts +23 -3
  133. package/types/src/charts/Plot/trendProjection.d.ts +28 -0
  134. package/types/src/charts/Plot/trendScene.d.ts +2 -1
  135. package/types/src/charts/Plot/trendTooltip.d.ts +16 -5
  136. package/types/src/charts/definition/ChartDefinition.d.ts +9 -0
  137. package/types/src/charts/definition/makeChart.d.ts +2 -2
  138. package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +2 -0
  139. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +7 -5
  140. package/types/src/charts/features/emitHelpers.d.ts +10 -4
  141. package/types/src/charts/features/features.d.ts +1 -8
  142. package/types/src/charts/features/featuresColorScale.d.ts +24 -0
  143. package/types/src/charts/features/featuresLegend.d.ts +15 -0
  144. package/types/src/charts/features/insetState.d.ts +95 -0
  145. package/types/src/charts/features/sceneBounds.d.ts +18 -0
  146. package/types/src/charts/features/tooltipSwatch.d.ts +31 -0
  147. package/types/src/charts/pipeline/insetPlacement.d.ts +45 -0
  148. package/types/src/charts/pipeline/runVizPipeline.d.ts +2 -1
  149. package/types/src/charts/viz/Viz.d.ts +9 -1
  150. package/types/src/charts/viz/VizBaseConfig.d.ts +8 -12
  151. package/types/src/charts/viz/linkGroup.d.ts +96 -0
  152. package/types/src/charts/viz/sceneRows.d.ts +13 -0
  153. package/types/src/charts/viz/vizTypes.d.ts +17 -0
  154. package/types/src/components/Axis/AxisBottom.d.ts +1 -1
  155. package/types/src/components/Axis/AxisLeft.d.ts +1 -1
  156. package/types/src/components/Axis/AxisRight.d.ts +1 -1
  157. package/types/src/components/Axis/AxisTop.d.ts +1 -1
  158. package/types/src/components/ColorScale/ColorScale.d.ts +4 -4
  159. package/types/src/components/Legend/legendRender.d.ts +1 -1
  160. package/types/src/components/TextBox.d.ts +1 -1
  161. package/types/src/shapes/Bar.d.ts +1 -1
  162. package/types/src/shapes/Box.d.ts +1 -1
  163. package/types/src/shapes/Rect.d.ts +1 -1
  164. package/types/src/shapes/Whisker.d.ts +1 -1
  165. package/types/src/shapes/textureKey.d.ts +9 -0
  166. package/types/src/utils/D3plusConfig.d.ts +42 -1
  167. package/umd/d3plus-core.full.js +2393 -594
  168. package/umd/d3plus-core.full.js.map +1 -1
  169. package/umd/d3plus-core.full.min.js +1945 -1601
  170. package/umd/d3plus-core.js +1744 -404
  171. package/umd/d3plus-core.js.map +1 -1
  172. package/umd/d3plus-core.min.js +1401 -1087
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/charts/Plot/index.ts"],"sourcesContent":["/* eslint no-cond-assign: 0*/\n\n// @ts-ignore\nimport pkg from \"open-color/open-color.js\";\nimport {zoomTransform} from \"d3-zoom\";\nconst {theme: openColor} = pkg;\n\nimport {\n colorAssign,\n colorContrast,\n} from \"@d3plus/color\";\nimport {assign, backgroundColor} from \"@d3plus/dom\";\n\nimport {\n AxisBottom,\n AxisLeft,\n AxisRight,\n AxisTop,\n} from \"../../components/index.js\";\nimport {accessor, constant} from \"../../utils/index.js\";\nimport {installFluent} from \"../../fluent.js\";\n\n// E4: Plot's identity-coerce accessor schema (18 keys). installFluent's\n// per-key idempotence lets this co-exist with vizSchema on the parent\n// Viz.prototype — installFluent walks the actual prototype (Plot.prototype\n// here) and skips keys already present.\nconst plotSchema = [\n {key: \"barPadding\", coerce: \"identity\" as const},\n {key: \"baseline\", coerce: \"identity\" as const},\n {key: \"lineLabels\", coerce: \"identity\" as const},\n {key: \"shapeSort\", coerce: \"identity\" as const},\n {key: \"sizeMax\", coerce: \"identity\" as const},\n {key: \"sizeMin\", coerce: \"identity\" as const},\n {key: \"sizeScale\", coerce: \"identity\" as const},\n {key: \"stacked\", coerce: \"identity\" as const},\n {key: \"tooltipShared\", coerce: \"identity\" as const},\n {key: \"xCutoff\", coerce: \"identity\" as const},\n {key: \"xDomain\", coerce: \"identity\" as const},\n {key: \"x2Domain\", coerce: \"identity\" as const},\n {key: \"xSort\", coerce: \"identity\" as const},\n {key: \"x2Sort\", coerce: \"identity\" as const},\n {key: \"yCutoff\", coerce: \"identity\" as const},\n {key: \"yDomain\", coerce: \"identity\" as const},\n {key: \"y2Domain\", coerce: \"identity\" as const},\n {key: \"ySort\", coerce: \"identity\" as const},\n {key: \"y2Sort\", coerce: \"identity\" as const},\n];\n\nimport {plotDef, plotSizeLegendScale} from \"./pipeline.js\";\nimport {drawPlot} from \"./draw.js\";\nimport {plotShapeDefaults} from \"./shapeDefaults.js\";\nimport {\n resolveStackOffset,\n resolveStackOrder,\n stackOffsetDiverging,\n stackOrderTotalDescending,\n type StackOffsetFn,\n type StackOrderFn,\n type StackOrderInput,\n} from \"./stackHelpers.js\";\nimport type {PlotPaintContext} from \"../features/plotPaint.js\";\nimport {paintZoomablePlot, zoomPlot, type ZoomState} from \"./plotZoom.js\";\nimport {trendLineDefaults, type TrendLineType} from \"./trendLines.js\";\nimport {contentPoint, handleSharedHover} from \"./sharedHover.js\";\nimport {appendSharedHoverNodes} from \"./sharedHoverScene.js\";\nimport Viz from \"../viz/Viz.js\";\n\nimport type {InteractionPoint, PickResult, Scene, SceneEvent, SceneNode} from \"@d3plus/render\";\nimport type {DataPoint} from \"@d3plus/data\";\nimport type {VizInstance} from \"../viz/vizTypes.js\";\n\n/** Accessor function or string key for a plotted value. */\ntype PlotAccessor = (d: DataPoint, i: number) => number | Date | string;\n/** Function-or-string-key value accepted by accessor setters. */\ntype PlotAccessorArg = string | PlotAccessor;\n\nimport {default as BarBuffer} from \"../plotBuffers/Bar.js\";\nimport {default as BoxBuffer} from \"../plotBuffers/Box.js\";\nimport {default as CircleBuffer} from \"../plotBuffers/Circle.js\";\nimport {default as LineBuffer} from \"../plotBuffers/Line.js\";\nimport {default as RectBuffer} from \"../plotBuffers/Rect.js\";\nconst defaultBuffers = {\n Bar: BarBuffer,\n Box: BoxBuffer,\n Circle: CircleBuffer,\n Line: LineBuffer,\n Rect: RectBuffer,\n};\n\n/**\n Creates an x/y plot based on an array of data.\n*/\nexport default class Plot extends Viz {\n _trendLine: TrendLineType = plotDef.defaults!.trendLine as TrendLineType;\n _trendLineConfig: Record<string, unknown> = trendLineDefaults();\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n*/\n constructor() {\n super();\n // E4: install identity-coerce accessors on Plot.prototype. Defaults\n // are still applied below imperatively from plotDef; installFluent\n // skips slots that are already set, so the constructor wins.\n installFluent(this, plotSchema);\n // E3: scalar defaults sourced from plotDef.\n const defaults = plotDef.defaults!;\n this._axisPersist = defaults.axisPersist as boolean;\n this._annotations = defaults.annotations as unknown[];\n this._backgroundConfig = {\n duration: 0,\n fill: \"transparent\",\n };\n this.schema.barPadding = defaults.barPadding as number;\n this._buffer = assign({}, defaultBuffers, {Bar: false, Line: false});\n this._confidenceConfig = {\n // A line's colour is its stroke, so the confidence band fills with that\n // same colour (at the reduced opacity below). Prefer a per-Line stroke\n // override, else the shared stroke accessor (the Line config itself sets\n // no `stroke` — the colour comes from the top-level `shapeConfig.stroke`).\n fill: (d: DataPoint, i: number) => {\n const {Line, stroke} = this.schema.shapeConfig;\n const s = Line && Line.stroke !== undefined ? Line.stroke : stroke;\n return typeof s === \"function\" ? s(d, i) : s;\n },\n fillOpacity: constant(0.5),\n };\n this._crosshairConfig = {\n stroke: openColor.colors.gray[500],\n strokeDasharray: \"4 3\",\n strokeWidth: 1,\n };\n this._discreteCutoff = defaults.discreteCutoff as number;\n this._groupPadding = defaults.groupPadding as number;\n this._labelConnectorConfig = {\n strokeDasharray: \"1 1\",\n };\n this._labelPosition = constant(\"auto\");\n this._lineMarkerConfig = {\n fill: (d: DataPoint, i: number) => colorAssign(this._id(d, i), this.schema.colorDefaults),\n r: constant(3),\n };\n this._lineMarkers = defaults.lineMarkers as boolean;\n this._previousAnnotations = {back: [], front: []};\n this._previousShapes = [];\n this.schema.shape = defaults.shape;\n this.schema.shapeConfig = assign(this.schema.shapeConfig, plotShapeDefaults.call(this as unknown as VizInstance));\n this._shapeOrder = [\"Area\", \"Path\", \"Bar\", \"Box\", \"Line\", \"Rect\", \"Circle\"];\n this.schema.shapeSort = (a: string, b: string) =>\n this._shapeOrder.indexOf(a) - this._shapeOrder.indexOf(b);\n this.schema.tooltipShared = defaults.tooltipShared as boolean;\n this.schema.sizeMax = 20;\n this.schema.sizeMin = 5;\n this.schema.sizeScale = \"sqrt\";\n this._stackOffset = stackOffsetDiverging;\n this._stackOrder = stackOrderTotalDescending;\n this.schema.timelineConfig = assign(this.schema.timelineConfig, {\n brushMin: () =>\n this._xTime || this._yTime || this._x2Time || this._y2Time ? 2 : 1,\n });\n\n this._x = accessor(\"x\");\n this._xKey = \"x\";\n this._xAxis = new AxisBottom().align(\"end\");\n // _xTest/_yTest/_x2Test/_y2Test are NOT persistent fields anymore. The\n // measure-only test axes are allocated as locals inside `_draw` and\n // garbage-collected after each draw — proving Plot doesn't need to\n // own a long-lived Axis instance just for layout. See measureAxis()\n // in axisLayout.ts for the standalone shape.\n this._xConfig = {\n gridConfig: {\n stroke: (d: {id: string}) => {\n if (this.schema.discrete && this.schema.discrete.charAt(0) === \"x\")\n return \"transparent\";\n const range = this._xAxis.range();\n const position = this._xAxis._getPosition.bind(this._xAxis)(d.id);\n if (range[0] === position) return \"transparent\";\n const bg = this._select ? backgroundColor(this._select.node()) : \"rgb(255, 255, 255)\";\n const contrast = colorContrast(bg, this.schema.colorDefaults);\n return contrast === this.schema.colorDefaults.dark ? openColor.colors.gray[200] : openColor.colors.gray[600];\n },\n },\n };\n this.schema.xCutoff = 150;\n\n this._x2 = accessor(\"x2\");\n this._x2Key = \"x2\";\n this._x2Axis = new AxisTop().align(\"start\");\n this._x2Config = {};\n\n this._y = accessor(\"y\");\n this._yKey = \"y\";\n this._yAxis = new AxisLeft().align(\"start\");\n this._yKey = \"y\";\n this._yConfig = {\n gridConfig: {\n stroke: (d: {id: string}) => {\n if (this.schema.discrete && this.schema.discrete.charAt(0) === \"y\")\n return \"transparent\";\n const range = this._yAxis.range();\n const position = this._yAxis._getPosition.bind(this._yAxis)(d.id);\n if (range[range.length - 1] === position) return \"transparent\";\n const bg = this._select ? backgroundColor(this._select.node()) : \"rgb(255, 255, 255)\";\n const contrast = colorContrast(bg, this.schema.colorDefaults);\n return contrast === this.schema.colorDefaults.dark ? openColor.colors.gray[200] : openColor.colors.gray[600];\n },\n },\n };\n this.schema.yCutoff = 150;\n\n this._y2 = accessor(\"y2\");\n this._y2Key = \"y2\";\n this._y2Axis = new AxisRight().align(\"end\");\n this._y2Config = {};\n }\n\n /**\n Extends the preDraw behavior of the abstract Viz class.\n @private\n*/\n _preDraw() {\n // logic repeated for each axis\n [\"x\", \"y\", \"x2\", \"y2\"].forEach(k => {\n // if user has supplied a String key as the main method value\n if (this[`_${k}Key`]) {\n const str = this[`_${k}Key`];\n\n // if axis is discrete and numerical, do not sum values\n if (!this.schema.aggs[str] && this.schema.discrete === k) {\n this.schema.aggs[str] = (a: DataPoint[], c: (d: DataPoint) => unknown) => {\n const v = Array.from(new Set(a.map(c)));\n return v.length === 1 ? v[0] : v;\n };\n }\n\n // set axis title if not discrete\n if (\n str !== k &&\n this[`_${k}Title`] === this[`_${k}Config`].title &&\n this.schema.discrete !== k\n ) {\n this[`_${k}Title`] = str;\n this[`_${k}Config`].title = str;\n }\n }\n });\n\n super._preDraw();\n }\n\n /**\n Composes the chart's scene graph: the native shape scenes from Viz.toScene\n (bars/lines/areas + labels) plus snapshots of the rendered axes, so a Plot\n renders fully — geometry and axes — through the @d3plus/render backends.\n*/\n toScene(): Scene {\n const scene = (Viz.prototype.toScene as () => Scene).call(this);\n // Skip the axis walk when an explicit empty-data render just\n // happened. Axes are constructor-allocated and never reset between\n // renders, so a previous-render's axis._select.node() still exists\n // after `.data([]).render()` — emitting its toScene snapshot\n // would leak stale tick marks + grid lines under the no-data\n // overlay. We test `length === 0` explicitly so test fixtures that\n // construct viz without ever calling .render() (and leave\n // _filteredData undefined) don't trip the early-return.\n if (\n Array.isArray(this._filteredData) &&\n this._filteredData.length === 0 &&\n (!this._annotations || this._annotations.length === 0)\n )\n return scene;\n const axisNodes: SceneNode[] = [];\n for (const name of [\"_xAxis\", \"_x2Axis\", \"_yAxis\", \"_y2Axis\"]) {\n const axis = this[name];\n if (\n axis &&\n typeof axis.toScene === \"function\" &&\n axis._select &&\n typeof axis._select.node === \"function\" &&\n axis._select.node()\n ) {\n // Wrap in a uniquely-keyed group so sibling axes never collide (axis\n // snapshots reuse a per-call key counter).\n axisNodes.push({type: \"group\", key: `plot-${name}`, children: [axis.toScene()]});\n }\n }\n // Axes are drawn behind the shapes.\n scene.root.children.unshift(...axisNodes);\n appendSharedHoverNodes(this as unknown as VizInstance, scene);\n return scene;\n }\n\n /**\n Wires user-registered `on()` event handlers onto a freshly-configured\n shape instance. Splits the registered events into three buckets:\n global (`\"click\"`), shape-scoped (`\"click.shape\"`), and\n shape-class-scoped (`\"click.Bar\"` etc.). All three forward into\n `this.schema.on[event](d.data, d.i, x, event)`. Extracted from\n Plot._paint so the chart-level event wiring is in one place.\n\n On the scene path (SvgRenderer/CanvasRenderer) these d3-selection\n bindings don't fire — compute-mode shapes mount no per-shape DOM.\n Pointer events are instead routed by `Viz._drawSceneToTarget`'s\n renderer bridge: it hit-tests via `Renderer.pick`, reads the picked\n node's stamped `shapeType`, and dispatches the matching global,\n `.shape`, and shape-class-scoped (`.Bar`) handlers — the same three\n buckets this method wires, so SVG and Canvas behave identically.\n */\n _wirePlotShapeEvents(\n shape: {on(event: string, handler: unknown): unknown},\n shapeKey: string,\n events: string[],\n ) {\n const classEvents = events.filter(e => e.includes(`.${shapeKey}`));\n const globalEvents = events.filter(e => !e.includes(\".\"));\n const shapeEvents = events.filter(e => e.includes(\".shape\"));\n const forward =\n (evt: string) =>\n (d: {data: DataPoint; i: number}, i: number, x: unknown, event: unknown) =>\n this.schema.on[evt](d.data, d.i, x, event);\n for (const evt of globalEvents) shape.on(evt, forward(evt));\n for (const evt of shapeEvents) shape.on(evt, forward(evt));\n for (const evt of classEvents) shape.on(evt, forward(evt));\n }\n\n /**\n For a multi-point shape (Line/Area) reports the point nearest the cursor\n along the discrete axis, so every mouse event (tooltip, click, user\n handlers) reflects the hovered x rather than the whole-series aggregate.\n Non-nested shapes and legend swatches fall through to the base (aggregate)\n behavior.\n @private\n*/\n _interactionDatum(\n pick: PickResult,\n event: SceneEvent,\n ): {d: unknown; i: number; x: unknown} {\n const node = pick.node as SceneNode & {\n interactionPoints?: InteractionPoint[];\n interactionGroup?: string;\n };\n const points = node && node.interactionPoints;\n if (\n node &&\n node.interactionGroup !== \"legend\" &&\n Array.isArray(points) &&\n points.length &&\n event &&\n Array.isArray(event.point)\n ) {\n const nearest = this._nearestInteractionPoint(points, event.point);\n if (nearest) {\n const wrapped = nearest.datum as {data?: unknown; i?: number};\n return {\n d: wrapped && wrapped.data ? wrapped.data : wrapped,\n i: typeof wrapped.i === \"number\" ? wrapped.i : nearest.index,\n x: wrapped,\n };\n }\n }\n return super._interactionDatum(pick, event);\n }\n\n /**\n Picks the interaction point closest to a surface-local cursor position\n along the discrete axis. `event.point` is post-zoom surface space while the\n points are in chart content space (under the `viz-zoom` group and then\n the chart's own `viz-chart-body` transform), so the cursor is un-zoomed\n by `_zoomTransform` and offset by `_chartTransform` before comparing.\n @private\n*/\n _nearestInteractionPoint(\n points: InteractionPoint[],\n point: [number, number],\n ): InteractionPoint | null {\n const [cx, cy] = contentPoint(this as unknown as VizInstance, point);\n const axis = this.schema.discrete === \"y\" ? \"y\" : \"x\";\n const target = axis === \"y\" ? cy : cx;\n let best: InteractionPoint | null = null;\n let bestDist = Infinity;\n for (const p of points) {\n const dist = Math.abs(p[axis] - target);\n if (dist < bestDist) {\n bestDist = dist;\n best = p;\n }\n }\n return best;\n }\n\n /**\n Drives the shared multi-series tooltip + crosshair: while the pointer is\n inside the plot area, snaps to the nearest discrete position and, when\n two or more series share it, shows them all in one tooltip (suppressing\n the single-shape tooltip). Clears on leaving the plot area or the chart.\n @private\n*/\n _sharedHover(event: SceneEvent): void {\n handleSharedHover(this as unknown as VizInstance, event);\n }\n\n /**\n Extends the draw behavior of the abstract Viz class.\n @private\n*/\n _draw(callback?: () => void) {\n return drawPlot(this as unknown as VizInstance, callback);\n }\n\n /**\n The bubble radius scale, for the size legend (see `plotSizeLegendScale`).\n @private\n */\n _sizeLegendScale() {\n return plotSizeLegendScale(this as unknown as VizInstance);\n }\n\n /**\n Paint phase: production axis rendering, shape buffer setup, and shape\n emission with event handlers. Receives all cross-phase locals from\n _draw via `pCtx` (so this method has zero coupling to _draw's local\n scope beyond the explicit context).\n */\n _paint(pCtx: PlotPaintContext) {\n // plotPaint builds the chart scene as a fresh array from the paint\n // context (data, scales, axis measurements) — emission is a pure\n // function of its inputs. `super._draw` resets `_chartScene` to []\n // before the paint phase, so the emit output IS the scene. Viz.toScene\n // wraps the collection in viz-chart-cells + zoom transform.\n const viz = this as unknown as VizInstance;\n const target = viz._zoomEventTarget || viz._container;\n this._chartScene = paintZoomablePlot(\n viz,\n pCtx,\n target && target.node() ? zoomTransform(target.node()) : undefined,\n );\n return this;\n }\n\n /**\n Zooms by rescaling the plot's linear axes instead of scaling the\n rendered picture (see `Plot/plotZoom.ts`). Returns false when no axis\n is linear, so the plot falls back to picture zoom.\n @private\n*/\n _zoomRescale(t: ZoomState, duration = 0): boolean {\n const nodes = zoomPlot(this as unknown as VizInstance, t, duration);\n if (!nodes) return false;\n this._chartScene = nodes;\n return true;\n }\n\n /**\n Allows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the [Shape](http://d3plus.org/docs/#Shape) class, either a single config object or an array of config objects. Each config object requires an additional parameter, the \"shape\", which denotes which [Shape](http://d3plus.org/docs/#Shape) sub-class to use ([Rect](http://d3plus.org/docs/#Rect), [Line](http://d3plus.org/docs/#Line), etc).\n\nAdditionally, each config object can also contain an optional \"layer\" key, which defines whether the annotations will be displayed in \"front\" or in \"back\" of the primary visualization shapes. This value defaults to \"back\" if not present.\n*/\n annotations(_?: unknown): this | unknown[] {\n return arguments.length\n ? ((this._annotations = _ instanceof Array ? _ : [_]), this)\n : this._annotations;\n }\n\n /**\n Determines whether the x and y axes should have their scales persist while users filter the data, the timeline being the prime example (set this to `true` to make the axes stay consistent when the timeline changes).\n*/\n axisPersist(_?: boolean): this | boolean {\n return arguments.length\n ? ((this._axisPersist = _), this)\n : this._axisPersist;\n }\n\n /**\n A d3plus-shape configuration Object used for styling the background rectangle of the inner x/y plot (behind all of the shapes and gridlines).\n*/\n backgroundConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._backgroundConfig = assign(this._backgroundConfig, _!)), this)\n : this._backgroundConfig;\n }\n\n /**\n Determines whether or not to add additional padding at the ends of x or y scales. The most commone use for this is in Scatter Plots, so that the shapes do not appear directly on the axis itself. The value provided can either be `true` or `false` to toggle the behavior for all shape types, or a keyed Object for each shape type (ie. `{Bar: false, Circle: true, Line: false}`).\n*/\n buffer(_?: boolean | Record<string, boolean>): this | Record<string, unknown> {\n if (arguments.length) {\n if (!_) this._buffer = {};\n else if (_ === true) this._buffer = defaultBuffers;\n else {\n this._buffer = assign({}, this._buffer, _);\n for (const key in this._buffer) {\n const buf = this._buffer as Record<string, unknown>;\n if (buf[key] === true) buf[key] = (defaultBuffers as Record<string, unknown>)[key];\n }\n }\n return this;\n }\n return this._buffer;\n }\n\n /**\n The confidence interval as an array of [lower, upper] bounds.\n\n@example <caption>Can be called with accessor functions or static keys:</caption>\n var data = {id: \"alpha\", value: 10, lci: 9, hci: 11};\n ...\n // Accessor functions\n .confidence([function(d) { return d.lci }, function(d) { return d.hci }])\n\n // Or static keys\n .confidence([\"lci\", \"hci\"])\n*/\n confidence(_?: unknown): this | [number, number] | false {\n if (arguments.length && _ instanceof Array) {\n this._confidence = [];\n const lower = _[0];\n this._confidence[0] =\n typeof lower === \"function\" || !lower ? lower : accessor(lower);\n const upper = _[1];\n this._confidence[1] =\n typeof upper === \"function\" || !upper ? upper : accessor(upper);\n\n return this;\n } else return this._confidence;\n }\n\n /**\n Configuration object for shapes rendered as confidence intervals.\n*/\n confidenceConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._confidenceConfig = assign(this._confidenceConfig, _!)), this)\n : this._confidenceConfig;\n }\n\n /**\n When the width or height of the chart is less than or equal to this pixel value, the discrete axis will not be shown. This helps produce slick sparklines. Set this value to `0` to disable the behavior entirely.\n*/\n discreteCutoff(_?: number): this | number {\n return arguments.length\n ? ((this._discreteCutoff = _), this)\n : this._discreteCutoff;\n }\n\n /**\n The pixel space between groups of bars.\n*/\n groupPadding(_?: number): this | number {\n return arguments.length\n ? ((this._groupPadding = _), this)\n : this._groupPadding;\n }\n\n /**\n The d3plus-shape config used on the Line shapes created to connect lineLabels to the end of their associated Line path.\n*/\n labelConnectorConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._labelConnectorConfig = assign(this._labelConnectorConfig, _!)),\n this)\n : this._labelConnectorConfig;\n }\n\n /**\n The behavior to be used when calculating the position and size of each shape's label(s). The value passed can either be the _String_ name of the behavior to be used for all shapes, or an accessor _Function_ that will be provided each data point and will be expected to return the behavior to be used for that data point. The availability and options for this method depend on the default logic for each Shape. As an example, the values \"outside\" or \"inside\" can be set for Bar shapes, whose \"auto\" default will calculate the best position dynamically based on the available space.\n*/\n labelPosition(\n _?: string | ((d: DataPoint, i: number) => string),\n ): this | ((d: DataPoint, i: number) => string) {\n return arguments.length\n ? ((this._labelPosition = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this._labelPosition;\n }\n\n /**\n Paint for the shared tooltip's crosshair guide line (`stroke`,\n `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …). Merged into the\n current config.\n*/\n crosshairConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._crosshairConfig = assign(this._crosshairConfig, _!)), this)\n : this._crosshairConfig;\n }\n\n /**\n Draws an automatic trend line fit to the plotted data: `true` (or `\"linear\"`) for a least-squares line, or one of `\"exponential\"`, `\"logarithmic\"`, `\"power\"`, or `\"polynomial\"`. By default each series gets its own line in its color; see `trendLineConfig` for grouping, a confidence band, and styling. On a chart with a discrete axis, the line runs along that axis, fitting categories by their order. Set to `false` (the default) to remove.\n*/\n trendLine(_?: TrendLineType): this | TrendLineType {\n return arguments.length\n ? ((this._trendLine = _ as TrendLineType), this)\n : this._trendLine;\n }\n\n /**\n Options for the trend lines drawn by `trendLine`, merged into the current config:\n - `group`: `\"series\"` (default) fits one line per series, colored to match it; `\"all\"` fits a single line to every point.\n - `order`: the polynomial degree when `trendLine` is `\"polynomial\"` (default `2`).\n - `confidence`: draws a confidence band around a linear fit (default `false`).\n - `confidenceLevel`: the band's confidence level (default `0.95`).\n - `confidenceConfig`: Area shape config for the band (default `{fillOpacity: 0.15}`; fill defaults to the line color).\n - `tooltip`: shows the fitted equation and R² when hovering a line (default `true`).\n - Any other key (`stroke`, `strokeWidth`, `strokeDasharray`, …) styles the Line shape.\n\nStacked charts always fit one line to the stack totals.\n*/\n trendLineConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._trendLineConfig = assign(this._trendLineConfig, _!)), this)\n : this._trendLineConfig;\n }\n\n /**\n Shape config for the Circle shapes drawn by the lineMarkers method.\n*/\n lineMarkerConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._lineMarkerConfig = assign(this._lineMarkerConfig, _!)), this)\n : this._lineMarkerConfig;\n }\n\n /**\n Draws circle markers on each vertex of a Line.\n*/\n lineMarkers(_?: boolean): this | boolean {\n return arguments.length\n ? ((this._lineMarkers = _), this)\n : this._lineMarkers;\n }\n\n /**\n Sets the size of bubbles to the given Number, data key, or function.\n*/\n size(_?: PlotAccessorArg | false): this | PlotAccessor {\n if (!arguments.length) return this._size;\n this._size = typeof _ === \"function\" || !_ ? _ : accessor(_ as string);\n this._sizeKey = typeof _ === \"string\" ? _ : undefined;\n return this;\n }\n\n /**\n Sets the vertical offset applied to stacked series. Accepts a named\n offset — `\"diverging\"` (default), `\"none\"`, `\"expand\"`, `\"silhouette\"`,\n or `\"wiggle\"` — or a custom offset function. Unknown names warn and fall\n back to `\"diverging\"`. If *value* is not specified, returns the current\n stack offset function.\n*/\n stackOffset(_?: string | StackOffsetFn): this | StackOffsetFn {\n return arguments.length\n ? ((this._stackOffset = resolveStackOffset(_!)), this)\n : (this._stackOffset as StackOffsetFn);\n }\n\n /**\n Sets the order of stacked series, from the bottom of the stack upward.\n Accepts:\n - a named order: `\"descending\"` (default) / `\"ascending\"` by summed\n value, `\"key\"` / `\"keyReverse\"` alphabetically by series key,\n `\"none\"` / `\"data\"` for input order, or d3's `\"insideOut\"`,\n `\"appearance\"`, `\"reverse\"`;\n - an Array of series keys for an explicit order;\n - a value accessor, or a `{value, order}` config, to rank series by an\n aggregate of any data field.\n\n Unknown named strings warn and fall back to `\"descending\"`. If *value*\n is not specified, returns the current stack order.\n*/\n stackOrder(_?: StackOrderInput): this | StackOrderFn | string[] {\n return arguments.length\n ? ((this._stackOrder = resolveStackOrder(_!)), this)\n : (this._stackOrder as StackOrderFn | string[]);\n }\n\n /**\n Accessor function or string key for the x-axis value of each data point.\n*/\n x(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._x = _;\n else {\n this._x = accessor(_ as string);\n this._xKey = _;\n }\n return this;\n } else return this._x;\n }\n\n /**\n Accessor function or string key for the secondary x-axis value of each data point.\n*/\n x2(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._x2 = _;\n else {\n this._x2 = accessor(_ as string);\n this._x2Key = _;\n }\n return this;\n } else return this._x2;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the x-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n*/\n xConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._xConfig = assign(this._xConfig, _!)), this)\n : this._xConfig;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary x-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n*/\n x2Config(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._x2Config = assign(this._x2Config, _!)), this)\n : this._x2Config;\n }\n\n /**\n Accessor function or string key for the y-axis value of each data point.\n*/\n y(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._y = _;\n else {\n this._y = accessor(_ as string);\n this._yKey = _;\n }\n return this;\n } else return this._y;\n }\n\n /**\n Accessor function or string key for the secondary y-axis value of each data point.\n*/\n y2(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._y2 = _;\n else {\n this._y2 = accessor(_ as string);\n this._y2Key = _;\n }\n return this;\n } else return this._y2;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the y-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n\n*Note:* If a \"domain\" array is passed to the y-axis config, it will be reversed.\n*/\n yConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n if (arguments.length) {\n const cfg = _ as {domain?: unknown[]};\n if (cfg.domain) cfg.domain = cfg.domain.slice().reverse();\n this._yConfig = assign(this._yConfig, _!);\n return this;\n }\n return this._yConfig;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary y-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n*/\n y2Config(_?: Record<string, unknown>): this | Record<string, unknown> {\n if (arguments.length) {\n const cfg = _ as {domain?: unknown[]};\n if (cfg.domain) cfg.domain = cfg.domain.slice().reverse();\n this._y2Config = assign(this._y2Config, _!);\n return this;\n }\n return this._y2Config;\n }\n\n}\n"],"names":["pkg","zoomTransform","theme","openColor","colorAssign","colorContrast","assign","backgroundColor","AxisBottom","AxisLeft","AxisRight","AxisTop","accessor","constant","installFluent","plotSchema","key","coerce","plotDef","plotSizeLegendScale","drawPlot","plotShapeDefaults","resolveStackOffset","resolveStackOrder","stackOffsetDiverging","stackOrderTotalDescending","paintZoomablePlot","zoomPlot","trendLineDefaults","contentPoint","handleSharedHover","appendSharedHoverNodes","Viz","default","BarBuffer","BoxBuffer","CircleBuffer","LineBuffer","RectBuffer","defaultBuffers","Bar","Box","Circle","Line","Rect","Plot","_trendLine","defaults","trendLine","_trendLineConfig","_axisPersist","axisPersist","_annotations","annotations","_backgroundConfig","duration","fill","schema","barPadding","_buffer","_confidenceConfig","d","i","shapeConfig","stroke","s","undefined","fillOpacity","_crosshairConfig","colors","gray","strokeDasharray","strokeWidth","_discreteCutoff","discreteCutoff","_groupPadding","groupPadding","_labelConnectorConfig","_labelPosition","_lineMarkerConfig","_id","colorDefaults","r","_lineMarkers","lineMarkers","_previousAnnotations","back","front","_previousShapes","shape","call","_shapeOrder","shapeSort","a","b","indexOf","tooltipShared","sizeMax","sizeMin","sizeScale","_stackOffset","_stackOrder","timelineConfig","brushMin","_xTime","_yTime","_x2Time","_y2Time","_x","_xKey","_xAxis","align","_xConfig","gridConfig","discrete","charAt","range","position","_getPosition","bind","id","bg","_select","node","contrast","dark","xCutoff","_x2","_x2Key","_x2Axis","_x2Config","_y","_yKey","_yAxis","_yConfig","length","yCutoff","_y2","_y2Key","_y2Axis","_y2Config","_preDraw","forEach","k","str","aggs","c","v","Array","from","Set","map","title","toScene","scene","prototype","isArray","_filteredData","axisNodes","name","axis","push","type","children","root","unshift","_wirePlotShapeEvents","shapeKey","events","classEvents","filter","e","includes","globalEvents","shapeEvents","forward","evt","x","event","on","data","_interactionDatum","pick","points","interactionPoints","interactionGroup","point","nearest","_nearestInteractionPoint","wrapped","datum","index","cx","cy","target","best","bestDist","Infinity","p","dist","Math","abs","_sharedHover","_draw","callback","_sizeLegendScale","_paint","pCtx","viz","_zoomEventTarget","_container","_chartScene","_zoomRescale","t","nodes","_","arguments","backgroundConfig","buffer","buf","confidence","_confidence","lower","upper","confidenceConfig","labelConnectorConfig","labelPosition","crosshairConfig","trendLineConfig","lineMarkerConfig","size","_size","_sizeKey","stackOffset","stackOrder","x2","xConfig","x2Config","y","y2","yConfig","cfg","domain","slice","reverse","y2Config"],"mappings":";;;;;;;;;;;;;;;;;;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F,MAAM,EAAE;oBACpB,IAAM0G,MAAM1B;oBACZ,IAAI0B,IAAIC,MAAM,EAAED,IAAIC,MAAM,GAAGD,IAAIC,MAAM,CAACC,KAAK,GAAGC,OAAO;oBACvD,IAAI,CAAC9G,QAAQ,GAAGhI,OAAO,IAAI,CAACgI,QAAQ,EAAEiF;oBACtC,OAAO,IAAI;gBACb;gBACA,OAAO,IAAI,CAACjF,QAAQ;YACtB;;;YAEA;;AAEF,GACE+G,KAAAA;mBAAAA,SAAAA,SAAS9B,CAA2B;gBAClC,IAAIC,UAAUjF,MAAM,EAAE;oBACpB,IAAM0G,MAAM1B;oBACZ,IAAI0B,IAAIC,MAAM,EAAED,IAAIC,MAAM,GAAGD,IAAIC,MAAM,CAACC,KAAK,GAAGC,OAAO;oBACvD,IAAI,CAACxG,SAAS,GAAGtI,OAAO,IAAI,CAACsI,SAAS,EAAE2E;oBACxC,OAAO,IAAI;gBACb;gBACA,OAAO,IAAI,CAAC3E,SAAS;YACvB;;;WA3qBmB/F;EAAab;AAHlC;;AAEA,GACA,SAAqBa,kBA6qBpB"}
1
+ {"version":3,"sources":["../../../../src/charts/Plot/index.ts"],"sourcesContent":["/* eslint no-cond-assign: 0*/\n\n// @ts-ignore\nimport pkg from \"open-color/open-color.js\";\nimport {zoomTransform} from \"d3-zoom\";\nconst {theme: openColor} = pkg;\n\nimport {\n colorAssign,\n colorContrast,\n} from \"@d3plus/color\";\nimport {assign, backgroundColor} from \"@d3plus/dom\";\n\nimport {\n AxisBottom,\n AxisLeft,\n AxisRight,\n AxisTop,\n} from \"../../components/index.js\";\nimport {accessor, constant} from \"../../utils/index.js\";\nimport {installFluent} from \"../../fluent.js\";\n\n// E4: Plot's identity-coerce accessor schema (18 keys). installFluent's\n// per-key idempotence lets this co-exist with vizSchema on the parent\n// Viz.prototype — installFluent walks the actual prototype (Plot.prototype\n// here) and skips keys already present.\nconst plotSchema = [\n {key: \"barPadding\", coerce: \"identity\" as const},\n {key: \"baseline\", coerce: \"identity\" as const},\n {key: \"lineLabels\", coerce: \"identity\" as const},\n {key: \"shapeSort\", coerce: \"identity\" as const},\n {key: \"sizeMax\", coerce: \"identity\" as const},\n {key: \"sizeMin\", coerce: \"identity\" as const},\n {key: \"sizeScale\", coerce: \"identity\" as const},\n {key: \"stacked\", coerce: \"identity\" as const},\n {key: \"tooltipShared\", coerce: \"identity\" as const},\n {key: \"xCutoff\", coerce: \"identity\" as const},\n {key: \"xDomain\", coerce: \"identity\" as const},\n {key: \"x2Domain\", coerce: \"identity\" as const},\n {key: \"xSort\", coerce: \"identity\" as const},\n {key: \"x2Sort\", coerce: \"identity\" as const},\n {key: \"yCutoff\", coerce: \"identity\" as const},\n {key: \"yDomain\", coerce: \"identity\" as const},\n {key: \"y2Domain\", coerce: \"identity\" as const},\n {key: \"ySort\", coerce: \"identity\" as const},\n {key: \"y2Sort\", coerce: \"identity\" as const},\n];\n\nimport {plotDef, plotSizeLegendScale} from \"./pipeline.js\";\nimport {drawPlot} from \"./draw.js\";\nimport {plotShapeDefaults} from \"./shapeDefaults.js\";\nimport {\n resolveStackOffset,\n resolveStackOrder,\n stackOffsetDiverging,\n stackOrderTotalDescending,\n type StackOffsetFn,\n type StackOrderFn,\n type StackOrderInput,\n} from \"./stackHelpers.js\";\nimport type {PlotPaintContext} from \"../features/plotPaint.js\";\nimport {paintZoomablePlot, zoomPlot, type ZoomState} from \"./plotZoom.js\";\nimport {trendLineDefaults, type TrendLineType} from \"./trendLines.js\";\nimport {contentPoint, handleSharedHover} from \"./sharedHover.js\";\nimport {appendSharedHoverNodes} from \"./sharedHoverScene.js\";\nimport Viz from \"../viz/Viz.js\";\nimport {plotInsetRegion} from \"./insetRegion.js\";\n\nimport type {InteractionPoint, PickResult, Scene, SceneEvent, SceneNode} from \"@d3plus/render\";\nimport type {DataPoint} from \"@d3plus/data\";\nimport {linkedColorDefaults} from \"../viz/linkGroup.js\";\nimport type {VizInstance} from \"../viz/vizTypes.js\";\n\n/** Accessor function or string key for a plotted value. */\ntype PlotAccessor = (d: DataPoint, i: number) => number | Date | string;\n/** Function-or-string-key value accepted by accessor setters. */\ntype PlotAccessorArg = string | PlotAccessor;\n\nimport {default as BarBuffer} from \"../plotBuffers/Bar.js\";\nimport {default as BoxBuffer} from \"../plotBuffers/Box.js\";\nimport {default as CircleBuffer} from \"../plotBuffers/Circle.js\";\nimport {default as LineBuffer} from \"../plotBuffers/Line.js\";\nimport {default as RectBuffer} from \"../plotBuffers/Rect.js\";\nconst defaultBuffers = {\n Bar: BarBuffer,\n Box: BoxBuffer,\n Circle: CircleBuffer,\n Line: LineBuffer,\n Rect: RectBuffer,\n};\n\n/**\n Creates an x/y plot based on an array of data.\n*/\nexport default class Plot extends Viz {\n _trendLine: TrendLineType = plotDef.defaults!.trendLine as TrendLineType;\n _trendLineConfig: Record<string, unknown> = trendLineDefaults();\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n*/\n constructor() {\n super();\n // E4: install identity-coerce accessors on Plot.prototype. Defaults\n // are still applied below imperatively from plotDef; installFluent\n // skips slots that are already set, so the constructor wins.\n installFluent(this, plotSchema);\n // E3: scalar defaults sourced from plotDef.\n const defaults = plotDef.defaults!;\n this._axisPersist = defaults.axisPersist as boolean;\n this._annotations = defaults.annotations as unknown[];\n this._backgroundConfig = {\n duration: 0,\n fill: \"transparent\",\n };\n this.schema.barPadding = defaults.barPadding as number;\n this._buffer = assign({}, defaultBuffers, {Bar: false, Line: false});\n this._confidenceConfig = {\n // A line's colour is its stroke, so the confidence band fills with that\n // same colour (at the reduced opacity below). Prefer a per-Line stroke\n // override, else the shared stroke accessor (the Line config itself sets\n // no `stroke` — the colour comes from the top-level `shapeConfig.stroke`).\n fill: (d: DataPoint, i: number) => {\n const {Line, stroke} = this.schema.shapeConfig;\n const s = Line && Line.stroke !== undefined ? Line.stroke : stroke;\n return typeof s === \"function\" ? s(d, i) : s;\n },\n fillOpacity: constant(0.5),\n };\n this._crosshairConfig = {\n stroke: openColor.colors.gray[500],\n strokeDasharray: \"4 3\",\n strokeWidth: 1,\n };\n this._discreteCutoff = defaults.discreteCutoff as number;\n this._groupPadding = defaults.groupPadding as number;\n this._labelConnectorConfig = {\n strokeDasharray: \"1 1\",\n };\n this._labelPosition = constant(\"auto\");\n this._lineMarkerConfig = {\n fill: (d: DataPoint, i: number) => colorAssign(this._id(d, i), linkedColorDefaults(this)),\n r: constant(3),\n };\n this._lineMarkers = defaults.lineMarkers as boolean;\n this._previousAnnotations = {back: [], front: []};\n this._previousShapes = [];\n this.schema.shape = defaults.shape;\n this.schema.shapeConfig = assign(this.schema.shapeConfig, plotShapeDefaults.call(this as unknown as VizInstance));\n this._shapeOrder = [\"Area\", \"Path\", \"Bar\", \"Box\", \"Line\", \"Rect\", \"Circle\"];\n this.schema.shapeSort = (a: string, b: string) =>\n this._shapeOrder.indexOf(a) - this._shapeOrder.indexOf(b);\n this.schema.tooltipShared = defaults.tooltipShared as boolean;\n this.schema.sizeMax = 20;\n this.schema.sizeMin = 5;\n this.schema.sizeScale = \"sqrt\";\n this._stackOffset = stackOffsetDiverging;\n this._stackOrder = stackOrderTotalDescending;\n this.schema.timelineConfig = assign(this.schema.timelineConfig, {\n brushMin: () =>\n this._xTime || this._yTime || this._x2Time || this._y2Time ? 2 : 1,\n });\n\n this._x = accessor(\"x\");\n this._xKey = \"x\";\n this._xAxis = new AxisBottom().align(\"end\");\n // _xTest/_yTest/_x2Test/_y2Test are NOT persistent fields anymore. The\n // measure-only test axes are allocated as locals inside `_draw` and\n // garbage-collected after each draw — proving Plot doesn't need to\n // own a long-lived Axis instance just for layout. See measureAxis()\n // in axisLayout.ts for the standalone shape.\n this._xConfig = {\n gridConfig: {\n stroke: (d: {id: string}) => {\n if (this.schema.discrete && this.schema.discrete.charAt(0) === \"x\")\n return \"transparent\";\n const range = this._xAxis.range();\n const position = this._xAxis._getPosition.bind(this._xAxis)(d.id);\n if (range[0] === position) return \"transparent\";\n const bg = this._select ? backgroundColor(this._select.node()) : \"rgb(255, 255, 255)\";\n const contrast = colorContrast(bg, this.schema.colorDefaults);\n return contrast === this.schema.colorDefaults.dark ? openColor.colors.gray[200] : openColor.colors.gray[600];\n },\n },\n };\n this.schema.xCutoff = 150;\n\n this._x2 = accessor(\"x2\");\n this._x2Key = \"x2\";\n this._x2Axis = new AxisTop().align(\"start\");\n this._x2Config = {};\n\n this._y = accessor(\"y\");\n this._yKey = \"y\";\n this._yAxis = new AxisLeft().align(\"start\");\n this._yKey = \"y\";\n this._yConfig = {\n gridConfig: {\n stroke: (d: {id: string}) => {\n if (this.schema.discrete && this.schema.discrete.charAt(0) === \"y\")\n return \"transparent\";\n const range = this._yAxis.range();\n const position = this._yAxis._getPosition.bind(this._yAxis)(d.id);\n if (range[range.length - 1] === position) return \"transparent\";\n const bg = this._select ? backgroundColor(this._select.node()) : \"rgb(255, 255, 255)\";\n const contrast = colorContrast(bg, this.schema.colorDefaults);\n return contrast === this.schema.colorDefaults.dark ? openColor.colors.gray[200] : openColor.colors.gray[600];\n },\n },\n };\n this.schema.yCutoff = 150;\n\n this._y2 = accessor(\"y2\");\n this._y2Key = \"y2\";\n this._y2Axis = new AxisRight().align(\"end\");\n this._y2Config = {};\n }\n\n /**\n Extends the preDraw behavior of the abstract Viz class.\n @private\n*/\n _preDraw() {\n // logic repeated for each axis\n [\"x\", \"y\", \"x2\", \"y2\"].forEach(k => {\n // if user has supplied a String key as the main method value\n if (this[`_${k}Key`]) {\n const str = this[`_${k}Key`];\n\n // if axis is discrete and numerical, do not sum values\n if (!this.schema.aggs[str] && this.schema.discrete === k) {\n this.schema.aggs[str] = (a: DataPoint[], c: (d: DataPoint) => unknown) => {\n const v = Array.from(new Set(a.map(c)));\n return v.length === 1 ? v[0] : v;\n };\n }\n\n // set axis title if not discrete\n if (\n str !== k &&\n this[`_${k}Title`] === this[`_${k}Config`].title &&\n this.schema.discrete !== k\n ) {\n this[`_${k}Title`] = str;\n this[`_${k}Config`].title = str;\n }\n }\n });\n\n super._preDraw();\n }\n\n /**\n Composes the chart's scene graph: the native shape scenes from Viz.toScene\n (bars/lines/areas + labels) plus snapshots of the rendered axes, so a Plot\n renders fully — geometry and axes — through the @d3plus/render backends.\n*/\n toScene(): Scene {\n const scene = (Viz.prototype.toScene as () => Scene).call(this);\n // Skip the axis walk when an explicit empty-data render just\n // happened. Axes are constructor-allocated and never reset between\n // renders, so a previous-render's axis._select.node() still exists\n // after `.data([]).render()` — emitting its toScene snapshot\n // would leak stale tick marks + grid lines under the no-data\n // overlay. We test `length === 0` explicitly so test fixtures that\n // construct viz without ever calling .render() (and leave\n // _filteredData undefined) don't trip the early-return.\n if (\n Array.isArray(this._filteredData) &&\n this._filteredData.length === 0 &&\n (!this._annotations || this._annotations.length === 0)\n )\n return scene;\n const axisNodes: SceneNode[] = [];\n for (const name of [\"_xAxis\", \"_x2Axis\", \"_yAxis\", \"_y2Axis\"]) {\n const axis = this[name];\n if (\n axis &&\n typeof axis.toScene === \"function\" &&\n axis._select &&\n typeof axis._select.node === \"function\" &&\n axis._select.node()\n ) {\n // Wrap in a uniquely-keyed group so sibling axes never collide (axis\n // snapshots reuse a per-call key counter).\n axisNodes.push({type: \"group\", key: `plot-${name}`, children: [axis.toScene()]});\n }\n }\n // Axes are drawn behind the shapes.\n scene.root.children.unshift(...axisNodes);\n appendSharedHoverNodes(this as unknown as VizInstance, scene);\n return scene;\n }\n\n /**\n Wires user-registered `on()` event handlers onto a freshly-configured\n shape instance. Splits the registered events into three buckets:\n global (`\"click\"`), shape-scoped (`\"click.shape\"`), and\n shape-class-scoped (`\"click.Bar\"` etc.). All three forward into\n `this.schema.on[event](d.data, d.i, x, event)`. Extracted from\n Plot._paint so the chart-level event wiring is in one place.\n\n On the scene path (SvgRenderer/CanvasRenderer) these d3-selection\n bindings don't fire — compute-mode shapes mount no per-shape DOM.\n Pointer events are instead routed by `Viz._drawSceneToTarget`'s\n renderer bridge: it hit-tests via `Renderer.pick`, reads the picked\n node's stamped `shapeType`, and dispatches the matching global,\n `.shape`, and shape-class-scoped (`.Bar`) handlers — the same three\n buckets this method wires, so SVG and Canvas behave identically.\n */\n _wirePlotShapeEvents(\n shape: {on(event: string, handler: unknown): unknown},\n shapeKey: string,\n events: string[],\n ) {\n const classEvents = events.filter(e => e.includes(`.${shapeKey}`));\n const globalEvents = events.filter(e => !e.includes(\".\"));\n const shapeEvents = events.filter(e => e.includes(\".shape\"));\n const forward =\n (evt: string) =>\n (d: {data: DataPoint; i: number}, i: number, x: unknown, event: unknown) =>\n this.schema.on[evt](d.data, d.i, x, event);\n for (const evt of globalEvents) shape.on(evt, forward(evt));\n for (const evt of shapeEvents) shape.on(evt, forward(evt));\n for (const evt of classEvents) shape.on(evt, forward(evt));\n }\n\n /**\n For a multi-point shape (Line/Area) reports the point nearest the cursor\n along the discrete axis, so every mouse event (tooltip, click, user\n handlers) reflects the hovered x rather than the whole-series aggregate.\n Non-nested shapes and legend swatches fall through to the base (aggregate)\n behavior.\n @private\n*/\n _interactionDatum(\n pick: PickResult,\n event: SceneEvent,\n ): {d: unknown; i: number; x: unknown} {\n const node = pick.node as SceneNode & {\n interactionPoints?: InteractionPoint[];\n interactionGroup?: string;\n };\n const points = node && node.interactionPoints;\n if (\n node &&\n node.interactionGroup !== \"legend\" &&\n Array.isArray(points) &&\n points.length &&\n event &&\n Array.isArray(event.point)\n ) {\n const nearest = this._nearestInteractionPoint(points, event.point);\n if (nearest) {\n const wrapped = nearest.datum as {data?: unknown; i?: number};\n return {\n d: wrapped && wrapped.data ? wrapped.data : wrapped,\n i: typeof wrapped.i === \"number\" ? wrapped.i : nearest.index,\n x: wrapped,\n };\n }\n }\n return super._interactionDatum(pick, event);\n }\n\n /**\n Picks the interaction point closest to a surface-local cursor position\n along the discrete axis. `event.point` is post-zoom surface space while the\n points are in chart content space (under the `viz-zoom` group and then\n the chart's own `viz-chart-body` transform), so the cursor is un-zoomed\n by `_zoomTransform` and offset by `_chartTransform` before comparing.\n @private\n*/\n _nearestInteractionPoint(\n points: InteractionPoint[],\n point: [number, number],\n ): InteractionPoint | null {\n const [cx, cy] = contentPoint(this as unknown as VizInstance, point);\n const axis = this.schema.discrete === \"y\" ? \"y\" : \"x\";\n const target = axis === \"y\" ? cy : cx;\n let best: InteractionPoint | null = null;\n let bestDist = Infinity;\n for (const p of points) {\n const dist = Math.abs(p[axis] - target);\n if (dist < bestDist) {\n bestDist = dist;\n best = p;\n }\n }\n return best;\n }\n\n /**\n Drives the shared multi-series tooltip + crosshair: while the pointer is\n inside the plot area, snaps to the nearest discrete position and, when\n two or more series share it, shows them all in one tooltip (suppressing\n the single-shape tooltip). Clears on leaving the plot area or the chart.\n @private\n*/\n _sharedHover(event: SceneEvent): void {\n handleSharedHover(this as unknown as VizInstance, event);\n }\n\n /**\n Extends the draw behavior of the abstract Viz class.\n @private\n*/\n _draw(callback?: () => void) {\n return drawPlot(this as unknown as VizInstance, callback);\n }\n\n /**\n The bubble radius scale, for the size legend (see `plotSizeLegendScale`).\n @private\n */\n _sizeLegendScale() {\n return plotSizeLegendScale(this as unknown as VizInstance);\n }\n\n /**\n The plot area, with the plotted marks as obstacles, for drawing a\n legend inside the plot's empty space (see `legendInset`).\n @private\n */\n _insetRegion() {\n return plotInsetRegion(this as unknown as VizInstance);\n }\n\n /**\n Paint phase: production axis rendering, shape buffer setup, and shape\n emission with event handlers. Receives all cross-phase locals from\n _draw via `pCtx` (so this method has zero coupling to _draw's local\n scope beyond the explicit context).\n */\n _paint(pCtx: PlotPaintContext) {\n // plotPaint builds the chart scene as a fresh array from the paint\n // context (data, scales, axis measurements) — emission is a pure\n // function of its inputs. `super._draw` resets `_chartScene` to []\n // before the paint phase, so the emit output IS the scene. Viz.toScene\n // wraps the collection in viz-chart-cells + zoom transform.\n const viz = this as unknown as VizInstance;\n const target = viz._zoomEventTarget || viz._container;\n this._chartScene = paintZoomablePlot(\n viz,\n pCtx,\n target && target.node() ? zoomTransform(target.node()) : undefined,\n );\n return this;\n }\n\n /**\n Zooms by rescaling the plot's linear axes instead of scaling the\n rendered picture (see `Plot/plotZoom.ts`). Returns false when no axis\n is linear, so the plot falls back to picture zoom.\n @private\n*/\n _zoomRescale(t: ZoomState, duration = 0): boolean {\n const nodes = zoomPlot(this as unknown as VizInstance, t, duration);\n if (!nodes) return false;\n this._chartScene = nodes;\n return true;\n }\n\n /**\n Allows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the [Shape](http://d3plus.org/docs/#Shape) class, either a single config object or an array of config objects. Each config object requires an additional parameter, the \"shape\", which denotes which [Shape](http://d3plus.org/docs/#Shape) sub-class to use ([Rect](http://d3plus.org/docs/#Rect), [Line](http://d3plus.org/docs/#Line), etc).\n\nAdditionally, each config object can also contain an optional \"layer\" key, which defines whether the annotations will be displayed in \"front\" or in \"back\" of the primary visualization shapes. This value defaults to \"back\" if not present.\n*/\n annotations(_?: unknown): this | unknown[] {\n return arguments.length\n ? ((this._annotations = _ instanceof Array ? _ : [_]), this)\n : this._annotations;\n }\n\n /**\n Determines whether the x and y axes should have their scales persist while users filter the data, the timeline being the prime example (set this to `true` to make the axes stay consistent when the timeline changes).\n*/\n axisPersist(_?: boolean): this | boolean {\n return arguments.length\n ? ((this._axisPersist = _), this)\n : this._axisPersist;\n }\n\n /**\n A d3plus-shape configuration Object used for styling the background rectangle of the inner x/y plot (behind all of the shapes and gridlines).\n*/\n backgroundConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._backgroundConfig = assign(this._backgroundConfig, _!)), this)\n : this._backgroundConfig;\n }\n\n /**\n Determines whether or not to add additional padding at the ends of x or y scales. The most commone use for this is in Scatter Plots, so that the shapes do not appear directly on the axis itself. The value provided can either be `true` or `false` to toggle the behavior for all shape types, or a keyed Object for each shape type (ie. `{Bar: false, Circle: true, Line: false}`).\n*/\n buffer(_?: boolean | Record<string, boolean>): this | Record<string, unknown> {\n if (arguments.length) {\n if (!_) this._buffer = {};\n else if (_ === true) this._buffer = defaultBuffers;\n else {\n this._buffer = assign({}, this._buffer, _);\n for (const key in this._buffer) {\n const buf = this._buffer as Record<string, unknown>;\n if (buf[key] === true) buf[key] = (defaultBuffers as Record<string, unknown>)[key];\n }\n }\n return this;\n }\n return this._buffer;\n }\n\n /**\n The confidence interval as an array of [lower, upper] bounds.\n\n@example <caption>Can be called with accessor functions or static keys:</caption>\n var data = {id: \"alpha\", value: 10, lci: 9, hci: 11};\n ...\n // Accessor functions\n .confidence([function(d) { return d.lci }, function(d) { return d.hci }])\n\n // Or static keys\n .confidence([\"lci\", \"hci\"])\n*/\n confidence(_?: unknown): this | [number, number] | false {\n if (arguments.length && _ instanceof Array) {\n this._confidence = [];\n const lower = _[0];\n this._confidence[0] =\n typeof lower === \"function\" || !lower ? lower : accessor(lower);\n const upper = _[1];\n this._confidence[1] =\n typeof upper === \"function\" || !upper ? upper : accessor(upper);\n\n return this;\n } else return this._confidence;\n }\n\n /**\n Configuration object for shapes rendered as confidence intervals.\n*/\n confidenceConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._confidenceConfig = assign(this._confidenceConfig, _!)), this)\n : this._confidenceConfig;\n }\n\n /**\n When the width or height of the chart is less than or equal to this pixel value, the discrete axis will not be shown. This helps produce slick sparklines. Set this value to `0` to disable the behavior entirely.\n*/\n discreteCutoff(_?: number): this | number {\n return arguments.length\n ? ((this._discreteCutoff = _), this)\n : this._discreteCutoff;\n }\n\n /**\n The pixel space between groups of bars.\n*/\n groupPadding(_?: number): this | number {\n return arguments.length\n ? ((this._groupPadding = _), this)\n : this._groupPadding;\n }\n\n /**\n The d3plus-shape config used on the Line shapes created to connect lineLabels to the end of their associated Line path.\n*/\n labelConnectorConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._labelConnectorConfig = assign(this._labelConnectorConfig, _!)),\n this)\n : this._labelConnectorConfig;\n }\n\n /**\n The behavior to be used when calculating the position and size of each shape's label(s). The value passed can either be the _String_ name of the behavior to be used for all shapes, or an accessor _Function_ that will be provided each data point and will be expected to return the behavior to be used for that data point. The availability and options for this method depend on the default logic for each Shape. As an example, the values \"outside\" or \"inside\" can be set for Bar shapes, whose \"auto\" default will calculate the best position dynamically based on the available space.\n*/\n labelPosition(\n _?: string | ((d: DataPoint, i: number) => string),\n ): this | ((d: DataPoint, i: number) => string) {\n return arguments.length\n ? ((this._labelPosition = typeof _ === \"function\" ? _ : constant(_)),\n this)\n : this._labelPosition;\n }\n\n /**\n Paint for the shared tooltip's crosshair guide line (`stroke`,\n `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …). Merged into the\n current config.\n*/\n crosshairConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._crosshairConfig = assign(this._crosshairConfig, _!)), this)\n : this._crosshairConfig;\n }\n\n /**\n Draws an automatic trend line fit to the plotted data: `true` (or `\"linear\"`) for a least-squares line, or one of `\"exponential\"`, `\"logarithmic\"`, `\"power\"`, or `\"polynomial\"`. By default each series gets its own line in its color; see `trendLineConfig` for grouping, a confidence band, and styling. On a chart with a discrete axis, the line runs along that axis, fitting categories by their order. Set to `false` (the default) to remove.\n*/\n trendLine(_?: TrendLineType): this | TrendLineType {\n return arguments.length\n ? ((this._trendLine = _ as TrendLineType), this)\n : this._trendLine;\n }\n\n /**\n Options for the trend lines drawn by `trendLine`, merged into the current config:\n - `group`: `\"series\"` (default) fits one line per series, colored to match it; `\"all\"` fits a single line to every point.\n - `order`: the polynomial degree when `trendLine` is `\"polynomial\"` (default `2`).\n - `confidence`: draws a confidence band around a linear fit (default `false`).\n - `confidenceLevel`: the band's confidence level (default `0.95`).\n - `confidenceConfig`: Area shape config for the band (default `{fillOpacity: 0.15}`; fill defaults to the line color).\n - `projection`: extends each line past the end of its data, by a number of steps at the data's own spacing (e.g. `5` more years), or to an end value with `{to: 2030}` (default `0`, off). The axis widens to fit, and a linear fit's band becomes a prediction interval that fans out over the projection. Hovering a projected step lists each series' projected value. Ignored on a category axis.\n - `projectionConfig`: Line shape config for the projected stretch, over the line's own styles (default `{strokeDasharray: \"2 4\"}`).\n - `tooltip`: shows the fitted equation and R² when hovering a line (default `true`).\n - Any other key (`stroke`, `strokeWidth`, `strokeDasharray`, …) styles the Line shape.\n\nStacked charts always fit one line to the stack totals.\n*/\n trendLineConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._trendLineConfig = assign(this._trendLineConfig, _!)), this)\n : this._trendLineConfig;\n }\n\n /**\n Shape config for the Circle shapes drawn by the lineMarkers method.\n*/\n lineMarkerConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._lineMarkerConfig = assign(this._lineMarkerConfig, _!)), this)\n : this._lineMarkerConfig;\n }\n\n /**\n Draws circle markers on each vertex of a Line.\n*/\n lineMarkers(_?: boolean): this | boolean {\n return arguments.length\n ? ((this._lineMarkers = _), this)\n : this._lineMarkers;\n }\n\n /**\n Sets the size of bubbles to the given Number, data key, or function.\n*/\n size(_?: PlotAccessorArg | false): this | PlotAccessor {\n if (!arguments.length) return this._size;\n this._size = typeof _ === \"function\" || !_ ? _ : accessor(_ as string);\n this._sizeKey = typeof _ === \"string\" ? _ : undefined;\n return this;\n }\n\n /**\n Sets the vertical offset applied to stacked series. Accepts a named\n offset — `\"diverging\"` (default), `\"none\"`, `\"expand\"`, `\"silhouette\"`,\n or `\"wiggle\"` — or a custom offset function. Unknown names warn and fall\n back to `\"diverging\"`. If *value* is not specified, returns the current\n stack offset function.\n*/\n stackOffset(_?: string | StackOffsetFn): this | StackOffsetFn {\n return arguments.length\n ? ((this._stackOffset = resolveStackOffset(_!)), this)\n : (this._stackOffset as StackOffsetFn);\n }\n\n /**\n Sets the order of stacked series, from the bottom of the stack upward.\n Accepts:\n - a named order: `\"descending\"` (default) / `\"ascending\"` by summed\n value, `\"key\"` / `\"keyReverse\"` alphabetically by series key,\n `\"none\"` / `\"data\"` for input order, or d3's `\"insideOut\"`,\n `\"appearance\"`, `\"reverse\"`;\n - an Array of series keys for an explicit order;\n - a value accessor, or a `{value, order}` config, to rank series by an\n aggregate of any data field.\n\n Unknown named strings warn and fall back to `\"descending\"`. If *value*\n is not specified, returns the current stack order.\n*/\n stackOrder(_?: StackOrderInput): this | StackOrderFn | string[] {\n return arguments.length\n ? ((this._stackOrder = resolveStackOrder(_!)), this)\n : (this._stackOrder as StackOrderFn | string[]);\n }\n\n /**\n Accessor function or string key for the x-axis value of each data point.\n*/\n x(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._x = _;\n else {\n this._x = accessor(_ as string);\n this._xKey = _;\n }\n return this;\n } else return this._x;\n }\n\n /**\n Accessor function or string key for the secondary x-axis value of each data point.\n*/\n x2(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._x2 = _;\n else {\n this._x2 = accessor(_ as string);\n this._x2Key = _;\n }\n return this;\n } else return this._x2;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the x-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n*/\n xConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._xConfig = assign(this._xConfig, _!)), this)\n : this._xConfig;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary x-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n*/\n x2Config(_?: Record<string, unknown>): this | Record<string, unknown> {\n return arguments.length\n ? ((this._x2Config = assign(this._x2Config, _!)), this)\n : this._x2Config;\n }\n\n /**\n Accessor function or string key for the y-axis value of each data point.\n*/\n y(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._y = _;\n else {\n this._y = accessor(_ as string);\n this._yKey = _;\n }\n return this;\n } else return this._y;\n }\n\n /**\n Accessor function or string key for the secondary y-axis value of each data point.\n*/\n y2(_?: PlotAccessorArg): this | PlotAccessor {\n if (arguments.length) {\n if (typeof _ === \"function\") this._y2 = _;\n else {\n this._y2 = accessor(_ as string);\n this._y2Key = _;\n }\n return this;\n } else return this._y2;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the y-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n\n*Note:* If a \"domain\" array is passed to the y-axis config, it will be reversed.\n*/\n yConfig(_?: Record<string, unknown>): this | Record<string, unknown> {\n if (arguments.length) {\n const cfg = _ as {domain?: unknown[]};\n if (cfg.domain) cfg.domain = cfg.domain.slice().reverse();\n this._yConfig = assign(this._yConfig, _!);\n return this;\n }\n return this._yConfig;\n }\n\n /**\n A pass-through to the underlying [Axis](http://d3plus.org/docs/#Axis) config used for the secondary y-axis. Includes additional functionality where passing \"auto\" as the value for the [scale](http://d3plus.org/docs/#Axis.scale) method will determine if the scale should be \"linear\" or \"log\" based on the provided data.\n*/\n y2Config(_?: Record<string, unknown>): this | Record<string, unknown> {\n if (arguments.length) {\n const cfg = _ as {domain?: unknown[]};\n if (cfg.domain) cfg.domain = cfg.domain.slice().reverse();\n this._y2Config = assign(this._y2Config, _!);\n return this;\n }\n return this._y2Config;\n }\n\n}\n"],"names":["pkg","zoomTransform","theme","openColor","colorAssign","colorContrast","assign","backgroundColor","AxisBottom","AxisLeft","AxisRight","AxisTop","accessor","constant","installFluent","plotSchema","key","coerce","plotDef","plotSizeLegendScale","drawPlot","plotShapeDefaults","resolveStackOffset","resolveStackOrder","stackOffsetDiverging","stackOrderTotalDescending","paintZoomablePlot","zoomPlot","trendLineDefaults","contentPoint","handleSharedHover","appendSharedHoverNodes","Viz","plotInsetRegion","linkedColorDefaults","default","BarBuffer","BoxBuffer","CircleBuffer","LineBuffer","RectBuffer","defaultBuffers","Bar","Box","Circle","Line","Rect","Plot","_trendLine","defaults","trendLine","_trendLineConfig","_axisPersist","axisPersist","_annotations","annotations","_backgroundConfig","duration","fill","schema","barPadding","_buffer","_confidenceConfig","d","i","shapeConfig","stroke","s","undefined","fillOpacity","_crosshairConfig","colors","gray","strokeDasharray","strokeWidth","_discreteCutoff","discreteCutoff","_groupPadding","groupPadding","_labelConnectorConfig","_labelPosition","_lineMarkerConfig","_id","r","_lineMarkers","lineMarkers","_previousAnnotations","back","front","_previousShapes","shape","call","_shapeOrder","shapeSort","a","b","indexOf","tooltipShared","sizeMax","sizeMin","sizeScale","_stackOffset","_stackOrder","timelineConfig","brushMin","_xTime","_yTime","_x2Time","_y2Time","_x","_xKey","_xAxis","align","_xConfig","gridConfig","discrete","charAt","range","position","_getPosition","bind","id","bg","_select","node","contrast","colorDefaults","dark","xCutoff","_x2","_x2Key","_x2Axis","_x2Config","_y","_yKey","_yAxis","_yConfig","length","yCutoff","_y2","_y2Key","_y2Axis","_y2Config","_preDraw","forEach","k","str","aggs","c","v","Array","from","Set","map","title","toScene","scene","prototype","isArray","_filteredData","axisNodes","name","axis","push","type","children","root","unshift","_wirePlotShapeEvents","shapeKey","events","classEvents","filter","e","includes","globalEvents","shapeEvents","forward","evt","x","event","on","data","_interactionDatum","pick","points","interactionPoints","interactionGroup","point","nearest","_nearestInteractionPoint","wrapped","datum","index","cx","cy","target","best","bestDist","Infinity","p","dist","Math","abs","_sharedHover","_draw","callback","_sizeLegendScale","_insetRegion","_paint","pCtx","viz","_zoomEventTarget","_container","_chartScene","_zoomRescale","t","nodes","_","arguments","backgroundConfig","buffer","buf","confidence","_confidence","lower","upper","confidenceConfig","labelConnectorConfig","labelPosition","crosshairConfig","trendLineConfig","lineMarkerConfig","size","_size","_sizeKey","stackOffset","stackOrder","x2","xConfig","x2Config","y","y2","yConfig","cfg","domain","slice","reverse","y2Config"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAG;YACxB;;;YAEA;;;;AAIF,GACEwG,KAAAA;mBAAAA,SAAAA,QAAQzB,CAA2B;gBACjC,IAAIC,UAAUlF,MAAM,EAAE;oBACpB,IAAM2G,MAAM1B;oBACZ,IAAI0B,IAAIC,MAAM,EAAED,IAAIC,MAAM,GAAGD,IAAIC,MAAM,CAACC,KAAK,GAAGC,OAAO;oBACvD,IAAI,CAAC/G,QAAQ,GAAGlI,OAAO,IAAI,CAACkI,QAAQ,EAAEkF;oBACtC,OAAO,IAAI;gBACb;gBACA,OAAO,IAAI,CAAClF,QAAQ;YACtB;;;YAEA;;AAEF,GACEgH,KAAAA;mBAAAA,SAAAA,SAAS9B,CAA2B;gBAClC,IAAIC,UAAUlF,MAAM,EAAE;oBACpB,IAAM2G,MAAM1B;oBACZ,IAAI0B,IAAIC,MAAM,EAAED,IAAIC,MAAM,GAAGD,IAAIC,MAAM,CAACC,KAAK,GAAGC,OAAO;oBACvD,IAAI,CAACzG,SAAS,GAAGxI,OAAO,IAAI,CAACwI,SAAS,EAAE4E;oBACxC,OAAO,IAAI;gBACb;gBACA,OAAO,IAAI,CAAC5E,SAAS;YACvB;;;WAtrBmB/F;EAAaf;AAHlC;;AAEA,GACA,SAAqBe,kBAwrBpB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ The region a Plot offers for drawing a legend inside its empty space
3
+ (see `legendInset`): the plot area, with the plotted marks as obstacles.
4
+ @module
5
+ */ import { sceneInsetRegion } from "../pipeline/insetPlacement.js";
6
+ /** Axis groups carry tick data, but aren't marks to keep clear of. */ var AXIS_KEY = /^plot-(x|x2|y|y2)-axis$/;
7
+ /** The plot area in surface coordinates, with its marks (not its axes) as obstacles; null before layout. */ export function plotInsetRegion(viz) {
8
+ var _t_x, _t_y;
9
+ var area = viz._plotArea, t = viz._chartTransform;
10
+ if (!area || !t) return null;
11
+ return sceneInsetRegion(viz, {
12
+ x: area.x + ((_t_x = t.x) !== null && _t_x !== void 0 ? _t_x : 0),
13
+ y: area.y + ((_t_y = t.y) !== null && _t_y !== void 0 ? _t_y : 0),
14
+ width: area.width,
15
+ height: area.height
16
+ }, function(node) {
17
+ return AXIS_KEY.test(String(node.key));
18
+ });
19
+ }
20
+
21
+ //# sourceMappingURL=insetRegion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/charts/Plot/insetRegion.ts"],"sourcesContent":["/**\n The region a Plot offers for drawing a legend inside its empty space\n (see `legendInset`): the plot area, with the plotted marks as obstacles.\n @module\n*/\nimport {sceneInsetRegion} from \"../pipeline/insetPlacement.js\";\nimport type {InsetRegion} from \"../features/insetState.js\";\nimport type {VizInstance} from \"../viz/vizTypes.js\";\n\n/** Axis groups carry tick data, but aren't marks to keep clear of. */\nconst AXIS_KEY = /^plot-(x|x2|y|y2)-axis$/;\n\n/** The plot area in surface coordinates, with its marks (not its axes) as obstacles; null before layout. */\nexport function plotInsetRegion(viz: VizInstance): InsetRegion | null {\n const area = viz._plotArea, t = viz._chartTransform;\n if (!area || !t) return null;\n return sceneInsetRegion(viz, {\n x: area.x + (t.x ?? 0),\n y: area.y + (t.y ?? 0),\n width: area.width,\n height: area.height,\n }, node => AXIS_KEY.test(String(node.key)));\n}\n"],"names":["sceneInsetRegion","AXIS_KEY","plotInsetRegion","viz","t","area","_plotArea","_chartTransform","x","y","width","height","node","test","String","key"],"mappings":"AAAA;;;;AAIA,GACA,SAAQA,gBAAgB,QAAO,gCAAgC;AAI/D,oEAAoE,GACpE,IAAMC,WAAW;AAEjB,0GAA0G,GAC1G,OAAO,SAASC,gBAAgBC,GAAgB;QAI/BC,MACAA;IAJf,IAAMC,OAAOF,IAAIG,SAAS,EAAEF,IAAID,IAAII,eAAe;IACnD,IAAI,CAACF,QAAQ,CAACD,GAAG,OAAO;IACxB,OAAOJ,iBAAiBG,KAAK;QAC3BK,GAAGH,KAAKG,CAAC,KAAIJ,OAAAA,EAAEI,CAAC,cAAHJ,kBAAAA,OAAO;QACpBK,GAAGJ,KAAKI,CAAC,KAAIL,OAAAA,EAAEK,CAAC,cAAHL,kBAAAA,OAAO;QACpBM,OAAOL,KAAKK,KAAK;QACjBC,QAAQN,KAAKM,MAAM;IACrB,GAAGC,SAAAA;eAAQX,SAASY,IAAI,CAACC,OAAOF,KAAKG,GAAG;;AAC1C"}
@@ -57,6 +57,8 @@ function _unsupported_iterable_to_array(o, minLen) {
57
57
  if (n === "Map" || n === "Set") return Array.from(n);
58
58
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
59
59
  }
60
+ import { visibleColor } from "../features/tooltipSwatch.js";
61
+ import { linkAs } from "../viz/linkGroup.js";
60
62
  import { renderSharedTooltip, renderSingleTooltip, restoreTooltip } from "./sharedTooltip.js";
61
63
  import { renderTrendTooltip } from "./trendTooltip.js";
62
64
  /**
@@ -73,9 +75,6 @@ import { renderTrendTooltip } from "./trendTooltip.js";
73
75
  (point[1] - ((_ref2 = t === null || t === void 0 ? void 0 : t.y) !== null && _ref2 !== void 0 ? _ref2 : 0)) / scale - ((_ref3 = c === null || c === void 0 ? void 0 : c.y) !== null && _ref3 !== void 0 ? _ref3 : 0)
74
76
  ];
75
77
  }
76
- var visibleColor = function visibleColor(s) {
77
- return typeof s === "string" && s !== "none" && s !== "transparent" ? s : undefined;
78
- };
79
78
  var discreteKey = function discreteKey(v) {
80
79
  return _instanceof(v, Date) ? String(v.getTime()) : String(v);
81
80
  };
@@ -188,22 +187,115 @@ var discreteKey = function discreteKey(v) {
188
187
  (viz._chartScene || []).forEach(function(node) {
189
188
  return walk(node);
190
189
  });
190
+ if (position) addProjectedColumns(viz, axis, columns, position);
191
191
  return columns;
192
192
  }
193
+ /**
194
+ Adds each trend line's projected steps (see `trendLineConfig.projection`)
195
+ as column members, so the crosshair snaps onto future positions and lists
196
+ every series' projected value there.
197
+ */ function addProjectedColumns(viz, axis, columns, position) {
198
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
199
+ try {
200
+ for(var _iterator = (viz._trendFits || [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
201
+ var fit = _step.value;
202
+ var _viz__trendLineConfig;
203
+ if (fit.axis !== axis || ((_viz__trendLineConfig = viz._trendLineConfig) === null || _viz__trendLineConfig === void 0 ? void 0 : _viz__trendLineConfig.tooltip) === false) continue;
204
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
205
+ try {
206
+ for(var _iterator1 = fit.samples[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
207
+ var sample = _step1.value;
208
+ if (!sample.step) continue;
209
+ var value = sample[axis];
210
+ var px = position(value);
211
+ if (!Number.isFinite(px)) continue;
212
+ var key = discreteKey(value);
213
+ var column = columns.get(key);
214
+ if (!column) {
215
+ column = {
216
+ px: px,
217
+ value: value,
218
+ members: new Map(),
219
+ bars: new Set(),
220
+ markers: []
221
+ };
222
+ columns.set(key, column);
223
+ }
224
+ var wrapped = fit.row || {};
225
+ column.members.set("".concat(fit.id, "::projected"), {
226
+ wrapped: wrapped,
227
+ color: fit.color,
228
+ shape: "Line",
229
+ trend: {
230
+ fit: fit,
231
+ sample: sample
232
+ }
233
+ });
234
+ }
235
+ } catch (err) {
236
+ _didIteratorError1 = true;
237
+ _iteratorError1 = err;
238
+ } finally{
239
+ try {
240
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
241
+ _iterator1.return();
242
+ }
243
+ } finally{
244
+ if (_didIteratorError1) {
245
+ throw _iteratorError1;
246
+ }
247
+ }
248
+ }
249
+ }
250
+ } catch (err) {
251
+ _didIteratorError = true;
252
+ _iteratorError = err;
253
+ } finally{
254
+ try {
255
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
256
+ _iterator.return();
257
+ }
258
+ } finally{
259
+ if (_didIteratorError) {
260
+ throw _iteratorError;
261
+ }
262
+ }
263
+ }
264
+ }
193
265
  /** A row for one column member; null when its value isn't numeric or its tooltip is off. */ function memberRow(viz, axis, id, member) {
266
+ if (member.trend) {
267
+ var _member_trend = member.trend, fit = _member_trend.fit, sample = _member_trend.sample;
268
+ var value = Number(sample[axis === "x" ? "y" : "x"]);
269
+ if (!Number.isFinite(value)) return null;
270
+ var name = String(fit.label);
271
+ var datum = fit.row || {};
272
+ return {
273
+ id: id,
274
+ name: name,
275
+ value: value,
276
+ color: member.color,
277
+ shape: "Line",
278
+ datum: datum,
279
+ index: 0,
280
+ projected: {
281
+ lci: sample.lci,
282
+ hci: sample.hci
283
+ }
284
+ };
285
+ }
194
286
  var valueOf = axis === "x" ? viz._y : viz._x;
195
- var datum = member.wrapped.data || member.wrapped;
287
+ var datum1 = member.wrapped.data || member.wrapped;
196
288
  var index = typeof member.wrapped.i === "number" ? member.wrapped.i : 0;
197
- var value = valueOf ? Number(valueOf(datum, index)) : NaN;
198
- if (!Number.isFinite(value) || !viz.schema.tooltip(datum, index)) return null;
199
- var name = String(viz._drawLabel(datum, index));
289
+ var value1 = valueOf ? Number(valueOf(datum1, index)) : NaN;
290
+ if (!Number.isFinite(value1) || !viz.schema.tooltip(datum1, index)) return null;
291
+ var name1 = String(viz._drawLabel(datum1, index));
200
292
  return {
201
293
  id: id,
202
- name: name,
203
- value: value,
294
+ name: name1,
295
+ value: value1,
204
296
  color: member.color,
205
297
  shape: member.shape,
206
- datum: datum,
298
+ datum: datum1,
207
299
  index: index
208
300
  };
209
301
  }
@@ -298,7 +390,9 @@ var discreteKey = function discreteKey(v) {
298
390
  var row = memberRow(viz, axis, id, member);
299
391
  if (row) rows.push(row);
300
392
  });
301
- if (rows.length >= 2) {
393
+ if (rows.length >= 2 || rows.some(function(r) {
394
+ return r.projected;
395
+ })) {
302
396
  sortRows(viz, axis, rows);
303
397
  var stack = best.bars.size ? {
304
398
  rows: best.bars,
@@ -404,7 +498,8 @@ var discreteKey = function discreteKey(v) {
404
498
  var prev = viz._sharedHoverState;
405
499
  viz._sharedHoverActive = true;
406
500
  viz._sharedHoverState = null;
407
- renderTrendTooltip(viz, trend, event);
501
+ var cursor = Array.isArray(event.point) ? contentPoint(viz, event.point) : undefined;
502
+ renderTrendTooltip(viz, trend, event, cursor);
408
503
  if (prev) {
409
504
  if (prev.mode === "shared" && typeof viz._hover === "function") viz.hover(false);
410
505
  viz._scheduleSceneRepaint();
@@ -422,10 +517,16 @@ var discreteKey = function discreteKey(v) {
422
517
  };
423
518
  if (hover.mode === "single") {
424
519
  if (prevMode === "shared") clear();
425
- } else if (stack) viz.hover(function(d) {
426
- return stack.rows.has(d) || !stack.bars.has(d);
427
- });
428
- else clear();
520
+ } else if (stack) {
521
+ // Non-bar marks stay bright in the column hover, but only the stack's
522
+ // own rows are what linked charts should match.
523
+ linkAs(viz, function(d) {
524
+ return stack.rows.has(d);
525
+ });
526
+ viz.hover(function(d) {
527
+ return stack.rows.has(d) || !stack.bars.has(d);
528
+ });
529
+ } else clear();
429
530
  }
430
531
 
431
532
  //# sourceMappingURL=sharedHover.js.map