stream-charts 1.2.1 → 2.0.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 (463) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +809 -1022
  3. package/changes.md +36 -0
  4. package/dist/app/charts/Chart.d.ts +35 -139
  5. package/dist/app/charts/Chart.d.ts.map +1 -0
  6. package/dist/app/charts/Chart.js +74 -65
  7. package/dist/app/charts/Chart.js.map +1 -1
  8. package/dist/app/charts/axes/AxesState.d.ts +26 -18
  9. package/dist/app/charts/axes/AxesState.d.ts.map +1 -0
  10. package/dist/app/charts/axes/AxesState.js +26 -24
  11. package/dist/app/charts/axes/AxesState.js.map +1 -1
  12. package/dist/app/charts/axes/AxisInterval.d.ts +44 -26
  13. package/dist/app/charts/axes/AxisInterval.d.ts.map +1 -0
  14. package/dist/app/charts/axes/AxisInterval.js +48 -29
  15. package/dist/app/charts/axes/AxisInterval.js.map +1 -1
  16. package/dist/app/charts/axes/BaseAxisRange.d.ts +46 -22
  17. package/dist/app/charts/axes/BaseAxisRange.d.ts.map +1 -0
  18. package/dist/app/charts/axes/BaseAxisRange.js +17 -12
  19. package/dist/app/charts/axes/BaseAxisRange.js.map +1 -1
  20. package/dist/app/charts/axes/ContinuousAxis.d.ts +47 -6
  21. package/dist/app/charts/axes/ContinuousAxis.d.ts.map +1 -0
  22. package/dist/app/charts/axes/ContinuousAxis.js +160 -27
  23. package/dist/app/charts/axes/ContinuousAxis.js.map +1 -1
  24. package/dist/app/charts/axes/ContinuousAxisRange.d.ts +29 -10
  25. package/dist/app/charts/axes/ContinuousAxisRange.d.ts.map +1 -0
  26. package/dist/app/charts/axes/ContinuousAxisRange.js +29 -11
  27. package/dist/app/charts/axes/ContinuousAxisRange.js.map +1 -1
  28. package/dist/app/charts/axes/EmptyAxis.d.ts +5 -2
  29. package/dist/app/charts/axes/EmptyAxis.d.ts.map +1 -0
  30. package/dist/app/charts/axes/EmptyAxis.js +30 -9
  31. package/dist/app/charts/axes/EmptyAxis.js.map +1 -1
  32. package/dist/app/charts/axes/OrdinalAxis.d.ts +5 -3
  33. package/dist/app/charts/axes/OrdinalAxis.d.ts.map +1 -0
  34. package/dist/app/charts/axes/OrdinalAxis.js +39 -16
  35. package/dist/app/charts/axes/OrdinalAxis.js.map +1 -1
  36. package/dist/app/charts/axes/OrdinalAxisRange.d.ts +76 -13
  37. package/dist/app/charts/axes/OrdinalAxisRange.d.ts.map +1 -0
  38. package/dist/app/charts/axes/OrdinalAxisRange.js +95 -16
  39. package/dist/app/charts/axes/OrdinalAxisRange.js.map +1 -1
  40. package/dist/app/charts/axes/autoScale.d.ts +111 -0
  41. package/dist/app/charts/axes/autoScale.d.ts.map +1 -0
  42. package/dist/app/charts/axes/autoScale.js +188 -0
  43. package/dist/app/charts/axes/autoScale.js.map +1 -0
  44. package/dist/app/charts/axes/axes.d.ts +273 -150
  45. package/dist/app/charts/axes/axes.d.ts.map +1 -0
  46. package/dist/app/charts/axes/axes.js +808 -583
  47. package/dist/app/charts/axes/axes.js.map +1 -1
  48. package/dist/app/charts/d3types.d.ts +40 -11
  49. package/dist/app/charts/d3types.d.ts.map +1 -0
  50. package/dist/app/charts/d3types.js +3 -0
  51. package/dist/app/charts/d3types.js.map +1 -1
  52. package/dist/app/charts/datasources/StreamingDataSource.d.ts +149 -0
  53. package/dist/app/charts/datasources/StreamingDataSource.d.ts.map +1 -0
  54. package/dist/app/charts/datasources/StreamingDataSource.js +110 -0
  55. package/dist/app/charts/datasources/StreamingDataSource.js.map +1 -0
  56. package/dist/app/charts/datasources/iteratesDataSource.d.ts +73 -0
  57. package/dist/app/charts/datasources/iteratesDataSource.d.ts.map +1 -0
  58. package/dist/app/charts/datasources/iteratesDataSource.js +87 -0
  59. package/dist/app/charts/datasources/iteratesDataSource.js.map +1 -0
  60. package/dist/app/charts/datasources/ordinalDataSource.d.ts +75 -0
  61. package/dist/app/charts/datasources/ordinalDataSource.d.ts.map +1 -0
  62. package/dist/app/charts/datasources/ordinalDataSource.js +135 -0
  63. package/dist/app/charts/datasources/ordinalDataSource.js.map +1 -0
  64. package/dist/app/charts/datasources/outlierDataSource.d.ts +53 -0
  65. package/dist/app/charts/datasources/outlierDataSource.d.ts.map +1 -0
  66. package/dist/app/charts/datasources/outlierDataSource.js +57 -0
  67. package/dist/app/charts/datasources/outlierDataSource.js.map +1 -0
  68. package/dist/app/charts/datasources/timeSeriesDataSource.d.ts +77 -0
  69. package/dist/app/charts/datasources/timeSeriesDataSource.d.ts.map +1 -0
  70. package/dist/app/charts/datasources/timeSeriesDataSource.js +85 -0
  71. package/dist/app/charts/datasources/timeSeriesDataSource.js.map +1 -0
  72. package/dist/app/charts/filters/regexFilter.d.ts +31 -4
  73. package/dist/app/charts/filters/regexFilter.d.ts.map +1 -0
  74. package/dist/app/charts/filters/regexFilter.js +38 -4
  75. package/dist/app/charts/filters/regexFilter.js.map +1 -1
  76. package/dist/app/charts/hooks/AxesProvider.d.ts +21 -0
  77. package/dist/app/charts/hooks/AxesProvider.d.ts.map +1 -0
  78. package/dist/app/charts/hooks/AxesProvider.js +213 -0
  79. package/dist/app/charts/hooks/AxesProvider.js.map +1 -0
  80. package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts +25 -0
  81. package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts.map +1 -0
  82. package/dist/app/charts/hooks/CanvasSurfaceProvider.js +76 -0
  83. package/dist/app/charts/hooks/CanvasSurfaceProvider.js.map +1 -0
  84. package/dist/app/charts/hooks/ChartProvider.d.ts +40 -0
  85. package/dist/app/charts/hooks/ChartProvider.d.ts.map +1 -0
  86. package/dist/app/charts/hooks/ChartProvider.js +33 -0
  87. package/dist/app/charts/hooks/ChartProvider.js.map +1 -0
  88. package/dist/app/charts/hooks/InteractionProvider.d.ts +23 -0
  89. package/dist/app/charts/hooks/InteractionProvider.d.ts.map +1 -0
  90. package/dist/app/charts/hooks/InteractionProvider.js +60 -0
  91. package/dist/app/charts/hooks/InteractionProvider.js.map +1 -0
  92. package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts +16 -0
  93. package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts.map +1 -0
  94. package/dist/app/charts/hooks/PlotDimensionsProvider.js +76 -0
  95. package/dist/app/charts/hooks/PlotDimensionsProvider.js.map +1 -0
  96. package/dist/app/charts/hooks/defaultAxesValues.d.ts +11 -0
  97. package/dist/app/charts/hooks/defaultAxesValues.d.ts.map +1 -0
  98. package/dist/app/charts/hooks/defaultAxesValues.js +36 -0
  99. package/dist/app/charts/hooks/defaultAxesValues.js.map +1 -0
  100. package/dist/app/charts/hooks/defaultMouseValues.d.ts +9 -0
  101. package/dist/app/charts/hooks/defaultMouseValues.d.ts.map +1 -0
  102. package/dist/app/charts/hooks/defaultMouseValues.js +23 -0
  103. package/dist/app/charts/hooks/defaultMouseValues.js.map +1 -0
  104. package/dist/app/charts/hooks/defaultPlotDimensions.d.ts +13 -0
  105. package/dist/app/charts/hooks/defaultPlotDimensions.d.ts.map +1 -0
  106. package/dist/app/charts/hooks/defaultPlotDimensions.js +23 -0
  107. package/dist/app/charts/hooks/defaultPlotDimensions.js.map +1 -0
  108. package/dist/app/charts/hooks/defaultTooltipValues.d.ts +9 -0
  109. package/dist/app/charts/hooks/defaultTooltipValues.d.ts.map +1 -0
  110. package/dist/app/charts/hooks/defaultTooltipValues.js +21 -0
  111. package/dist/app/charts/hooks/defaultTooltipValues.js.map +1 -0
  112. package/dist/app/charts/hooks/defaultUseChartValues.d.ts +14 -0
  113. package/dist/app/charts/hooks/defaultUseChartValues.d.ts.map +1 -0
  114. package/dist/app/charts/hooks/defaultUseChartValues.js +30 -0
  115. package/dist/app/charts/hooks/defaultUseChartValues.js.map +1 -0
  116. package/dist/app/charts/hooks/useAxes.d.ts +49 -36
  117. package/dist/app/charts/hooks/useAxes.d.ts.map +1 -0
  118. package/dist/app/charts/hooks/useAxes.js +16 -176
  119. package/dist/app/charts/hooks/useAxes.js.map +1 -1
  120. package/dist/app/charts/hooks/useCanvasSurface.d.ts +25 -0
  121. package/dist/app/charts/hooks/useCanvasSurface.d.ts.map +1 -0
  122. package/dist/app/charts/hooks/useCanvasSurface.js +18 -0
  123. package/dist/app/charts/hooks/useCanvasSurface.js.map +1 -0
  124. package/dist/app/charts/hooks/useChart.d.ts +30 -44
  125. package/dist/app/charts/hooks/useChart.d.ts.map +1 -0
  126. package/dist/app/charts/hooks/useChart.js +26 -48
  127. package/dist/app/charts/hooks/useChart.js.map +1 -1
  128. package/dist/app/charts/hooks/useDataSource.d.ts +68 -0
  129. package/dist/app/charts/hooks/useDataSource.d.ts.map +1 -0
  130. package/dist/app/charts/hooks/useDataSource.js +63 -0
  131. package/dist/app/charts/hooks/useDataSource.js.map +1 -0
  132. package/dist/app/charts/hooks/useHoveredSeries.d.ts +25 -0
  133. package/dist/app/charts/hooks/useHoveredSeries.d.ts.map +1 -0
  134. package/dist/app/charts/hooks/useHoveredSeries.js +15 -0
  135. package/dist/app/charts/hooks/useHoveredSeries.js.map +1 -0
  136. package/dist/app/charts/hooks/useMouse.d.ts +46 -22
  137. package/dist/app/charts/hooks/useMouse.d.ts.map +1 -0
  138. package/dist/app/charts/hooks/useMouse.js +12 -56
  139. package/dist/app/charts/hooks/useMouse.js.map +1 -1
  140. package/dist/app/charts/hooks/usePlotDimensions.d.ts +25 -13
  141. package/dist/app/charts/hooks/usePlotDimensions.d.ts.map +1 -0
  142. package/dist/app/charts/hooks/usePlotDimensions.js +6 -62
  143. package/dist/app/charts/hooks/usePlotDimensions.js.map +1 -1
  144. package/dist/app/charts/hooks/useTooltip.d.ts +24 -26
  145. package/dist/app/charts/hooks/useTooltip.d.ts.map +1 -0
  146. package/dist/app/charts/hooks/useTooltip.js +12 -42
  147. package/dist/app/charts/hooks/useTooltip.js.map +1 -1
  148. package/dist/app/charts/index.d.ts +66 -0
  149. package/dist/app/charts/index.d.ts.map +1 -0
  150. package/dist/app/charts/index.js +87 -0
  151. package/dist/app/charts/index.js.map +1 -0
  152. package/dist/app/charts/legends/Legend.d.ts +33 -12
  153. package/dist/app/charts/legends/Legend.d.ts.map +1 -0
  154. package/dist/app/charts/legends/Legend.js +138 -379
  155. package/dist/app/charts/legends/Legend.js.map +1 -1
  156. package/dist/app/charts/legends/constants.d.ts +19 -0
  157. package/dist/app/charts/legends/constants.d.ts.map +1 -0
  158. package/dist/app/charts/legends/constants.js +34 -0
  159. package/dist/app/charts/legends/constants.js.map +1 -0
  160. package/dist/app/charts/observables/ChartData.d.ts +1 -0
  161. package/dist/app/charts/observables/ChartData.d.ts.map +1 -0
  162. package/dist/app/charts/observables/iterates.d.ts +13 -7
  163. package/dist/app/charts/observables/iterates.d.ts.map +1 -0
  164. package/dist/app/charts/observables/iterates.js +42 -9
  165. package/dist/app/charts/observables/iterates.js.map +1 -1
  166. package/dist/app/charts/observables/ordinals.d.ts +70 -12
  167. package/dist/app/charts/observables/ordinals.d.ts.map +1 -0
  168. package/dist/app/charts/observables/ordinals.js +127 -48
  169. package/dist/app/charts/observables/ordinals.js.map +1 -1
  170. package/dist/app/charts/observables/outliers.d.ts +18 -0
  171. package/dist/app/charts/observables/outliers.d.ts.map +1 -0
  172. package/dist/app/charts/observables/outliers.js +2 -0
  173. package/dist/app/charts/observables/outliers.js.map +1 -0
  174. package/dist/app/charts/plots/BarPlot.d.ts +87 -13
  175. package/dist/app/charts/plots/BarPlot.d.ts.map +1 -0
  176. package/dist/app/charts/plots/BarPlot.js +603 -356
  177. package/dist/app/charts/plots/BarPlot.js.map +1 -1
  178. package/dist/app/charts/plots/OutlierPlot.d.ts +123 -0
  179. package/dist/app/charts/plots/OutlierPlot.d.ts.map +1 -0
  180. package/dist/app/charts/plots/OutlierPlot.js +430 -0
  181. package/dist/app/charts/plots/OutlierPlot.js.map +1 -0
  182. package/dist/app/charts/plots/PoincarePlot.d.ts +92 -14
  183. package/dist/app/charts/plots/PoincarePlot.d.ts.map +1 -0
  184. package/dist/app/charts/plots/PoincarePlot.js +523 -364
  185. package/dist/app/charts/plots/PoincarePlot.js.map +1 -1
  186. package/dist/app/charts/plots/RasterPlot.d.ts +31 -10
  187. package/dist/app/charts/plots/RasterPlot.d.ts.map +1 -0
  188. package/dist/app/charts/plots/RasterPlot.js +198 -306
  189. package/dist/app/charts/plots/RasterPlot.js.map +1 -1
  190. package/dist/app/charts/plots/ScatterPlot.d.ts +77 -21
  191. package/dist/app/charts/plots/ScatterPlot.d.ts.map +1 -0
  192. package/dist/app/charts/plots/ScatterPlot.js +359 -302
  193. package/dist/app/charts/plots/ScatterPlot.js.map +1 -1
  194. package/dist/app/charts/plots/autoScaleYAxes.d.ts +43 -0
  195. package/dist/app/charts/plots/autoScaleYAxes.d.ts.map +1 -0
  196. package/dist/app/charts/plots/autoScaleYAxes.js +71 -0
  197. package/dist/app/charts/plots/autoScaleYAxes.js.map +1 -0
  198. package/dist/app/charts/plots/colorizedLine.d.ts +61 -0
  199. package/dist/app/charts/plots/colorizedLine.d.ts.map +1 -0
  200. package/dist/app/charts/plots/colorizedLine.js +157 -0
  201. package/dist/app/charts/plots/colorizedLine.js.map +1 -0
  202. package/dist/app/charts/plots/constants.d.ts +7 -0
  203. package/dist/app/charts/plots/constants.d.ts.map +1 -0
  204. package/dist/app/charts/plots/constants.js +11 -0
  205. package/dist/app/charts/plots/constants.js.map +1 -0
  206. package/dist/app/charts/plots/hitTesting.d.ts +88 -0
  207. package/dist/app/charts/plots/hitTesting.d.ts.map +1 -0
  208. package/dist/app/charts/plots/hitTesting.js +136 -0
  209. package/dist/app/charts/plots/hitTesting.js.map +1 -0
  210. package/dist/app/charts/plots/plot.d.ts +52 -16
  211. package/dist/app/charts/plots/plot.d.ts.map +1 -0
  212. package/dist/app/charts/plots/plot.js +108 -35
  213. package/dist/app/charts/plots/plot.js.map +1 -1
  214. package/dist/app/charts/plots/useCanvasZoomPan.d.ts +119 -0
  215. package/dist/app/charts/plots/useCanvasZoomPan.d.ts.map +1 -0
  216. package/dist/app/charts/plots/useCanvasZoomPan.js +113 -0
  217. package/dist/app/charts/plots/useCanvasZoomPan.js.map +1 -0
  218. package/dist/app/charts/plots/useStreamingTimeAxes.d.ts +103 -0
  219. package/dist/app/charts/plots/useStreamingTimeAxes.d.ts.map +1 -0
  220. package/dist/app/charts/plots/useStreamingTimeAxes.js +257 -0
  221. package/dist/app/charts/plots/useStreamingTimeAxes.js.map +1 -0
  222. package/dist/app/charts/series/baseSeries.d.ts +60 -8
  223. package/dist/app/charts/series/baseSeries.d.ts.map +1 -0
  224. package/dist/app/charts/series/baseSeries.js +53 -8
  225. package/dist/app/charts/series/baseSeries.js.map +1 -1
  226. package/dist/app/charts/series/iterateSeries.d.ts +9 -8
  227. package/dist/app/charts/series/iterateSeries.d.ts.map +1 -0
  228. package/dist/app/charts/series/iterateSeries.js +7 -7
  229. package/dist/app/charts/series/iterateSeries.js.map +1 -1
  230. package/dist/app/charts/series/ordinalSeries.d.ts +27 -13
  231. package/dist/app/charts/series/ordinalSeries.d.ts.map +1 -0
  232. package/dist/app/charts/series/ordinalSeries.js +29 -15
  233. package/dist/app/charts/series/ordinalSeries.js.map +1 -1
  234. package/dist/app/charts/series/outlierSeries.d.ts +142 -0
  235. package/dist/app/charts/series/outlierSeries.d.ts.map +1 -0
  236. package/dist/app/charts/series/outlierSeries.js +82 -0
  237. package/dist/app/charts/series/outlierSeries.js.map +1 -0
  238. package/dist/app/charts/series/timeSeries.d.ts +13 -9
  239. package/dist/app/charts/series/timeSeries.d.ts.map +1 -0
  240. package/dist/app/charts/series/timeSeries.js +6 -3
  241. package/dist/app/charts/series/timeSeries.js.map +1 -1
  242. package/dist/app/charts/series/timeSeriesChartData.d.ts +18 -10
  243. package/dist/app/charts/series/timeSeriesChartData.d.ts.map +1 -0
  244. package/dist/app/charts/series/timeSeriesChartData.js +28 -14
  245. package/dist/app/charts/series/timeSeriesChartData.js.map +1 -1
  246. package/dist/app/charts/styling/barPlotStyle.d.ts +46 -2
  247. package/dist/app/charts/styling/barPlotStyle.d.ts.map +1 -0
  248. package/dist/app/charts/styling/barPlotStyle.js +37 -3
  249. package/dist/app/charts/styling/barPlotStyle.js.map +1 -1
  250. package/dist/app/charts/styling/canvasStyle.d.ts +53 -0
  251. package/dist/app/charts/styling/canvasStyle.d.ts.map +1 -0
  252. package/dist/app/charts/styling/canvasStyle.js +71 -0
  253. package/dist/app/charts/styling/canvasStyle.js.map +1 -0
  254. package/dist/app/charts/styling/margins.d.ts +21 -2
  255. package/dist/app/charts/styling/margins.d.ts.map +1 -0
  256. package/dist/app/charts/styling/margins.js +25 -4
  257. package/dist/app/charts/styling/margins.js.map +1 -1
  258. package/dist/app/charts/styling/svgStyle.d.ts +10 -56
  259. package/dist/app/charts/styling/svgStyle.d.ts.map +1 -0
  260. package/dist/app/charts/styling/svgStyle.js +3 -78
  261. package/dist/app/charts/styling/svgStyle.js.map +1 -1
  262. package/dist/app/charts/subscriptions/viewDrivers.d.ts +124 -0
  263. package/dist/app/charts/subscriptions/viewDrivers.d.ts.map +1 -0
  264. package/dist/app/charts/subscriptions/viewDrivers.js +338 -0
  265. package/dist/app/charts/subscriptions/viewDrivers.js.map +1 -0
  266. package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts +12 -78
  267. package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts.map +1 -0
  268. package/dist/app/charts/tooltips/BarPlotTooltipContent.js +65 -257
  269. package/dist/app/charts/tooltips/BarPlotTooltipContent.js.map +1 -1
  270. package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts +9 -0
  271. package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts.map +1 -0
  272. package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js +16 -0
  273. package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js.map +1 -0
  274. package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts +30 -0
  275. package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts.map +1 -0
  276. package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js +26 -0
  277. package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js.map +1 -0
  278. package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts +22 -72
  279. package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts.map +1 -0
  280. package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js +104 -171
  281. package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js.map +1 -1
  282. package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts +32 -8
  283. package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts.map +1 -0
  284. package/dist/app/charts/tooltips/RasterPlotTooltipContent.js +62 -115
  285. package/dist/app/charts/tooltips/RasterPlotTooltipContent.js.map +1 -1
  286. package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts +39 -12
  287. package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts.map +1 -0
  288. package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js +162 -134
  289. package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js.map +1 -1
  290. package/dist/app/charts/tooltips/Tooltip.d.ts +27 -32
  291. package/dist/app/charts/tooltips/Tooltip.d.ts.map +1 -0
  292. package/dist/app/charts/tooltips/Tooltip.js +37 -81
  293. package/dist/app/charts/tooltips/Tooltip.js.map +1 -1
  294. package/dist/app/charts/tooltips/TooltipContent.d.ts +81 -0
  295. package/dist/app/charts/tooltips/TooltipContent.d.ts.map +1 -0
  296. package/dist/app/charts/tooltips/TooltipContent.js +99 -0
  297. package/dist/app/charts/tooltips/TooltipContent.js.map +1 -0
  298. package/dist/app/charts/tooltips/tooltipUtils.d.ts +186 -36
  299. package/dist/app/charts/tooltips/tooltipUtils.d.ts.map +1 -0
  300. package/dist/app/charts/tooltips/tooltipUtils.js +277 -48
  301. package/dist/app/charts/tooltips/tooltipUtils.js.map +1 -1
  302. package/dist/app/charts/tooltips/useOutlierTooltip.d.ts +59 -0
  303. package/dist/app/charts/tooltips/useOutlierTooltip.d.ts.map +1 -0
  304. package/dist/app/charts/tooltips/useOutlierTooltip.js +16 -0
  305. package/dist/app/charts/tooltips/useOutlierTooltip.js.map +1 -0
  306. package/dist/app/charts/tooltips/useTooltipPlacement.d.ts +51 -0
  307. package/dist/app/charts/tooltips/useTooltipPlacement.d.ts.map +1 -0
  308. package/dist/app/charts/tooltips/useTooltipPlacement.js +52 -0
  309. package/dist/app/charts/tooltips/useTooltipPlacement.js.map +1 -0
  310. package/dist/app/charts/tooltips/useTooltipStyle.d.ts +11 -0
  311. package/dist/app/charts/tooltips/useTooltipStyle.d.ts.map +1 -0
  312. package/dist/app/charts/tooltips/useTooltipStyle.js +14 -0
  313. package/dist/app/charts/tooltips/useTooltipStyle.js.map +1 -0
  314. package/dist/app/charts/trackers/Tracker.d.ts +22 -6
  315. package/dist/app/charts/trackers/Tracker.d.ts.map +1 -0
  316. package/dist/app/charts/trackers/Tracker.js +36 -22
  317. package/dist/app/charts/trackers/Tracker.js.map +1 -1
  318. package/dist/app/charts/trackers/trackerUtils.d.ts +40 -18
  319. package/dist/app/charts/trackers/trackerUtils.d.ts.map +1 -0
  320. package/dist/app/charts/trackers/trackerUtils.js +213 -300
  321. package/dist/app/charts/trackers/trackerUtils.js.map +1 -1
  322. package/dist/app/charts/utils.d.ts +72 -33
  323. package/dist/app/charts/utils.d.ts.map +1 -0
  324. package/dist/app/charts/utils.js +87 -42
  325. package/dist/app/charts/utils.js.map +1 -1
  326. package/dist/index.d.ts +2 -45
  327. package/dist/index.d.ts.map +1 -0
  328. package/dist/index.js +2 -72
  329. package/dist/index.js.map +1 -1
  330. package/package.json +87 -46
  331. package/src/app/charts/Chart.tsx +132 -168
  332. package/src/app/charts/axes/AxesState.ts +27 -29
  333. package/src/app/charts/axes/AxisInterval.ts +57 -32
  334. package/src/app/charts/axes/BaseAxisRange.ts +47 -27
  335. package/src/app/charts/axes/ContinuousAxis.tsx +235 -39
  336. package/src/app/charts/axes/ContinuousAxisRange.ts +29 -11
  337. package/src/app/charts/axes/EmptyAxis.tsx +52 -17
  338. package/src/app/charts/axes/OrdinalAxis.tsx +54 -28
  339. package/src/app/charts/axes/OrdinalAxisRange.ts +96 -16
  340. package/src/app/charts/axes/autoScale.ts +244 -0
  341. package/src/app/charts/axes/axes.ts +954 -735
  342. package/src/app/charts/d3types.ts +42 -13
  343. package/src/app/charts/datasources/StreamingDataSource.ts +214 -0
  344. package/src/app/charts/datasources/iteratesDataSource.ts +122 -0
  345. package/src/app/charts/datasources/ordinalDataSource.ts +205 -0
  346. package/src/app/charts/datasources/outlierDataSource.ts +90 -0
  347. package/src/app/charts/datasources/timeSeriesDataSource.ts +133 -0
  348. package/src/app/charts/filters/regexFilter.ts +45 -5
  349. package/src/app/charts/hooks/AxesProvider.tsx +301 -0
  350. package/src/app/charts/hooks/CanvasSurfaceProvider.tsx +117 -0
  351. package/src/app/charts/hooks/ChartProvider.tsx +79 -0
  352. package/src/app/charts/hooks/InteractionProvider.tsx +88 -0
  353. package/src/app/charts/hooks/PlotDimensionsProvider.tsx +109 -0
  354. package/src/app/charts/hooks/defaultAxesValues.ts +40 -0
  355. package/src/app/charts/hooks/defaultMouseValues.ts +24 -0
  356. package/src/app/charts/hooks/defaultPlotDimensions.ts +27 -0
  357. package/src/app/charts/hooks/defaultTooltipValues.tsx +23 -0
  358. package/src/app/charts/hooks/defaultUseChartValues.tsx +36 -0
  359. package/src/app/charts/hooks/useAxes.tsx +60 -228
  360. package/src/app/charts/hooks/useCanvasSurface.tsx +35 -0
  361. package/src/app/charts/hooks/useChart.tsx +47 -106
  362. package/src/app/charts/hooks/useDataSource.tsx +106 -0
  363. package/src/app/charts/hooks/useHoveredSeries.tsx +33 -0
  364. package/src/app/charts/hooks/useMouse.tsx +58 -82
  365. package/src/app/charts/hooks/usePlotDimensions.tsx +25 -89
  366. package/src/app/charts/hooks/useTooltip.tsx +32 -63
  367. package/src/app/charts/index.ts +213 -0
  368. package/src/app/charts/legends/Legend.tsx +198 -479
  369. package/src/app/charts/legends/constants.ts +37 -0
  370. package/src/app/charts/observables/iterates.ts +32 -12
  371. package/src/app/charts/observables/ordinals.ts +141 -67
  372. package/src/app/charts/observables/outliers.ts +20 -0
  373. package/src/app/charts/plots/BarPlot.tsx +784 -666
  374. package/src/app/charts/plots/OutlierPlot.tsx +685 -0
  375. package/src/app/charts/plots/PoincarePlot.tsx +707 -489
  376. package/src/app/charts/plots/RasterPlot.tsx +253 -445
  377. package/src/app/charts/plots/ScatterPlot.tsx +480 -463
  378. package/src/app/charts/plots/autoScaleYAxes.ts +102 -0
  379. package/src/app/charts/plots/colorizedLine.ts +185 -0
  380. package/src/app/charts/plots/constants.ts +16 -0
  381. package/src/app/charts/plots/hitTesting.ts +198 -0
  382. package/src/app/charts/plots/plot.ts +138 -44
  383. package/src/app/charts/plots/useCanvasZoomPan.ts +240 -0
  384. package/src/app/charts/plots/useStreamingTimeAxes.ts +384 -0
  385. package/src/app/charts/series/baseSeries.ts +81 -14
  386. package/src/app/charts/series/iterateSeries.ts +8 -8
  387. package/src/app/charts/series/ordinalSeries.ts +35 -20
  388. package/src/app/charts/series/outlierSeries.ts +188 -0
  389. package/src/app/charts/series/timeSeries.ts +14 -12
  390. package/src/app/charts/series/timeSeriesChartData.ts +31 -17
  391. package/src/app/charts/styling/barPlotStyle.ts +48 -5
  392. package/src/app/charts/styling/canvasStyle.ts +86 -0
  393. package/src/app/charts/styling/margins.ts +28 -4
  394. package/src/app/charts/styling/svgStyle.ts +10 -91
  395. package/src/app/charts/subscriptions/viewDrivers.ts +447 -0
  396. package/src/app/charts/tooltips/BarPlotTooltipContent.tsx +156 -380
  397. package/src/app/charts/tooltips/DefaultOutlierTooltipContent.tsx +40 -0
  398. package/src/app/charts/tooltips/OutlierPlotTooltipContent.tsx +67 -0
  399. package/src/app/charts/tooltips/PoincarePlotTooltipContent.tsx +229 -292
  400. package/src/app/charts/tooltips/RasterPlotTooltipContent.tsx +164 -217
  401. package/src/app/charts/tooltips/ScatterPlotTooltipContent.tsx +373 -236
  402. package/src/app/charts/tooltips/Tooltip.tsx +58 -124
  403. package/src/app/charts/tooltips/TooltipContent.tsx +177 -0
  404. package/src/app/charts/tooltips/tooltipUtils.ts +359 -61
  405. package/src/app/charts/tooltips/useOutlierTooltip.tsx +68 -0
  406. package/src/app/charts/tooltips/useTooltipPlacement.ts +86 -0
  407. package/src/app/charts/tooltips/useTooltipStyle.ts +15 -0
  408. package/src/app/charts/trackers/Tracker.tsx +68 -33
  409. package/src/app/charts/trackers/trackerUtils.ts +263 -376
  410. package/src/app/charts/utils.ts +90 -48
  411. package/src/index.ts +2 -322
  412. package/dist/app/charts/axes/AxesState.test.d.ts +0 -1
  413. package/dist/app/charts/axes/AxesState.test.js +0 -30
  414. package/dist/app/charts/axes/AxesState.test.js.map +0 -1
  415. package/dist/app/charts/axes/AxisInterval.test.d.ts +0 -1
  416. package/dist/app/charts/axes/AxisInterval.test.js +0 -120
  417. package/dist/app/charts/axes/AxisInterval.test.js.map +0 -1
  418. package/dist/app/charts/axes/ContinuousAxisRange.test.d.ts +0 -1
  419. package/dist/app/charts/axes/ContinuousAxisRange.test.js +0 -47
  420. package/dist/app/charts/axes/ContinuousAxisRange.test.js.map +0 -1
  421. package/dist/app/charts/axes/OrdinalAxisRange.test.d.ts +0 -1
  422. package/dist/app/charts/axes/OrdinalAxisRange.test.js +0 -48
  423. package/dist/app/charts/axes/OrdinalAxisRange.test.js.map +0 -1
  424. package/dist/app/charts/filters/regexFilter.test.d.ts +0 -1
  425. package/dist/app/charts/filters/regexFilter.test.js +0 -11
  426. package/dist/app/charts/filters/regexFilter.test.js.map +0 -1
  427. package/dist/app/charts/hooks/useDataObservable.d.ts +0 -72
  428. package/dist/app/charts/hooks/useDataObservable.js +0 -74
  429. package/dist/app/charts/hooks/useDataObservable.js.map +0 -1
  430. package/dist/app/charts/hooks/useInitialData.d.ts +0 -36
  431. package/dist/app/charts/hooks/useInitialData.js +0 -28
  432. package/dist/app/charts/hooks/useInitialData.js.map +0 -1
  433. package/dist/app/charts/observables/iterates.test.d.ts +0 -1
  434. package/dist/app/charts/observables/iterates.test.js +0 -180
  435. package/dist/app/charts/observables/iterates.test.js.map +0 -1
  436. package/dist/app/charts/observables/ordinals.test.d.ts +0 -1
  437. package/dist/app/charts/observables/ordinals.test.js +0 -102
  438. package/dist/app/charts/observables/ordinals.test.js.map +0 -1
  439. package/dist/app/charts/series/datumSeries.test.d.ts +0 -1
  440. package/dist/app/charts/series/datumSeries.test.js +0 -50
  441. package/dist/app/charts/series/datumSeries.test.js.map +0 -1
  442. package/dist/app/charts/styling/margins.test.d.ts +0 -1
  443. package/dist/app/charts/styling/margins.test.js +0 -19
  444. package/dist/app/charts/styling/margins.test.js.map +0 -1
  445. package/dist/app/charts/subscriptions/subscription.test.d.ts +0 -1
  446. package/dist/app/charts/subscriptions/subscription.test.js +0 -395
  447. package/dist/app/charts/subscriptions/subscription.test.js.map +0 -1
  448. package/dist/app/charts/subscriptions/subscriptions.d.ts +0 -100
  449. package/dist/app/charts/subscriptions/subscriptions.js +0 -449
  450. package/dist/app/charts/subscriptions/subscriptions.js.map +0 -1
  451. package/src/app/charts/axes/AxesState.test.ts +0 -34
  452. package/src/app/charts/axes/AxisInterval.test.ts +0 -143
  453. package/src/app/charts/axes/ContinuousAxisRange.test.ts +0 -55
  454. package/src/app/charts/axes/OrdinalAxisRange.test.ts +0 -55
  455. package/src/app/charts/filters/regexFilter.test.ts +0 -13
  456. package/src/app/charts/hooks/useDataObservable.tsx +0 -170
  457. package/src/app/charts/hooks/useInitialData.tsx +0 -64
  458. package/src/app/charts/observables/iterates.test.ts +0 -201
  459. package/src/app/charts/observables/ordinals.test.ts +0 -135
  460. package/src/app/charts/series/datumSeries.test.ts +0 -60
  461. package/src/app/charts/styling/margins.test.ts +0 -22
  462. package/src/app/charts/subscriptions/subscription.test.ts +0 -499
  463. package/src/app/charts/subscriptions/subscriptions.ts +0 -635
@@ -1,10 +1,11 @@
1
- import { Dimensions, Margin } from "../styling/margins";
1
+ import type { Dimensions, Margin } from "../styling/margins";
2
2
  import { ContinuousAxisRange } from "./ContinuousAxisRange";
3
- import { Axis, ScaleBand, ScaleContinuousNumeric, ZoomTransform } from "d3";
4
- import { AxisElementSelection, SvgSelection } from "../d3types";
3
+ import type { AutoScale } from "./autoScale";
4
+ import { type ScaleBand, type ScaleContinuousNumeric } from "d3";
5
+ import type { CanvasContext } from "../d3types";
5
6
  import { AxesState } from "./AxesState";
6
- import { AxesAssignment } from "../plots/plot";
7
- import { BaseSeries } from "../series/baseSeries";
7
+ import type { AxesAssignment } from "../plots/plot";
8
+ import type { BaseSeries } from "../series/baseSeries";
8
9
  import { OrdinalAxisRange } from "./OrdinalAxisRange";
9
10
  import { BaseAxisRange } from "./BaseAxisRange";
10
11
  import { AxisInterval } from "./AxisInterval";
@@ -18,7 +19,8 @@ export type AxisTickStyle = {
18
19
  };
19
20
  /**
20
21
  * Factory function to create a default AxisTickStyle with the default font,
21
- * no rotation, and no auto-rotation.
22
+ * no rotation, and no autorotation.
23
+ * @return The default axis tick style
22
24
  */
23
25
  export declare function defaultAxisTickStyle(): AxisTickStyle;
24
26
  /**
@@ -33,6 +35,7 @@ export interface AxesFont {
33
35
  /**
34
36
  * Factory function to create a default AxesFont with the default font size, color,
35
37
  * family, and weight.
38
+ * @return The default axes font
36
39
  */
37
40
  export declare function defaultAxesFont(): AxesFont;
38
41
  /**
@@ -53,19 +56,59 @@ export interface SeriesLineStyle extends SeriesStyle {
53
56
  /**
54
57
  * Factory function to create a default SeriesLineStyle with the default color, line width,
55
58
  * highlight color, and highlight width.
59
+ * @return The default series line style
56
60
  */
57
61
  export declare function defaultLineStyle(): SeriesLineStyle;
58
62
  /**
59
- * The base interface that all Axes must implement. Each axis must have a unique ID,
60
- * a location (top, bottom, left, right), and d3 SVG selection for the axis.
63
+ * The concrete kind of an axis, set by every axis-creator function to its own unique value.
64
+ * Lets code that only has a `BaseAxis` (e.g. a plot's `axesFor` validating an `axisAssignments`
65
+ * entry) discriminate the concrete axis shape at runtime -- `BaseAxis`/`ContinuousNumericAxis`/
66
+ * `OrdinalStringAxis` are plain structural interfaces, so a type-level cast (`as ContinuousNumericAxis`)
67
+ * cannot do that; this field is what actually can.
68
+ * Note: replaces enums to support `erasableSyntaxOnly`
69
+ * TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
70
+ */
71
+ export declare const AxisType: {
72
+ readonly ContinuousNumeric: "ContinuousNumeric";
73
+ readonly OrdinalString: "OrdinalString";
74
+ };
75
+ export type AxisType = (typeof AxisType)[keyof typeof AxisType];
76
+ /**
77
+ * Checks that a plot's axis is of the type the plot needs (e.g. a bar plot needs an ordinal x-axis).
78
+ * A missing axis passes, since the plots already skip the series whose axes aren't found.
79
+ * @param plotName The name of the plot's component (e.g. "RasterPlot")
80
+ * @param dimension Whether the axis is the plot's x-axis or its y-axis
81
+ * @param axis The axis (`undefined` when it isn't found)
82
+ * @param expected The axis type the plot needs
83
+ * @throws Error when the axis isn't of the expected type, naming the axis component it needs to be
84
+ */
85
+ export declare function checkAxisType(plotName: string, dimension: 'x' | 'y', axis: BaseAxis | undefined, expected: AxisType): void;
86
+ /**
87
+ * The base interface that all Axes must implement. Each axis must have a unique ID and a location
88
+ * (top, bottom, left, right). Under the old SVG-backed implementation this also carried a
89
+ * `selection`; that's gone now that axes draw onto a shared canvas instead of owning their own DOM
90
+ * elements.
61
91
  */
62
92
  export interface BaseAxis {
63
93
  axisId: string;
64
94
  location: AxisLocation;
65
- selection: AxisElementSelection;
95
+ /**
96
+ * The concrete kind of this axis (see {@link AxisType}). Every axis-creator function sets this
97
+ * to its own unique value.
98
+ */
99
+ axisType: AxisType;
100
+ /**
101
+ * True for a placeholder axis added via `addEmptyXAxis`/`addEmptyYAxis` (just a
102
+ * line, with no real data domain behind it). Consumers that report a value for the mouse
103
+ * position -- e.g., the tracker's axis labels -- should skip axes marked this way, since their
104
+ * scale doesn't reflect anything meaningful.
105
+ */
106
+ isEmpty?: boolean;
66
107
  }
67
108
  /**
68
- * Represents a continuous numeric axis.
109
+ * Represents a continuous numeric axis. Draws itself by registering a draw function with the
110
+ * chart's {@link CanvasContext} (see `addContinuousNumericXAxis` and
111
+ * `addContinuousNumericYAxis`, below) rather than owning an SVG element.
69
112
  */
70
113
  export interface ContinuousNumericAxis extends BaseAxis {
71
114
  /**
@@ -73,200 +116,270 @@ export interface ContinuousNumericAxis extends BaseAxis {
73
116
  */
74
117
  scale: ScaleContinuousNumeric<number, number>;
75
118
  /**
76
- * A d3 axis generator for a continuous numeric axis.
119
+ * When set, the axis' domain grows to fit the data plotted against it, within the settings'
120
+ * limits (see `ContinuousAxis`'s `autoScale` prop). Set by the axis component, and applied by
121
+ * the plots that support it (for y-axes).
77
122
  */
78
- generator: Axis<number | {
79
- valueOf(): number;
80
- }>;
123
+ autoScale?: AutoScale;
81
124
  /**
82
- * Updates the axis based on the specified domain and plot dimensions.
125
+ * Updates the axis based on the specified domain and plot dimensions and requests the plot
126
+ * to be redrawn.
83
127
  * @param domain The interval representing the domain of the axis.
84
128
  * @param plotDimensions The dimensions of the plot (without the margins).
85
129
  * @param margin The margins for the plot
86
130
  */
87
131
  update: (domain: AxisInterval, plotDimensions: Dimensions, margin: Margin) => void;
132
+ /**
133
+ * Updates the font (color, size, family, weight) used for ticks and the axis label, without
134
+ * recreating the axis or touching its domain. Used to keep the label color in sync with the
135
+ * chart's `color` prop (e.g., on a theme change) between full axis updates.
136
+ */
137
+ updateFont: (font: AxesFont) => void;
138
+ /**
139
+ * Highlights (or un-highlights) this axis -- used, for example, to indicate which axis a
140
+ * currently-hovered series is plotted against. When `highlighted` is true, the axis' domain
141
+ * line, ticks, and labels are drawn in `color` at `lineWidth` instead of the normal font color
142
+ * and 1px line; `color`/`lineWidth` are remembered across calls, so a later `setHighlighted(true)`
143
+ * without them reuses whatever was last passed (or the built-in default on the first call).
144
+ * @param highlighted Whether the axis should be drawn highlighted
145
+ * @param color The highlight color
146
+ * @param lineWidth The highlight line width
147
+ */
148
+ setHighlighted: (highlighted: boolean, color?: string, lineWidth?: number) => void;
88
149
  }
89
150
  /**
90
- * Represents an ordinal string axis.
151
+ * Represents an ordinal string axis. Draws itself by registering a draw function with the chart's
152
+ * {@link CanvasContext} rather than owning an SVG element.
91
153
  */
92
154
  export interface OrdinalStringAxis extends BaseAxis {
93
155
  /**
94
156
  * A d3 scale for an ordinal string axis.
95
157
  */
96
158
  scale: ScaleBand<string>;
97
- /**
98
- * A d3 axis generator for an ordinal string axis.
99
- */
100
- generator: Axis<string>;
101
159
  /**
102
160
  * The size of each category on the axis.
103
161
  */
104
162
  categorySize: number;
105
163
  /**
106
- * Updates the axis based on the specified domain and plot dimensions.
164
+ * Updates the axis based on the specified categories, range, and plot dimensions, and requests
165
+ * the plot to be redrawn.
166
+ * @param categories The category names for the axis, in order -- replaces the scale's domain,
167
+ * so passing a different set of categories (e.g. because the number of series changed) is how
168
+ * an axis reflects a new category count. Pass `axis.scale.domain()` to leave the categories
169
+ * unchanged (e.g. from a pan/zoom call site that isn't varying the category set).
107
170
  * @param range An interval representing the range of the axis.
108
171
  * @param originalRange An interval representing the original range of the axis (before zooming or panning).
109
172
  * @param plotDimensions The dimensions of the plot (without the margins).
110
173
  * @param margin The margins for the plot
111
174
  * @return The number of pixels for each category on the axis.
112
175
  */
113
- update: (range: AxisInterval, originalRange: AxisInterval, plotDimensions: Dimensions, margin: Margin) => number;
114
- }
115
- /**
116
- * Enumerates the possible locations of an axis.
117
- */
118
- export declare enum AxisLocation {
119
- Left = 0,
120
- Right = 1,
121
- Bottom = 2,
122
- Top = 3
176
+ update: (categories: Array<string>, range: AxisInterval, originalRange: AxisInterval, plotDimensions: Dimensions, margin: Margin) => number;
177
+ /**
178
+ * Updates the font used for the axis label without recreating the axis. The font's color is
179
+ * also the color of the axis line, the ticks, and the tick labels; the tick labels' size,
180
+ * family, and weight, though, stay fixed at whatever the tick style's font was set to when
181
+ * the axis was created.
182
+ */
183
+ updateFont: (font: AxesFont) => void;
184
+ /**
185
+ * Highlights (or un-highlights) this axis -- see {@link ContinuousNumericAxis.setHighlighted}
186
+ * for the full explanation. `color`/`lineWidth` are remembered across calls, so a later
187
+ * `setHighlighted(true)` without them reuses whatever was last passed (or the built-in
188
+ * default on the first call).
189
+ * @param highlighted Whether the axis should be drawn highlighted
190
+ * @param color The highlight color
191
+ * @param lineWidth The highlight line width
192
+ */
193
+ setHighlighted: (highlighted: boolean, color?: string, lineWidth?: number) => void;
123
194
  }
124
195
  /**
125
- * Adds a clip area for the chart to the specified SVG element. The clip-area is given
126
- * an `id` of `clip-series-<chart_id>`, which because the chart ID should be unique, makes
127
- * this unique as well
128
- * @param chartId The ID of the chart to which the clip area is to be added
129
- * @param axisId The ID of the axis to which the clip area is to be added
130
- * @param svg The SVG element to which the clip area is to be added
131
- * @param location The location of the axis
132
- * @param plotDimensions The dimensions of the plot
133
- * @param margin The margins around the plot
134
- * @return The ID of the clip-path
196
+ * The possible locations of an axis.
197
+ * Note: replaces enums to support `erasableSyntaxOnly`
198
+ * TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
135
199
  */
136
- export declare function setClipPath(chartId: number, axisId: string, svg: SvgSelection, location: AxisLocation, plotDimensions: Dimensions, margin: Margin): string;
200
+ export declare const AxisLocation: {
201
+ readonly Left: "Left";
202
+ readonly Right: "Right";
203
+ readonly Bottom: "Bottom";
204
+ readonly Top: "Top";
205
+ };
206
+ export type AxisLocation = (typeof AxisLocation)[keyof typeof AxisLocation];
137
207
  /**
138
- * Adds a category axis to the specified location. When the location is top or bottom,
139
- * the category axis represents the x-axis. When the location is left or right, then the
140
- * category axis represents the y-axis.
141
- * @param chartId The unique ID of the chart to which this axis belongs
208
+ * Adds a category axis to the specified location, registering its draw function with the canvas
209
+ * context. When the location is top or bottom, the category axis represents the x-axis; when the
210
+ * location is left or right, it represents the y-axis.
211
+ * @param cc The canvas context to register the axis' draw function with
142
212
  * @param axisId A unique ID for the axis
143
- * @param svg The SVG selection (d3)
144
213
  * @param location The location of the axis
145
- * @param categories An array holding the category names
214
+ * @param categories The category names (the axis' `update` function can replace them later)
146
215
  * @param axisLabel The axis label
147
216
  * @param axesLabelFont The font for the axis label
148
- * @param axisTickStyle Styling information for the ticks (e.g. font, rotation, etc)
217
+ * @param axisTickStyle Styling information for the ticks (font, rotation, etc.)
149
218
  * @param plotDimensions The dimensions of the plot
150
219
  * @param margin The plot margin
151
- * @param setAxisRangeFor Lambda that sets the axis range for the specified axis
152
- * @param setOriginalAxisRangeFor Lambda that sets the original axis range for the specified axis
153
- * @return A category axis
220
+ * @param setAxisRangeFor Callback that sets the axis range for the specified axis
221
+ * @param setOriginalAxisRangeFor Callback that sets the original axis range for the specified axis
222
+ * @return An {@link OrdinalStringAxis}
154
223
  */
155
- export declare function addOrdinalStringAxis(chartId: number, axisId: string, svg: SvgSelection, location: AxisLocation, categories: Array<string>, axisLabel: string, axesLabelFont: AxesFont, axisTickStyle: AxisTickStyle, plotDimensions: Dimensions, margin: Margin, setAxisRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalAxisRangeFor: (axisId: string, range: AxisInterval) => void): OrdinalStringAxis;
224
+ export declare function addOrdinalStringAxis(cc: CanvasContext, axisId: string, location: AxisLocation, categories: Array<string>, axisLabel: string, axesLabelFont: AxesFont, axisTickStyle: AxisTickStyle, plotDimensions: Dimensions, margin: Margin, setAxisRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalAxisRangeFor: (axisId: string, range: AxisInterval) => void): OrdinalStringAxis;
156
225
  /**
157
- * Adds a new empty x-axis to the SVG element at the specified location. An empty axis
158
- * is just a line where the axis would be, without any ticks or labels.
226
+ * Removes a category x-axis' draw function from the canvas context (e.g. when the axis unmounts)
227
+ * @param cc The canvas context the axis' draw function is registered with
228
+ * @param axisId The ID of the axis
229
+ */
230
+ export declare function removeOrdinalXAxis(cc: CanvasContext, axisId: string): void;
231
+ /**
232
+ * Removes a category y-axis' draw function from the canvas context (e.g. when the axis unmounts)
233
+ * @param cc The canvas context the axis' draw function is registered with
159
234
  * @param axisId The ID of the axis
160
- * @param svg The SVG selection to which to add the axis
161
- * @param plotDimensions The dimensions of the plot
162
- * @param location The location of the axis
163
- * @param scaleGenerator The higher-order function that returns the axis d3 "scale" function
164
- * @param domain The axis range (start, end)
165
- * @param margin The plot margins for the border of main SVG group
166
- * @param setAxisRangeFor A callback used to set the axis range
167
- * @return A {@link ContinuousNumericAxis} based on the arguments to this function
168
235
  */
169
- export declare function addEmptyXAxis(axisId: string, svg: SvgSelection, plotDimensions: Dimensions, location: AxisLocation.Bottom | AxisLocation.Top, scaleGenerator: ScaleContinuousNumeric<number, number>, margin: Margin, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void, domain?: [minValue: number, maxValue: number]): ContinuousNumericAxis;
236
+ export declare function removeOrdinalYAxis(cc: CanvasContext, axisId: string): void;
170
237
  /**
171
- * Adds a new empty y-axis to the SVG element at the specified location. An empty axis
238
+ * Adds a new, empty x-axis (a line with no ticks or label) to the canvas context. An empty axis
172
239
  * is just a line where the axis would be, without any ticks or labels.
240
+ * @param canvasContext The canvas context to register the axis' draw function with
173
241
  * @param axisId The ID of the axis
174
- * @param svg The SVG selection to which to add the axis
175
242
  * @param plotDimensions The dimensions of the plot
176
243
  * @param location The location of the axis
177
- * @param scaleGenerator The higher-order function that returns the axis d3 "scale" function
178
- * @param domain The axis range (start, end)
179
- * @param margin The plot margins for the border of main SVG group
180
- * @param setAxisRangeFor A callback used to set the axis range
181
- * @return A {@link ContinuousNumericAxis} based on the arguments to this function
244
+ * @param scaleGenerator The d3 scale to use for the axis (its domain and range get overwritten)
245
+ * @param margin The plot margins
246
+ * @param setAxisRangeFor A callback used to report the axis' domain when it's updated
247
+ * @param color The color of the axis line (the axis' `updateFont` updates it with the font's color)
248
+ * @param [domain=[0, 1]] The axis' initial domain (min, max)
249
+ * @return A {@link ContinuousNumericAxis} (marked `isEmpty`) based on the arguments to this function
182
250
  */
183
- export declare function addEmptyYAxis(axisId: string, svg: SvgSelection, plotDimensions: Dimensions, location: AxisLocation.Left | AxisLocation.Right, scaleGenerator: ScaleContinuousNumeric<number, number>, margin: Margin, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void, domain?: [minValue: number, maxValue: number]): ContinuousNumericAxis;
251
+ export declare function addEmptyXAxis(canvasContext: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Bottom | typeof AxisLocation.Top, scaleGenerator: ScaleContinuousNumeric<number, number>, margin: Margin, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void, color: string, domain?: [minValue: number, maxValue: number]): ContinuousNumericAxis;
184
252
  /**
185
- * Adds a new x-axis to the SVG element at the specified location
186
- * @param chartId The ID of the chart
253
+ * Adds a new, empty y-axis (a line with no ticks or label) to the canvas context.
254
+ * @param cc The canvas context to register the axis' draw function with
187
255
  * @param axisId The ID of the axis
188
- * @param svg The SVG selection to which to add the axis
189
256
  * @param plotDimensions The dimensions of the plot
190
257
  * @param location The location of the axis
191
- * @param scaleGenerator The higher-order function that returns the axis d3 "scale" function
192
- * @param domain The axis range (start, end)
193
- * @param axesLabelFont The font for the axis labels
194
- * @param margin The plot margins for the border of main SVG group
258
+ * @param scaleGenerator The d3 scale to use for the axis (its domain and range get overwritten)
259
+ * @param margin The plot margins
260
+ * @param setAxisRangeFor A callback used to report the axis' domain when it's updated
261
+ * @param color The color of the axis line (the axis' `updateFont` updates it with the font's color)
262
+ * @param [domain=[0, 1]] The axis' initial domain (min, max)
263
+ * @return A {@link ContinuousNumericAxis} (marked `isEmpty`) based on the arguments to this function
264
+ */
265
+ export declare function addEmptyYAxis(cc: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Left | typeof AxisLocation.Right, scaleGenerator: ScaleContinuousNumeric<number, number>, margin: Margin, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void, color: string, domain?: [minValue: number, maxValue: number]): ContinuousNumericAxis;
266
+ /**
267
+ * Adds a new x-axis, registering its draw function with the canvas context.
268
+ * @param cc The canvas context to register the axis' draw function with
269
+ * @param axisId A unique ID for the axis
270
+ * @param plotDimensions The dimensions of the plot
271
+ * @param location The location of the axis (top or bottom)
272
+ * @param scaleGenerator The d3 scale to use for the axis (its domain/range get overwritten)
273
+ * @param domain The axis' initial domain (min, max)
274
+ * @param axesLabelFont The font for the axis label and ticks
275
+ * @param margin The plot margins
195
276
  * @param axisLabel The label for the axis
196
- * @param setAxisRangeFor A callback used to set the axis range
197
- * @return A {@link ContinuousNumericAxis} based on the arguments to this function
277
+ * @param setAxisRangeFor Callback used to report the axis' domain when it's updated
278
+ * @return A {@link ContinuousNumericAxis}
198
279
  */
199
- export declare function addContinuousNumericXAxis(chartId: number, axisId: string, svg: SvgSelection, plotDimensions: Dimensions, location: AxisLocation.Bottom | AxisLocation.Top, scaleGenerator: ScaleContinuousNumeric<number, number>, domain: [minValue: number, maxValue: number], axesLabelFont: AxesFont, margin: Margin, axisLabel: string, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void): ContinuousNumericAxis;
280
+ export declare function addContinuousNumericXAxis(cc: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Bottom | typeof AxisLocation.Top, scaleGenerator: ScaleContinuousNumeric<number, number>, domain: [minValue: number, maxValue: number], axesLabelFont: AxesFont, margin: Margin, axisLabel: string, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void): ContinuousNumericAxis;
200
281
  /**
201
- * Adds a new y-axis to the SVG element at the specified location
202
- * @param chartId The ID of the chart
203
- * @param axisId The ID of the axis
204
- * @param svg The SVG selection to which to add the axis
282
+ * Adds a new y-axis, registering its draw function with the canvas context.
283
+ * @param cc The canvas context to register the axis' draw function with
284
+ * @param axisId A unique ID for the axis
205
285
  * @param plotDimensions The dimensions of the plot
206
- * @param location The location of the axis
207
- * @param scaleGenerator The higher-order function that returns the axis d3 "scale" function
208
- * @param domain The axis range (start, end)
209
- * @param axesLabelFont The font for the axis labels
210
- * @param margin The plot margins for the border of main SVG group
286
+ * @param location The location of the axis (left or right)
287
+ * @param scaleGenerator The d3 scale to use for the axis (its domain/range get overwritten)
288
+ * @param domain The axis' initial domain (min, max)
289
+ * @param axesLabelFont The font for the axis label and ticks
290
+ * @param margin The plot margins
211
291
  * @param axisLabel The label for the axis
212
- * @param setAxisRangeFor A callback used to set the axis range
213
- * @return A {@link ContinuousNumericAxis} based on the arguments to this function
292
+ * @param setAxisRangeFor Callback used to report the axis' domain when it's updated
293
+ * @return A {@link ContinuousNumericAxis}
214
294
  */
215
- export declare function addContinuousNumericYAxis(chartId: number, axisId: string, svg: SvgSelection, plotDimensions: Dimensions, location: AxisLocation.Left | AxisLocation.Right, scaleGenerator: ScaleContinuousNumeric<number, number>, domain: [minValue: number, maxValue: number], axesLabelFont: AxesFont, margin: Margin, axisLabel: string, setAxisRangeFor: (axisId: string, range: AxisInterval) => void): ContinuousNumericAxis;
295
+ export declare function addContinuousNumericYAxis(cc: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Left | typeof AxisLocation.Right, scaleGenerator: ScaleContinuousNumeric<number, number>, domain: [minValue: number, maxValue: number], axesLabelFont: AxesFont, margin: Margin, axisLabel: string, setAxisRangeFor: (axisId: string, range: AxisInterval) => void): ContinuousNumericAxis;
216
296
  /**
217
- * Calculates a unique ID for the axis based on the location and chart ID
218
- * @param chartId The unique ID of the chart
219
- * @param location The axis location (i.e. top, bottom, left, right)
220
- * @return A unique ID for the axis
297
+ * Removes a continuous x-axis' draw function from the canvas context (called on "unmount" to avoid
298
+ * leaking a draw registration for an axis that's no longer part of the chart).
299
+ * @param cc The canvas context the axis' draw function is registered with
300
+ * @param axisId The ID of the axis
221
301
  */
222
- export declare function labelIdFor(chartId: number, location: AxisLocation): string;
302
+ export declare function removeContinuousXAxis(cc: CanvasContext, axisId: string): void;
303
+ /**
304
+ * Removes a continuous y-axis' draw function from the canvas context (called on "unmount" to avoid
305
+ * leaking a draw registration for an axis that's no longer part of the chart).
306
+ * @param cc The canvas context the axis' draw function is registered with
307
+ * @param axisId The ID of the axis
308
+ */
309
+ export declare function removeContinuousYAxis(cc: CanvasContext, axisId: string): void;
223
310
  /**
224
311
  * The result of a zoom action
225
312
  */
226
313
  export interface ZoomResult<AR extends BaseAxisRange> {
227
314
  range: AR;
228
- zoomFactor: number;
229
315
  }
230
316
  /**
231
317
  * Called when the user uses the scroll wheel (or scroll gesture) to zoom in or out. Zooms in/out
232
- * at the location of the mouse when the scroll wheel or gesture was applied, while ensure that
233
- * the range (start, end) is contained within the constraint (min, max).
234
- * @param transform The d3 zoom transformation information
235
- * @param x The x-position of the mouse when the scroll wheel or gesture is used
236
- * @param axis The axis being zoomed
318
+ * around the specified domain value (the pivot), while ensuring that the range (start, end) is
319
+ * contained within the constraint (min, max). The pivot is a domain value rather than a pixel
320
+ * position -- while streaming, callers pin it to the axis's current "now" rather than to wherever
321
+ * the mouse happens to be (see `calcZoomAndUpdate`'s `pivotDomainValueFor`), which is what keeps
322
+ * "now" fixed on screen as the zoom widens/narrows the window around it.
323
+ *
324
+ * `zoomFactor` is *incremental* (relative to the range's `.current`, not its `.original`) -- see
325
+ * {@link BaseAxisRange.scaledRange}. d3-zoom's own `transform.k` is cumulative from wherever
326
+ * `__zoom` was last reset to identity, so callers must convert it to an incremental factor (this
327
+ * event's `k` divided by the previously-applied `k`) before calling this -- see
328
+ * `useCanvasZoomPan`.
329
+ * @param zoomFactor The incremental zoom scale factor for this event
330
+ * @param domainValue The domain value to zoom around (the pivot)
237
331
  * @param range The current range for the axis being zoomed
238
332
  * @param constraint The minimum and maximum value the scaled range can have
239
- * @return The updated range and the new zoom factor
333
+ * @return The updated range
240
334
  */
241
- export declare function calculateConstrainedZoomFor(transform: ZoomTransform, x: number, axis: ContinuousNumericAxis, range: ContinuousAxisRange, constraint: [min: number, max: number]): ZoomResult<ContinuousAxisRange>;
335
+ export declare function calculateConstrainedZoomFor(zoomFactor: number, domainValue: number, range: ContinuousAxisRange, constraint: [min: number, max: number]): ZoomResult<ContinuousAxisRange>;
242
336
  /**
243
- * Calculates the zoom for an ordinal axis.
244
- * @param transform The d3 zoom transformation information
337
+ * Calculates the zoom for an ordinal axis. Unlike {@link calculateConstrainedZoomFor}'s continuous
338
+ * axis, `zoomFactor` here is *cumulative* (d3-zoom's own `event.transform.k`, passed through
339
+ * unmodified) -- see {@link OrdinalAxisRange.scaledCumulative} for why: the range is scaled from
340
+ * `.current` by the incremental step the cumulative factor implies, except that a factor of
341
+ * exactly 1 snaps it back to `.original`, so that zooming all the way out always shows every
342
+ * category, whatever pivots were used along the way.
343
+ * @param zoomFactor The cumulative zoom scale factor for this event
245
344
  * @param x The x-position of the mouse when the scroll wheel or gesture is used
246
345
  * @param range The current range for the axis being zoomed
247
346
  * @param constraint The minimum and maximum value the scaled range can have
248
- * @return A ZoomResult holding the updated range and the new zoom factor
347
+ * @return A ZoomResult holding the updated range
249
348
  */
250
- export declare function calculateOrdinalConstrainedZoomFor(transform: ZoomTransform, x: number, range: OrdinalAxisRange, constraint: [min: number, max: number]): ZoomResult<OrdinalAxisRange>;
349
+ export declare function calculateOrdinalConstrainedZoomFor(zoomFactor: number, x: number, range: OrdinalAxisRange, constraint: [min: number, max: number]): ZoomResult<OrdinalAxisRange>;
251
350
  /**
252
- * Adjusts the range and updates the plot when the plot is dragged to the left or right
253
- * @param delta The amount that the plot is dragged
254
- * @param axis The axis being zoomed
255
- * @param range The current range for the axis being zoomed
351
+ * Calculates the axis range after the plot is dragged to the left or right (x-axis) or up or down
352
+ * (y-axis).
353
+ * @param delta The amount (in pixels) that the plot is dragged
354
+ * @param axis The axis being panned
355
+ * @param range The current range for the axis being panned
256
356
  * @param [constrainToOriginalRange=false] When set to `true` then the pan requires that the axis
257
- * range remains a subset of the origin axis range; when `false` the pan allows and range
357
+ * range remains a subset of the original axis range (a pan that would leave it isn't made); when
358
+ * `false` the pan allows any range
258
359
  * @return The updated range
259
360
  */
260
361
  export declare function calculatePanFor(delta: number, axis: ContinuousNumericAxis, range: ContinuousAxisRange, constrainToOriginalRange?: boolean): ContinuousAxisRange;
261
- export declare function calculateOrdinalPanFor(delta: number, range: OrdinalAxisRange, plotDimensions: Dimensions, constrainToOriginalRange?: boolean): OrdinalAxisRange;
362
+ /**
363
+ * Calculates the ordinal axis range after the plot is dragged to the left or right (x-axis) or up
364
+ * or down (y-axis). A pan that would leave part of the plot without categories (i.e. take the
365
+ * range's start past 0, or its end short of the plot's width or height) isn't made.
366
+ * @param delta The amount (in pixels) to pan the axis by.
367
+ * @param range The current axis range.
368
+ * @param plotDimensions The dimensions of the plot.
369
+ * @param location The location of the axis.
370
+ * @param constrainToOriginalRange Whether to constrain the pan to the original range.
371
+ * @returns The new axis range.
372
+ */
373
+ export declare function calculateOrdinalPanFor(delta: number, range: OrdinalAxisRange, plotDimensions: Dimensions, location: AxisLocation, constrainToOriginalRange?: boolean): OrdinalAxisRange;
262
374
  /**
263
375
  * Accepts the series, the assignment of the series to axes, and the current x-axes state, and
264
- * returns an array of the distinct axis IDs that cover all the series in the plot.
376
+ * returns an array of the distinct x-axis IDs that cover all the series in the plot (a series
377
+ * without an x-axis assignment uses the default x-axis).
265
378
  *
266
379
  * @param series The array of series
267
380
  * @param axisAssignments A map association a series name with its axis assignments
268
- * @param axesState The current axis state
269
- * @return an array of the distinct axes that cover all the series in the plot
381
+ * @param axesState The current x-axes state
382
+ * @return an array of the distinct x-axis IDs that cover all the series in the plot
270
383
  */
271
384
  export declare function axesForSeriesGen<D, A extends BaseAxis>(series: Array<BaseSeries<D>>, axisAssignments: Map<string, AxesAssignment>, axesState: AxesState<A>): Array<string>;
272
385
  /**
@@ -276,7 +389,7 @@ export declare function axesForSeriesGen<D, A extends BaseAxis>(series: Array<Ba
276
389
  * to the left or right. After calling the handler function, the plot needs to be updated as well, and this is
277
390
  * left for the caller.
278
391
  *
279
- * Please note that the function generated by this function has side effects -- it updates the axes ranges.
392
+ * Please note that the function generated by this function has side effects -- it updates the axis ranges.
280
393
  *
281
394
  * @param axesForSeries The distinct axes that cover all the series
282
395
  * @param margin The plot margin
@@ -294,7 +407,7 @@ export declare function panHandler(axesForSeries: Array<string>, margin: Margin,
294
407
  * to the left or right. After calling the handler function, the plot needs to be updated as well, and this is
295
408
  * left for the caller.
296
409
  *
297
- * Please note that the function generated by this function has side effects -- it updates the axes ranges.
410
+ * Please note that the function generated by this function has side effects -- it updates the axes' ranges.
298
411
  *
299
412
  * @param axesForSeries The distinct axes that cover all the series
300
413
  * @param margin The plot margin
@@ -312,7 +425,7 @@ export declare function ordinalPanHandler(axesForSeries: Array<string>, margin:
312
425
  * to the left or right. After calling the handler function, the plot needs to be updated as well, and this is
313
426
  * left for the caller.
314
427
  *
315
- * Please note that the function generated by this function has side effects -- it updates the axes ranges.
428
+ * Please note that the function generated by this function has side effects -- it updates the axes' ranges.
316
429
  *
317
430
  * @param xAxesForSeries The distinct x-axes that cover all the series
318
431
  * @param yAxesForSeries The distinct y-axes that cover all the series
@@ -331,40 +444,40 @@ export declare function panHandler2D(xAxesForSeries: Array<string>, yAxesForSeri
331
444
  * function returns a handler function. And this handler function adjusts the range when the plot is zoomed.
332
445
  * After calling the handler function, the plot needs to be updated as well, and this is left for the caller.
333
446
  *
334
- * Please note that the function generated by this function has side effects -- it updates the axes ranges.
447
+ * Please note that the function generated by this function has side effects -- it updates the axes' ranges.
335
448
  *
336
449
  * @param axesForSeries The distinct axes that cover all the series
337
450
  * @param margin The plot margin
338
451
  * @param setRangeFor Function for setting the new time-range for a specific axis
339
452
  * @param axesState The current state of the x- or y-axes
340
- * @param scaleExtent The minimum and maximum allowed scale factors
341
- * @return A handler function for pan events
453
+ * @param [scaleExtent=[0, Infinity]] The minimum and maximum allowed scale factors
454
+ * @return A handler function for zoom events
342
455
  */
343
- export declare function continuousAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<ContinuousNumericAxis>, scaleExtent?: [min: number, max: number]): (transform: ZoomTransform, x: number, plotDimensions: Dimensions, ranges: Map<string, ContinuousAxisRange>) => void;
456
+ export declare function continuousAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<ContinuousNumericAxis>, scaleExtent?: [min: number, max: number]): (zoomFactor: number, pivotDomainValueFor: (axisId: string, axis: ContinuousNumericAxis) => number, plotDimensions: Dimensions, ranges: Map<string, ContinuousAxisRange>) => void;
344
457
  /**
345
458
  * Higher-order function that generates a handler for zoom events, given the distinct series IDs that cover all
346
459
  * the axes in the chart, the margin, range update function, and the current state of the x- or y-axes. This
347
460
  * function returns a handler function. And this handler function adjusts the range when the plot is zoomed.
348
461
  * After calling the handler function, the plot needs to be updated as well, and this is left for the caller.
349
462
  *
350
- * Please note that the function generated by this function has side effects -- it updates the axes ranges.
463
+ * Please note that the function generated by this function has side effects -- it updates the axes' ranges.
351
464
  *
352
465
  * @param axesForSeries The distinct axes that cover all the series
353
466
  * @param margin The plot margin
354
467
  * @param setRangeFor Function for setting the new time-range for a specific axis
355
468
  * @param setOriginalRangeFor Function for setting the new original range for a specific axis
356
469
  * @param axesState The current state of the x- or y-axes
357
- * @param scaleExtent The minimum and maximum allowed scale factors
358
- * @return A handler function for pan events
470
+ * @param [scaleExtent=[0, Infinity]] The minimum and maximum allowed scale factors
471
+ * @return A handler function for zoom events
359
472
  */
360
- export declare function ordinalAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<OrdinalStringAxis>, scaleExtent?: [min: number, max: number]): (transform: ZoomTransform, x: number, plotDimensions: Dimensions, ranges: Map<string, OrdinalAxisRange>) => void;
473
+ export declare function ordinalAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<OrdinalStringAxis>, scaleExtent?: [min: number, max: number]): (zoomFactor: number, x: number, plotDimensions: Dimensions, ranges: Map<string, OrdinalAxisRange>) => void;
361
474
  /**
362
475
  * Higher-order function that generates a handler for zoom events, given the distinct series IDs that cover all
363
476
  * the axes in the chart, the margin, range update function, and the current state of the x- or y-axes. This
364
477
  * function returns a handler function. And this handler function adjusts the time-range when the plot is zoomed.
365
478
  * After calling the handler function, the plot needs to be updated as well, and this is left for the caller.
366
479
  *
367
- * Please note that the function generated by this function has side effects -- it updates the axes ranges.
480
+ * Please note that the function generated by this function has side effects -- it updates the axes' ranges.
368
481
  *
369
482
  * @param xAxesForSeries The distinct x-axes that cover all the series
370
483
  * @param yAxesForSeries The distinct y-axes that cover all the series
@@ -373,47 +486,57 @@ export declare function ordinalAxisZoomHandler(axesForSeries: Array<string>, mar
373
486
  * @param xAxesState The current state of the x-axes
374
487
  * @param yAxesState The current state of the y-axes
375
488
  * @param scaleExtent The smallest and largest scale factors allowed
376
- * @return A handler function for pan events
489
+ * @return A handler function for zoom events
377
490
  */
378
- export declare function axesZoomHandler(xAxesForSeries: Array<string>, yAxesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, xAxesState: AxesState<ContinuousNumericAxis>, yAxesState: AxesState<ContinuousNumericAxis>, scaleExtent: [min: number, max: number]): (transform: ZoomTransform, mousePosition: [x: number, y: number], plotDimensions: Dimensions, xRanges: Map<string, ContinuousAxisRange>, yRanges: Map<string, ContinuousAxisRange>) => void;
491
+ export declare function axesZoomHandler(xAxesForSeries: Array<string>, yAxesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, xAxesState: AxesState<ContinuousNumericAxis>, yAxesState: AxesState<ContinuousNumericAxis>, scaleExtent: [min: number, max: number]): (zoomFactor: number, mousePosition: [x: number, y: number], plotDimensions: Dimensions, xRanges: Map<string, ContinuousAxisRange>, yRanges: Map<string, ContinuousAxisRange>) => void;
379
492
  /**
380
- * Calculates the axis-ranges for each of the continuous numeric axes in the map
493
+ * Calculates the axis-ranges for each of the continuous numeric axes in the map, from each axis'
494
+ * current domain (see {@link continuousRange})
381
495
  * @param axes The map containing the axes and their associated IDs
382
- * @return a map associating the axis IDs to their continuous axis-range
496
+ * @return a map associating the axis IDs with their continuous axis-range
383
497
  */
384
498
  export declare function continuousAxisRanges(axes: Map<string, ContinuousNumericAxis>): Map<string, ContinuousAxisRange>;
385
499
  /**
386
- * Calculates the axis-ranges for each of the ordinal axes in the map
500
+ * Calculates the axis-ranges for each of the ordinal axes in the map, read from each axis's own
501
+ * scale range.
387
502
  * @param axes The map containing the axes and their associated IDs
388
- * @param originalRange The original range of the axis
389
- * @return a map associating the axis IDs to their ordinal axis-range
503
+ * @return a map associating the axis IDs with their ordinal axis-range
390
504
  */
391
- export declare function ordinalAxisRanges(axes: Map<string, OrdinalStringAxis>, originalRange: AxisInterval): Map<string, OrdinalAxisRange>;
505
+ export declare function ordinalAxisRanges(axes: Map<string, OrdinalStringAxis>): Map<string, OrdinalAxisRange>;
392
506
  /**
393
- * Calculates the axis interval (start, end) for each of the axis
394
- * @param axes The axes representing the time
395
- * @return A map associating each axis with a (start, end) interval
507
+ * Calculates the axis interval (start, end) of each axis' current domain
508
+ * @param axes The axes, by their IDs
509
+ * @return A map associating each axis ID with its domain's (start, end) interval
396
510
  */
397
511
  export declare function continuousAxisIntervals(axes: Map<string, ContinuousNumericAxis>): Map<string, AxisInterval>;
398
512
  /**
399
- * Calculates the axis interval (start, end) for each of the axis
400
- * @param axes The axes representing the time
401
- * @return A map associating each axis with a (start, end) interval
513
+ * Calculates the pixel interval (start, end) of each ordinal axis' current range, along with its
514
+ * categories
515
+ * @param axes The axes, by their IDs
516
+ * @return A map associating each axis ID with its range's (start, end) interval and its categories
402
517
  */
403
518
  export declare function ordinalAxisIntervals(axes: Map<string, OrdinalStringAxis>): Map<string, {
404
519
  interval: AxisInterval;
405
520
  categories: Array<string>;
406
521
  }>;
407
522
  /**
408
- * Returns the bounds on the specified continuous numeric axes
523
+ * Returns the bounds on the specified continuous numeric axes: a new axis range (with its original
524
+ * range the same as its current range) from each axis' current domain
409
525
  * @param axes A map associating an axis ID with a {@link ContinuousNumericAxis}
410
526
  * @return A map associating each specified axis ID with the interval covered (bounds) by the axis
411
527
  */
412
528
  export declare function continuousRange(axes: Map<string, ContinuousNumericAxis>): Map<string, ContinuousAxisRange>;
413
529
  /**
414
- * Returns the bounds on the specified continuous numeric axes
530
+ * Returns the bounds on the specified ordinal axes, read from each axis's own scale range.
531
+ *
532
+ * Previously mapped every axis ID to one shared, caller-supplied `originalRange`, discarding the
533
+ * axis object entirely (`[id, ]`) -- harmless today only because there's no per-axis margin/offset
534
+ * mechanism anywhere in this codebase, so every ordinal axis in a chart is architecturally
535
+ * guaranteed to span the same pixel range already. Reading each axis's own `.scale.range()`
536
+ * instead (mirroring {@link ordinalAxisIntervals}, which already does this correctly) removes that
537
+ * latent footgun for a chart with multiple category axes whose ranges genuinely differ.
415
538
  * @param axes A map associating an axis ID with a {@link OrdinalStringAxis}
416
- * @param originalRange The original range of the axis
417
539
  * @return A map associating each specified axis ID with the interval covered (bounds) by the axis
418
540
  */
419
- export declare function ordinalRange(axes: Map<string, OrdinalStringAxis>, originalRange: AxisInterval): Map<string, OrdinalAxisRange>;
541
+ export declare function ordinalRange(axes: Map<string, OrdinalStringAxis>): Map<string, OrdinalAxisRange>;
542
+ //# sourceMappingURL=axes.d.ts.map