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
package/README.md CHANGED
@@ -4,76 +4,116 @@
4
4
  [Change History](changes.md) •
5
5
  [Example Project](https://github.com/robphilipp/stream-charts-examples)
6
6
 
7
- `stream-charts` are [react](https://reactjs.org)-based time-series charts for viewing high frequency data, streamed in real-time using [rxjs](https://rxjs-dev.firebaseapp.com). Generally, update periods of 25 ms aren't a problem for about a hundred or so time-series. To achieve this type of performance, the charts are implemented using [d3](https://d3js.org) SVG elements, wrapped in react functional components, and keep chart updates outside the react render cycle.
7
+ ## [&#10514;](#top) <span id="intro">intro</span>
8
+ `stream-charts` is a [react](https://reactjs.org)-based library for building real-time time-series charts for viewing high frequency data. Ingesting and plotting new data for about 100 time-series every 25 ms isn't generally a problem.
8
9
 
9
- ### quick overview
10
+ The following plot types are currently available:
10
11
 
11
- With `stream-charts` you can display initial (or static) data as well as live data from an `Observable`.
12
+ 1. **Scatter Plot**: for plotting time-series data.
13
+ 2. **Raster Plot**: for plotting event-timing data.
14
+ 3. **Bar Plot**: for plotting time-series as bars that show the current value and its minimum, maximum, and mean values for all times and time-windows.
15
+ 4. **Poincare Plot**: for plotting function iterates (`f[n](t)` vs `f[n-m](t)`).
12
16
 
13
- `Charts` are composable using react components. So you can add different axis types, multiple axes, trackers, tooltips, and plots.
17
+ > Try it on codesandbox [stream-charts](https://codesandbox.io/p/sandbox/n7c8jm)
14
18
 
15
- All aspects of the `Charts` style are exposed allowing you to use your favorite frameworks theme provider, or none at all.
16
-
17
- `Charts` provide zooming and panning can be enabled or disabled. And zooming is set to use a modifier key by default so that it doesn't interfere with normal scrolling.
19
+ `Charts` are composable using react components. So you can add different axis types, multiple axes, trackers, tooltips, and plots. `stream-charts` provides the following react components from which to build your own charts:
20
+ 1. The [Chart](#chart-usage) serves as the container, holding the other components as children, and providing the data to the plot.
21
+ 2. The [ContinuousAxis](#continuous-axes-usage) and [OrdinalAxis](#ordinal-axes-usage) components define the x- and y-axes, and provide the scales for the axes. Charts are required to have at least one x-axis and one y-axis.
22
+ 3. The optional [Tracker](#tracker-usage) component shows the value associated with the current mouse location of the axes to which it is assigned.
23
+ 4. The optional [Tooltip](#tooltip-usage) component shows the `TooltipContent` for the datum under the mouse cursor. Each plot type has a default tooltip content component ([ScatterPlotTooltipContent](#scatterplot-tooltip-usage), [RasterPlotTooltipContent](#rasterplot-tooltip-usage), [BarPlotTooltipContent](#barplot-tooltip-usage), [PoincarePlotTooltipContent](#poincareplot-tooltip-usage)).
24
+ 5. The `Plot` component displays the data. Currently, there are four plot components: [ScatterPlot](#scatter-plot-usage), [RasterPlot](#raster-plot-usage), [BarPlot](#bar-plot-usage), and [PoincarePlot](#poincare-plot-usage).
18
25
 
19
- When using lower update frequencies, such as < 250 ms, and data updates are sparse, you can set an update cadence so that the plot's time smoothly scrolls, rather than updating only when new data arrives.
26
+ ### [&#10514;](#content) <span id="axes">capabilities</span>
27
+ Charts can have multiple x-axes and y-axes, and these axes can have different scales. Time series can be assigned to an axis or use the default one. Currently, there are continuous and ordinal (category) axes. Continuous axes are available with all the scales supported by [d3](https://d3js.org) (for example, linear scales, logarithmic scales, and power scales).
20
28
 
21
- `Charts` can have a data TTL (time-to-live) to drop older data to allow long-running streams of data. With the data-update callback you can capture that data and store it in local storage, memory, or a location of your choice.
29
+ Each plot type comes with a default tooltip and tooltip content. However, you can customize the tooltip and tooltip content to suit your needs.
22
30
 
31
+ The charts are designed to be responsive to changes in size, for example, to support window resizing.
23
32
 
24
- ### project status
25
- Although still under development, there are two charts available:
33
+ With `stream-charts` you can display initial (static) data as well as live data from an [Observable](https://rxjs-dev.firebaseapp.com/api/index/class/Observable).
26
34
 
27
- 1. a neuron raster chart, and a
28
- 2. scatter chart.
29
-
30
- Over time, I'll add additional chart types. In the meantime, I welcome any contributions to create new chart types (bar, gauges, etc).
31
-
32
- ## [&#10514;](#top) <span id="content">content</span>
35
+ All aspects of the `Charts` style are exposed allowing you to use your favorite frameworks theme provider, or none at all.
33
36
 
34
- **[quick start](#quick-start)**<br>
35
- &nbsp;&nbsp;&nbsp;&nbsp;[example raster chart code](#example-raster-chart-code)<br>
36
- &nbsp;&nbsp;&nbsp;&nbsp;[example scatter chart code](#example-scatter-chart-code)
37
+ `Charts` provide zooming and panning that can be enabled or disabled. And zooming is set to use a modifier key by default so that it doesn't interfere with normal scrolling.
37
38
 
38
- **[intro](#intro)**<br>
39
- &nbsp;&nbsp;&nbsp;&nbsp;[terminology](#terminology)<br>
40
- &nbsp;&nbsp;&nbsp;&nbsp;[data ttl, time-windows, performance](#data-ttl)<br>
39
+ ### [&#10514;](#top) <span id="content">rendering performance</span>
40
+ Charts can easily ingest and plot new data for about 100 time-series every 25 ms.
41
41
 
42
- **[chart](#chart)**<br>
43
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;Chart/&gt;](#chart-usage)<br>
44
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimensions](#chart-usage-dimensions)<br>
45
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[styling](#chart-usage-styling)<br>
46
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[initial data](#chart-usage-initial-data)<br>
47
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[streaming data](#chart-usage-streaming-data)<br>
42
+ When using lower update frequencies, such as < 250 ms, and data updates are sparse, you can set an update cadence so that the plot's time smoothly scrolls, rather than updating only when new data arrives.
48
43
 
49
- **[axes](#axes)**<br>
50
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;ContinousAxis/&gt;](#continuous-axes-usage)<br>
51
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[base properties](#continuous-axes-usage-base)<br>
52
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[styling](#continuous-axes-usage-styling)<br>
44
+ `Charts` can have a data TTL (time-to-live) to drop older data to allow long-running streams of data. With the data-update callback you can capture that data and store it in local storage, memory, or a location of your choice.
53
45
 
54
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;CategoryAxis/&gt;](#category-axes-usage)<br>
55
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[base properties](#category-axes-usage-base)<br>
56
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[styling](#category-axes-usage-styling)<br>
46
+ To achieve this type of performance, the charts:
47
+ 1. accept an [rxjs](https://rxjs-dev.firebaseapp.com) [Observable](https://rxjs-dev.firebaseapp.com/api/index/class/Observable) as the source of the time-series data, and
48
+ 2. are implemented using [d3](https://d3js.org) SVG elements wrapped in [react](https://reactjs.org) functional components, and
49
+ 3. keep chart updates outside [react](https://reactjs.org)'s render cycle.
57
50
 
58
- **[plots](#plots)**<br>
59
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;ScatterPlot/&gt;](#scatter-plot-usage)<br>
60
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[base properties](#scatter-plot-usage-base)<br>
61
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[view-modifying interactions](#scatter-plot-usage-view)<br>
62
51
 
63
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;RasterPlot/&gt;](#raster-plot-usage)<br>
64
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[base properties](#raster-plot-usage-base)<br>
65
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[view-modifying interactions](#raster-plot-usage-view)<br>
52
+ ### [&#10514;](#top) <span id="content">project status</span>
53
+ The following plots are currently available:
66
54
 
67
- **[utilities](#utilities)**<br>
68
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;Tracker/&gt;](#tracker-usage)<br>
69
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[base properties](#tracker-usage-base)<br>
70
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[styling](#tracker-usage-styling)<br>
55
+ 1. **Scatter Plot**: for plotting time-series data.
56
+ 2. **Raster Plot**: for plotting event-timing data.
57
+ 3. **Bar Plot**: for plotting windowed stats (min, max, mean).
58
+ 4. **Poincare Plot**: for plotting iterates (n vs n-1).
71
59
 
72
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;Tooltip/&gt;](#tooltip-usage)<br>
60
+ Over time, I'll add additional chart types. In the meantime, I welcome any contributions to create new chart types (gauges, etc).
73
61
 
74
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;ScatterPlotTooltipContent/&gt;](#scatterplot-tooltip-usage)<br>
62
+ ## [&#10514;](#top) <span id="content">content</span>
75
63
 
76
- &nbsp;&nbsp;&nbsp;&nbsp;[&lt;RasterPlotTooltipContent/&gt;](#rasterplot-tooltip-usage)<br>
64
+ **[quick start](#quick-start)**
65
+ - [example raster chart code](#example-raster-chart-code)
66
+ - [example scatter chart code](#example-scatter-chart-code)
67
+ - [example bar chart code](#example-bar-chart-code)
68
+ - [example poincare chart code](#example-poincare-chart-code)
69
+
70
+ **[intro](#intro)**
71
+ - [terminology](#terminology)
72
+ - [data ttl, time-windows, performance](#data-ttl)
73
+
74
+ **[chart](#chart)**
75
+ - [&lt;Chart/&gt;](#chart-usage)
76
+ - [dimensions](#chart-usage-dimensions)
77
+ - [styling](#chart-usage-styling)
78
+ - [initial data](#chart-usage-initial-data)
79
+ - [streaming data](#chart-usage-streaming-data)
80
+
81
+ **[axes](#axes)**
82
+ - [&lt;ContinuousAxis/&gt;](#continuous-axes-usage)
83
+ - [base properties](#continuous-axes-usage-base)
84
+ - [styling](#continuous-axes-usage-styling)
85
+
86
+ - [&lt;OrdinalAxis/&gt;](#ordinal-axes-usage)
87
+ - [base properties](#ordinal-axes-usage-base)
88
+ - [styling](#ordinal-axes-usage-styling)
89
+
90
+ **[plots](#plots)**
91
+ - [&lt;ScatterPlot/&gt;](#scatter-plot-usage)
92
+ - [base properties](#scatter-plot-usage-base)
93
+ - [view-modifying interactions](#scatter-plot-usage-view)
94
+
95
+ - [&lt;RasterPlot/&gt;](#raster-plot-usage)
96
+ - [base properties](#raster-plot-usage-base)
97
+ - [view-modifying interactions](#raster-plot-usage-view)
98
+
99
+ - [&lt;BarPlot/&gt;](#bar-plot-usage)
100
+ - [base properties](#bar-plot-usage-base)
101
+ - [view-modifying interactions](#bar-plot-usage-view)
102
+
103
+ - [&lt;PoincarePlot/&gt;](#poincare-plot-usage)
104
+ - [base properties](#poincare-plot-usage-base)
105
+ - [view-modifying interactions](#poincare-plot-usage-view)
106
+
107
+ **[utilities](#utilities)**
108
+ - [&lt;Tracker/&gt;](#tracker-usage)
109
+ - [base properties](#tracker-usage-base)
110
+ - [styling](#tracker-usage-styling)
111
+ - [&lt;Tooltip/&gt;](#tooltip-usage)
112
+ - [&lt;RasterPlotTooltipContent/&gt;](#rasterplot-tooltip-usage)
113
+ - [&lt;ScatterPlotTooltipContent/&gt;](#scatterplot-tooltip-usage)
114
+ - [&lt;BarPlotTooltipContent/&gt;](#barplot-tooltip-usage)
115
+ - [&lt;PoincarePlotTooltipContent/&gt;](#poincareplot-tooltip-usage)
116
+ - [hooks](#hooks)
77
117
 
78
118
 
79
119
  ## [&#10514;](#content) <span id="quick-start">quick start</span>
@@ -83,66 +123,99 @@ npm install stream-charts
83
123
  ```
84
124
 
85
125
  ### [&#10514;](#content) <span id="example-raster-chart-code">example raster chart</span>
86
- For the neuron raster chart (see [example](https://github.com/robphilipp/stream-charts-examples/blob/master/src/app/examples/StreamingRasterChart.tsx))
126
+ An example raster chart (see [example](https://github.com/robphilipp/stream-charts-examples/blob/master/src/app/examples/StreamingRasterChart.tsx))
87
127
 
88
- ![raster-chart](https://github.com/robphilipp/stream-charts/blob/master/images/raster-magnifier.png?raw=true)
128
+ ![raster-chart](https://github.com/robphilipp/stream-charts/blob/develop/images/raster-chart-tooltip.png?raw=true)
89
129
 
90
130
 
91
131
  ```typescript jsx
92
- import {RasterChart} from "stream-charts";
93
- // .
94
- // .
95
- // .
96
132
  <Chart
133
+ chartId={chartId.current}
97
134
  width={useGridCellWidth()}
98
135
  height={useGridCellHeight()}
99
- margin={{...defaultMargin, top: 60, right: 60}}
136
+ margin={{...defaultMargin, top: 40, right: 75, left: 70, bottom: 40}}
137
+ // svgStyle={{'background-color': 'pink'}}
100
138
  color={theme.color}
101
139
  backgroundColor={theme.backgroundColor}
102
140
  seriesStyles={new Map([
103
- ['test1', {...defaultLineStyle, color: 'orange', lineWidth: 1, highlightColor: 'orange'}],
104
- ['test2', {...defaultLineStyle,
105
- color: theme.name === 'light' ? 'blue' : 'gray',
106
- lineWidth: 3,
107
- highlightColor: theme.name === 'light' ? 'blue' : 'gray',
108
- highlightWidth: 5}
109
- ],
141
+ ['neuron1', {
142
+ ...defaultLineStyle(),
143
+ color: 'orange',
144
+ lineWidth: 2,
145
+ highlightColor: 'orange'
146
+ }],
147
+ ['neuron2', {
148
+ ...defaultLineStyle(),
149
+ color: 'orange',
150
+ lineWidth: 2,
151
+ highlightColor: 'orange'
152
+ }],
153
+ ['neuron3', {
154
+ ...defaultLineStyle(),
155
+ color: 'orange',
156
+ lineWidth: 2,
157
+ highlightColor: 'orange'
158
+ }],
159
+ ['neuron4', {
160
+ ...defaultLineStyle(),
161
+ color: 'orange',
162
+ lineWidth: 2,
163
+ highlightColor: 'orange'
164
+ }],
165
+ ['neuron5', {
166
+ ...defaultLineStyle(),
167
+ color: 'orange',
168
+ lineWidth: 2,
169
+ highlightColor: 'orange'
170
+ }],
171
+ ['neuron6', {
172
+ ...defaultLineStyle(),
173
+ color: theme.name === 'light' ? 'blue' : 'gray',
174
+ lineWidth: 3,
175
+ highlightColor: theme.name === 'light' ? 'blue' : 'gray',
176
+ highlightWidth: 5
177
+ }],
178
+ // ['test3', {...defaultLineStyle, color: 'dodgerblue', lineWidth: 1, highlightColor: 'dodgerblue', highlightWidth: 3}],
110
179
  ])}
111
180
  initialData={initialDataRef.current}
112
181
  seriesFilter={filter}
113
182
  seriesObservable={observableRef.current}
114
183
  shouldSubscribe={running}
115
- windowingTime={35}
184
+ onUpdateAxesBounds={handleChartTimeUpdate}
185
+ windowingTime={25}
186
+ // onSubscribe={subscription => console.log("subscribed raster")}
116
187
  >
117
188
  <ContinuousAxis
118
189
  axisId="x-axis-1"
119
190
  location={AxisLocation.Bottom}
120
191
  domain={[0, 5000]}
121
- label="x-axis"
192
+ label="t (ms)"
122
193
  // font={{color: theme.color}}
123
194
  />
124
195
  <ContinuousAxis
125
196
  axisId="x-axis-2"
126
197
  location={AxisLocation.Top}
127
- domain={[0, 10000]}
128
- label="x-axis"
198
+ domain={[0, 5000]}
199
+ label="t (ms)"
129
200
  // font={{color: theme.color}}
130
201
  />
131
- <CategoryAxis
202
+ <OrdinalAxis
132
203
  axisId="y-axis-1"
133
204
  location={AxisLocation.Left}
134
205
  categories={initialDataRef.current.map(series => series.name)}
135
- label="y-axis"
206
+ label="neuron"
207
+ axisTickStyle={{rotation: 25}}
136
208
  />
137
- <CategoryAxis
209
+ <OrdinalAxis
138
210
  axisId="y-axis-2"
139
211
  location={AxisLocation.Right}
140
212
  categories={initialDataRef.current.map(series => series.name)}
141
- label="y-axis"
213
+ label="neuron"
142
214
  />
143
215
  <Tracker
144
216
  visible={visibility.tracker}
145
- labelLocation={TrackerLabelLocation.WithMouse}
217
+ labelLocation={TrackerLabelLocation.ByAxis}
218
+ labelFormatter={x => `${d3.format(",.0f")(x)} ms`}
146
219
  style={{color: theme.color}}
147
220
  font={{color: theme.color}}
148
221
  // onTrackerUpdate={update => console.dir(update)}
@@ -164,14 +237,20 @@ import {RasterChart} from "stream-charts";
164
237
  <RasterPlot
165
238
  axisAssignments={new Map([
166
239
  // ['test', assignAxes("x-axis-1", "y-axis-1")],
167
- ['test1', assignAxes("x-axis-2", "y-axis-2")],
240
+ ['neuron1', assignAxes("x-axis-2", "y-axis-2")],
241
+ ['neuron2', assignAxes("x-axis-2", "y-axis-2")],
242
+ ['neuron3', assignAxes("x-axis-2", "y-axis-2")],
243
+ ['neuron4', assignAxes("x-axis-2", "y-axis-2")],
244
+ ['neuron5', assignAxes("x-axis-2", "y-axis-2")],
245
+ ['neuron6', assignAxes("x-axis-2", "y-axis-2")],
168
246
  // ['test3', assignAxes("x-axis-1", "y-axis-1")],
169
247
  ])}
170
- dropDataAfter={10000}
248
+ spikeMargin={1}
249
+ dropDataAfter={5000}
171
250
  panEnabled={true}
172
251
  zoomEnabled={true}
173
252
  zoomKeyModifiersRequired={true}
174
- withCadenceOf={30}
253
+ withCadenceOf={50}
175
254
  />
176
255
  </Chart>
177
256
  ```
@@ -180,39 +259,51 @@ import {RasterChart} from "stream-charts";
180
259
 
181
260
  An example scatter chart (see [example](https://github.com/robphilipp/stream-charts-examples/blob/master/src/app/examples/StreamingScatterChart.tsx))
182
261
 
183
- ![scatter-chart-tooltip](https://github.com/robphilipp/stream-charts/blob/master/images/scatter-tooltip.png?raw=true)
262
+ ![scatter-chart-tooltip](https://github.com/robphilipp/stream-charts/blob/develop/images/scatter-chart-with-tooltip.png?raw=true)
184
263
 
185
264
 
186
265
  ```typescript jsx
187
- import {ScatterChart} from "stream-charts";
188
- // .
189
- // .
190
- // .
191
266
  <Chart
267
+ chartId={chartId.current}
192
268
  width={useGridCellWidth()}
193
269
  height={useGridCellHeight()}
194
- margin={{...defaultMargin, top: 60, right: 60}}
270
+ margin={{...defaultMargin, top: 40, bottom: 40, right: 60}}
271
+ // svgStyle={{'background-color': 'pink'}}
195
272
  color={theme.color}
196
273
  backgroundColor={theme.backgroundColor}
197
274
  seriesStyles={new Map([
198
- ['test1', {...defaultLineStyle, color: 'orange', lineWidth: 1, highlightColor: 'orange'}],
199
- ['test2', {...defaultLineStyle,
200
- color: theme.name === 'light' ? 'blue' : 'gray',
201
- lineWidth: 3,
202
- highlightColor: theme.name === 'light' ? 'blue' : 'gray',
203
- highlightWidth: 5}
204
- ],
275
+ ['test1', {
276
+ ...defaultLineStyle(),
277
+ color: 'orange',
278
+ lineWidth: 1,
279
+ highlightColor: 'orange'
280
+ }],
281
+ ['test2', {
282
+ ...defaultLineStyle(),
283
+ color: theme.name === 'light' ? 'blue' : 'gray',
284
+ lineWidth: 3,
285
+ highlightColor: theme.name === 'light' ? 'blue' : 'gray',
286
+ highlightWidth: 5
287
+ }],
288
+ ['test3', {
289
+ ...defaultLineStyle(),
290
+ color: theme.name === 'light' ? 'dodgerblue' : 'gray',
291
+ lineWidth: 3,
292
+ highlightColor: theme.name === 'light' ? 'dodgerblue' : 'gray',
293
+ highlightWidth: 5
294
+ }],
205
295
  ])}
206
296
  initialData={initialDataRef.current}
207
297
  seriesFilter={filter}
208
298
  seriesObservable={observableRef.current}
209
299
  shouldSubscribe={running}
300
+ onUpdateAxesBounds={handleChartTimeUpdate}
210
301
  windowingTime={25}
211
302
  >
212
303
  <ContinuousAxis
213
304
  axisId="x-axis-1"
214
305
  location={AxisLocation.Bottom}
215
- domain={[10, 5000]}
306
+ domain={[10, 10000]}
216
307
  label="x-axis"
217
308
  />
218
309
  <ContinuousAxis
@@ -224,7 +315,7 @@ import {ScatterChart} from "stream-charts";
224
315
  <ContinuousAxis
225
316
  axisId="x-axis-2"
226
317
  location={AxisLocation.Top}
227
- domain={[100, 2500]}
318
+ domain={[100, 5000]}
228
319
  label="x-axis (2)"
229
320
  />
230
321
  <ContinuousAxis
@@ -236,7 +327,8 @@ import {ScatterChart} from "stream-charts";
236
327
  />
237
328
  <Tracker
238
329
  visible={visibility.tracker}
239
- labelLocation={TrackerLabelLocation.WithMouse}
330
+ labelLocation={TrackerLabelLocation.ByAxis}
331
+ labelFormatter={x => `${d3.format(",.0f")(x)} ms`}
240
332
  style={{color: theme.color}}
241
333
  font={{color: theme.color}}
242
334
  // onTrackerUpdate={update => console.dir(update)}
@@ -254,49 +346,297 @@ import {ScatterChart} from "stream-charts";
254
346
  xLabel="t (ms)"
255
347
  yLabel="count"
256
348
  yValueFormatter={value => formatNumber(value, " ,.0f")}
257
- yChangeFormatter={value => formatNumber(value, " ,.0f")}
349
+ yChangeFormatter={(y1, y2) => formatNumber(y2 - y1, " ,.0f")}
258
350
  />
259
351
  </Tooltip>
260
352
  <ScatterPlot
261
353
  interpolation={interpolation}
262
354
  axisAssignments={new Map([
355
+ // ['test1', assignAxes("x-axis-1", "y-axis-1")],
263
356
  ['test2', assignAxes("x-axis-2", "y-axis-2")],
357
+ ['test3', assignAxes("x-axis-2", "y-axis-1")],
264
358
  ])}
265
- dropDataAfter={10000}
359
+ dropDataAfter={20000}
266
360
  panEnabled={true}
267
361
  zoomEnabled={true}
268
362
  zoomKeyModifiersRequired={true}
269
- withCadenceOf={30}
363
+ // withCadenceOf={30}
364
+ // timeWindowBehavior={TimeWindowBehavior.SQUEEZE}
270
365
  />
271
366
  </Chart>
367
+
272
368
  ```
273
369
 
274
- ## [&#10514;](#content) <span id="intro">intro</span>
370
+ ### [&#10514;](#content) <span id="example-bar-chart-code">example bar chart</span>
275
371
 
276
- `stream-charts` aim to provide high-performance charts for displaying large amounts of data in real-time. The examples (above) show a scatter plot and raster plot whose data was updated about every 25 ms. These plots show 30 time-series of data each.
372
+ Example bar chart showing windowed statistics (see [example](https://github.com/robphilipp/stream-charts-examples/blob/develop/src/app/examples/StreamingBarChart.tsx)).
277
373
 
278
- > There are obviously limits to the amount of data, and the performance of the plots. For example, the raster chart plots thousands of lines in the chart. When displaying more data in the raster plot, update performance will suffer. Therefore, you must tune your plots somewhat when you are working in the limits of their performance.
374
+ ![bar-chart-tooltip](https://github.com/robphilipp/stream-charts/blob/develop/images/bar-chart-with-tooltip.png?raw=true)
375
+
376
+ ```typescript jsx
377
+
378
+ <Chart<OrdinalChartData, OrdinalDatum, BarSeriesStyle, WindowedOrdinalStats>
379
+ chartId={chartId.current}
380
+ width={useGridCellWidth()}
381
+ height={useGridCellHeight()}
382
+ margin={{...defaultMargin, top: 60, bottom: 80, right: 75, left: 70}}
383
+ // svgStyle={{'background-color': 'pink'}}
384
+ color={theme.color}
385
+ backgroundColor={theme.backgroundColor}
386
+ seriesStyles={new Map<string, BarSeriesStyle>([
387
+ ['neuron1', {
388
+ ...defaultBarSeriesStyle('orange'),
389
+ lineWidth: 2,
390
+ minMaxBar: {
391
+ ...defaultBarSeriesStyle('orange').minMaxBar,
392
+ stroke: {
393
+ ...defaultBarSeriesStyle('orange').minMaxBar.stroke,
394
+ width: 0
395
+ }
396
+ }
397
+ } as BarSeriesStyle],
398
+ ['neuron14', {
399
+ ...defaultBarSeriesStyle(theme.name === 'light' ? 'blue' : 'gray'),
400
+ lineWidth: 3,
401
+ highlightWidth: 5,
402
+ minMaxBar: {
403
+ ...defaultBarSeriesStyle(theme.name === 'light' ? 'blue' : 'gray').minMaxBar,
404
+ widthFraction: 1
405
+ }
406
+
407
+ } as BarSeriesStyle],
408
+ ['neuron31', {
409
+ ...defaultBarSeriesStyle('green'),
410
+ lineWidth: 2,
411
+ } as BarSeriesStyle],
412
+ ])}
413
+ initialData={initialDataRef.current}
414
+ seriesObservable={observableRef.current}
415
+ seriesFilter={filter}
416
+ shouldSubscribe={running}
417
+ onUpdateChartTime={handleChartTimeUpdate}
418
+ onUpdateAxesBounds={handleChartRangeUpdate}
419
+ windowingTime={25}
279
420
  >
280
- > The scatter chart can handle a larger number of series at 25 ms update frequency.
421
+ <OrdinalAxis
422
+ axisId="x-axis-1"
423
+ location={AxisLocation.Bottom}
424
+ categories={initialDataRef.current.map(series => series.name)}
425
+ label="neuron"
426
+ axisTickStyle={{rotation: 90}}
427
+ />
428
+ <OrdinalAxis
429
+ axisId="x-axis-2"
430
+ location={AxisLocation.Top}
431
+ categories={initialDataRef.current.map(series => series.name)}
432
+ label="neuron"
433
+ axisTickStyle={{rotation: 40}}
434
+ />
435
+ <ContinuousAxis
436
+ axisId="y-axis-1"
437
+ location={AxisLocation.Left}
438
+ domain={[-1.1, 1.1]}
439
+ label="ρ (mV)"
440
+ />
441
+ <ContinuousAxis
442
+ axisId="y-axis-2"
443
+ location={AxisLocation.Right}
444
+ domain={[-1.1, 1.1]}
445
+ label="ρ (mV)"
446
+ />
447
+ <Tracker
448
+ visible={visibility.tracker}
449
+ trackerAxis={AxisLocation.Left}
450
+ labelLocation={TrackerLabelLocation.ByAxis}
451
+ labelFormatter={x => `${d3.format(".2f")(x)} mV`}
452
+ style={{color: theme.color}}
453
+ font={{color: theme.color}}
454
+ // onTrackerUpdate={update => console.dir(update)}
455
+ />
456
+ <Tooltip
457
+ visible={visibility.tooltip}
458
+ style={{
459
+ fontColor: theme.color,
460
+ backgroundColor: theme.backgroundColor,
461
+ borderColor: theme.color,
462
+ backgroundOpacity: 0.9,
463
+ }}
464
+ >
465
+ <BarPlotTooltipContent ordinalUnits="mV"/>
466
+ </Tooltip>
467
+ <BarPlot
468
+ barMargin={1}
469
+ dropDataAfter={5000}
470
+ panEnabled={true}
471
+ zoomEnabled={true}
472
+ zoomKeyModifiersRequired={true}
473
+ // withCadenceOf={50}
474
+
475
+ // to have the upper axis zoom when the series zoom, we must have at
476
+ // least one series assigned to this axis.
477
+ axisAssignments={new Map([
478
+ ['neuron1', assignAxes("x-axis-2", "y-axis-2")],
479
+ ])}
480
+
481
+ showMinMaxBars={showMinMax}
482
+ showValueLines={showValue}
483
+ showMeanValueLines={showMean}
484
+ showWindowedMinMaxBars={showWinMinMax}
485
+ showWindowedMeanValueLines={showWinMean}
486
+ />
487
+ </Chart>
488
+ ```
489
+
490
+ ### [&#10514;](#content) <span id="example-poincare-chart-code">example poincare chart</span>
491
+
492
+ Example Poincare (iterates) chart (see [example](https://github.com/robphilipp/stream-charts-examples/blob/develop/src/app/examples/StreamingPoincareChart.tsx)).
493
+
494
+ ![poincare-chart-with-tooltip](https://github.com/robphilipp/stream-charts/blob/develop/images/poincare-chart-with-tooltip.png?raw=true)
495
+
496
+ ```typescript jsx
497
+ <Chart
498
+ chartId={chartId.current}
499
+ width={useGridCellWidth()}
500
+ height={useGridCellHeight()}
501
+ margin={{...defaultMargin, top: 40, bottom: 30, right: 60}}
502
+ // svgStyle={{'background-color': 'pink'}}
503
+ color={theme.color}
504
+ backgroundColor={theme.backgroundColor}
505
+ seriesStyles={new Map([
506
+ ['test1', {
507
+ ...defaultLineStyle(),
508
+ color: 'orange',
509
+ lineWidth: 1,
510
+ highlightColor: 'orange'
511
+ }],
512
+ ['test2', {
513
+ ...defaultLineStyle(),
514
+ color: theme.name === 'light' ? 'blue' : 'gray',
515
+ lineWidth: 1,
516
+ highlightColor: theme.name === 'light' ? 'blue' : 'gray',
517
+ highlightWidth: 5
518
+ }],
519
+ ['test3', {
520
+ ...defaultLineStyle(),
521
+ color: theme.name === 'light' ? 'red' : 'gray',
522
+ lineWidth: 1,
523
+ highlightColor: theme.name === 'light' ? 'dodgerblue' : 'gray',
524
+ highlightWidth: 5
525
+ }],
526
+ ])}
527
+ initialData={initialDataRef.current}
528
+ // seriesFilter={filter}
529
+ seriesObservable={observableRef.current}
530
+ shouldSubscribe={running}
531
+ onUpdateChartTime={handleChartTimeUpdate}
532
+ windowingTime={25}
533
+ >
534
+ <ContinuousAxis
535
+ axisId="x-axis-1"
536
+ location={AxisLocation.Bottom}
537
+ domain={axesRange}
538
+ label="f[n](x)"
539
+ updateAxisBasedOnDomainValues={false}
540
+ />
541
+ <ContinuousAxis
542
+ axisId="y-axis-1"
543
+ location={AxisLocation.Left}
544
+ domain={axesRange}
545
+ label={`f[n+${lagN}](x)`}
546
+ updateAxisBasedOnDomainValues={false}
547
+ />
548
+ <ContinuousAxis
549
+ axisId="x-axis-2"
550
+ location={AxisLocation.Top}
551
+ domain={axesRange}
552
+ label="f[n](x)"
553
+ updateAxisBasedOnDomainValues={false}
554
+ />
555
+ <ContinuousAxis
556
+ axisId="y-axis-2"
557
+ location={AxisLocation.Right}
558
+ domain={axesRange}
559
+ label={`f[n+${lagN}](x)`}
560
+ updateAxisBasedOnDomainValues={false}
561
+ />
562
+ <Tracker
563
+ key="tracker-x-axis"
564
+ visible={visibility.tracker}
565
+ // labelLocation={TrackerLabelLocation.Nowhere}
566
+ labelLocation={TrackerLabelLocation.ByAxis}
567
+ trackerAxis={AxisLocation.Bottom}
568
+ labelFormatter={x => `${d3.format(",.3f")(x)}`}
569
+ style={{color: theme.color}}
570
+ font={{color: theme.color}}
571
+ // onTrackerUpdate={update => console.dir("bottom", update)}
572
+ />
573
+ <Tracker
574
+ key="tracker-y-axis"
575
+ visible={visibility.tracker}
576
+ // labelLocation={TrackerLabelLocation.Nowhere}
577
+ labelLocation={TrackerLabelLocation.ByAxis}
578
+ trackerAxis={AxisLocation.Left}
579
+ labelFormatter={x => `${d3.format(",.3f")(x)}`}
580
+ style={{color: theme.color}}
581
+ font={{color: theme.color}}
582
+ // onTrackerUpdate={update => console.dir("left", update)}
583
+ />
584
+ <Tooltip
585
+ visible={visibility.tooltip}
586
+ style={{
587
+ fontColor: theme.color,
588
+ backgroundColor: theme.backgroundColor,
589
+ borderColor: theme.color,
590
+ backgroundOpacity: 0.9,
591
+ }}
592
+ >
593
+ <PoincarePlotTooltipContent
594
+ xLabel="t (ms)"
595
+ yLabel="f(x)"
596
+ yValueFormatter={value => formatNumber(value, " ,.4f")}
597
+ style={{
598
+ ...defaultTooltipStyle,
599
+ fontColor: 'black',
600
+ // fontColor: theme.color,
601
+ fontWeight: 650
602
+ }}
603
+ />
604
+ </Tooltip>
605
+ <PoincarePlot
606
+ interpolation={interpolation}
607
+ dropDataAfter={dropAfterMs}
608
+ panEnabled={true}
609
+ zoomEnabled={true}
610
+ zoomKeyModifiersRequired={true}
611
+ // withCadenceOf={30}
612
+ />
613
+ </Chart>
614
+ ```
615
+
616
+ ## [&#10514;](#content) <span id="intro">intro</span>
617
+
618
+ `stream-charts` aim to provide high-performance charts for displaying large amounts of data in real-time. The examples (above) show various plot types whose data can be updated about every 25 ms.
619
+
620
+ There are obviously limits to the amount of data, and the performance of the plots. For example, the raster chart plots thousands of lines in the chart. When displaying more data in the raster plot, update performance will suffer. Therefore, you must tune your plots somewhat when you are working in the limits of their performance.
281
621
 
282
622
  ### [&#10514;](#content) <span id="terminology">terminology</span>
283
623
 
284
- A &lt;Chart/&gt; holds a `plot`, the `axes`, and optionally, a &lt;Tracker/&gt;, and a &lt;Tooltip/&gt;. A &lt;Chart/&gt; is generic, and holds a specific type of `plot`, for example, a &lt;RasterPlot/&gt; or a &lt;ScatterPlot/&gt;. The `plot` holds the data, and optionally provides pan and zoom. The `axes` provide the scale of the data. For example, the scale could be a continuous numeric logarithmic scale, or a category scale. The `axes` are also generic. Though, a `plot` can restrict the type of `axes` allowed. For example, a &lt;RasterPlot/&gt; requires that the y-axes are category axes. &lt;Trackers/&gt; are generic. &lt;Tooltipes/&gt; are also generic, though the tooltip content is a child, specific to a plot type, that it knows how to interpret and present the data.
624
+ A &lt;Chart/&gt; holds a `plot`, the `axes`, and optionally, a &lt;Tracker/&gt;, and a &lt;Tooltip/&gt;. A &lt;Chart/&gt; is generic, and holds a specific type of `plot`, for example, a &lt;RasterPlot/&gt;, &lt;ScatterPlot/&gt;, &lt;BarPlot/&gt;, or &lt;PoincarePlot/&gt;. The `plot` holds the data, and optionally provides pan and zoom. The `axes` provide the scale of the data. For example, the scale could be a continuous numeric logarithmic scale, or an ordinal scale. The `axes` are also generic. Though, a `plot` can restrict the type of `axes` allowed. For example, a &lt;RasterPlot/&gt; requires that the y-axes are ordinal axes. &lt;Trackers/&gt; are generic. &lt;Tooltips/&gt; are also generic, though the tooltip content is a child, specific to a plot type, that it knows how to interpret and present the data.
285
625
 
286
- > **&lt;Chart/&gt;** [&#8628;](#chart)<br>
287
- > Generic container which holds the `Axes`, `Plot`, `Tracker`, `Tooltip`.
626
+ **&lt;Chart/&gt;** [&#8628;](#chart)<br>
627
+ Generic container which holds the `Axes`, `Plot`, `Tracker`, `Tooltip`.
288
628
 
289
- > **Axes** [&#8628;](#axes)<br>
290
- > Defines the scale of the data. `stream-charts` current has two axis types: [&lt;ContinousAxis/&gt;](#continuous-axes-usage) and [&lt;CategoryAxis/&gt;](#category-axes-usage). The &lt;ContinousAxis can be used as an x-axis or y-axis. However, the &lt;CategoryAxis/&gt; can only be used as a y-axes because these are all time-series charts and the x-axis currently only represents time (this will change in the future with additional plot types).
629
+ **Axes** [&#8628;](#axes)<br>
630
+ Defines the scale of the data. `stream-charts` current has two axis types: [&lt;ContinuousAxis/&gt;](#continuous-axes-usage) and [&lt;OrdinalAxis/&gt;](#ordinal-axes-usage). The &lt;ContinuousAxis/&gt; can be used as an x-axis or y-axis. However, the &lt;OrdinalAxis/&gt; can only be used as a y-axes because these are all time-series charts and the x-axis currently only represents time.
291
631
 
292
- > **Plot** [&#8628;](#plots)<br>
293
- > The plot is a container for the data that uses the `axes` for scale, domain, and range information. Plots provide panning and zooming of the x-axis (time), interacting with the `axes` to update the time-range. The plot is the visual representation of the data. Currently, two type of plots are available: [&lt;RasterPlot/&gt;](#raster-plot-usage), and [&lt;ScatterPlot/&gt;](#scatter-plot-usage).
632
+ **Plot** [&#8628;](#plots)<br>
633
+ The plot is a container for the data that uses the `axes` for scale, domain, and range information. Plots provide panning and zooming of the x-axis (time), interacting with the `axes` to update the time-range. The plot is the visual representation of the data. Currently, four types of plots are available: [&lt;RasterPlot/&gt;](#raster-plot-usage), [&lt;ScatterPlot/&gt;](#scatter-plot-usage), [&lt;BarPlot/&gt;](#bar-plot-usage), and [&lt;PoincarePlot/&gt;](#poincare-plot-usage).
294
634
 
295
- > **&lt;Tracker/&gt;** [&#8628;](#tracker-usage)<br>
296
- > The tracker displays the current plot time of the mouse. When multiple x-axes are used in the chart, then the tracker displays both times (i.e. from the upper and lower x-axis).
635
+ **&lt;Tracker/&gt;** [&#8628;](#tracker-usage)<br>
636
+ The tracker displays the current plot time of the mouse. When multiple x-axes are used in the chart, then the tracker displays both times (i.e. from the upper and lower x-axis).
297
637
 
298
- > **&lt;Tooltip/&gt;** [&#8628;](#tooltip-usage)<br>
299
- > The tooltip is a generic component for rendering information about the data when the user mouses over a series or datum. The `<Tooltip/>` expects a child component that understands the data and renders the information show in the tooltip. For example, when using a [&lt;RasterPlot/&gt;](#raster-plot-usage), the [&lt;RasterPlotTooltipContent/&gt;](#rasterplot-tooltip-usage) renders the data for the raster plot tooltip. And when using a [&lt;ScatterPlot/&gt;](#scatter-plot-usage), the [&lt;ScatterPlotTooltipContent/&gt;](#scatterplot-tooltip-usage) renders the data for the scatter plot tooltip. The tooltip content can be extended.
638
+ **&lt;Tooltip/&gt;** [&#8628;](#tooltip-usage)<br>
639
+ The tooltip is a generic component for rendering information about the data when the user mouses over a series or datum. The `<Tooltip/>` expects a child component that understands the data and renders the information show in the tooltip. For example, when using a [&lt;RasterPlot/&gt;](#raster-plot-usage), the [&lt;RasterPlotTooltipContent/&gt;](#rasterplot-tooltip-usage) renders the data for the raster plot tooltip. And when using a [&lt;ScatterPlot/&gt;](#scatter-plot-usage), the [&lt;ScatterPlotTooltipContent/&gt;](#scatterplot-tooltip-usage) renders the data for the scatter plot tooltip. The tooltip content can be extended.
300
640
 
301
641
  ### [&#10514;](#content) <span id="data-ttl">data ttl, time-windows, performance</span>
302
642
 
@@ -327,93 +667,92 @@ The `Chart`s properties fall into four categories:
327
667
  4. streamed data and how to manage the stream of data
328
668
 
329
669
  #### [&#10514;](#content) <span id="chart-usage-dimensions">&lt;Chart/&gt; dimensions</span>
330
- > **width (pixels)**<br>
331
- > The width (in pixels) of the container that holds the chart. The actual plot will be smaller based on the margins.
670
+ **width (pixels)**<br>
671
+ The width (in pixels) of the container that holds the chart. The actual plot will be smaller based on the margins.
332
672
 
333
- > **height (pixels)**<br>
334
- > The height (in pixels) of the container that holds the chart. The actual plot will be smaller based on the margins.
673
+ **height (pixels)**<br>
674
+ The height (in pixels) of the container that holds the chart. The actual plot will be smaller based on the margins.
335
675
 
336
676
  #### [&#10514;](#content) <span id="chart-usage-styling">&lt;Chart/&gt; styling</span>
337
- > **margin ([Margin](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/margins.ts), optional)**<br>
338
- > The margin (in pixels) around plot. For example, if the container has a (h, w) = (300, 600) and a margin of 10 pixels for the top, left, right, bottom, then the actual plot will have a (h, w) = (290, 590), leaving only 10 pixels around the plot for axis titles, ticks, and axis labels.
339
- >
340
- > The Margin has the following shape
677
+ **margin ([Margin](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/margins.ts), optional)**<br>
678
+ The margin (in pixels) around plot. For example, if the container has a (h, w) = (300, 600) and a margin of 10 pixels for the top, left, right, bottom, then the actual plot will have a (h, w) = (290, 590), leaving only 10 pixels around the plot for axis titles, ticks, and axis labels.
679
+
680
+ The Margin has the following shape
341
681
  >```typescript
342
682
  >interface Margin {
343
- > top: number
344
- > bottom: number
345
- > left: number
346
- > right: number
683
+ top: number
684
+ bottom: number
685
+ left: number
686
+ right: number
347
687
  >}
348
688
  >```
349
689
 
350
690
 
351
- > **color (string, optional)**<br>
352
- > The color of the axis lines and text, which can be overridden specifically by the axes styles.
691
+ **color (string, optional)**<br>
692
+ The color of the axis lines and text, which can be overridden specifically by the axes styles.
693
+
694
+ **backgroundColor (string, optional)**<br>
695
+ The color of the chart background (the whole chart, not just the plot).
353
696
 
354
- > **backgroundColor (string, optional)**<br>
355
- > The color of the chart background (the whole chart, not just the plot).
697
+ **svgStyle ([SvgStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/svgStyle.ts), optional)**<br>
698
+ The style attributes for the main SVG element, in case you want to change those. Generally, this is not needed.
356
699
 
357
- > **svgStyle ([SvgStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/svgStyle.ts), optional)**<br>
358
- > The style attributes for the main SVG element, in case you want to change those. Generally, this is not needed.
359
- >
360
- > The SvgStyle has the following shape
700
+ The SvgStyle has the following shape
361
701
  >```typescript
362
702
  >interface SvgStyle {
363
- > height?: string | number
364
- > width?: string | number
365
- > outline?: string
366
- > // any valid SVG CSS attribute
367
- > [propName: string]: any
703
+ height?: string | number
704
+ width?: string | number
705
+ outline?: string
706
+ // any valid SVG CSS attribute
707
+ [propName: string]: any
368
708
  >}
369
709
  >```
370
710
 
371
- > **seriesStyles (Map&lt;string, [SeriesLineStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) &gt;, optional)**<br>
372
- > A map holding the data series name with an associated SeriesLineStyle. Any series listed in this map will use the associated styles for that series. Any series not in the map will use the default series styles.
373
- >
374
- > The SeriesLineStyle has the following shape
375
- > ```typescript
376
- > interface SeriesLineStyle {
377
- > color: string
378
- > lineWidth: number
379
- > // the color of the series when the user mouses over the series
380
- > highlightColor: string
381
- > // the line width of the series when the user mouses over the series
382
- > highlightWidth: number
383
- > // the line margin used for raster charts
384
- > margin?: number
385
- > }
711
+ **seriesStyles (Map&lt;string, [SeriesLineStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) &gt;, optional)**<br>
712
+ A map holding the data series name with an associated SeriesLineStyle. Any series listed in this map will use the associated styles for that series. Any series not in the map will use the default series styles.
713
+
714
+ The SeriesLineStyle has the following shape
715
+ ```typescript
716
+ interface SeriesLineStyle {
717
+ color: string
718
+ lineWidth: number
719
+ // the color of the series when the user mouses over the series
720
+ highlightColor: string
721
+ // the line width of the series when the user mouses over the series
722
+ highlightWidth: number
723
+ // the line margin used for raster charts
724
+ margin?: number
725
+ }
386
726
  >```
387
727
 
388
728
  #### [&#10514;](#content) <span id="chart-usage-initial-data">&lt;Chart/&gt; initial data</span>
389
729
 
390
730
  Holds the initial (static data). This data is displayed in the chart even before subscribing to the chart-data observable. The initial data can be used to generate static charts.
391
731
 
392
- > **initialData (Array<[Series](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/datumSeries.ts) >)**<br>
393
- > An array holding the initial data series to be plotted before subscribing to the chart-data observable.
732
+ **initialData (Array<[Series](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/datumSeries.ts) >)**<br>
733
+ An array holding the initial data series to be plotted before subscribing to the chart-data observable.
394
734
  >
395
- > The Series has the following shape
396
- > ```typescript
397
- > interface Series {
398
- > // the series name
399
- > readonly name: string;
400
- > // the array of time-value pairs
401
- > data: Array<Datum>;
402
- > // ... accessor functions
403
- > .
404
- > .
405
- > .
406
- > }
407
- >
408
- >```
409
- > And the [Datum](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/datumSeries.ts) is an immutable object that has the following shape
410
- > ```typescript
411
- > interface Datum {
412
- > readonly time: number;
413
- > readonly value: number;
414
- > }
735
+ The Series has the following shape
736
+ ```typescript
737
+ interface Series {
738
+ // the series name
739
+ readonly name: string
740
+ // the array of time-value pairs
741
+ data: Array<Datum>
742
+ // ... accessor functions
743
+ // .
744
+ // .
745
+ // .
746
+ }
747
+ ```
748
+ And the [Datum](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/datumSeries.ts) is an immutable object that has the following shape
749
+ ```typescript
750
+ interface Datum {
751
+ readonly time: number;
752
+ readonly value: number;
753
+ }
415
754
  >```
416
- > There are a number of helper functions for creating `Series` and `Datum`.
755
+ There are a number of helper functions for creating `Series` and `Datum`.
417
756
  >> `seriesFrom(name: string, data: Array<Datum> = []): Series`<br>
418
757
  >> `seriesFromTuples(name: string, data: Array<[number, number]> = []): Series`<br>
419
758
  >> `emptySeries(name: string): Series`<br>
@@ -423,42 +762,42 @@ Holds the initial (static data). This data is displayed in the chart even before
423
762
 
424
763
  A set of properties, functions, and callbacks to control and observe the streaming of live data into the chart.
425
764
 
426
- > **seriesObservable (Observable<[ChartData](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/chartData.ts) >)**<br>
427
- > An observable of (source for) chart-data. The `shouldSubscribe` property controls whether the chart subscribes to the observable, or unsubscribes. This is the source of live data to the chart. An example of an observable is shown below.
428
- > ```typescript
429
- > function randomSpikeDataObservable(
430
- > series: Array<Series>,
431
- > updatePeriod: number = UPDATE_PERIOD_MS,
432
- > spikeProbability: number = 0.1
433
- > ): Observable<ChartData> {
434
- > const seriesNames = series.map(series => series.name)
435
- > const initialData = initialChartData(series)
436
- > return interval(updatePeriod).pipe(
437
- > // convert the number sequence to a time
438
- > map(sequence => (sequence + 1) * updatePeriod),
439
- > // create a random spike for each series
440
- > map((time) => randomSpikeData(time, seriesNames, initialData.maxTimes, updatePeriod, spikeProbability))
441
- > )
442
- > }
443
- > ```
444
-
445
- > **shouldSubscribe (boolean, optional, default = false)**<br>
446
- > Optional property, that when set from `false` to `true`, causes the &lt;Chart/&gt; to subscribe to the chart-data observable. When set to `false` after a subscription, causes the &lt;Chart/&gt; to unsubscribe from the chart-data observable.
447
-
448
- > **windowingTime (number, milliseconds, optional, default = 100 ms)**<br>
449
- > Optional property that defines a time-window during which incoming events are buffered, and then handed to plot, causing the plot to update. The `windowingTime` defines the maximum plot update rate, though not the maximum data update rate. The larger the windowing time, the fewer updates per unit time, and the more choppy the updates. Large amounts of data with high update rates can cause rendering delays. The windowing time provides a lever to manage the plot update rates to get the smoothest plot updates that keep up with real-time.
450
-
451
- > **shouldSubscribe (number, optional, default = false)**<br>
452
- > Optional property that default to `false`. When changed to `true`, from `false`, signals the &lt;Chart/&gt; to subscribe to the `seriesObservable`, streaming in the `ChartData` and updating the &lt;Chart/&gt; in real-time.
453
-
454
- > **onSubscribe (callback function, (subscription: Subscription) => void, optional, default = noop**<br>
455
- > Optional callback function that is called when the &lt;Chart/&gt; subscribes to the `ChartData` observable.
456
-
457
- > **onUpdateData (callback function, (seriesName: string, data: Array<Datum>)) => void, optional, default = noop)**<br>
458
- > Optional callback function that is called when the data updates. This callback can be used if you would like to respond to data updates. For example, use this callback if you would like to have the plot drop data after 10 seconds, but would like to store that data in an in-browser database. Though, a more efficient way to store the data would be to subscribe to the series-observable separately, and then use that observer to stream the data to the storage.
459
-
460
- > **onUpdateTime (callback function, (times: Map<string, [start: number, end: number]>) => void, optional, default = noop)**<br>
461
- > Optional callback this is called whenever the time-ranges change. Use this to track the current time of the plot.
765
+ **seriesObservable (Observable<[ChartData](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/chartData.ts) >)**<br>
766
+ An observable of (source for) chart-data. The `shouldSubscribe` property controls whether the chart subscribes to the observable, or unsubscribes. This is the source of live data to the chart. An example of an observable is shown below.
767
+ ```typescript
768
+ function randomSpikeDataObservable(
769
+ series: Array<Series>,
770
+ updatePeriod: number = UPDATE_PERIOD_MS,
771
+ spikeProbability: number = 0.1
772
+ ): Observable<ChartData> {
773
+ const seriesNames = series.map(series => series.name)
774
+ const initialData = initialChartData(series)
775
+ return interval(updatePeriod).pipe(
776
+ // convert the number sequence to a time
777
+ map(sequence => (sequence + 1) * updatePeriod),
778
+ // create a random spike for each series
779
+ map((time) => randomSpikeData(time, seriesNames, initialData.maxTimes, updatePeriod, spikeProbability))
780
+ )
781
+ }
782
+ ```
783
+
784
+ **shouldSubscribe (boolean, optional, default = false)**<br>
785
+ Optional property, that when set from `false` to `true`, causes the &lt;Chart/&gt; to subscribe to the chart-data observable. When set to `false` after a subscription, causes the &lt;Chart/&gt; to unsubscribe from the chart-data observable.
786
+
787
+ **windowingTime (number, milliseconds, optional, default = 100 ms)**<br>
788
+ Optional property that defines a time-window during which incoming events are buffered, and then handed to plot, causing the plot to update. The `windowingTime` defines the maximum plot update rate, though not the maximum data update rate. The larger the windowing time, the fewer updates per unit time, and the more choppy the updates. Large amounts of data with high update rates can cause rendering delays. The windowing time provides a lever to manage the plot update rates to get the smoothest plot updates that keep up with real-time.
789
+
790
+ **shouldSubscribe (number, optional, default = false)**<br>
791
+ Optional property that default to `false`. When changed to `true`, from `false`, signals the &lt;Chart/&gt; to subscribe to the `seriesObservable`, streaming in the `ChartData` and updating the &lt;Chart/&gt; in real-time.
792
+
793
+ **onSubscribe (callback function, (subscription: Subscription) => void, optional, default = noop**<br>
794
+ Optional callback function that is called when the &lt;Chart/&gt; subscribes to the `ChartData` observable.
795
+
796
+ **onUpdateData (callback function, (seriesName: string, data: Array<Datum>)) => void, optional, default = noop)**<br>
797
+ Optional callback function that is called when the data updates. This callback can be used if you would like to respond to data updates. For example, use this callback if you would like to have the plot drop data after 10 seconds, but would like to store that data in an in-browser database. Though, a more efficient way to store the data would be to subscribe to the series-observable separately, and then use that observer to stream the data to the storage.
798
+
799
+ **onUpdateTime (callback function, (times: Map<string, [start: number, end: number]>) => void, optional, default = noop)**<br>
800
+ Optional callback this is called whenever the time-ranges change. Use this to track the current time of the plot.
462
801
 
463
802
  ## [&#10514;](#content) <span id="axes">axes</span>
464
803
 
@@ -472,67 +811,67 @@ When creating a &lt;ContinuousAxis/&gt;, you must specify its location using the
472
811
 
473
812
  The base properties defining the axis.
474
813
 
475
- > **axisId (string)**<br>
476
- > The unique ID of the axis. The axis can then be referred to by this ID. For example, when assigning axes to series, the assignment is made by associating the axis ID to the series name.
814
+ **axisId (string)**<br>
815
+ The unique ID of the axis. The axis can then be referred to by this ID. For example, when assigning axes to series, the assignment is made by associating the axis ID to the series name.
477
816
 
478
- > **location ([AxisLocation](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) )**<br>
479
- > The location of the axis. As defined by the `AxisLocation` in the the [axes.ts](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) file, x-axes can be placed on the `bottom` or the `top`, and y-axes can be placed on the `left` or the `right`.
817
+ **location ([AxisLocation](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) )**<br>
818
+ The location of the axis. As defined by the `AxisLocation` in the the [axes.ts](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) file, x-axes can be placed on the `bottom` or the `top`, and y-axes can be placed on the `left` or the `right`.
480
819
 
481
- > **scale (ScaleContinuousNumeric<number, number>, optional, default = d3.scaleLinear)**<br>
482
- > The optional scale (factory) of the continuous axis. The scale of the axis is like the axis ruler and determines how the points are placed on the screen. For example, a linear scale is like an evenly spaced ruler, and the mapping between screen location and data value are linear. As another example, the log scale has a logarithmic mapping between the screen location and the data. The scale can be a linear scale (default scale, d3.scaleLinear), a logarithmic scale (d3.scaleLog), a power scale (d3.scalePower), or any other d3 continouos numeric scale that works. Not that if a chart, for example, has two x-axes, that the x-axes are **not** required to have the same scale.
820
+ **scale (ScaleContinuousNumeric<number, number>, optional, default = d3.scaleLinear)**<br>
821
+ The optional scale (factory) of the continuous axis. The scale of the axis is like the axis ruler and determines how the points are placed on the screen. For example, a linear scale is like an evenly spaced ruler, and the mapping between screen location and data value are linear. As another example, the log scale has a logarithmic mapping between the screen location and the data. The scale can be a linear scale (default scale, d3.scaleLinear), a logarithmic scale (d3.scaleLog), a power scale (d3.scalePower), or any other d3 continouos numeric scale that works. Not that if a chart, for example, has two x-axes, that the x-axes are **not** required to have the same scale.
483
822
 
484
- > **domain ([min: number, max: number])**<br>
485
- > The domain of the axis (in d3 terminology) is effectively the minimum value of the axis and the maximum value of the axis when the initial data is displayed. The domain defines the time-window of the displayed data. For example, if the `domain` for an x-axis is specified as `[1000, 6000]`, then the axis starts at `1000` and ends at `6000`, and the time-window is `5000`. Once data starts to stream past the axis end, the plot starts to scroll, maintaining the calculated time-window (in out example, 5000). Of course, a zooming event will change the domain, and also the time-window.
823
+ **domain ([min: number, max: number])**<br>
824
+ The domain of the axis (in d3 terminology) is effectively the minimum value of the axis and the maximum value of the axis when the initial data is displayed. The domain defines the time-window of the displayed data. For example, if the `domain` for an x-axis is specified as `[1000, 6000]`, then the axis starts at `1000` and ends at `6000`, and the time-window is `5000`. Once data starts to stream past the axis end, the plot starts to scroll, maintaining the calculated time-window (in out example, 5000). Of course, a zooming event will change the domain, and also the time-window.
486
825
 
487
- > **label (string)**<br>
488
- > The axis label.
826
+ **label (string)**<br>
827
+ The axis label.
489
828
 
490
829
  #### [&#10514;](#content) <span id="continuous-axes-usage-styling">&lt;ContinuousAxis/&gt; styling</span>
491
830
 
492
831
  A set of properties to update the style of the axes.
493
832
 
494
- > **font (Partial<[AxesLabelFont](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) >)**<br>
495
- > An optional CSS properties specifying the font for the axis and tick labels.
833
+ **font (Partial<[AxesLabelFont](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) >)**<br>
834
+ An optional CSS properties specifying the font for the axis and tick labels.
496
835
 
497
836
 
498
- ### [&#10514;](#content) <span id="category-axes-usage">&lt;CategoryAxis/&gt;</span>
837
+ ### [&#10514;](#content) <span id="ordinal-axes-usage">&lt;OrdinalAxis/&gt;</span>
499
838
 
500
- The &lt;CategoryAxis/&gt; must be a child of the &lt;Chart/&gt;. Each &lt;Chart/&gt can one or two category axes for the y-axes. Unlike the [&lt;ContinousAxis/&gt;](#continuous-axes-usage), the &lt;CategoryAxis/&gt; can only be used as a y-axis because for stream charts (at this point) the x-axes represent time. In the same way as with the [&lt;ContinousAxis/&gt;](#continuous-axes-usage), when using multiple multiple y-axes you must assign the series to the axes in one of the `Plot` components. Any series that are not explicitly assigned an axis will be assigned to the default y-axis, which is the left-hand side axis in the &lt;Chart/&gt.
839
+ The &lt;OrdinalAxis/&gt; must be a child of the &lt;Chart/&gt;. Each &lt;Chart/&gt; can have one or two ordinal axes for the y-axes. Unlike the [&lt;ContinuousAxis/&gt;](#continuous-axes-usage), the &lt;OrdinalAxis/&gt; can only be used as a y-axis because for stream charts (at this point) the x-axes represent time. In the same way as with the [&lt;ContinuousAxis/&gt;](#continuous-axes-usage), when using multiple multiple y-axes you must assign the series to the axes in one of the `Plot` components. Any series that are not explicitly assigned an axis will be assigned to the default y-axis, which is the left-hand side axis in the &lt;Chart/&gt;.
501
840
 
502
- When creating a &lt;CategoryAxis/&gt;, you must specify its location using the `AxisLocation` enum defined in the [axes.ts](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) file. Each axis must have a unique axis ID. The &lt;CategoryAxis/&gt; uses a band scale (d3.scaleLinear).
841
+ When creating an &lt;OrdinalAxis/&gt;, you must specify its location using the `AxisLocation` enum defined in the [axes.ts](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) file. Each axis must have a unique axis ID. The &lt;OrdinalAxis/&gt; uses a band scale (d3.scaleBand).
503
842
 
504
- #### [&#10514;](#content) <span id="category-axes-usage-base">&lt;CategoryAxis/&gt; base properties</span>
843
+ #### [&#10514;](#content) <span id="ordinal-axes-usage-base">&lt;OrdinalAxis/&gt; base properties</span>
505
844
 
506
845
  The base properties defining the axis.
507
846
 
508
- > **axisId (string)**<br>
509
- > The unique ID of the axis. The axis can then be referred to by this ID. For example, when assigning axes to series, the assignment is made by associating the axis ID to the series name.
847
+ **axisId (string)**<br>
848
+ The unique ID of the axis. The axis can then be referred to by this ID. For example, when assigning axes to series, the assignment is made by associating the axis ID to the series name.
510
849
 
511
- > **location ([AxisLocation](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) )**<br>
512
- > The location of the axis. As defined by the `AxisLocation` in the the [axes.ts](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) file, x-axes can be placed on the `bottom` or the `top`, and y-axes can be placed on the `left` or the `right`.
850
+ **location ([AxisLocation](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) )**<br>
851
+ The location of the axis. As defined by the `AxisLocation` in the the [axes.ts](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) file, x-axes can be placed on the `bottom` or the `top`, and y-axes can be placed on the `left` or the `right`.
513
852
 
514
- > **categories (Array<string>)**<br>
515
- > The required `categories` property holds the names of the categories, in the order that they will be displayed on the axis. The first element in the array will be on shown at the top of the axis. The second element will be on lower, and the last element will be at the bottom of the axis.
853
+ **categories (Array<string>)**<br>
854
+ The required `categories` property holds the names of the categories, in the order that they will be displayed on the axis. The first element in the array will be shown at the top of the axis. The second element will be lower, and the last element will be at the bottom of the axis.
516
855
 
517
- > **domain ([min: number, max: number])**<br>
518
- > The domain of the axis (in d3 terminology) is effectively the minimum value of the displayed axis and the maximum value of the displayed axis when the initial data is displayed. The domain defines the time-window of the displayed data. For example, if the `domain` for an x-axis is specified as `[1000, 6000]`, then the axis starts at `1000` and ends at `6000`, and the time-window is `5000`. Once data starts to stream past the axis end, the plot starts to scroll, maintaining the calculated time-window (in out example, 5000). Of course, a zooming event will change the domain, and also the time-window.
856
+ **domain ([min: number, max: number])**<br>
857
+ The domain of the axis (in d3 terminology) is effectively the minimum value of the displayed axis and the maximum value of the displayed axis when the initial data is displayed. The domain defines the time-window of the displayed data. For example, if the `domain` for an x-axis is specified as `[1000, 6000]`, then the axis starts at `1000` and ends at `6000`, and the time-window is `5000`. Once data starts to stream past the axis end, the plot starts to scroll, maintaining the calculated time-window (in our example, 5000). Of course, a zooming event will change the domain, and also the time-window.
519
858
 
520
- > **label (string)**<br>
521
- > The axis label.
859
+ **label (string)**<br>
860
+ The axis label.
522
861
 
523
- #### [&#10514;](#content) <span id="category-axes-usage-styling">&lt;CategoryAxis/&gt; styling</span>
862
+ #### [&#10514;](#content) <span id="ordinal-axes-usage-styling">&lt;OrdinalAxis/&gt; styling</span>
524
863
 
525
864
  A set of properties to update the style of the axes.
526
865
 
527
- > **font (Partial<[AxesLabelFont](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) >, optional)**<br>
528
- > An optional CSS properties specifying the font for the axis and tick labels.
866
+ **font (Partial<[AxesLabelFont](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/axes.ts) >, optional)**<br>
867
+ An optional CSS properties specifying the font for the axis and tick labels.
529
868
 
530
869
 
531
870
  ## [&#10514;](#content) <span id="plots">plots</span>
532
871
 
533
872
  ### [&#10514;](#content) <span id="scatter-plot-usage">&lt;ScatterPlot/&gt;</span>
534
873
 
535
- In `stream-charts`, the `plot` is the data visualization component. To work, a plot must be a child of the &lt;Chart/&gt; component so that it is plugged into the `stream-charts` ecosystem. The plot determines how to render the data. But it relies on the axes to determine scaling information so that it can map data to screen locations. And therefore, a plot must have sibling axes ([&lt;ContinousAxis/&gt;](#continuous-axes-usage), [&lt;CategoryAxis/&gt;](#category-axes-usage)) components for the x-axis and the y-axis. Because the plot is responsible for data visualization, it is also where the data series are assigned to axes. The assignment of axes to series is optional, and any series not explicitly assigned to an axis will be assigned to the default axes. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot.
874
+ In `stream-charts`, the `plot` is the data visualization component. To work, a plot must be a child of the &lt;Chart/&gt; component so that it is plugged into the `stream-charts` ecosystem. The plot determines how to render the data. But it relies on the axes to determine scaling information so that it can map data to screen locations. And therefore, a plot must have sibling axes ([&lt;ContinousAxis/&gt;](#continuous-axes-usage), [&lt;OrdinalAxis/&gt;](#ordinal-axes-usage)) components for the x-axis and the y-axis. Because the plot is responsible for data visualization, it is also where the data series are assigned to axes. The assignment of axes to series is optional, and any series not explicitly assigned to an axis will be assigned to the default axes. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot.
536
875
 
537
876
  The plot determines what view-modifying user interactions are available. Specifically, panning the data to the left and right in time, and zooming in time.
538
877
 
@@ -540,66 +879,115 @@ The &lt;ScatterPlot/&gt; specifically is used to plot time-series data, where th
540
879
 
541
880
  #### [&#10514;](#content) <span id="scatter-plot-usage-base">&lt;ScatterPlot/&gt; base properties</span>
542
881
 
543
- > **axisAssignments (Map<string, [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts) >, optional, default = Map())**<br>
544
- > An optional property that assigns data series to (x, y)-axes. Any series not assigned to an axis will use the default axis. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot. The `Map` associates the series name with an [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts), which is a simple object (`{xAxis: string, yAxis: string}`) that holds the axis ID for the x-axis and for the y-axis assigned to the series.
882
+ **axisAssignments (Map<string, [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts) >, optional, default = Map())**<br>
883
+ An optional property that assigns data series to (x, y)-axes. Any series not assigned to an axis will use the default axis. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot. The `Map` associates the series name with an [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts), which is a simple object (`{xAxis: string, yAxis: string}`) that holds the axis ID for the x-axis and for the y-axis assigned to the series.
545
884
 
546
- > **interpolation (d3.CurveFactory, optional, default = d3.curveLinear)**<br>
547
- > An optional property that defines how the data series line will be interpolated between individual data points. You can use any valid [d3.CurveFactory](https://github.com/d3/d3-shape#curves) for the interpolation. Changing the interpolation once the data is already display, will cause a re-render of the data with the new interpolation.
885
+ **interpolation (d3.CurveFactory, optional, default = d3.curveLinear)**<br>
886
+ An optional property that defines how the data series line will be interpolated between individual data points. You can use any valid [d3.CurveFactory](https://github.com/d3/d3-shape#curves) for the interpolation. Changing the interpolation once the data is already display, will cause a re-render of the data with the new interpolation.
548
887
 
549
- > <span id="scatter-plot-drop">**dropDataAfter (number, milliseconds, opitional, default = Infinity)**</span><br>
550
- > Optional property that sets when to drop data (effectively a TTL). This only drops data while streaming. Don't worry, your data won't disappear after the streaming has stopped. By default, none of the data is dropped. However, when large amounts of data are being streamed and plotted over long periods of time, memory and performance may become an issue. Setting this value allows a scrolling chart to run forever without running into resource issues.
888
+ <span id="scatter-plot-drop">**dropDataAfter (number, milliseconds, opitional, default = Infinity)**</span><br>
889
+ Optional property that sets when to drop data (effectively a TTL). This only drops data while streaming. Don't worry, your data won't disappear after the streaming has stopped. By default, none of the data is dropped. However, when large amounts of data are being streamed and plotted over long periods of time, memory and performance may become an issue. Setting this value allows a scrolling chart to run forever without running into resource issues.
551
890
 
552
891
  #### [&#10514;](#content) <span id="scatter-plot-usage-view">&lt;ScatterPlot/&gt; view-modifying interactions</span>
553
892
 
554
893
  View-modifying interactions are those that change the way the data is displayed. For example, zooming in time, panning in time.
555
894
 
556
- > **panEnabled (boolean, optional, default = false)**<br>
557
- > Optional property that defaults to `false`. When set to `true` then enables "panning" which allows the user to drag the plot to the left and right.
895
+ **panEnabled (boolean, optional, default = false)**<br>
896
+ Optional property that defaults to `false`. When set to `true` then enables "panning" which allows the user to drag the plot to the left and right.
558
897
 
559
- > **zoomEnabled (boolean, optional, default = false)**<br>
560
- > Optional property that defaults for `false`. When set to `true` then enables "zooming" which allows the user to increase or decrease the displayed time range. By default, scrolling will cause the zoom effect. See the `zoomKeyModifiersRequired` property which requires the `shift` key to be pressed in order for the zoom action to apply.
898
+ **zoomEnabled (boolean, optional, default = false)**<br>
899
+ Optional property that defaults for `false`. When set to `true` then enables "zooming" which allows the user to increase or decrease the displayed time range. By default, scrolling will cause the zoom effect. See the `zoomKeyModifiersRequired` property which requires the `shift` key to be pressed in order for the zoom action to apply.
561
900
 
562
- > **zoomKeyModifiersRequired (boolean, optional, default = false)**<br>
563
- > An optional property that defaults to `false`. When set to `true`, and the `zoomEnabled` property is also set to `true`, then requires that the `shift` key be pressed when scrolling in order to activate the zoom. This is nice when a user can scroll through your page containing the plot, so that zooming doesn't interfere with scrolling.
901
+ **zoomKeyModifiersRequired (boolean, optional, default = false)**<br>
902
+ An optional property that defaults to `false`. When set to `true`, and the `zoomEnabled` property is also set to `true`, then requires that the `shift` key be pressed when scrolling in order to activate the zoom. This is nice when a user can scroll through your page containing the plot, so that zooming doesn't interfere with scrolling.
564
903
 
565
- > **withCadenceOf (number, optional, default = undefinded)**<br>
566
- > An optional property that defaults to `undefined`. When set, uses a cadence with the specified refresh period (in milliseconds). For plots with slow data updates (> 100 ms) using a cadence of 10 to 25 ms smooths out the updates so the time scrolling doesn't appear choppy. When updates are around 25 ms or less, then setting the cadence period too small will result in poor update performance. Generally at high update speeds, the cadence is unnecessary. Finally, using cadence, sets the max time to the current time. See also the related &lt;Chart/&gt's `windowingTime` property.
904
+ **withCadenceOf (number, optional, default = undefinded)**<br>
905
+ An optional property that defaults to `undefined`. When set, uses a cadence with the specified refresh period (in milliseconds). For plots with slow data updates (> 100 ms) using a cadence of 10 to 25 ms smooths out the updates so the time scrolling doesn't appear choppy. When updates are around 25 ms or less, then setting the cadence period too small will result in poor update performance. Generally at high update speeds, the cadence is unnecessary. Finally, using cadence, sets the max time to the current time. See also the related &lt;Chart/&gt's `windowingTime` property.
567
906
 
568
907
 
569
908
  ### [&#10514;](#content) <span id="raster-plot-usage">&lt;RasterPlot/&gt;</span>
570
909
 
571
- In `stream-charts`, the `plot` is the data visualization component. To work, a plot must be a child of the &lt;Chart/&gt; component so that it is plugged into the `stream-charts` ecosystem. The plot determines how to render the data. But it relies on the axes to determine scaling information so that it can map data to screen locations. And therefore, a plot must have sibling axes ([&lt;ContinousAxis/&gt;](#continuous-axes-usage), [&lt;CategoryAxis/&gt;](#category-axes-usage)) components for the x-axis and the y-axis. Because the plot is responsible for data visualization, it is also where the data series are assigned to axes. The assignment of axes to series is optional, and any series not explicitly assigned to an axis will be assigned to the default axes. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot.
910
+ In `stream-charts`, the `plot` is the data visualization component. To work, a plot must be a child of the &lt;Chart/&gt; component so that it is plugged into the `stream-charts` ecosystem. The plot determines how to render the data. But it relies on the axes to determine scaling information so that it can map data to screen locations. And therefore, a plot must have sibling axes ([&lt;ContinousAxis/&gt;](#continuous-axes-usage), [&lt;OrdinalAxis/&gt;](#ordinal-axes-usage)) components for the x-axis and the y-axis. Because the plot is responsible for data visualization, it is also where the data series are assigned to axes. The assignment of axes to series is optional, and any series not explicitly assigned to an axis will be assigned to the default axes. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot.
572
911
 
573
912
  The plot determines what view-modifying user interactions are available. Specifically, panning the data to the left and right in time, and zooming in time.
574
913
 
575
- The &lt;RasterPlot/&gt; specifically is used to plot event-timing data, where the x-values are time, and the y-values are a category to which the event belongs. The x-axis is required to be a [&lt;ContinousAxis/&gt;](#continuous-axes-usage), and the y-axis is required to the a [&lt;CategoryAxis/&gt;](#category-axes-usage).
914
+ The &lt;RasterPlot/&gt; specifically is used to plot event-timing data, where the x-values are time, and the y-values are a category to which the event belongs. The x-axis is required to be a [&lt;ContinuousAxis/&gt;](#continuous-axes-usage), and the y-axis is required to be an [&lt;OrdinalAxis/&gt;](#ordinal-axes-usage).
576
915
 
577
916
  #### [&#10514;](#content) <span id="raster-plot-usage-base">&lt;RasterPlot/&gt; base properties</span>
578
917
 
579
- > **axisAssignments (Map<string, [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts) >, optional, default = Map())**<br>
580
- > An optional property that assigns data series to (x, y)-axes. Any series not assigned to an axis will use the default axis. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot. The `Map` associates the series name with an [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts), which is a simple object (`{xAxis: string, yAxis: string}`) that holds the axis ID for the x-axis and for the y-axis assigned to the series.
918
+ **axisAssignments (Map<string, [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts) >, optional, default = Map())**<br>
919
+ An optional property that assigns data series to (x, y)-axes. Any series not assigned to an axis will use the default axis. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot. The `Map` associates the series name with an [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts), which is a simple object (`{xAxis: string, yAxis: string}`) that holds the axis ID for the x-axis and for the y-axis assigned to the series.
581
920
 
582
- > <span id="raster-plot-drop">**dropDataAfter (number, milliseconds, opitional, default = Infinity)**</span><br>
583
- > Optional property that sets when to drop data (effectively a TTL). This only drops data while streaming. Don't worry, your data won't disappear after the streaming has stopped. By default, none of the data is dropped. However, when large amounts of data are being streamed and plotted over long periods of time, memory and performance may become an issue. Setting this value allows a scrolling chart to run forever without running into resource issues.
921
+ <span id="raster-plot-drop">**dropDataAfter (number, milliseconds, opitional, default = Infinity)**</span><br>
922
+ Optional property that sets when to drop data (effectively a TTL). This only drops data while streaming. Don't worry, your data won't disappear after the streaming has stopped. By default, none of the data is dropped. However, when large amounts of data are being streamed and plotted over long periods of time, memory and performance may become an issue. Setting this value allows a scrolling chart to run forever without running into resource issues.
584
923
 
585
- > **spikeMargin (number, pixels, default = 2)**<br>
586
- > Optional property that adds a margin to the top and bottom of the raster (event) lines to give vertical spacing to the events in the plot. Margins on individual series can also be set through the [Chart.seriesStyles](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/hooks/useChart.tsx) property.
924
+ **spikeMargin (number, pixels, default = 2)**<br>
925
+ Optional property that adds a margin to the top and bottom of the raster (event) lines to give vertical spacing to the events in the plot. Margins on individual series can also be set through the [Chart.seriesStyles](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/hooks/useChart.tsx) property.
587
926
 
588
927
  #### [&#10514;](#content) <span id="raster-plot-usage-view">&lt;RasterPlot/&gt; view-modifying interactions</span>
589
928
 
590
929
  View-modifying interactions are those that change the way the data is displayed. For example, zooming in time, panning in time.
591
930
 
592
- > **panEnabled (boolean, optional, default = false)**<br>
593
- > Optional property that defaults to `false`. When set to `true` then enables "panning" which allows the user to drag the plot to the left and right.
931
+ **panEnabled (boolean, optional, default = false)**<br>
932
+ Optional property that defaults to `false`. When set to `true` then enables "panning" which allows the user to drag the plot to the left and right.
933
+
934
+ **zoomEnabled (boolean, optional, default = false)**<br>
935
+ Optional property that defaults for `false`. When set to `true` then enables "zooming" which allows the user to increase or decrease the displayed time range. By default, scrolling will cause the zoom effect. See the `zoomKeyModifiersRequired` property which requires the `shift` key to be pressed in order for the zoom action to apply.
936
+
937
+ **zoomKeyModifiersRequired (boolean, optional, default = false)**<br>
938
+ An optional property that defaults to `false`. When set to `true`, and the `zoomEnabled` property is also set to `true`, then requires that the `shift` key be pressed when scrolling in order to activate the zoom. This is nice when a user can scroll through your page containing the plot, so that zooming doesn't interfere with scrolling.
939
+
940
+ **withCadenceOf (number, optional, default = undefinded)**<br>
941
+ An optional property that defaults to `undefined`. When set, uses a cadence with the specified refresh period (in milliseconds). For plots with slow data updates (> 100 ms) using a cadence of 10 to 25 ms smooths out the updates so the time scrolling doesn't appear choppy. When updates are around 25 ms or less, then setting the cadence period too small will result in poor update performance. Generally at high update speeds, the cadence is unnecessary. Finally, using cadence, sets the max time to the current time. See also the related &lt;Chart/&gt's `windowingTime` property.
942
+
943
+ ### [&#10514;](#content) <span id="bar-plot-usage">&lt;BarPlot/&gt;</span>
944
+
945
+ The &lt;BarPlot/&gt; is used to plot windowed statistics for a data series. It can display the current value, the mean value, and the min/max range for the windowed data.
946
+
947
+ #### [&#10514;](#content) <span id="bar-plot-usage-base">&lt;BarPlot/&gt; base properties</span>
948
+
949
+ **axisAssignments (Map<string, [AxesAssignment](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/plot.ts) >, optional, default = Map())**<br>
950
+ An optional property that assigns data series to (x, y)-axes. Any series not assigned to an axis will use the default axis. The default x-axis is the bottom axis, and the default y-axis is the axis on the left-hand side of the plot.
951
+
952
+ **showMinMaxBars (boolean, optional, default = false)**<br>
953
+ When `true`, displays bars representing the minimum and maximum values in the data.
954
+
955
+ **showWindowedMinMaxBars (boolean, optional, default = false)**<br>
956
+ When `true`, displays bars representing the windowed minimum and maximum values.
957
+
958
+ **showValueLines (boolean, optional, default = false)**<br>
959
+ When `true`, displays lines representing the current values of the data series.
960
+
961
+ **showMeanValueLines (boolean, optional, default = false)**<br>
962
+ When `true`, displays lines representing the mean values of the data series.
963
+
964
+ **showWindowedMeanValueLines (boolean, optional, default = false)**<br>
965
+ When `true`, displays lines representing the windowed mean values.
966
+
967
+ **barMargin (number, pixels, optional, default = 2)**<br>
968
+ Optional property that adds a margin to the top and bottom of the bars.
969
+
970
+ #### [&#10514;](#content) <span id="bar-plot-usage-view">&lt;BarPlot/&gt; view-modifying interactions</span>
971
+
972
+ **panEnabled**, **zoomEnabled**, **zoomKeyModifiersRequired**, **withCadenceOf**<br>
973
+ These properties behave the same as in [&lt;ScatterPlot/&gt;](#scatter-plot-usage-view).
974
+
975
+ ### [&#10514;](#content) <span id="poincare-plot-usage">&lt;PoincarePlot/&gt;</span>
976
+
977
+ The &lt;PoincarePlot/&gt; (also known as an iterates plot) is used to plot the current value of a series against its previous value (n vs n-1). This is useful for identifying patterns or oscillations in the data.
594
978
 
595
- > **zoomEnabled (boolean, optional, default = false)**<br>
596
- > Optional property that defaults for `false`. When set to `true` then enables "zooming" which allows the user to increase or decrease the displayed time range. By default, scrolling will cause the zoom effect. See the `zoomKeyModifiersRequired` property which requires the `shift` key to be pressed in order for the zoom action to apply.
979
+ #### [&#10514;](#content) <span id="poincare-plot-usage-base">&lt;PoincarePlot/&gt; base properties</span>
597
980
 
598
- > **zoomKeyModifiersRequired (boolean, optional, default = false)**<br>
599
- > An optional property that defaults to `false`. When set to `true`, and the `zoomEnabled` property is also set to `true`, then requires that the `shift` key be pressed when scrolling in order to activate the zoom. This is nice when a user can scroll through your page containing the plot, so that zooming doesn't interfere with scrolling.
981
+ **interpolation (d3.CurveFactory, optional, default = undefined)**<br>
982
+ An optional property that defines how the line between iterates will be interpolated. Use `NoCurveFactory` to disable the line.
600
983
 
601
- > **withCadenceOf (number, optional, default = undefinded)**<br>
602
- > An optional property that defaults to `undefined`. When set, uses a cadence with the specified refresh period (in milliseconds). For plots with slow data updates (> 100 ms) using a cadence of 10 to 25 ms smooths out the updates so the time scrolling doesn't appear choppy. When updates are around 25 ms or less, then setting the cadence period too small will result in poor update performance. Generally at high update speeds, the cadence is unnecessary. Finally, using cadence, sets the max time to the current time. See also the related &lt;Chart/&gt's `windowingTime` property.
984
+ **showPoints (boolean, optional, default = false)**<br>
985
+ When `true`, displays individual data points on the plot.
986
+
987
+ #### [&#10514;](#content) <span id="poincare-plot-usage-view">&lt;PoincarePlot/&gt; view-modifying interactions</span>
988
+
989
+ **panEnabled**, **zoomEnabled**, **zoomKeyModifiersRequired**, **withCadenceOf**<br>
990
+ These properties behave the same as in [&lt;ScatterPlot/&gt;](#scatter-plot-usage-view).
603
991
 
604
992
  ## [&#10514;](#content) <span id="utilities">utilities</span>
605
993
 
@@ -609,23 +997,23 @@ The tracker, when enabled, follows the mouse when it is in the plot area, render
609
997
 
610
998
  #### [&#10514;](#content) <span id="tracker-usage-base">&lt;Tracker/&gt; base properties</span>
611
999
 
612
- > **visible (boolean)**<br>
613
- > When set to `true` the tracker is visible when the mouse is in the plot area. When set to `false` the tracker is not shown.
1000
+ **visible (boolean)**<br>
1001
+ When set to `true` the tracker is visible when the mouse is in the plot area. When set to `false` the tracker is not shown.
614
1002
 
615
- > **labelLocation ([TrackerLabelLocation](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/Tracker.tsx), optional, default = TrackerLabelLocation.WithMouse)**<br>
616
- > Optional property specifies the location of the label. The `TrackerLabelLocation` is an enumeration with three values `Nowhere`, `WithMouse`, and `ByAxes`. By default, the label location is with the mouse (i.e. `WithMouse`). The `Nowhere` location can be used to hide the label, in cases where you would like to use your own. The `WithMouse` value has the label follow the mouse in the vertical direction along the tracker line. And the `ByAxes` displays the labels next to their respective axes, with the tracker line.
1003
+ **labelLocation ([TrackerLabelLocation](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/Tracker.tsx), optional, default = TrackerLabelLocation.WithMouse)**<br>
1004
+ Optional property specifies the location of the label. The `TrackerLabelLocation` is an enumeration with three values `Nowhere`, `WithMouse`, and `ByAxes`. By default, the label location is with the mouse (i.e. `WithMouse`). The `Nowhere` location can be used to hide the label, in cases where you would like to use your own. The `WithMouse` value has the label follow the mouse in the vertical direction along the tracker line. And the `ByAxes` displays the labels next to their respective axes, with the tracker line.
617
1005
 
618
- > **onTrackerUpdate ((update: TrackerAxisUpdate) => void, optional, default = noop)**<br>
619
- > Optional callback function that accepts the update from the tracker. Use this to display the tracker and data information outside of the &lt;Chart/&gt. The `TrackerAxisUpdate` is a `Map<string, TrackerAxisInfo>`, the `TrackerAxisInfo` has the shape `{x: number, axisLocation: AxisLocation}`, and the `AxisLocation` is an same enumeration used for placing the axes on the chart (i.e. `AxisLocation.Bottom`, `AxisLocation.Top`).
1006
+ **onTrackerUpdate ((update: TrackerAxisUpdate) => void, optional, default = noop)**<br>
1007
+ Optional callback function that accepts the update from the tracker. Use this to display the tracker and data information outside of the &lt;Chart/&gt. The `TrackerAxisUpdate` is a `Map<string, TrackerAxisInfo>`, the `TrackerAxisInfo` has the shape `{x: number, axisLocation: AxisLocation}`, and the `AxisLocation` is an same enumeration used for placing the axes on the chart (i.e. `AxisLocation.Bottom`, `AxisLocation.Top`).
620
1008
 
621
1009
 
622
1010
  #### [&#10514;](#content) <span id="tracker-usage-styling">&lt;Tracker/&gt; styling</span>
623
1011
 
624
- > **style ([TrackerStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/trackerUtils.ts), optional, default = {visible: false, color: '#d2933f', lineWidth: 1})**<br>
625
- > Optional property defining the style for the tracker line. Has a shape of `{visible: boolean, color: string, lineWidth: number}`.
1012
+ **style ([TrackerStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/trackerUtils.ts), optional, default = {visible: false, color: '#d2933f', lineWidth: 1})**<br>
1013
+ Optional property defining the style for the tracker line. Has a shape of `{visible: boolean, color: string, lineWidth: number}`.
626
1014
 
627
- > **font ([TrackerLabelFont](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/trackerUtils.ts), optional, default = {size: 12, color: '#d2933f', weight: 300, family: 'sans-serif'})**<br>
628
- > Optional property defining the font for the tracker label. Has a shape of `{size: number, color: string, family: string, weight: number}`.
1015
+ **font ([TrackerLabelFont](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/trackerUtils.ts), optional, default = {size: 12, color: '#d2933f', weight: 300, family: 'sans-serif'})**<br>
1016
+ Optional property defining the font for the tracker label. Has a shape of `{size: number, color: string, family: string, weight: number}`.
629
1017
 
630
1018
 
631
1019
  ### [&#10514;](#content) <span id="tooltip-usage">&lt;Tooltip/&gt;</span>
@@ -634,32 +1022,32 @@ A tooltip renders information about the data over which the mouse is hovering. T
634
1022
 
635
1023
  The properties for the lt;Tooltip/&gt; are simple and limited. The tooltip content components have more options.
636
1024
 
637
- > **visible (boolean)**<br>
638
- > When set to `true` the the tooltip is shown when the mouse hovers over a data series or point.
639
-
640
- > **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional, default = [defaultTooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts) )**<br>
641
- > Optional property defining the style of the tooltip. The following style elements are available
642
- > 1. **visible**<br>Visibility of the tooltip when the mouse hovers over a data series or point
643
- > ---
644
- > 2. **fontSize**<br>The size of the font displayed in the tooltip
645
- > 3. **fontColor**<br>The color of the text displayed in the tooltip
646
- > 4. **fontFamily**<br>The font weight for the text displayed in the tooltip
647
- > 5. **fontWeight**<br>The font weight for the text displayed in the tooltip
648
- > ---
649
- > 6. **backgroundColor**<br>The background color of the tooltip
650
- > 7. **backgroundOpacity**<br>The opacity of the background (i.e. how transparent it is)
651
- > ---
652
- > 8. **borderColor**<br>The color of the border surrounding the tooltip content
653
- > 9. **borderWidth**<br>The width of the border surrounding the tooltip content
654
- > 10. **borderRadius**<br>The radius of the border surrounding the tooltip content
655
- > ---
656
- > 11. **paddingLeft**<br>The padding to the left of the tooltip content
657
- > 12. **paddingRight**<br>The padding to the right of the tooltip content
658
- > 13. **paddingTop**<br>The padding to the top of the tooltip content
659
- > 14. **paddingBottom**<br>The padding to the bottom of the tooltip content
660
-
661
- > **children (&lt;ScatterPlotTooltipContent/&gt; and &lt;RasterPlotTooltipContent/&gt;)**<br>
662
- > The tooltip content.
1025
+ **visible (boolean)**<br>
1026
+ When set to `true` the the tooltip is shown when the mouse hovers over a data series or point.
1027
+
1028
+ **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional, default = [defaultTooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts) )**<br>
1029
+ Optional property defining the style of the tooltip. The following style elements are available
1030
+ 1. **visible**<br>Visibility of the tooltip when the mouse hovers over a data series or point
1031
+ ---
1032
+ 2. **fontSize**<br>The size of the font displayed in the tooltip
1033
+ 3. **fontColor**<br>The color of the text displayed in the tooltip
1034
+ 4. **fontFamily**<br>The font weight for the text displayed in the tooltip
1035
+ 5. **fontWeight**<br>The font weight for the text displayed in the tooltip
1036
+ ---
1037
+ 6. **backgroundColor**<br>The background color of the tooltip
1038
+ 7. **backgroundOpacity**<br>The opacity of the background (i.e. how transparent it is)
1039
+ ---
1040
+ 8. **borderColor**<br>The color of the border surrounding the tooltip content
1041
+ 9. **borderWidth**<br>The width of the border surrounding the tooltip content
1042
+ 10. **borderRadius**<br>The radius of the border surrounding the tooltip content
1043
+ ---
1044
+ 11. **paddingLeft**<br>The padding to the left of the tooltip content
1045
+ 12. **paddingRight**<br>The padding to the right of the tooltip content
1046
+ 13. **paddingTop**<br>The padding to the top of the tooltip content
1047
+ 14. **paddingBottom**<br>The padding to the bottom of the tooltip content
1048
+
1049
+ **children (&lt;ScatterPlotTooltipContent/&gt; and &lt;RasterPlotTooltipContent/&gt;)**<br>
1050
+ The tooltip content.
663
1051
 
664
1052
 
665
1053
  ### [&#10514;](#content) <span id="scatterplot-tooltip-usage">&lt;ScatterPlotTooltipContent/&gt;</span>
@@ -676,61 +1064,88 @@ series name
676
1064
 
677
1065
  ---
678
1066
 
679
- > **xLabel (string)**<br>
680
- > Required property that gives a name to the x-values. This is the label for the x-values in the tooltip.
1067
+ **xLabel (string)**<br>
1068
+ Required property that gives a name to the x-values. This is the label for the x-values in the tooltip.
681
1069
 
682
- > **yLabel (string)**<br>
683
- > Required property that gives a name to the y-values. This is the label for the y-values in the tooltip.
1070
+ **yLabel (string)**<br>
1071
+ Required property that gives a name to the y-values. This is the label for the y-values in the tooltip.
684
1072
 
685
- > **beforeHeader (string, optional, default = 'before')**<br>
686
- > Optional property that gives a name to the data point that is immediately before the mouse location.
1073
+ **beforeHeader (string, optional, default = 'before')**<br>
1074
+ Optional property that gives a name to the data point that is immediately before the mouse location.
687
1075
 
688
- > **afterHeader (string, optional, default = 'after')**<br>
689
- > Optional property that gives a name to the data point that is immediately after the mouse location.
1076
+ **afterHeader (string, optional, default = 'after')**<br>
1077
+ Optional property that gives a name to the data point that is immediately after the mouse location.
690
1078
 
691
- > **deltaHeader (string, optional, default = '∆')**<br>
692
- > Optional property that gives a name to the difference between the datum immediately before and after the mouse location.
1079
+ **deltaHeader (string, optional, default = '∆')**<br>
1080
+ Optional property that gives a name to the difference between the datum immediately before and after the mouse location.
693
1081
 
694
- > **xValueFormatter ((value: number) => string, optional, default =** [**formatTime**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
695
- > Optional function that formats the x-value immediately before and after the mouse location. The default function formats that x-values as natural numbers representing milliseconds.
1082
+ **xValueFormatter ((value: number) => string, optional, default =** [**formatTime**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
1083
+ Optional function that formats the x-value immediately before and after the mouse location. The default function formats that x-values as natural numbers representing milliseconds.
696
1084
 
697
- > **yValueFormatter ((value: number) => string, optional, default =** [**formatValue**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
698
- > Optional function that formats the x-value immediately before and after the mouse location. The default function formats the y-values as floating point with 3 values to the right of the decimal point.
1085
+ **yValueFormatter ((value: number) => string, optional, default =** [**formatValue**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
1086
+ Optional function that formats the x-value immediately before and after the mouse location. The default function formats the y-values as floating point with 3 values to the right of the decimal point.
699
1087
 
700
- > **xChangeFormatter ((value1: number, value2: number) => string, optional, default =** [**formatTimeChange**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
701
- > Optional function that formats the change in the x-value of the points immediately before and after the mouse location. The default function formats the value as a natural number.
1088
+ **xChangeFormatter ((value1: number, value2: number) => string, optional, default =** [**formatTimeChange**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
1089
+ Optional function that formats the change in the x-value of the points immediately before and after the mouse location. The default function formats the value as a natural number.
702
1090
 
703
- > **yChangeFormatter ((value1: number, value2: number) => string, optional, default =** [**formatValueChange**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
704
- > Optional function that formats the change in the y-value of the points immediately before and after the mouse location. The default function formats the value as floating point with 3 values to the right of the decimal point.
1091
+ **yChangeFormatter ((value1: number, value2: number) => string, optional, default =** [**formatValueChange**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
1092
+ Optional function that formats the change in the y-value of the points immediately before and after the mouse location. The default function formats the value as floating point with 3 values to the right of the decimal point.
705
1093
 
706
- > **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional, default = [defaultTooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts) )**<br>
707
- > Optional styles for the tooltip content. The styles are the same as those for the &lt;Tooltip/&gt;.
1094
+ **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional, default = [defaultTooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts) )**<br>
1095
+ Optional styles for the tooltip content. The styles are the same as those for the &lt;Tooltip/&gt;.
708
1096
 
709
1097
 
710
1098
  ### [&#10514;](#content) <span id="rasterplot-tooltip-usage">&lt;RasterTooltipContent/&gt;</span>
711
- The &lt;RasterPlotTooltipContent/&gt; shows the series name, the time and value of the point over which the mouse is hovering. There are only three properties.
1099
+ The &lt;RasterPlotTooltipContent/&gt; shows the series name, the time, and value of the point over which the mouse is hovering. There are only three properties.
712
1100
 
713
- > **xFormatter ((value: number) => string, optional, default =** [**formatTime**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
714
- > Optional function that formats the x-value immediately before and after the mouse location. The default function formats that x-values as natural numbers representing milliseconds.
1101
+ **xFormatter ((value: number) => string, optional, default =** [**formatTime**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
1102
+ Optional function that formats the x-value immediately before and after the mouse location. The default function formats that x-values as natural numbers representing milliseconds.
715
1103
 
716
- > **yFormatter ((value: number) => string, optional, default =** [**formatValue**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
717
- > Optional function that formats the x-value immediately before and after the mouse location. The default function formats the y-values as floating point with 3 values to the right of the decimal point.
1104
+ **yFormatter ((value: number) => string, optional, default =** [**formatValue**](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/utils.ts) <br>
1105
+ Optional function that formats the x-value immediately before and after the mouse location. The default function formats the y-values as floating point with 3 values to the right of the decimal point.
718
1106
 
719
- > **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional, default = [defaultTooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts) )**<br>
720
- > Optional styles for the tooltip content. The styles are the same as those for the &lt;Tooltip/&gt;.
1107
+ **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional, default = [defaultTooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts) )**<br>
1108
+ Optional styles for the tooltip content. The styles are the same as those for the &lt;Tooltip/&gt;.
721
1109
 
722
- ## building
1110
+ ### [&#10514;](#content) <span id="barplot-tooltip-usage">&lt;BarPlotTooltipContent/&gt;</span>
723
1111
 
724
- Building
725
- ```shell
726
- npm install
727
- npm run build
728
- ```
1112
+ The &lt;BarPlotTooltipContent/&gt; displays the series name and current statistics in a table format.
729
1113
 
730
- Packaging
731
- ```shell
732
- npm pack
733
- ```
1114
+ **ordinalUnits (string, optional)**<br>
1115
+ Optional units to display alongside the values.
1116
+
1117
+ **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional)**<br>
1118
+ Optional styles for the tooltip content.
1119
+
1120
+ ### [&#10514;](#content) <span id="poincareplot-tooltip-usage">&lt;PoincarePlotTooltipContent/&gt;</span>
1121
+
1122
+ The &lt;PoincarePlotTooltipContent/&gt; displays the series name and the current, previous, and next iterates in a table format.
1123
+
1124
+ **xLabel (string)**<br>
1125
+ Required label for the x-axis values.
1126
+
1127
+ **yLabel (string)**<br>
1128
+ Required label for the y-axis values.
1129
+
1130
+ **nMinusLagHeader**, **nHeader**, **nPlusLagHeader** (string, optional)<br>
1131
+ Optional headers for the previous, current, and next iterates.
1132
+
1133
+ **xValueFormatter**, **yValueFormatter**, **xChangeFormatter**, **yChangeFormatter** (optional)<br>
1134
+ Optional formatters for values and their changes.
1135
+
1136
+ **style ([TooltipStyle](https://github.com/robphilipp/stream-charts/blob/master/src/app/charts/tooltipUtils.ts), optional)**<br>
1137
+ Optional styles for the tooltip content.
1138
+
1139
+ ## [&#10514;](#content) <span id="hooks">hooks</span>
1140
+
1141
+ For advanced usage, `stream-charts` provides several hooks to interact with the chart's internal state.
1142
+
1143
+ - **useChart()**: Access the chart's context, including dimensions, scales, and registration functions for tooltips and trackers.
1144
+ - **useAxes()**: Access the state of the x and y axes.
1145
+ - **usePlotDimensions()**: Access the dimensions of the plot area and margins.
1146
+ - **useDataObservable()**: Access the data stream observable.
1147
+
1148
+ ## [&#10514;](#content) <span id="building">building</span>
734
1149
 
735
1150
  Testing
736
1151
  ```shell