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,5 +1,4 @@
1
- import { Dimensions, Margin } from "./styling/margins";
2
- import { Selection } from "d3";
1
+ import type { Dimensions, Margin } from "./styling/margins";
3
2
  /**
4
3
  * No operation function for use when a default function is needed
5
4
  */
@@ -9,19 +8,13 @@ export declare const noop: () => void;
9
8
  * @param x The x-coordinate of the mouse's position
10
9
  * @param y The y-coordinate of the mouse's position
11
10
  * @param margin The plot margins
12
- * @param dimensions The the overall dimensions (plot dimensions plus margin)
11
+ * @param dimensions The overall dimensions (plot dimensions plus margin)
13
12
  * @return `true` if the mouse is in the plot area; `false` if the mouse is not in the plot area
14
13
  */
15
14
  export declare function mouseInPlotAreaFor(x: number, y: number, margin: Margin, dimensions: Dimensions): boolean;
16
15
  /**
17
- * Calculates the width of an SVG text element, based on its bounding box
18
- * @param elem The SVG text element
19
- * @return The width in pixels, or 0 if SVG text element has not children
20
- */
21
- export declare function textWidthOf(elem: Selection<SVGTextElement, any, any, any>): number;
22
- /**
23
- * Type for representing the dimensions and location of the bounding box for an
24
- * SVG text element.
16
+ * The dimensions (and location) of a text's bounding box. `x`/`y` are always `0` for canvas
17
+ * text, which `measureText` measures from its own origin.
25
18
  */
26
19
  export type BoundingBox = {
27
20
  x: number;
@@ -30,36 +23,82 @@ export type BoundingBox = {
30
23
  height: number;
31
24
  };
32
25
  /**
33
- * @return An empty bounding box with x, y, width, height set to 0.
26
+ * Measures the width and height (its ascent plus descent) of `text` as it would be rendered with
27
+ * the font currently set on the context.
28
+ * @param context The canvas 2D context; its `.font` must already be set to the font to measure with
29
+ * @param text The text to measure
30
+ * @return The bounding box for the text (`x`/`y` are always `0`)
31
+ */
32
+ export declare function textDimensions(context: CanvasRenderingContext2D, text: string): BoundingBox;
33
+ /**
34
+ * Builds a CSS font shorthand string suitable for assigning to `ctx.font`.
35
+ * @param size The font size, in pixels
36
+ * @param family The font family (e.g. `'sans-serif'`)
37
+ * @param weight The font weight (e.g. `300`)
38
+ * @return The font string (e.g. `"300 12px sans-serif"`)
34
39
  */
35
- export declare function emptyBoundingBox(): BoundingBox;
40
+ export declare function fontStringFor(size: number, family: string, weight: number): string;
36
41
  /**
37
- * Calculates the width and height of the text element
38
- * @param elem The SVG text element
39
- * @return The width and height of the bounding box
42
+ * Formats a number with a d3 format specifier
43
+ * @param value The number
44
+ * @param format The d3 format specifier (e.g. `" ,.3f"`)
45
+ * @return The formatted number, or `"---"` when the number is `NaN`
40
46
  */
41
- export declare function textDimensions(elem: Selection<SVGTextElement, any, any, any>): BoundingBox;
42
47
  export declare function formatNumber(value: number, format: string): string;
48
+ /**
49
+ * Formats a time as a whole number, with thousands separators, followed by the units
50
+ * @param value The time
51
+ * @param [units=""] The units (e.g. `"ms"`), appended after a space (unless the time is `NaN`)
52
+ * @return The formatted time, or `"---"` when the time is `NaN`
53
+ */
43
54
  export declare function formatTime(value: number, units?: string): string;
55
+ /**
56
+ * Formats a value with three decimal places, and thousands separators
57
+ * @param value The value
58
+ * @return The formatted value, or `"---"` when the value is `NaN`
59
+ */
44
60
  export declare function formatValue(value: number): string;
61
+ /**
62
+ * Formats the change from one number to another (`v2 - v1`) with a d3 format specifier
63
+ * @param v1 The number before
64
+ * @param v2 The number after
65
+ * @param format The d3 format specifier (e.g. `" ,.3f"`)
66
+ * @return The formatted change, or `"---"` when either number is `NaN`
67
+ */
45
68
  export declare function formatChange(v1: number, v2: number, format: string): string;
69
+ /**
70
+ * Formats the change from one time to another (`v2 - v1`) as a whole number, with thousands separators
71
+ * @param v1 The time before
72
+ * @param v2 The time after
73
+ * @return The formatted change, or `"---"` when either time is `NaN`
74
+ */
46
75
  export declare function formatTimeChange(v1: number, v2: number): string;
76
+ /**
77
+ * Formats the change from one value to another (`v2 - v1`) with three decimal places, and
78
+ * thousands separators
79
+ * @param v1 The value before
80
+ * @param v2 The value after
81
+ * @return The formatted change, or `"---"` when either value is `NaN`
82
+ */
47
83
  export declare function formatValueChange(v1: number, v2: number): string;
48
84
  /**
49
- * Calculates the (min, max) of all the values (from the accessor) in the data matrix, clamped by the global
50
- * (currentMin, currentMax).
51
- *
52
- * Curried function that accepts an accessor used to grab the value from the data point, and array of (x, y) values
53
- * (each (x, y) value is represented as [number, number] tuple), and a global, current min and max values. The
54
- * global, current min and max clamp the calculated min and max values.
55
- * @param accessor Access function that accepts a datum and returns the value which to use in the min-max calc
56
- * @return A function that accepts data (represented as a matrix of (x, y) pairs, where each row is a data series),
57
- * a global currentMin and currentMax, which clamp the calculated results. The function return a tuple holding the
58
- * min as the first value and the max as the second value.
59
- * @example
60
- * // function that calculates the min-max of the y-values generated by calling the minMaxOf and handing it the
61
- * // accessor function that grabs the y-value from the datum
62
- * const minMaxTimeSeriesY: (data: Array<TimeSeries>, currentMinMax: [number, number]) => [number, number] =
63
- minMaxOf((datum: [number, number]): number => datum[1])
85
+ * Finds the index of the first element whose x-value (per `xFrom`) is `>= value`, in a
86
+ * time-ordered (ascending) array-like collection, via binary search. Used to cheaply skip
87
+ * retained-but-off-screen data before doing per-point work (scaling, segment building) in a
88
+ * plot's draw function -- retained data (governed by `dropDataAfter`) is often much larger than
89
+ * what's actually visible in the current axis domain (a scrolling window), so iterating the full
90
+ * retained array every frame does a lot of work whose result is immediately discarded as
91
+ * off-screen. Finding the visible slice's start index up front makes per-frame cost scale with
92
+ * what's on screen, not with how much history is retained.
93
+ * @param data An array-like collection (supports `.length` and index access), sorted ascending by `xFrom`
94
+ * @param value The x-value to search for
95
+ * @param xFrom A function that extracts the x-value from an element
96
+ * @return The index of the first element with `xFrom(element) >= value`, or `data.length` if
97
+ * every element is before `value`
98
+ * @template D The type of the elements in `data`
64
99
  */
65
- export declare const minMaxOf: <T>(accessor: (v: T) => number) => (data: Array<Array<T>>, currentMinMax: [number, number]) => [number, number];
100
+ export declare function firstIndexAtOrAfter<D>(data: {
101
+ length: number;
102
+ [index: number]: D;
103
+ }, value: number, xFrom: (datum: D) => number): number;
104
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/app/charts/utils.ts"],"names":[],"mappings":"AAAA,OA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EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAA;CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAYrI"}
@@ -10,7 +10,7 @@ export const noop = () => {
10
10
  * @param x The x-coordinate of the mouse's position
11
11
  * @param y The y-coordinate of the mouse's position
12
12
  * @param margin The plot margins
13
- * @param dimensions The the overall dimensions (plot dimensions plus margin)
13
+ * @param dimensions The overall dimensions (plot dimensions plus margin)
14
14
  * @return `true` if the mouse is in the plot area; `false` if the mouse is not in the plot area
15
15
  */
16
16
  export function mouseInPlotAreaFor(x, y, margin, dimensions) {
@@ -20,72 +20,117 @@ export function mouseInPlotAreaFor(x, y, margin, dimensions) {
20
20
  y < dimensions.height - margin.bottom;
21
21
  }
22
22
  /**
23
- * Calculates the width of an SVG text element, based on its bounding box
24
- * @param elem The SVG text element
25
- * @return The width in pixels, or 0 if SVG text element has not children
23
+ * Measures the width and height (its ascent plus descent) of `text` as it would be rendered with
24
+ * the font currently set on the context.
25
+ * @param context The canvas 2D context; its `.font` must already be set to the font to measure with
26
+ * @param text The text to measure
27
+ * @return The bounding box for the text (`x`/`y` are always `0`)
26
28
  */
27
- export function textWidthOf(elem) {
28
- var _a, _b;
29
- return ((_b = (_a = elem.node()) === null || _a === void 0 ? void 0 : _a.getBBox()) === null || _b === void 0 ? void 0 : _b.width) || 0;
29
+ export function textDimensions(context, text) {
30
+ var _a, _b, _c, _d;
31
+ const metrics = context.measureText(text);
32
+ const ascent = (_b = (_a = metrics.actualBoundingBoxAscent) !== null && _a !== void 0 ? _a : metrics.fontBoundingBoxAscent) !== null && _b !== void 0 ? _b : 0;
33
+ const descent = (_d = (_c = metrics.actualBoundingBoxDescent) !== null && _c !== void 0 ? _c : metrics.fontBoundingBoxDescent) !== null && _d !== void 0 ? _d : 0;
34
+ return {
35
+ x: 0,
36
+ y: 0,
37
+ width: metrics.width || 0,
38
+ height: ascent + descent
39
+ };
30
40
  }
31
41
  /**
32
- * @return An empty bounding box with x, y, width, height set to 0.
42
+ * Builds a CSS font shorthand string suitable for assigning to `ctx.font`.
43
+ * @param size The font size, in pixels
44
+ * @param family The font family (e.g. `'sans-serif'`)
45
+ * @param weight The font weight (e.g. `300`)
46
+ * @return The font string (e.g. `"300 12px sans-serif"`)
33
47
  */
34
- export function emptyBoundingBox() {
35
- return { x: 0, y: 0, width: 0, height: 0 };
48
+ export function fontStringFor(size, family, weight) {
49
+ return `${weight} ${size}px ${family}`;
36
50
  }
37
51
  /**
38
- * Calculates the width and height of the text element
39
- * @param elem The SVG text element
40
- * @return The width and height of the bounding box
52
+ * Formats a number with a d3 format specifier
53
+ * @param value The number
54
+ * @param format The d3 format specifier (e.g. `" ,.3f"`)
55
+ * @return The formatted number, or `"---"` when the number is `NaN`
41
56
  */
42
- export function textDimensions(elem) {
43
- var _a;
44
- const boundingBox = (_a = elem.node()) === null || _a === void 0 ? void 0 : _a.getBBox();
45
- return {
46
- width: (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.width) || 0,
47
- height: (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.height) || 0,
48
- x: (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.x) || 0,
49
- y: (boundingBox === null || boundingBox === void 0 ? void 0 : boundingBox.y) || 0
50
- };
51
- }
52
57
  export function formatNumber(value, format) {
53
58
  return isNaN(value) ? '---' : d3.format(format)(value);
54
59
  }
60
+ /**
61
+ * Formats a time as a whole number, with thousands separators, followed by the units
62
+ * @param value The time
63
+ * @param [units=""] The units (e.g. `"ms"`), appended after a space (unless the time is `NaN`)
64
+ * @return The formatted time, or `"---"` when the time is `NaN`
65
+ */
55
66
  export function formatTime(value, units = "") {
56
67
  return `${formatNumber(value, " ,.0f")}${!isNaN(value) && units ? ` ${units}` : ""}`;
57
68
  }
69
+ /**
70
+ * Formats a value with three decimal places, and thousands separators
71
+ * @param value The value
72
+ * @return The formatted value, or `"---"` when the value is `NaN`
73
+ */
58
74
  export function formatValue(value) {
59
75
  return formatNumber(value, " ,.3f");
60
76
  }
77
+ /**
78
+ * Formats the change from one number to another (`v2 - v1`) with a d3 format specifier
79
+ * @param v1 The number before
80
+ * @param v2 The number after
81
+ * @param format The d3 format specifier (e.g. `" ,.3f"`)
82
+ * @return The formatted change, or `"---"` when either number is `NaN`
83
+ */
61
84
  export function formatChange(v1, v2, format) {
62
85
  return isNaN(v1) || isNaN(v2) ? '---' : d3.format(format)(v2 - v1);
63
86
  }
87
+ /**
88
+ * Formats the change from one time to another (`v2 - v1`) as a whole number, with thousands separators
89
+ * @param v1 The time before
90
+ * @param v2 The time after
91
+ * @return The formatted change, or `"---"` when either time is `NaN`
92
+ */
64
93
  export function formatTimeChange(v1, v2) {
65
94
  return formatChange(v1, v2, " ,.0f");
66
95
  }
96
+ /**
97
+ * Formats the change from one value to another (`v2 - v1`) with three decimal places, and
98
+ * thousands separators
99
+ * @param v1 The value before
100
+ * @param v2 The value after
101
+ * @return The formatted change, or `"---"` when either value is `NaN`
102
+ */
67
103
  export function formatValueChange(v1, v2) {
68
104
  return formatChange(v1, v2, " ,.3f");
69
105
  }
70
106
  /**
71
- * Calculates the (min, max) of all the values (from the accessor) in the data matrix, clamped by the global
72
- * (currentMin, currentMax).
73
- *
74
- * Curried function that accepts an accessor used to grab the value from the data point, and array of (x, y) values
75
- * (each (x, y) value is represented as [number, number] tuple), and a global, current min and max values. The
76
- * global, current min and max clamp the calculated min and max values.
77
- * @param accessor Access function that accepts a datum and returns the value which to use in the min-max calc
78
- * @return A function that accepts data (represented as a matrix of (x, y) pairs, where each row is a data series),
79
- * a global currentMin and currentMax, which clamp the calculated results. The function return a tuple holding the
80
- * min as the first value and the max as the second value.
81
- * @example
82
- * // function that calculates the min-max of the y-values generated by calling the minMaxOf and handing it the
83
- * // accessor function that grabs the y-value from the datum
84
- * const minMaxTimeSeriesY: (data: Array<TimeSeries>, currentMinMax: [number, number]) => [number, number] =
85
- minMaxOf((datum: [number, number]): number => datum[1])
107
+ * Finds the index of the first element whose x-value (per `xFrom`) is `>= value`, in a
108
+ * time-ordered (ascending) array-like collection, via binary search. Used to cheaply skip
109
+ * retained-but-off-screen data before doing per-point work (scaling, segment building) in a
110
+ * plot's draw function -- retained data (governed by `dropDataAfter`) is often much larger than
111
+ * what's actually visible in the current axis domain (a scrolling window), so iterating the full
112
+ * retained array every frame does a lot of work whose result is immediately discarded as
113
+ * off-screen. Finding the visible slice's start index up front makes per-frame cost scale with
114
+ * what's on screen, not with how much history is retained.
115
+ * @param data An array-like collection (supports `.length` and index access), sorted ascending by `xFrom`
116
+ * @param value The x-value to search for
117
+ * @param xFrom A function that extracts the x-value from an element
118
+ * @return The index of the first element with `xFrom(element) >= value`, or `data.length` if
119
+ * every element is before `value`
120
+ * @template D The type of the elements in `data`
86
121
  */
87
- export const minMaxOf = (accessor) => (data, currentMinMax) => [
88
- Math.min(d3.min(data, series => d3.min(series, datum => accessor(datum))) || 0, currentMinMax[0]),
89
- Math.max(d3.max(data, series => d3.max(series, datum => accessor(datum))) || 1, currentMinMax[1])
90
- ];
122
+ export function firstIndexAtOrAfter(data, value, xFrom) {
123
+ let lo = 0;
124
+ let hi = data.length;
125
+ while (lo < hi) {
126
+ const mid = (lo + hi) >>> 1;
127
+ if (xFrom(data[mid]) < value) {
128
+ lo = mid + 1;
129
+ }
130
+ else {
131
+ hi = mid;
132
+ }
133
+ }
134
+ return lo;
135
+ }
91
136
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/app/charts/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC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AAA;AACtE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAU,EAAE,EAAU;IACnD,OAAO,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACxC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAU,EAAE,EAAU;IACpD,OAAO,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACxC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,mBAAmB,CAAI,IAA0C,EAAE,KAAa,EAAE,KAA2B;IACzH,IAAI,EAAE,GAAG,CAAC,CAAA;IACV,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;IACpB,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;YAC3B,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;QAChB,CAAC;aAAM,CAAC;YACJ,EAAE,GAAG,GAAG,CAAA;QACZ,CAAC;IACL,CAAC;IACD,OAAO,EAAE,CAAA;AACb,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,45 +1,2 @@
1
- export { Chart } from './app/charts/Chart';
2
- export { type AxisElementSelection, type SvgSelection, type GSelection, type LineSelection, type TextSelection, type RadialMagnifierSelection, type BarMagnifierSelection, type MagnifierTextSelection, type TrackerSelection } from './app/charts/d3types';
3
- export { noop, mouseInPlotAreaFor, textWidthOf, textDimensions, formatNumber, formatTime, formatValue, formatChange, formatTimeChange, formatValueChange, minMaxOf } from './app/charts/utils';
4
- export { type AxisTickStyle, defaultAxisTickStyle, type AxesFont, defaultAxesFont, type SeriesStyle, type SeriesLineStyle, defaultLineStyle, type BaseAxis, type ContinuousNumericAxis, type OrdinalStringAxis, AxisLocation, addOrdinalStringAxis, labelIdFor, type ZoomResult, calculateOrdinalConstrainedZoomFor, calculateConstrainedZoomFor, ordinalAxisZoomHandler, axesZoomHandler, calculatePanFor, panHandler, panHandler2D, axesForSeriesGen, continuousAxisRanges, continuousAxisIntervals, continuousRange } from './app/charts/axes/axes';
5
- export { AxisInterval } from './app/charts/axes/AxisInterval';
6
- export { ContinuousAxis, } from './app/charts/axes/ContinuousAxis';
7
- export { type ContinuousAxisRange, } from './app/charts/axes/ContinuousAxisRange';
8
- export { OrdinalAxis, } from './app/charts/axes/OrdinalAxis';
9
- export { type OrdinalAxisRange, } from './app/charts/axes/OrdinalAxisRange';
10
- export { EmptyAxis, } from './app/charts/axes/EmptyAxis';
11
- export { regexFilter } from './app/charts/filters/regexFilter';
12
- export { type AxesState, } from './app/charts/axes/AxesState';
13
- export { useAxes, type UseAxesValues, defaultAxesValues, } from './app/charts/hooks/useAxes';
14
- export { useChart, type NoTooltipMetadata, type UseChartValues, } from './app/charts/hooks/useChart';
15
- export { useDataObservable, type UseObservableValues, } from './app/charts/hooks/useDataObservable';
16
- export { useInitialData, type UseInitialDataValues, } from './app/charts/hooks/useInitialData';
17
- export { useMouse, type UseMouseValues, defaultMouseValues, } from './app/charts/hooks/useMouse';
18
- export { usePlotDimensions, type UsePlotDimensionsValues, defaultPlotDimensions, defaultMargin, } from './app/charts/hooks/usePlotDimensions';
19
- export { useTooltip, type UseTooltipValues, defaultTooltipValues, type TooltipData, type TooltipContentProvider, } from './app/charts/hooks/useTooltip';
20
- export { type ChartData, defaultChartData, copyChartData } from './app/charts/observables/ChartData';
21
- export { type IterateChartData, copyIterateDataFrom, iteratesObservable } from './app/charts/observables/iterates';
22
- export { ordinalsObservable, type OrdinalChartData, type OrdinalStats, defaultOrdinalStats, type OrdinalValueStats, defaultOrdinalValueStats, type OrdinalDatumExtremum, initialMinValueDatum, initialMaxValueDatum, initialMinTimeDatum, initialMaxTimeDatum, valueStatusDatumOfDefault, isDefaultValueStatsDatum, copyOrdinalDataFrom, copyOrdinalStats, copyOrdinalValueStats, copyValueStatsForSeries, copyOrdinalDatumExtremum, } from './app/charts/observables/ordinals';
23
- export { type Series, createPlotContainer, type AxesAssignment, setClipPathG, assignAxes } from './app/charts/plots/plot';
24
- export { BarPlot, } from './app/charts/plots/BarPlot';
25
- export { NoCurveFactory, PoincarePlot, } from './app/charts/plots/PoincarePlot';
26
- export { RasterPlot, } from './app/charts/plots/RasterPlot';
27
- export { ScatterPlot, } from './app/charts/plots/ScatterPlot';
28
- export { type BaseSeries, seriesFrom, emptySeries, emptySeriesFor } from './app/charts/series/baseSeries';
29
- export { type IterateDatum, emptyIterateDatum, iterateDatumOf, nonEmptyIterateDatum, type IterateSeries, iterateSeriesFromTuples, } from './app/charts/series/iterateSeries';
30
- export { type OrdinalDatum, emptyOrdinalDatum, copyOrdinalDatum, ordinalDatumOf, nonEmptyOrdinalDatum, type OrdinalSeries, ordinateSeriesFromTuples, initialOrdinalChartData, } from './app/charts/series/ordinalSeries';
31
- export { type TimeSeriesChartData, emptyTimeSeriesChartData, initialTimeSeriesChartData, } from './app/charts/series/timeSeriesChartData';
32
- export { type Datum, datumOf, emptyDatum, type TimeSeries, timeSeriesFromTuples, type PixelDatum } from './app/charts/series/timeSeries';
33
- export { type BarSeriesStyle, type BarStyle, type LineStyle, defaultBarSeriesStyle, defaultMinMaxBarStyle, defaultWindowedMinMaxBarStyle, defaultWindowedMeanValueLineStyle, defaultValueLineStyle, defaultMeanValueLineStyle } from './app/charts/styling/barPlotStyle';
34
- export { type Margin, noMargins, type Dimensions, plotDimensionsFrom, containerDimensionsFrom } from './app/charts/styling/margins';
35
- export { type SvgStyle, initialSvgStyle, grabWidth, grabHeight, type SvgStrokeStyle, STROKE_COLOR, STROKE_WIDTH, STROKE_OPACITY, updateSvgStrokeColor, updateSvgStrokeWidth, updateSvgStrokeOpacity, applyStrokeStylesTo, type SvgFillStyle, updateSvgFillColor, updateSvgFillOpacity, applyFillStylesTo } from './app/charts/styling/svgStyle';
36
- export { TimeWindowBehavior, subscriptionTimeSeriesFor, subscriptionTimeSeriesWithCadenceFor, subscriptionIteratesFor, type WindowedOrdinalStats, subscriptionOrdinalXFor } from './app/charts/subscriptions/subscriptions';
37
- export { BarPlotTooltipContent, } from './app/charts/tooltips/BarPlotTooltipContent';
38
- export { PoincarePlotTooltipContent, } from './app/charts/tooltips/PoincarePlotTooltipContent';
39
- export { RasterPlotTooltipContent, } from './app/charts/tooltips/RasterPlotTooltipContent';
40
- export { ScatterPlotTooltipContent, } from './app/charts/tooltips/ScatterPlotTooltipContent';
41
- export { Tooltip, } from './app/charts/tooltips/Tooltip';
42
- export { type TooltipStyle, defaultTooltipStyle, type TooltipDimensions, removeTooltip, tooltipX, tooltipY, categoryTooltipY, boundingPoints, findPointAndNeighbors } from './app/charts/tooltips/tooltipUtils';
43
- export { type TrackerAxisInfo, type TrackerAxisUpdate, TrackerLabelLocation, Tracker, } from './app/charts/trackers/Tracker';
44
- export { type TrackerLabelFont, defaultTrackerLabelFont, type TrackerStyle, defaultTrackerStyle, trackerControlInstance, removeTrackerControl, } from './app/charts/trackers/trackerUtils';
45
- export { Legend, defaultLegendStyle, LegendLocation, type LegendStyle } from './app/charts/legends/Legend';
1
+ export * from './app/charts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,73 +1,3 @@
1
- export { Chart } from './app/charts/Chart';
2
- export { noop, mouseInPlotAreaFor, textWidthOf, textDimensions, formatNumber, formatTime, formatValue, formatChange, formatTimeChange, formatValueChange, minMaxOf } from './app/charts/utils';
3
- //
4
- // axes
5
- //
6
- export { defaultAxisTickStyle, defaultAxesFont, defaultLineStyle, AxisLocation, addOrdinalStringAxis, labelIdFor, calculateOrdinalConstrainedZoomFor, calculateConstrainedZoomFor, ordinalAxisZoomHandler, axesZoomHandler, calculatePanFor, panHandler, panHandler2D, axesForSeriesGen, continuousAxisRanges, continuousAxisIntervals, continuousRange } from './app/charts/axes/axes';
7
- export { AxisInterval } from './app/charts/axes/AxisInterval';
8
- export { ContinuousAxis, } from './app/charts/axes/ContinuousAxis';
9
- export { OrdinalAxis, } from './app/charts/axes/OrdinalAxis';
10
- export { EmptyAxis, } from './app/charts/axes/EmptyAxis';
11
- //
12
- // filters
13
- //
14
- export { regexFilter } from './app/charts/filters/regexFilter';
15
- export { useAxes, defaultAxesValues, } from './app/charts/hooks/useAxes';
16
- export { useChart, } from './app/charts/hooks/useChart';
17
- export { useDataObservable, } from './app/charts/hooks/useDataObservable';
18
- export { useInitialData, } from './app/charts/hooks/useInitialData';
19
- export { useMouse, defaultMouseValues, } from './app/charts/hooks/useMouse';
20
- export { usePlotDimensions, defaultPlotDimensions, defaultMargin, } from './app/charts/hooks/usePlotDimensions';
21
- export { useTooltip, defaultTooltipValues, } from './app/charts/hooks/useTooltip';
22
- //
23
- // observables
24
- //
25
- //
26
- export { defaultChartData, copyChartData } from './app/charts/observables/ChartData';
27
- export { copyIterateDataFrom, iteratesObservable } from './app/charts/observables/iterates';
28
- export { ordinalsObservable, defaultOrdinalStats, defaultOrdinalValueStats, initialMinValueDatum, initialMaxValueDatum, initialMinTimeDatum, initialMaxTimeDatum, valueStatusDatumOfDefault, isDefaultValueStatsDatum, copyOrdinalDataFrom, copyOrdinalStats, copyOrdinalValueStats, copyValueStatsForSeries, copyOrdinalDatumExtremum, } from './app/charts/observables/ordinals';
29
- //
30
- // plots
31
- //
32
- export { createPlotContainer, setClipPathG, assignAxes } from './app/charts/plots/plot';
33
- export { BarPlot, } from './app/charts/plots/BarPlot';
34
- export { NoCurveFactory, PoincarePlot, } from './app/charts/plots/PoincarePlot';
35
- export { RasterPlot, } from './app/charts/plots/RasterPlot';
36
- export { ScatterPlot, } from './app/charts/plots/ScatterPlot';
37
- //
38
- // series
39
- //
40
- export { seriesFrom, emptySeries, emptySeriesFor } from './app/charts/series/baseSeries';
41
- export { emptyIterateDatum, iterateDatumOf, nonEmptyIterateDatum, iterateSeriesFromTuples, } from './app/charts/series/iterateSeries';
42
- export { emptyOrdinalDatum, copyOrdinalDatum, ordinalDatumOf, nonEmptyOrdinalDatum, ordinateSeriesFromTuples, initialOrdinalChartData, } from './app/charts/series/ordinalSeries';
43
- export { emptyTimeSeriesChartData, initialTimeSeriesChartData, } from './app/charts/series/timeSeriesChartData';
44
- export { datumOf, emptyDatum, timeSeriesFromTuples } from './app/charts/series/timeSeries';
45
- //
46
- // styling
47
- //
48
- export { defaultBarSeriesStyle, defaultMinMaxBarStyle, defaultWindowedMinMaxBarStyle, defaultWindowedMeanValueLineStyle, defaultValueLineStyle, defaultMeanValueLineStyle } from './app/charts/styling/barPlotStyle';
49
- export { noMargins, plotDimensionsFrom, containerDimensionsFrom } from './app/charts/styling/margins';
50
- export { initialSvgStyle, grabWidth, grabHeight, STROKE_COLOR, STROKE_WIDTH, STROKE_OPACITY, updateSvgStrokeColor, updateSvgStrokeWidth, updateSvgStrokeOpacity, applyStrokeStylesTo, updateSvgFillColor, updateSvgFillOpacity, applyFillStylesTo } from './app/charts/styling/svgStyle';
51
- //
52
- // subscriptions
53
- //
54
- export { TimeWindowBehavior, subscriptionTimeSeriesFor, subscriptionTimeSeriesWithCadenceFor, subscriptionIteratesFor, subscriptionOrdinalXFor } from './app/charts/subscriptions/subscriptions';
55
- //
56
- // tooltips
57
- //
58
- export { BarPlotTooltipContent, } from './app/charts/tooltips/BarPlotTooltipContent';
59
- export { PoincarePlotTooltipContent, } from './app/charts/tooltips/PoincarePlotTooltipContent';
60
- export { RasterPlotTooltipContent, } from './app/charts/tooltips/RasterPlotTooltipContent';
61
- export { ScatterPlotTooltipContent, } from './app/charts/tooltips/ScatterPlotTooltipContent';
62
- export { Tooltip, } from './app/charts/tooltips/Tooltip';
63
- export { defaultTooltipStyle, removeTooltip, tooltipX, tooltipY, categoryTooltipY, boundingPoints, findPointAndNeighbors } from './app/charts/tooltips/tooltipUtils';
64
- //
65
- // trackers
66
- //
67
- export { TrackerLabelLocation, Tracker, } from './app/charts/trackers/Tracker';
68
- export { defaultTrackerLabelFont, defaultTrackerStyle, trackerControlInstance, removeTrackerControl, } from './app/charts/trackers/trackerUtils';
69
- //
70
- // legend
71
- //
72
- export { Legend, defaultLegendStyle, LegendLocation } from './app/charts/legends/Legend';
1
+ // the public API lives in app/charts/index.ts
2
+ export * from './app/charts';
73
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAA;AAcxC,OAAO,EACH,IAAI,EACJ,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EACxF,QAAQ,EACX,MAAM,oBAAoB,CAAA;AAE3B,EAAE;AACF,OAAO;AACP,EAAE;AAEF,OAAO,EACiB,oBAAoB,EACzB,eAAe,EAER,gBAAgB,EAEtC,YAAY,EACZ,oBAAoB,EACpB,UAAU,EAEV,kCAAkC,EAAE,2BAA2B,EAC/D,sBAAsB,EAAE,eAAe,EACvC,eAAe,EAAE,UAAU,EAAE,YAAY,EACzC,gBAAgB,EAChB,oBAAoB,EAAE,uBAAuB,EAAE,eAAe,EACjE,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAA;AAE3D,OAAO,EACH,cAAc,GACjB,MAAM,kCAAkC,CAAA;AAMzC,OAAO,EACH,WAAW,GACd,MAAM,+BAA+B,CAAA;AAMtC,OAAO,EACH,SAAS,GACZ,MAAM,6BAA6B,CAAA;AAEpC,EAAE;AACF,UAAU;AACV,EAAE;AAEF,OAAO,EACH,WAAW,EACd,MA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