stream-charts 1.0.1 → 1.1.0

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