stream-charts 1.0.1 → 1.1.1

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 (271) hide show
  1. package/README.md +757 -342
  2. package/changes.md +11 -0
  3. package/dist/src/app/charts/Chart.d.ts +116 -87
  4. package/dist/src/app/charts/Chart.js +96 -101
  5. package/dist/src/app/charts/Chart.js.map +1 -1
  6. package/dist/src/app/charts/axes/AxesState.d.ts +64 -0
  7. package/dist/src/app/charts/axes/AxesState.js +97 -0
  8. package/dist/src/app/charts/axes/AxesState.js.map +1 -0
  9. package/dist/src/app/charts/axes/AxesState.test.js +30 -0
  10. package/dist/src/app/charts/axes/AxesState.test.js.map +1 -0
  11. package/dist/src/app/charts/axes/AxisInterval.d.ts +92 -0
  12. package/dist/src/app/charts/axes/AxisInterval.js +126 -0
  13. package/dist/src/app/charts/axes/AxisInterval.js.map +1 -0
  14. package/dist/src/app/charts/axes/AxisInterval.test.js +120 -0
  15. package/dist/src/app/charts/axes/AxisInterval.test.js.map +1 -0
  16. package/dist/src/app/charts/axes/BaseAxisRange.d.ts +83 -0
  17. package/dist/src/app/charts/axes/BaseAxisRange.js +58 -0
  18. package/dist/src/app/charts/axes/BaseAxisRange.js.map +1 -0
  19. package/dist/src/app/charts/axes/ContinuousAxis.d.ts +22 -0
  20. package/dist/src/app/charts/axes/ContinuousAxis.js +96 -0
  21. package/dist/src/app/charts/axes/ContinuousAxis.js.map +1 -0
  22. package/dist/src/app/charts/axes/ContinuousAxisRange.d.ts +59 -0
  23. package/dist/src/app/charts/axes/ContinuousAxisRange.js +84 -0
  24. package/dist/src/app/charts/axes/ContinuousAxisRange.js.map +1 -0
  25. package/dist/src/app/charts/axes/ContinuousAxisRange.test.js +47 -0
  26. package/dist/src/app/charts/axes/ContinuousAxisRange.test.js.map +1 -0
  27. package/dist/src/app/charts/axes/OrdinalAxis.d.ts +23 -0
  28. package/dist/src/app/charts/axes/OrdinalAxis.js +124 -0
  29. package/dist/src/app/charts/axes/OrdinalAxis.js.map +1 -0
  30. package/dist/src/app/charts/axes/OrdinalAxisRange.d.ts +69 -0
  31. package/dist/src/app/charts/axes/OrdinalAxisRange.js +100 -0
  32. package/dist/src/app/charts/axes/OrdinalAxisRange.js.map +1 -0
  33. package/dist/src/app/charts/axes/OrdinalAxisRange.test.js +48 -0
  34. package/dist/src/app/charts/axes/OrdinalAxisRange.test.js.map +1 -0
  35. package/dist/src/app/charts/axes/axes.d.ts +391 -0
  36. package/dist/src/app/charts/axes/axes.js +1046 -0
  37. package/dist/src/app/charts/axes/axes.js.map +1 -0
  38. package/dist/src/app/charts/d3types.d.ts +10 -10
  39. package/dist/src/app/charts/filters/regexFilter.d.ts +9 -0
  40. package/dist/src/app/charts/filters/regexFilter.js +18 -0
  41. package/dist/src/app/charts/filters/regexFilter.js.map +1 -0
  42. package/dist/src/app/charts/filters/regexFilter.test.d.ts +1 -0
  43. package/dist/src/app/charts/filters/regexFilter.test.js +11 -0
  44. package/dist/src/app/charts/filters/regexFilter.test.js.map +1 -0
  45. package/dist/src/app/charts/hooks/useAxes.d.ts +144 -0
  46. package/dist/src/app/charts/hooks/useAxes.js +187 -0
  47. package/dist/src/app/charts/hooks/useAxes.js.map +1 -0
  48. package/dist/src/app/charts/hooks/useChart.d.ts +30 -201
  49. package/dist/src/app/charts/hooks/useChart.js +33 -134
  50. package/dist/src/app/charts/hooks/useChart.js.map +1 -1
  51. package/dist/src/app/charts/hooks/useDataObservable.d.ts +74 -0
  52. package/dist/src/app/charts/hooks/useDataObservable.js +76 -0
  53. package/dist/src/app/charts/hooks/useDataObservable.js.map +1 -0
  54. package/dist/src/app/charts/hooks/useInitialData.d.ts +38 -0
  55. package/dist/src/app/charts/hooks/useInitialData.js +29 -0
  56. package/dist/src/app/charts/hooks/useInitialData.js.map +1 -0
  57. package/dist/src/app/charts/hooks/useMouse.d.ts +53 -0
  58. package/dist/src/app/charts/hooks/useMouse.js +65 -0
  59. package/dist/src/app/charts/hooks/useMouse.js.map +1 -0
  60. package/dist/src/app/charts/hooks/usePlotDimensions.d.ts +34 -0
  61. package/dist/src/app/charts/hooks/usePlotDimensions.js +73 -0
  62. package/dist/src/app/charts/hooks/usePlotDimensions.js.map +1 -0
  63. package/dist/src/app/charts/hooks/useTooltip.d.ts +64 -0
  64. package/dist/src/app/charts/hooks/useTooltip.js +52 -0
  65. package/dist/src/app/charts/hooks/useTooltip.js.map +1 -0
  66. package/dist/src/app/charts/observables/ChartData.d.ts +23 -0
  67. package/dist/src/app/charts/observables/ChartData.js +20 -0
  68. package/dist/src/app/charts/observables/ChartData.js.map +1 -0
  69. package/dist/src/app/charts/observables/iterates.d.ts +52 -0
  70. package/dist/src/app/charts/observables/iterates.js +121 -0
  71. package/dist/src/app/charts/observables/iterates.js.map +1 -0
  72. package/dist/src/app/charts/observables/iterates.test.d.ts +1 -0
  73. package/dist/src/app/charts/observables/iterates.test.js +180 -0
  74. package/dist/src/app/charts/observables/iterates.test.js.map +1 -0
  75. package/dist/src/app/charts/observables/ordinals.d.ts +75 -0
  76. package/dist/src/app/charts/observables/ordinals.js +141 -0
  77. package/dist/src/app/charts/observables/ordinals.js.map +1 -0
  78. package/dist/src/app/charts/observables/ordinals.test.d.ts +1 -0
  79. package/dist/src/app/charts/observables/ordinals.test.js +102 -0
  80. package/dist/src/app/charts/observables/ordinals.test.js.map +1 -0
  81. package/dist/src/app/charts/plots/BarPlot.d.ts +81 -0
  82. package/dist/src/app/charts/plots/BarPlot.js +557 -0
  83. package/dist/src/app/charts/plots/BarPlot.js.map +1 -0
  84. package/dist/src/app/charts/plots/PoincarePlot.d.ts +78 -0
  85. package/dist/src/app/charts/plots/PoincarePlot.js +504 -0
  86. package/dist/src/app/charts/plots/PoincarePlot.js.map +1 -0
  87. package/dist/src/app/charts/{RasterPlot.d.ts → plots/RasterPlot.d.ts} +1 -1
  88. package/dist/src/app/charts/{RasterPlot.js → plots/RasterPlot.js} +152 -133
  89. package/dist/src/app/charts/plots/RasterPlot.js.map +1 -0
  90. package/dist/src/app/charts/{ScatterPlot.d.ts → plots/ScatterPlot.d.ts} +10 -8
  91. package/dist/src/app/charts/plots/ScatterPlot.js +379 -0
  92. package/dist/src/app/charts/plots/ScatterPlot.js.map +1 -0
  93. package/dist/src/app/charts/{plot.d.ts → plots/plot.d.ts} +12 -14
  94. package/dist/src/app/charts/{plot.js → plots/plot.js} +19 -17
  95. package/dist/src/app/charts/plots/plot.js.map +1 -0
  96. package/dist/src/app/charts/series/baseSeries.d.ts +38 -0
  97. package/dist/src/app/charts/series/baseSeries.js +36 -0
  98. package/dist/src/app/charts/series/baseSeries.js.map +1 -0
  99. package/dist/src/app/charts/series/datumSeries.test.d.ts +1 -0
  100. package/dist/src/app/charts/series/datumSeries.test.js +50 -0
  101. package/dist/src/app/charts/series/datumSeries.test.js.map +1 -0
  102. package/dist/src/app/charts/series/iterateSeries.d.ts +42 -0
  103. package/dist/src/app/charts/series/iterateSeries.js +34 -0
  104. package/dist/src/app/charts/series/iterateSeries.js.map +1 -0
  105. package/dist/src/app/charts/series/ordinalSeries.d.ts +54 -0
  106. package/dist/src/app/charts/series/ordinalSeries.js +98 -0
  107. package/dist/src/app/charts/series/ordinalSeries.js.map +1 -0
  108. package/dist/src/app/charts/series/timeSeries.d.ts +30 -0
  109. package/dist/src/app/charts/series/timeSeries.js +19 -0
  110. package/dist/src/app/charts/series/timeSeries.js.map +1 -0
  111. package/dist/src/app/charts/{chartData.d.ts → series/timeSeriesChartData.d.ts} +11 -6
  112. package/dist/src/app/charts/series/timeSeriesChartData.js +32 -0
  113. package/dist/src/app/charts/series/timeSeriesChartData.js.map +1 -0
  114. package/dist/src/app/charts/styling/barPlotStyle.d.ts +41 -0
  115. package/dist/src/app/charts/styling/barPlotStyle.js +84 -0
  116. package/dist/src/app/charts/styling/barPlotStyle.js.map +1 -0
  117. package/dist/src/app/charts/{margins.d.ts → styling/margins.d.ts} +7 -5
  118. package/dist/src/app/charts/{margins.js → styling/margins.js} +19 -9
  119. package/dist/src/app/charts/styling/margins.js.map +1 -0
  120. package/dist/src/app/charts/styling/margins.test.d.ts +1 -0
  121. package/dist/src/app/charts/styling/margins.test.js +19 -0
  122. package/dist/src/app/charts/styling/margins.test.js.map +1 -0
  123. package/dist/src/app/charts/styling/svgStyle.d.ts +76 -0
  124. package/dist/src/app/charts/styling/svgStyle.js +84 -0
  125. package/dist/src/app/charts/styling/svgStyle.js.map +1 -0
  126. package/dist/src/app/charts/subscriptions/subscription.test.d.ts +1 -0
  127. package/dist/src/app/charts/subscriptions/subscription.test.js +395 -0
  128. package/dist/src/app/charts/subscriptions/subscription.test.js.map +1 -0
  129. package/dist/src/app/charts/subscriptions/subscriptions.d.ts +100 -0
  130. package/dist/src/app/charts/subscriptions/subscriptions.js +449 -0
  131. package/dist/src/app/charts/subscriptions/subscriptions.js.map +1 -0
  132. package/dist/src/app/charts/tooltips/BarPlotTooltipContent.d.ts +90 -0
  133. package/dist/src/app/charts/tooltips/BarPlotTooltipContent.js +302 -0
  134. package/dist/src/app/charts/tooltips/BarPlotTooltipContent.js.map +1 -0
  135. package/dist/src/app/charts/tooltips/PoincarePlotTooltipContent.d.ts +100 -0
  136. package/dist/src/app/charts/tooltips/PoincarePlotTooltipContent.js +190 -0
  137. package/dist/src/app/charts/tooltips/PoincarePlotTooltipContent.js.map +1 -0
  138. package/dist/src/app/charts/{RasterPlotTooltipContent.js → tooltips/RasterPlotTooltipContent.js} +40 -44
  139. package/dist/src/app/charts/tooltips/RasterPlotTooltipContent.js.map +1 -0
  140. package/dist/src/app/charts/tooltips/ScatterPlotTooltipContent.js +154 -0
  141. package/dist/src/app/charts/tooltips/ScatterPlotTooltipContent.js.map +1 -0
  142. package/dist/src/app/charts/{Tooltip.d.ts → tooltips/Tooltip.d.ts} +4 -2
  143. package/dist/src/app/charts/{Tooltip.js → tooltips/Tooltip.js} +23 -28
  144. package/dist/src/app/charts/tooltips/Tooltip.js.map +1 -0
  145. package/dist/src/app/charts/{tooltipUtils.d.ts → tooltips/tooltipUtils.d.ts} +11 -6
  146. package/dist/src/app/charts/{tooltipUtils.js → tooltips/tooltipUtils.js} +33 -17
  147. package/dist/src/app/charts/tooltips/tooltipUtils.js.map +1 -0
  148. package/dist/src/app/charts/{Tracker.d.ts → trackers/Tracker.d.ts} +6 -5
  149. package/dist/src/app/charts/trackers/Tracker.js +60 -0
  150. package/dist/src/app/charts/trackers/Tracker.js.map +1 -0
  151. package/dist/src/app/charts/{trackerUtils.d.ts → trackers/trackerUtils.d.ts} +13 -8
  152. package/dist/src/app/charts/trackers/trackerUtils.js +359 -0
  153. package/dist/src/app/charts/trackers/trackerUtils.js.map +1 -0
  154. package/dist/src/app/charts/utils.d.ts +22 -32
  155. package/dist/src/app/charts/utils.js +36 -37
  156. package/dist/src/app/charts/utils.js.map +1 -1
  157. package/dist/src/index.d.ts +48 -15
  158. package/dist/src/index.js +71 -15
  159. package/dist/src/index.js.map +1 -1
  160. package/package.json +30 -20
  161. package/src/app/charts/Chart.tsx +334 -0
  162. package/src/app/charts/axes/AxesState.test.ts +34 -0
  163. package/src/app/charts/axes/AxesState.ts +112 -0
  164. package/src/app/charts/axes/AxisInterval.test.ts +143 -0
  165. package/src/app/charts/axes/AxisInterval.ts +139 -0
  166. package/src/app/charts/axes/BaseAxisRange.ts +113 -0
  167. package/src/app/charts/axes/ContinuousAxis.tsx +192 -0
  168. package/src/app/charts/axes/ContinuousAxisRange.test.ts +55 -0
  169. package/src/app/charts/axes/ContinuousAxisRange.ts +96 -0
  170. package/src/app/charts/axes/OrdinalAxis.tsx +223 -0
  171. package/src/app/charts/axes/OrdinalAxisRange.test.ts +55 -0
  172. package/src/app/charts/axes/OrdinalAxisRange.ts +112 -0
  173. package/src/app/charts/axes/axes.ts +1569 -0
  174. package/src/app/charts/d3types.ts +16 -0
  175. package/src/app/charts/filters/regexFilter.test.ts +13 -0
  176. package/src/app/charts/filters/regexFilter.ts +17 -0
  177. package/src/app/charts/hooks/useAxes.tsx +341 -0
  178. package/src/app/charts/hooks/useChart.tsx +159 -0
  179. package/src/app/charts/hooks/useDataObservable.tsx +175 -0
  180. package/src/app/charts/hooks/useInitialData.tsx +65 -0
  181. package/src/app/charts/hooks/useMouse.tsx +125 -0
  182. package/src/app/charts/hooks/usePlotDimensions.tsx +120 -0
  183. package/src/app/charts/hooks/useTooltip.tsx +112 -0
  184. package/src/app/charts/observables/ChartData.ts +31 -0
  185. package/src/app/charts/observables/iterates.test.ts +201 -0
  186. package/src/app/charts/observables/iterates.ts +203 -0
  187. package/src/app/charts/observables/ordinals.test.ts +135 -0
  188. package/src/app/charts/observables/ordinals.ts +248 -0
  189. package/src/app/charts/plots/BarPlot.tsx +1088 -0
  190. package/src/app/charts/plots/PoincarePlot.tsx +832 -0
  191. package/src/app/charts/plots/RasterPlot.tsx +676 -0
  192. package/src/app/charts/plots/ScatterPlot.tsx +653 -0
  193. package/src/app/charts/plots/plot.ts +75 -0
  194. package/src/app/charts/series/baseSeries.ts +52 -0
  195. package/src/app/charts/series/datumSeries.test.ts +60 -0
  196. package/src/app/charts/series/iterateSeries.ts +56 -0
  197. package/src/app/charts/series/ordinalSeries.ts +164 -0
  198. package/src/app/charts/series/timeSeries.ts +40 -0
  199. package/src/app/charts/series/timeSeriesChartData.ts +68 -0
  200. package/src/app/charts/styling/barPlotStyle.ts +126 -0
  201. package/src/app/charts/styling/margins.test.ts +22 -0
  202. package/src/app/charts/styling/margins.ts +58 -0
  203. package/src/app/charts/styling/svgStyle.ts +118 -0
  204. package/src/app/charts/subscriptions/subscription.test.ts +499 -0
  205. package/src/app/charts/subscriptions/subscriptions.ts +635 -0
  206. package/src/app/charts/tooltips/BarPlotTooltipContent.tsx +440 -0
  207. package/src/app/charts/tooltips/PoincarePlotTooltipContent.tsx +352 -0
  208. package/src/app/charts/tooltips/RasterPlotTooltipContent.tsx +274 -0
  209. package/src/app/charts/tooltips/ScatterPlotTooltipContent.tsx +319 -0
  210. package/src/app/charts/tooltips/Tooltip.tsx +148 -0
  211. package/src/app/charts/tooltips/tooltipUtils.ts +216 -0
  212. package/src/app/charts/trackers/Tracker.tsx +129 -0
  213. package/src/app/charts/trackers/trackerUtils.ts +494 -0
  214. package/src/app/charts/utils.ts +109 -0
  215. package/dist/src/app/charts/CategoryAxis.d.ts +0 -20
  216. package/dist/src/app/charts/CategoryAxis.js +0 -112
  217. package/dist/src/app/charts/CategoryAxis.js.map +0 -1
  218. package/dist/src/app/charts/ContinuousAxis.d.ts +0 -16
  219. package/dist/src/app/charts/ContinuousAxis.js +0 -186
  220. package/dist/src/app/charts/ContinuousAxis.js.map +0 -1
  221. package/dist/src/app/charts/RasterPlot.js.map +0 -1
  222. package/dist/src/app/charts/RasterPlotTooltipContent.js.map +0 -1
  223. package/dist/src/app/charts/ScatterPlot.js +0 -351
  224. package/dist/src/app/charts/ScatterPlot.js.map +0 -1
  225. package/dist/src/app/charts/ScatterPlotTooltipContent.js +0 -163
  226. package/dist/src/app/charts/ScatterPlotTooltipContent.js.map +0 -1
  227. package/dist/src/app/charts/Tooltip.js.map +0 -1
  228. package/dist/src/app/charts/Tracker.js +0 -65
  229. package/dist/src/app/charts/Tracker.js.map +0 -1
  230. package/dist/src/app/charts/axes.d.ts +0 -132
  231. package/dist/src/app/charts/axes.js +0 -265
  232. package/dist/src/app/charts/axes.js.map +0 -1
  233. package/dist/src/app/charts/chartData.js +0 -32
  234. package/dist/src/app/charts/chartData.js.map +0 -1
  235. package/dist/src/app/charts/continuousAxisRangeFor.d.ts +0 -20
  236. package/dist/src/app/charts/continuousAxisRangeFor.js +0 -68
  237. package/dist/src/app/charts/continuousAxisRangeFor.js.map +0 -1
  238. package/dist/src/app/charts/datumSeries.d.ts +0 -59
  239. package/dist/src/app/charts/datumSeries.js +0 -55
  240. package/dist/src/app/charts/datumSeries.js.map +0 -1
  241. package/dist/src/app/charts/datumSeries.test.js +0 -50
  242. package/dist/src/app/charts/datumSeries.test.js.map +0 -1
  243. package/dist/src/app/charts/hooks/AxesState.d.ts +0 -37
  244. package/dist/src/app/charts/hooks/AxesState.js +0 -44
  245. package/dist/src/app/charts/hooks/AxesState.js.map +0 -1
  246. package/dist/src/app/charts/margins.js.map +0 -1
  247. package/dist/src/app/charts/margins.test.js +0 -14
  248. package/dist/src/app/charts/margins.test.js.map +0 -1
  249. package/dist/src/app/charts/plot.js.map +0 -1
  250. package/dist/src/app/charts/regexFilter.d.ts +0 -9
  251. package/dist/src/app/charts/regexFilter.js +0 -17
  252. package/dist/src/app/charts/regexFilter.js.map +0 -1
  253. package/dist/src/app/charts/regexFilter.test.js +0 -11
  254. package/dist/src/app/charts/regexFilter.test.js.map +0 -1
  255. package/dist/src/app/charts/subscriptions.d.ts +0 -43
  256. package/dist/src/app/charts/subscriptions.js +0 -213
  257. package/dist/src/app/charts/subscriptions.js.map +0 -1
  258. package/dist/src/app/charts/svgStyle.d.ts +0 -27
  259. package/dist/src/app/charts/svgStyle.js +0 -32
  260. package/dist/src/app/charts/svgStyle.js.map +0 -1
  261. package/dist/src/app/charts/timeRange.test.js +0 -54
  262. package/dist/src/app/charts/timeRange.test.js.map +0 -1
  263. package/dist/src/app/charts/tooltipUtils.js.map +0 -1
  264. package/dist/src/app/charts/trackerUtils.js +0 -130
  265. package/dist/src/app/charts/trackerUtils.js.map +0 -1
  266. /package/dist/src/app/charts/{datumSeries.test.d.ts → axes/AxesState.test.d.ts} +0 -0
  267. /package/dist/src/app/charts/{margins.test.d.ts → axes/AxisInterval.test.d.ts} +0 -0
  268. /package/dist/src/app/charts/{regexFilter.test.d.ts → axes/ContinuousAxisRange.test.d.ts} +0 -0
  269. /package/dist/src/app/charts/{timeRange.test.d.ts → axes/OrdinalAxisRange.test.d.ts} +0 -0
  270. /package/dist/src/app/charts/{RasterPlotTooltipContent.d.ts → tooltips/RasterPlotTooltipContent.d.ts} +0 -0
  271. /package/dist/src/app/charts/{ScatterPlotTooltipContent.d.ts → tooltips/ScatterPlotTooltipContent.d.ts} +0 -0
@@ -0,0 +1,557 @@
1
+ import { setClipPathG } from "./plot";
2
+ import * as d3 from "d3";
3
+ import { noop } from "../utils";
4
+ import { useChart } from "../hooks/useChart";
5
+ import { useCallback, useEffect, useMemo, useRef } from "react";
6
+ import { axesForSeriesGen, ordinalAxisIntervals, ordinalAxisRanges, ordinalAxisZoomHandler, ordinalPanHandler } from "../axes/axes";
7
+ import { subscriptionOrdinalXFor } from "../subscriptions/subscriptions";
8
+ import { useDataObservable } from "../hooks/useDataObservable";
9
+ import { usePlotDimensions } from "../hooks/usePlotDimensions";
10
+ import { useInitialData } from "../hooks/useInitialData";
11
+ import { copyValueStatsForSeries } from "../observables/ordinals";
12
+ import { calculateOrdinalStats } from "../series/ordinalSeries";
13
+ import { applyFillStylesTo, applyStrokeStylesTo, STROKE_COLOR, STROKE_OPACITY, STROKE_WIDTH } from "../styling/svgStyle";
14
+ import { defaultBarSeriesStyle } from "../styling/barPlotStyle";
15
+ import { AxisInterval } from "../axes/AxisInterval";
16
+ import { Optional } from "result-fn";
17
+ const STREAM_CHARTS_BAR_CHART_ID = 'stream-charts-bar-chart';
18
+ // elements of the bar-chart
19
+ const BAR_CHART_CLASS_IDS = {
20
+ currentValue: STREAM_CHARTS_BAR_CHART_ID + '-value-lines',
21
+ meanValue: STREAM_CHARTS_BAR_CHART_ID + '-mean-value-lines',
22
+ minMax: STREAM_CHARTS_BAR_CHART_ID + '-min-max-bars',
23
+ windowedMeanValue: STREAM_CHARTS_BAR_CHART_ID + '-windowed-mean-value-lines',
24
+ windowedMinMax: STREAM_CHARTS_BAR_CHART_ID + '-windowed-mean-bars'
25
+ };
26
+ const classIdFor = (id) => '.' + id;
27
+ // constants identifying the bar-chart elements for which mouse-over/mouse-leave events are defined
28
+ const TOOLTIP_PROVIDER_ID = STREAM_CHARTS_BAR_CHART_ID + '-tooltip-provider';
29
+ export const BAR_CHART_TOOLTIP_PROVIDER_IDS = {
30
+ currentValue: TOOLTIP_PROVIDER_ID + '-current-value',
31
+ meanValue: TOOLTIP_PROVIDER_ID + '-mean-value',
32
+ minMax: TOOLTIP_PROVIDER_ID + '-min-max',
33
+ windowedMeanValue: TOOLTIP_PROVIDER_ID + '-windowed-min-max',
34
+ windowedMinMax: TOOLTIP_PROVIDER_ID + '-windowed-mean'
35
+ };
36
+ /**
37
+ * Renders a streaming bar plot for the series in the initial data and those sourced by the
38
+ * observable specified as a property in the {@link Chart}. This component uses the {@link useChart}
39
+ * hook, and therefore must be a child of the {@link Chart} to be plugged in to the
40
+ * chart ecosystem (axes, tracker, tooltip).
41
+ *
42
+ * For a relatively complete example of how to use this plot component, see the
43
+ * <a href="https://github.com/robphilipp/stream-charts-examples">`StreamingBarChart` example</a>
44
+ *
45
+ * @param props The properties associated with the bar plot
46
+ * @constructor
47
+ * @example
48
+ * ```typescript
49
+ * <BarPlot
50
+ * barMargin={1}
51
+ * dropDataAfter={5000}
52
+ * // panEnabled={true}
53
+ * // zoomEnabled={true}
54
+ * // zoomKeyModifiersRequired={true}
55
+ * // withCadenceOf={50}
56
+ *
57
+ * showMinMaxBars={showMinMax}
58
+ * showValueLines={showValue}
59
+ * showMeanValueLines={showMean}
60
+ * showWindowedMinMaxBars={showWinMinMax}
61
+ * showWindowedMeanValueLines={showWinMean}
62
+ * />
63
+ * ```
64
+ */
65
+ export function BarPlot(props) {
66
+ const { chartId, container, mainG, axes, seriesStyles, seriesFilter, mouse } = useChart();
67
+ const { xAxesState, yAxesState, setAxisAssignments, setAxisIntervalFor, setOriginalAxisIntervalFor, axesRanges } = axes;
68
+ const { mouseOverHandlerFor, mouseLeaveHandlerFor } = mouse;
69
+ const { plotDimensions, margin } = usePlotDimensions();
70
+ const { seriesObservable, windowingTime = 100, shouldSubscribe, onSubscribe = noop, onUpdateData, onUpdateChartTime = noop } = useDataObservable();
71
+ const { initialData } = useInitialData();
72
+ const { axisAssignments = new Map(), dropDataAfter = Infinity, panEnabled = false, zoomEnabled = false, zoomKeyModifiersRequired = true, showMinMaxBars = true, showWindowedMinMaxBars = true, showValueLines = true, showMeanValueLines = true, showWindowedMeanValueLines = true, barMargin = 2, barSeriesStyle = defaultBarSeriesStyle() } = props;
73
+ // why do "dataRef" and "seriesRef" both hold on to the same underlying data? for performance.
74
+ //
75
+ // the "dataRef" and "seriesRef" both point to the same underlying data, a collection
76
+ // of series. The series in "dataRef" are bound to the DOM elements through d3. The "seriesRef" series
77
+ // are the ones that are updated as new data is streamed in.
78
+ //
79
+ // the "dataRef" object holds on to a copy of the initial data (which is an array of
80
+ // time-series, e.i. an array of BaseSeries<OrdinalDatum> objects). The slice just creates a copy of
81
+ // the array, but the references to the BaseSeries objects are the same and still point to the same
82
+ // data as the "initialData" array.
83
+ //
84
+ // the "seriesRef" object is a reference to a map (series_name -> BaseSeries<OrdinalDatum>) which is
85
+ // used to update the data in the series. When new data enters, it is appended to one or more series.
86
+ //
87
+ // the series in the "dataRef" object are the ones bound to the DOM elements in d3, and so as these
88
+ // are updated, d3 will update the DOM elements (the elements in this plot).
89
+ const dataRef = useRef(initialData.slice());
90
+ const seriesRef = useRef(new Map(initialData.map(series => [series.name, series])));
91
+ const statsRef = useRef(initialOrdinalStats(dataRef.current));
92
+ // map(axis_id -> current_time) -- maps the axis ID to the current time for that axis
93
+ const currentTimeRef = useRef(0);
94
+ const subscriptionRef = useRef(undefined);
95
+ const isSubscriptionClosed = () => subscriptionRef.current === undefined || subscriptionRef.current.closed;
96
+ const allowTooltipRef = useRef(isSubscriptionClosed());
97
+ useEffect(() => {
98
+ currentTimeRef.current = 0;
99
+ }, [xAxesState]);
100
+ // set the axis assignments needed if a tooltip is being used
101
+ useEffect(() => {
102
+ setAxisAssignments(axisAssignments);
103
+ }, [axisAssignments, setAxisAssignments]);
104
+ // calculates the distinct series IDs that cover all the series in the plot
105
+ const axesForSeries = useMemo(() => axesForSeriesGen(initialData, axisAssignments, xAxesState), [initialData, axisAssignments, xAxesState]);
106
+ // updates the timing using the onUpdateTime and updatePlot references. This and the references
107
+ // defined above allow the axes' times to be updated properly by avoid stale reference to these
108
+ // functions.
109
+ const updateTimingAndPlot = useCallback((ranges) => {
110
+ if (mainG !== null) {
111
+ updatePlotRef.current(ranges, mainG);
112
+ onUpdateChartTime(currentTimeRef.current);
113
+ updatePlotRef.current(ranges, mainG);
114
+ }
115
+ }, [mainG, onUpdateChartTime]);
116
+ // todo find better way
117
+ // when the initial data changes, then reset the plot. note that the initial data doesn't change
118
+ // during the normal course of updates from the observable, only when the plot is restarted.
119
+ useEffect(() => {
120
+ dataRef.current = initialData.slice();
121
+ seriesRef.current = new Map(initialData.map(series => [series.name, series]));
122
+ currentTimeRef.current = 0;
123
+ statsRef.current = initialOrdinalStats(dataRef.current);
124
+ },
125
+ // ** not happy about this **
126
+ // only want this effect to run when the initial data is changed, which mean all the
127
+ // other dependencies are recalculated anyway.
128
+ // eslint-disable-next-line react-hooks/exhaustive-deps
129
+ [initialData]);
130
+ /**
131
+ * Adjusts the time-range and updates the plot when the plot is dragged to the left or right
132
+ * @param deltaX The amount that the plot is dragged
133
+ * @param plotDimensions The dimensions of the plot
134
+ * @param series An array of series names
135
+ * @param ranges A map holding the axis ID and its associated time range
136
+ */
137
+ const onPan = useCallback((x, plotDimensions, series, ranges) => ordinalPanHandler(axesForSeries, margin, setAxisIntervalFor, xAxesState)(x, plotDimensions, series, ranges), [axesForSeries, margin, setAxisIntervalFor, xAxesState]);
138
+ /**
139
+ * Called when the user uses the scroll wheel (or scroll gesture) to zoom in or out. Zooms in/out
140
+ * at the location of the mouse when the scroll wheel or gesture was applied.
141
+ * @param transform The d3 zoom transformation information
142
+ * @param x The x-position of the mouse when the scroll wheel or gesture is used
143
+ * @param plotDimensions The dimensions of the plot
144
+ * @param series An array of series names
145
+ * @param ranges A map holding the axis ID and its associated time-range
146
+ */
147
+ const onZoom = useCallback((transform, x, plotDimensions, ranges) => ordinalAxisZoomHandler(axesForSeries, margin, setAxisIntervalFor, setOriginalAxisIntervalFor, xAxesState)(transform, x, plotDimensions, ranges), [axesForSeries, margin, setAxisIntervalFor, setOriginalAxisIntervalFor, xAxesState]);
148
+ /**
149
+ * @param ordinalRanges
150
+ * @param mainGElem
151
+ */
152
+ const updatePlot = useCallback((ordinalRanges, mainGElem) => {
153
+ if (container) {
154
+ // select the svg element bind the data to them
155
+ const svg = d3.select(container);
156
+ // set up panning
157
+ if (panEnabled) {
158
+ const drag = d3.drag()
159
+ .on("start", () => {
160
+ d3.select(container).style("cursor", "move");
161
+ allowTooltipRef.current = false;
162
+ })
163
+ .on("drag", (event) => {
164
+ const names = dataRef.current.map(series => series.name);
165
+ onPan(event.dx, plotDimensions, names, ordinalRanges);
166
+ // need to update the plot with the new time-ranges
167
+ updatePlotRef.current(ordinalRanges, mainGElem);
168
+ })
169
+ .on("end", () => {
170
+ d3.select(container).style("cursor", "auto");
171
+ allowTooltipRef.current = isSubscriptionClosed();
172
+ });
173
+ svg.call(drag);
174
+ }
175
+ // set up for zooming
176
+ if (zoomEnabled) {
177
+ const zoom = d3.zoom()
178
+ .filter((event) => !zoomKeyModifiersRequired || event.shiftKey || event.ctrlKey)
179
+ .scaleExtent([1, 10])
180
+ .translateExtent([[margin.left, margin.top], [plotDimensions.width, plotDimensions.height]])
181
+ .on("zoom", (event) => {
182
+ onZoom(event.transform, event.sourceEvent.offsetX - margin.left, plotDimensions, ordinalRanges);
183
+ updatePlotRef.current(ordinalRanges, mainGElem);
184
+ });
185
+ svg.call(zoom);
186
+ }
187
+ // enter, update, delete the bar data
188
+ dataRef.current.forEach(series => {
189
+ var _a, _b, _c;
190
+ const [xAxis, yAxis] = axesFor(series.name, axisAssignments, axisId => xAxesState.axisFor(axisId).getOrUndefined(), axisId => yAxesState.axisFor(axisId).getOrUndefined());
191
+ // grab the series styles, or the defaults if none exist
192
+ const { margin: categoryMargin = barMargin, valueLine: valueLineStyle, meanValueLine: meanValueLineStyle, windowedMeanValueLine: windowedMeanLineStyle, minMaxBar: minMaxBarStyle, windowedMinMaxBar: windowedBarStyle } = seriesStyles.get(series.name) || Object.assign(Object.assign({}, barSeriesStyle), { highlightColor: barSeriesStyle.color });
193
+ // only show the data for which the regex filter matches
194
+ const plotData = series.name.match(seriesFilter) ? [series.data[series.data.length - 1]] : [];
195
+ // grab the functions for determining the lower and upper bounds of the category
196
+ const { lower, upper } = xAxisCategoryBoundsFn(xAxis.scale.bandwidth(), valueLineStyle.regular.width, categoryMargin);
197
+ // grab the value (index) associated with the series name (this is a category axis)
198
+ const x = xAxis.scale(series.name) || 0;
199
+ //
200
+ // min/max bar rectangle
201
+ const totalBar = barDimensions(minMaxBarStyle.widthFraction, lower(x), upper(x), ((_a = statsRef.current.valueStatsForSeries.get(series.name)) === null || _a === void 0 ? void 0 : _a.min.value) || 0, ((_b = statsRef.current.valueStatsForSeries.get(series.name)) === null || _b === void 0 ? void 0 : _b.max.value) || 0, yAxis);
202
+ svg
203
+ .select(`#${series.name}-${chartId}-bar`)
204
+ .selectAll(classIdFor(BAR_CHART_CLASS_IDS.minMax))
205
+ .data(plotData)
206
+ .join(enter => barFor(enter.append('rect').attr('class', BAR_CHART_CLASS_IDS.minMax), totalBar, barStyleFor(showMinMaxBars, minMaxBarStyle)), update => barFor(update, totalBar, barStyleFor(showMinMaxBars, minMaxBarStyle)), exit => exit.remove())
207
+ .on("mouseover", (event) => handleMouseOverBar(container, yAxis, series, statsRef.current, event, margin, seriesStyles, barSeriesStyle, allowTooltipRef.current, mouseOverHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.minMax), BAR_CHART_TOOLTIP_PROVIDER_IDS.minMax))
208
+ .on("mouseleave", event => handleMouseLeaveSeries(series.name, event.currentTarget, seriesStyles, barSeriesStyle, mouseLeaveHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.minMax), BAR_CHART_TOOLTIP_PROVIDER_IDS.minMax));
209
+ //
210
+ // windowed-mean line when the windowed stats are defined for the series
211
+ const seriesWindowedStats = statsRef.current.windowedValueStatsForSeries.get(series.name);
212
+ if (seriesWindowedStats !== undefined) {
213
+ const windowedBar = barDimensions(windowedBarStyle.widthFraction, lower(x), upper(x), seriesWindowedStats.min.value, seriesWindowedStats.max.value, yAxis);
214
+ svg
215
+ .select(`#${series.name}-${chartId}-bar`)
216
+ .selectAll(classIdFor(BAR_CHART_CLASS_IDS.windowedMinMax))
217
+ .data(plotData)
218
+ .join(enter => barFor(enter.append('rect').attr('class', BAR_CHART_CLASS_IDS.windowedMinMax), windowedBar, barStyleFor(showWindowedMinMaxBars, windowedBarStyle)), update => barFor(update, windowedBar, barStyleFor(showWindowedMinMaxBars, windowedBarStyle)), exit => exit.remove())
219
+ .on("mouseover", (event) => handleMouseOverBar(container, yAxis, series, statsRef.current, event, margin, seriesStyles, barSeriesStyle, allowTooltipRef.current, mouseOverHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMinMax), BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMinMax))
220
+ .on("mouseleave", event => handleMouseLeaveSeries(series.name, event.currentTarget, seriesStyles, barSeriesStyle, mouseLeaveHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMinMax), BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMinMax));
221
+ //
222
+ // mean line
223
+ const meanLineY = yAxis.scale(((_c = statsRef.current.valueStatsForSeries.get(series.name)) === null || _c === void 0 ? void 0 : _c.mean) || 0);
224
+ svg
225
+ .select(`#${series.name}-${chartId}-bar`)
226
+ .selectAll(classIdFor(BAR_CHART_CLASS_IDS.meanValue))
227
+ .data(showMeanValueLines ? plotData : [])
228
+ .join(enter => lineFor(enter.append('line').attr('class', BAR_CHART_CLASS_IDS.meanValue), {
229
+ x1: () => lower(x), y1: () => meanLineY,
230
+ x2: () => upper(x), y2: () => meanLineY
231
+ }, meanValueLineStyle.regular), update => lineFor(update, {
232
+ x1: () => lower(x), y1: () => meanLineY,
233
+ x2: () => upper(x), y2: () => meanLineY
234
+ }, meanValueLineStyle.regular), exit => exit.remove())
235
+ .on("mouseover", (event) => handleMouseOverBar(container, yAxis, series, statsRef.current, event, margin, seriesStyles, barSeriesStyle, allowTooltipRef.current, mouseOverHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.meanValue), BAR_CHART_TOOLTIP_PROVIDER_IDS.meanValue))
236
+ .on("mouseleave", event => handleMouseLeaveSeries(series.name, event.currentTarget, seriesStyles, barSeriesStyle, mouseLeaveHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.meanValue), BAR_CHART_TOOLTIP_PROVIDER_IDS.meanValue));
237
+ const windowedMeanLineY = yAxis.scale(isNaN(seriesWindowedStats.mean) ? 0 : seriesWindowedStats.mean);
238
+ svg
239
+ .select(`#${series.name}-${chartId}-bar`)
240
+ .selectAll(classIdFor(BAR_CHART_CLASS_IDS.windowedMeanValue))
241
+ .data(showWindowedMeanValueLines ? plotData : [])
242
+ .join(enter => lineFor(enter.append('line').attr('class', BAR_CHART_CLASS_IDS.windowedMeanValue), {
243
+ x1: () => lower(x), y1: () => windowedMeanLineY,
244
+ x2: () => upper(x), y2: () => windowedMeanLineY
245
+ }, windowedMeanLineStyle.regular), update => lineFor(update, {
246
+ x1: () => lower(x), y1: () => windowedMeanLineY,
247
+ x2: () => upper(x), y2: () => windowedMeanLineY
248
+ }, windowedMeanLineStyle.regular), exit => exit.remove())
249
+ .on("mouseover", (event) => handleMouseOverBar(container, yAxis, series, statsRef.current, event, margin, seriesStyles, barSeriesStyle, allowTooltipRef.current, mouseOverHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMeanValue), BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMeanValue))
250
+ .on("mouseleave", event => handleMouseLeaveSeries(series.name, event.currentTarget, seriesStyles, barSeriesStyle, mouseLeaveHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMeanValue), BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMeanValue));
251
+ }
252
+ //
253
+ // value lines
254
+ svg
255
+ .select(`#${series.name}-${chartId}-bar`)
256
+ .selectAll(classIdFor(BAR_CHART_CLASS_IDS.currentValue))
257
+ .data(showValueLines ? plotData : [])
258
+ .join(enter => lineFor(enter.append('line').attr('class', BAR_CHART_CLASS_IDS.currentValue), {
259
+ x1: () => lower(x), y1: datum => yAxis.scale(datum.value),
260
+ x2: () => upper(x), y2: datum => yAxis.scale(datum.value)
261
+ }, valueLineStyle.regular), update => lineFor(update, {
262
+ x1: () => lower(x), y1: datum => yAxis.scale(datum.value),
263
+ x2: () => upper(x), y2: datum => yAxis.scale(datum.value)
264
+ }, valueLineStyle.regular), exit => exit.remove())
265
+ .on("mouseover", (event) => handleMouseOverBar(container, yAxis, series, statsRef.current, event, margin, seriesStyles, barSeriesStyle, allowTooltipRef.current, mouseOverHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.currentValue), BAR_CHART_TOOLTIP_PROVIDER_IDS.currentValue))
266
+ .on("mouseleave", event => handleMouseLeaveSeries(series.name, event.currentTarget, seriesStyles, barSeriesStyle, mouseLeaveHandlerFor(`tooltip-${chartId}`, BAR_CHART_TOOLTIP_PROVIDER_IDS.currentValue), BAR_CHART_TOOLTIP_PROVIDER_IDS.currentValue));
267
+ });
268
+ }
269
+ }, [
270
+ container,
271
+ panEnabled, zoomEnabled,
272
+ onPan, onZoom,
273
+ plotDimensions, margin, zoomKeyModifiersRequired,
274
+ axisAssignments, xAxesState, yAxesState,
275
+ barMargin, seriesStyles, barSeriesStyle,
276
+ seriesFilter,
277
+ chartId,
278
+ showValueLines,
279
+ showMinMaxBars,
280
+ mouseOverHandlerFor, mouseLeaveHandlerFor,
281
+ showMeanValueLines,
282
+ showWindowedMeanValueLines,
283
+ showWindowedMinMaxBars
284
+ ]);
285
+ // need to keep the function references for use by the subscription, which forms a closure
286
+ // on them. without the references, the closures become stale, and resizing during streaming
287
+ // doesn't work properly
288
+ const updatePlotRef = useRef(noop);
289
+ useEffect(() => {
290
+ if (mainG != null && container != null) {
291
+ // when the update plot function doesn't yet exist, then create the container holding the plot
292
+ const clipPathId = setClipPathG(chartId, mainG, plotDimensions);
293
+ if (updatePlotRef.current === noop) {
294
+ mainG
295
+ .selectAll('g')
296
+ .attr("clip-path", `url(#${clipPathId})`)
297
+ .data(dataRef.current)
298
+ .enter()
299
+ .append('g')
300
+ .attr('class', 'spikes-series')
301
+ .attr('id', series => `${series.name}-${chartId}-bar`)
302
+ .attr('transform', `translate(${margin.left}, ${margin.top})`);
303
+ }
304
+ else {
305
+ mainG
306
+ .selectAll('g')
307
+ .attr("clip-path", `url(#${clipPathId})`);
308
+ }
309
+ updatePlotRef.current = updatePlot;
310
+ }
311
+ }, [chartId, container, mainG, margin, plotDimensions, updatePlot]);
312
+ // memoized function for subscribing to the chart-data observable
313
+ const subscribe = useCallback(() => {
314
+ if (seriesObservable === undefined || mainG === null)
315
+ return undefined;
316
+ return subscriptionOrdinalXFor(seriesObservable, onSubscribe, windowingTime, axisAssignments, yAxesState, onUpdateData, dropDataAfter, updateTimingAndPlot,
317
+ // as new data flows into the subscription, the subscription
318
+ // updates this map directly (for performance)
319
+ seriesRef.current, statsRef, (currentTime) => currentTimeRef.current = currentTime, AxisInterval.from(0, plotDimensions.width));
320
+ }, [
321
+ axisAssignments, dropDataAfter, mainG,
322
+ onSubscribe, onUpdateData,
323
+ seriesObservable, updateTimingAndPlot, windowingTime, yAxesState,
324
+ plotDimensions.width
325
+ ]);
326
+ useEffect(() => {
327
+ if (container && mainG) {
328
+ const ordinalAxesRanges = axesRanges();
329
+ // so this gets a bit complicated. the ordinal-ranges need to be updated whenever the ordinal-ranges
330
+ // change. for example, when the window is resized, and then we need to update the
331
+ // ordinal-range. however, we want to keep the ordinal-ranges to reflect their original scale so that
332
+ // we can zoom properly (so the updates can't fuck with the scale).
333
+ if (ordinalAxesRanges.size === 0) {
334
+ // when no time-ranges have yet been created, then create them and hold on to a mutable
335
+ // reference to them
336
+ updatePlot(ordinalAxisRanges(xAxesState.axes, AxisInterval.from(0, plotDimensions.width)), mainG);
337
+ }
338
+ else {
339
+ // when the ordinal-ranges already exist, then we want to update the ordinal-ranges for each
340
+ // existing ordinal-range in a way that maintains the original scale.
341
+ const intervals = ordinalAxisIntervals(xAxesState.axes);
342
+ // todo instead of updating the underlying map, this should use setter methods to make the updates
343
+ ordinalAxesRanges
344
+ .forEach((range, id, rangesMap) => {
345
+ Optional
346
+ .ofNullable(intervals.get(id))
347
+ .map(intervalInfo => intervalInfo.interval.asTuple())
348
+ .ifPresent(([start, end]) => {
349
+ // update the reference map with the new (start, end) portion of the range,
350
+ // while keeping the original scale intact
351
+ rangesMap.set(id, range.update(start, end));
352
+ });
353
+ });
354
+ updatePlot(ordinalAxesRanges, mainG);
355
+ }
356
+ }
357
+ }, [axesRanges, container, mainG, plotDimensions.width, updatePlot, xAxesState.axes]);
358
+ // subscribe/unsubscribe to the observable chart data. when the `shouldSubscribe`
359
+ // is changed to `true` and we haven't subscribed yet, then subscribe. when the
360
+ // `shouldSubscribe` is `false` and we had subscribed, then unsubscribe. otherwise,
361
+ // do nothing.
362
+ useEffect(() => {
363
+ var _a;
364
+ if (shouldSubscribe && subscriptionRef.current === undefined) {
365
+ subscriptionRef.current = subscribe();
366
+ allowTooltipRef.current = false;
367
+ }
368
+ else if (!shouldSubscribe && subscriptionRef.current !== undefined) {
369
+ (_a = subscriptionRef.current) === null || _a === void 0 ? void 0 : _a.unsubscribe();
370
+ subscriptionRef.current = undefined;
371
+ allowTooltipRef.current = true;
372
+ }
373
+ }, [shouldSubscribe, subscribe]);
374
+ return null;
375
+ }
376
+ function barStyleFor(isVisible, style) {
377
+ return Object.assign(Object.assign({}, style), { fill: updateOpacityFor(isVisible, style.fill), stroke: updateOpacityFor(isVisible, style.stroke) });
378
+ }
379
+ function updateOpacityFor(isVisible, style) {
380
+ return Object.assign(Object.assign({}, style), { opacity: isVisible ? style.opacity : 0 });
381
+ }
382
+ /**
383
+ * Sets the attributes for the bar based on the d3 selection
384
+ * @param selection The d3 selection (rect SVG element)
385
+ * @param dimensions The bar dimensions
386
+ * @param style The bar style holding the fill and stroke styles
387
+ * @return The updated SVG selection (rect SVG element)
388
+ */
389
+ function barFor(selection, dimensions, style) {
390
+ selection
391
+ .attr('x', () => dimensions.upperX)
392
+ .attr('y', () => dimensions.upperY)
393
+ .attr('width', () => dimensions.width)
394
+ .attr('height', () => dimensions.height);
395
+ return applyStrokeStylesTo(applyFillStylesTo(selection, style.fill), style.stroke);
396
+ }
397
+ /**
398
+ * Creates the line segment for values and means
399
+ * @param selection The d3 selection (rect SVG element)
400
+ * @param pathSegment The object containing functions for extracting the (x1, y1) and (x2, y2)
401
+ * points for the path segment
402
+ * @param strokeStyle The stroke style
403
+ * @return The updated SVG selection (rect SVG element)
404
+ */
405
+ function lineFor(selection, pathSegment, strokeStyle) {
406
+ selection
407
+ .attr('x1', datum => pathSegment.x1(datum))
408
+ .attr('y1', datum => pathSegment.y1(datum))
409
+ .attr('x2', datum => pathSegment.x2(datum))
410
+ .attr('y2', datum => pathSegment.y2(datum));
411
+ return applyStrokeStylesTo(selection, strokeStyle);
412
+ }
413
+ /**
414
+ * Calculates the upper (x, y) coordinates of the bar, and the width and height of the bar
415
+ * @param widthFraction The fraction of the category width that the bar should take
416
+ * @param lowerX (Scaled to the axis) The lower bounds of the bar on the x-axis
417
+ * @param upperX (Scaled to the axis) The upper bounds of the bar on the x-axis
418
+ * @param min The minimum value for the category (NOT scaled to the axis)
419
+ * @param max The maximum value for the category (NOT scaled to the axis)
420
+ * @param axis The axis (needed for scaling)
421
+ * @return The bar's upper (x, y) coordinates, the width, and height
422
+ */
423
+ function barDimensions(widthFraction, lowerX, upperX, min, max, axis) {
424
+ const x = lowerX + Math.max(0, 0.5 - widthFraction / 2) * (upperX - lowerX);
425
+ const maxValue = (isNaN(max) || max === -Infinity) ? 0 : max;
426
+ const y = axis.scale(maxValue);
427
+ const width = Math.max(0, widthFraction * (upperX - lowerX));
428
+ const minValue = (isNaN(min) || min === -Infinity) ? 0 : min;
429
+ const height = Math.max(0, axis.scale(minValue) - axis.scale(maxValue));
430
+ return {
431
+ upperX: x,
432
+ upperY: y,
433
+ width,
434
+ height,
435
+ };
436
+ }
437
+ /**
438
+ * Calculates the ordinal stats for each of the ordinal series (generally, initial data) and
439
+ * returns a {@link WindowedOrdinalStats} object
440
+ * @param series The array of ordinal series
441
+ * @return A {@link WindowedOrdinalStats} object with the stats for each of the series
442
+ */
443
+ function initialOrdinalStats(series) {
444
+ const ordinalStats = calculateOrdinalStats(series);
445
+ return Object.assign(Object.assign({}, ordinalStats), { windowedValueStatsForSeries: copyValueStatsForSeries(ordinalStats.valueStatsForSeries) });
446
+ }
447
+ /**
448
+ * Attempts to locate the x- and y-axes for the specified series. If no axis is found for the
449
+ * series name, then uses the default returned by the useChart() hook.
450
+ * @param seriesName Name of the series for which to retrieve the axis
451
+ * @param axisAssignments A map holding the series name and the associated x- and y-axes assigned
452
+ * to that series. Note that the series in the axis-assignment map is merely a subset of the set
453
+ * of series names.
454
+ * @param xAxisFor The function that accepts an axis ID and returns the corresponding x-axis
455
+ * @param yAxisFor The function that accepts an axis ID and returns the corresponding y-axis
456
+ * @return A 2d tuple holding the linear x-axis as its first element and the category y-axis as
457
+ * the second element.
458
+ */
459
+ function axesFor(seriesName, axisAssignments, xAxisFor, yAxisFor) {
460
+ const axes = axisAssignments.get(seriesName);
461
+ const xAxis = xAxisFor((axes === null || axes === void 0 ? void 0 : axes.xAxis) || "");
462
+ const xAxisCategory = xAxis;
463
+ if (xAxis && !xAxisCategory) {
464
+ throw Error("Bar plot requires that x-axis be of type CategoryAxis");
465
+ }
466
+ const yAxis = yAxisFor((axes === null || axes === void 0 ? void 0 : axes.yAxis) || "");
467
+ const yAxisContinuous = yAxis;
468
+ if (yAxis && !yAxisContinuous) {
469
+ throw Error("Bar plot requires that y-axis be of type ContinuousNumericAxis");
470
+ }
471
+ return [xAxisCategory, yAxisContinuous];
472
+ }
473
+ /**
474
+ * Calculates the upper and lower coordinate for the category
475
+ * @param categorySize The size of the category (i.e. plot_height / num_series)
476
+ * @param lineWidth The width of the series line
477
+ * @param margin The margin applied to the top and bottom of the spike line (vertical spacing)
478
+ * @return An object with two functions, that when handed a y-coordinate, return the location
479
+ * for the start (yUpper) or end (yLower) of the spikes line.
480
+ */
481
+ function xAxisCategoryBoundsFn(categorySize, lineWidth, margin) {
482
+ if (categorySize <= margin)
483
+ return {
484
+ upper: value => value + lineWidth,
485
+ lower: value => value
486
+ };
487
+ return {
488
+ upper: value => value + categorySize - margin,
489
+ lower: value => value + margin
490
+ };
491
+ }
492
+ /**
493
+ * Renders a tooltip showing for the bar in the bar chart (see {@link BarPlotTooltipContent})
494
+ * @param container The chart container
495
+ * @param yAxis The y-axis
496
+ * @param selectedSeries The selected series
497
+ * @param seriesStats The statistics about the current series
498
+ * @param event The mouse-over series event holding the line element
499
+ * @param margin The plot margin
500
+ * @param barStyles The series style information (needed for (un)highlighting)
501
+ * @param defaultBarSeriesStyle The default bar series style that is used if no style is found for the series
502
+ * @param allowTooltip When set to `false` won't show tooltip, even if it is visible (used by pan)
503
+ * @param mouseOverHandlerFor The handler for the mouse over (registered by the <Tooltip/>)
504
+ * @param tooltipProvider The ID of the tooltip provider
505
+ */
506
+ function handleMouseOverBar(container, yAxis, selectedSeries, seriesStats, event, margin, barStyles, defaultBarSeriesStyle, allowTooltip, mouseOverHandlerFor, tooltipProvider) {
507
+ // grab the time needed for the tooltip ID
508
+ const [x, y] = d3.pointer(event, container);
509
+ const value = yAxis.scale.invert(y - margin.top);
510
+ const { name: categoryName, data: selectedData } = selectedSeries;
511
+ const barSeriesStyle = barStyles.get(categoryName) || defaultBarSeriesStyle;
512
+ const lineStyle = lineStyleFor(tooltipProvider, barSeriesStyle);
513
+ if (lineStyle !== undefined) {
514
+ d3.select(event.currentTarget)
515
+ .style(STROKE_COLOR, lineStyle.highlight.color)
516
+ .style(STROKE_WIDTH, lineStyle.highlight.width)
517
+ .style(STROKE_OPACITY, lineStyle.highlight.opacity);
518
+ }
519
+ if (mouseOverHandlerFor && allowTooltip) {
520
+ // the contract for the mouse over handler is for a series
521
+ mouseOverHandlerFor(categoryName, value, { series: selectedData, metadata: seriesStats }, [x, y]);
522
+ }
523
+ }
524
+ /**
525
+ * Unselects the time series and calls the mouse-leave-series handler registered for this series.
526
+ * @param seriesName The name of the series (i.e. the neuron ID)
527
+ * @param segment The SVG line element representing the spike, over which the mouse is hovering.
528
+ * @param seriesStyles The styles for the series (for (un)highlighting)
529
+ * @param defaultBarSeriesStyle The default bar series style that is used if no style is found for the series
530
+ * @param mouseLeaverHandlerFor Registered handler for the series when the mouse leaves
531
+ * @param tooltipProvider The tooltip provider ID for the mouse-over event
532
+ */
533
+ function handleMouseLeaveSeries(seriesName, segment, seriesStyles, defaultBarSeriesStyle, mouseLeaverHandlerFor, tooltipProvider) {
534
+ const barSeriesStyle = seriesStyles.get(seriesName) || defaultBarSeriesStyle;
535
+ const lineStyle = lineStyleFor(tooltipProvider, barSeriesStyle);
536
+ if (lineStyle !== undefined) {
537
+ d3.select(segment)
538
+ .style(STROKE_COLOR, lineStyle.regular.color)
539
+ .style(STROKE_WIDTH, lineStyle.regular.width)
540
+ .style(STROKE_OPACITY, lineStyle.regular.opacity);
541
+ }
542
+ if (mouseLeaverHandlerFor) {
543
+ mouseLeaverHandlerFor(seriesName);
544
+ }
545
+ }
546
+ function lineStyleFor(tooltipProvider, barSeriesStyle) {
547
+ const { valueLine, windowedMeanValueLine } = barSeriesStyle;
548
+ switch (tooltipProvider) {
549
+ case BAR_CHART_TOOLTIP_PROVIDER_IDS.currentValue:
550
+ return valueLine;
551
+ case BAR_CHART_TOOLTIP_PROVIDER_IDS.windowedMeanValue:
552
+ return windowedMeanValueLine;
553
+ default:
554
+ return undefined;
555
+ }
556
+ }
557
+ //# sourceMappingURL=BarPlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BarPlot.js","sour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