stream-charts 1.2.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +809 -1022
- package/changes.md +36 -0
- package/dist/app/charts/Chart.d.ts +35 -139
- package/dist/app/charts/Chart.d.ts.map +1 -0
- package/dist/app/charts/Chart.js +74 -65
- package/dist/app/charts/Chart.js.map +1 -1
- package/dist/app/charts/axes/AxesState.d.ts +26 -18
- package/dist/app/charts/axes/AxesState.d.ts.map +1 -0
- package/dist/app/charts/axes/AxesState.js +26 -24
- package/dist/app/charts/axes/AxesState.js.map +1 -1
- package/dist/app/charts/axes/AxisInterval.d.ts +44 -26
- package/dist/app/charts/axes/AxisInterval.d.ts.map +1 -0
- package/dist/app/charts/axes/AxisInterval.js +48 -29
- package/dist/app/charts/axes/AxisInterval.js.map +1 -1
- package/dist/app/charts/axes/BaseAxisRange.d.ts +46 -22
- package/dist/app/charts/axes/BaseAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/BaseAxisRange.js +17 -12
- package/dist/app/charts/axes/BaseAxisRange.js.map +1 -1
- package/dist/app/charts/axes/ContinuousAxis.d.ts +47 -6
- package/dist/app/charts/axes/ContinuousAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/ContinuousAxis.js +160 -27
- package/dist/app/charts/axes/ContinuousAxis.js.map +1 -1
- package/dist/app/charts/axes/ContinuousAxisRange.d.ts +29 -10
- package/dist/app/charts/axes/ContinuousAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/ContinuousAxisRange.js +29 -11
- package/dist/app/charts/axes/ContinuousAxisRange.js.map +1 -1
- package/dist/app/charts/axes/EmptyAxis.d.ts +5 -2
- package/dist/app/charts/axes/EmptyAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/EmptyAxis.js +30 -9
- package/dist/app/charts/axes/EmptyAxis.js.map +1 -1
- package/dist/app/charts/axes/OrdinalAxis.d.ts +5 -3
- package/dist/app/charts/axes/OrdinalAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/OrdinalAxis.js +39 -16
- package/dist/app/charts/axes/OrdinalAxis.js.map +1 -1
- package/dist/app/charts/axes/OrdinalAxisRange.d.ts +76 -13
- package/dist/app/charts/axes/OrdinalAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/OrdinalAxisRange.js +95 -16
- package/dist/app/charts/axes/OrdinalAxisRange.js.map +1 -1
- package/dist/app/charts/axes/autoScale.d.ts +111 -0
- package/dist/app/charts/axes/autoScale.d.ts.map +1 -0
- package/dist/app/charts/axes/autoScale.js +188 -0
- package/dist/app/charts/axes/autoScale.js.map +1 -0
- package/dist/app/charts/axes/axes.d.ts +273 -150
- package/dist/app/charts/axes/axes.d.ts.map +1 -0
- package/dist/app/charts/axes/axes.js +808 -583
- package/dist/app/charts/axes/axes.js.map +1 -1
- package/dist/app/charts/d3types.d.ts +40 -11
- package/dist/app/charts/d3types.d.ts.map +1 -0
- package/dist/app/charts/d3types.js +3 -0
- package/dist/app/charts/d3types.js.map +1 -1
- package/dist/app/charts/datasources/StreamingDataSource.d.ts +149 -0
- package/dist/app/charts/datasources/StreamingDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/StreamingDataSource.js +110 -0
- package/dist/app/charts/datasources/StreamingDataSource.js.map +1 -0
- package/dist/app/charts/datasources/iteratesDataSource.d.ts +73 -0
- package/dist/app/charts/datasources/iteratesDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/iteratesDataSource.js +87 -0
- package/dist/app/charts/datasources/iteratesDataSource.js.map +1 -0
- package/dist/app/charts/datasources/ordinalDataSource.d.ts +75 -0
- package/dist/app/charts/datasources/ordinalDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/ordinalDataSource.js +135 -0
- package/dist/app/charts/datasources/ordinalDataSource.js.map +1 -0
- package/dist/app/charts/datasources/outlierDataSource.d.ts +53 -0
- package/dist/app/charts/datasources/outlierDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/outlierDataSource.js +57 -0
- package/dist/app/charts/datasources/outlierDataSource.js.map +1 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.d.ts +77 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.js +85 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.js.map +1 -0
- package/dist/app/charts/filters/regexFilter.d.ts +31 -4
- package/dist/app/charts/filters/regexFilter.d.ts.map +1 -0
- package/dist/app/charts/filters/regexFilter.js +38 -4
- package/dist/app/charts/filters/regexFilter.js.map +1 -1
- package/dist/app/charts/hooks/AxesProvider.d.ts +21 -0
- package/dist/app/charts/hooks/AxesProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/AxesProvider.js +213 -0
- package/dist/app/charts/hooks/AxesProvider.js.map +1 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts +25 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.js +76 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.js.map +1 -0
- package/dist/app/charts/hooks/ChartProvider.d.ts +40 -0
- package/dist/app/charts/hooks/ChartProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/ChartProvider.js +33 -0
- package/dist/app/charts/hooks/ChartProvider.js.map +1 -0
- package/dist/app/charts/hooks/InteractionProvider.d.ts +23 -0
- package/dist/app/charts/hooks/InteractionProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/InteractionProvider.js +60 -0
- package/dist/app/charts/hooks/InteractionProvider.js.map +1 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts +16 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.js +76 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.js.map +1 -0
- package/dist/app/charts/hooks/defaultAxesValues.d.ts +11 -0
- package/dist/app/charts/hooks/defaultAxesValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultAxesValues.js +36 -0
- package/dist/app/charts/hooks/defaultAxesValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultMouseValues.d.ts +9 -0
- package/dist/app/charts/hooks/defaultMouseValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultMouseValues.js +23 -0
- package/dist/app/charts/hooks/defaultMouseValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.d.ts +13 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.js +23 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.js.map +1 -0
- package/dist/app/charts/hooks/defaultTooltipValues.d.ts +9 -0
- package/dist/app/charts/hooks/defaultTooltipValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultTooltipValues.js +21 -0
- package/dist/app/charts/hooks/defaultTooltipValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultUseChartValues.d.ts +14 -0
- package/dist/app/charts/hooks/defaultUseChartValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultUseChartValues.js +30 -0
- package/dist/app/charts/hooks/defaultUseChartValues.js.map +1 -0
- package/dist/app/charts/hooks/useAxes.d.ts +49 -36
- package/dist/app/charts/hooks/useAxes.d.ts.map +1 -0
- package/dist/app/charts/hooks/useAxes.js +16 -176
- package/dist/app/charts/hooks/useAxes.js.map +1 -1
- package/dist/app/charts/hooks/useCanvasSurface.d.ts +25 -0
- package/dist/app/charts/hooks/useCanvasSurface.d.ts.map +1 -0
- package/dist/app/charts/hooks/useCanvasSurface.js +18 -0
- package/dist/app/charts/hooks/useCanvasSurface.js.map +1 -0
- package/dist/app/charts/hooks/useChart.d.ts +30 -44
- package/dist/app/charts/hooks/useChart.d.ts.map +1 -0
- package/dist/app/charts/hooks/useChart.js +26 -48
- package/dist/app/charts/hooks/useChart.js.map +1 -1
- package/dist/app/charts/hooks/useDataSource.d.ts +68 -0
- package/dist/app/charts/hooks/useDataSource.d.ts.map +1 -0
- package/dist/app/charts/hooks/useDataSource.js +63 -0
- package/dist/app/charts/hooks/useDataSource.js.map +1 -0
- package/dist/app/charts/hooks/useHoveredSeries.d.ts +25 -0
- package/dist/app/charts/hooks/useHoveredSeries.d.ts.map +1 -0
- package/dist/app/charts/hooks/useHoveredSeries.js +15 -0
- package/dist/app/charts/hooks/useHoveredSeries.js.map +1 -0
- package/dist/app/charts/hooks/useMouse.d.ts +46 -22
- package/dist/app/charts/hooks/useMouse.d.ts.map +1 -0
- package/dist/app/charts/hooks/useMouse.js +12 -56
- package/dist/app/charts/hooks/useMouse.js.map +1 -1
- package/dist/app/charts/hooks/usePlotDimensions.d.ts +25 -13
- package/dist/app/charts/hooks/usePlotDimensions.d.ts.map +1 -0
- package/dist/app/charts/hooks/usePlotDimensions.js +6 -62
- package/dist/app/charts/hooks/usePlotDimensions.js.map +1 -1
- package/dist/app/charts/hooks/useTooltip.d.ts +24 -26
- package/dist/app/charts/hooks/useTooltip.d.ts.map +1 -0
- package/dist/app/charts/hooks/useTooltip.js +12 -42
- package/dist/app/charts/hooks/useTooltip.js.map +1 -1
- package/dist/app/charts/index.d.ts +66 -0
- package/dist/app/charts/index.d.ts.map +1 -0
- package/dist/app/charts/index.js +87 -0
- package/dist/app/charts/index.js.map +1 -0
- package/dist/app/charts/legends/Legend.d.ts +33 -12
- package/dist/app/charts/legends/Legend.d.ts.map +1 -0
- package/dist/app/charts/legends/Legend.js +138 -379
- package/dist/app/charts/legends/Legend.js.map +1 -1
- package/dist/app/charts/legends/constants.d.ts +19 -0
- package/dist/app/charts/legends/constants.d.ts.map +1 -0
- package/dist/app/charts/legends/constants.js +34 -0
- package/dist/app/charts/legends/constants.js.map +1 -0
- package/dist/app/charts/observables/ChartData.d.ts +1 -0
- package/dist/app/charts/observables/ChartData.d.ts.map +1 -0
- package/dist/app/charts/observables/iterates.d.ts +13 -7
- package/dist/app/charts/observables/iterates.d.ts.map +1 -0
- package/dist/app/charts/observables/iterates.js +42 -9
- package/dist/app/charts/observables/iterates.js.map +1 -1
- package/dist/app/charts/observables/ordinals.d.ts +70 -12
- package/dist/app/charts/observables/ordinals.d.ts.map +1 -0
- package/dist/app/charts/observables/ordinals.js +127 -48
- package/dist/app/charts/observables/ordinals.js.map +1 -1
- package/dist/app/charts/observables/outliers.d.ts +18 -0
- package/dist/app/charts/observables/outliers.d.ts.map +1 -0
- package/dist/app/charts/observables/outliers.js +2 -0
- package/dist/app/charts/observables/outliers.js.map +1 -0
- package/dist/app/charts/plots/BarPlot.d.ts +87 -13
- package/dist/app/charts/plots/BarPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/BarPlot.js +603 -356
- package/dist/app/charts/plots/BarPlot.js.map +1 -1
- package/dist/app/charts/plots/OutlierPlot.d.ts +123 -0
- package/dist/app/charts/plots/OutlierPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/OutlierPlot.js +430 -0
- package/dist/app/charts/plots/OutlierPlot.js.map +1 -0
- package/dist/app/charts/plots/PoincarePlot.d.ts +92 -14
- package/dist/app/charts/plots/PoincarePlot.d.ts.map +1 -0
- package/dist/app/charts/plots/PoincarePlot.js +523 -364
- package/dist/app/charts/plots/PoincarePlot.js.map +1 -1
- package/dist/app/charts/plots/RasterPlot.d.ts +31 -10
- package/dist/app/charts/plots/RasterPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/RasterPlot.js +198 -306
- package/dist/app/charts/plots/RasterPlot.js.map +1 -1
- package/dist/app/charts/plots/ScatterPlot.d.ts +77 -21
- package/dist/app/charts/plots/ScatterPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/ScatterPlot.js +359 -302
- package/dist/app/charts/plots/ScatterPlot.js.map +1 -1
- package/dist/app/charts/plots/autoScaleYAxes.d.ts +43 -0
- package/dist/app/charts/plots/autoScaleYAxes.d.ts.map +1 -0
- package/dist/app/charts/plots/autoScaleYAxes.js +71 -0
- package/dist/app/charts/plots/autoScaleYAxes.js.map +1 -0
- package/dist/app/charts/plots/colorizedLine.d.ts +61 -0
- package/dist/app/charts/plots/colorizedLine.d.ts.map +1 -0
- package/dist/app/charts/plots/colorizedLine.js +157 -0
- package/dist/app/charts/plots/colorizedLine.js.map +1 -0
- package/dist/app/charts/plots/constants.d.ts +7 -0
- package/dist/app/charts/plots/constants.d.ts.map +1 -0
- package/dist/app/charts/plots/constants.js +11 -0
- package/dist/app/charts/plots/constants.js.map +1 -0
- package/dist/app/charts/plots/hitTesting.d.ts +88 -0
- package/dist/app/charts/plots/hitTesting.d.ts.map +1 -0
- package/dist/app/charts/plots/hitTesting.js +136 -0
- package/dist/app/charts/plots/hitTesting.js.map +1 -0
- package/dist/app/charts/plots/plot.d.ts +52 -16
- package/dist/app/charts/plots/plot.d.ts.map +1 -0
- package/dist/app/charts/plots/plot.js +108 -35
- package/dist/app/charts/plots/plot.js.map +1 -1
- package/dist/app/charts/plots/useCanvasZoomPan.d.ts +119 -0
- package/dist/app/charts/plots/useCanvasZoomPan.d.ts.map +1 -0
- package/dist/app/charts/plots/useCanvasZoomPan.js +113 -0
- package/dist/app/charts/plots/useCanvasZoomPan.js.map +1 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.d.ts +103 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.d.ts.map +1 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.js +257 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.js.map +1 -0
- package/dist/app/charts/series/baseSeries.d.ts +60 -8
- package/dist/app/charts/series/baseSeries.d.ts.map +1 -0
- package/dist/app/charts/series/baseSeries.js +53 -8
- package/dist/app/charts/series/baseSeries.js.map +1 -1
- package/dist/app/charts/series/iterateSeries.d.ts +9 -8
- package/dist/app/charts/series/iterateSeries.d.ts.map +1 -0
- package/dist/app/charts/series/iterateSeries.js +7 -7
- package/dist/app/charts/series/iterateSeries.js.map +1 -1
- package/dist/app/charts/series/ordinalSeries.d.ts +27 -13
- package/dist/app/charts/series/ordinalSeries.d.ts.map +1 -0
- package/dist/app/charts/series/ordinalSeries.js +29 -15
- package/dist/app/charts/series/ordinalSeries.js.map +1 -1
- package/dist/app/charts/series/outlierSeries.d.ts +142 -0
- package/dist/app/charts/series/outlierSeries.d.ts.map +1 -0
- package/dist/app/charts/series/outlierSeries.js +82 -0
- package/dist/app/charts/series/outlierSeries.js.map +1 -0
- package/dist/app/charts/series/timeSeries.d.ts +13 -9
- package/dist/app/charts/series/timeSeries.d.ts.map +1 -0
- package/dist/app/charts/series/timeSeries.js +6 -3
- package/dist/app/charts/series/timeSeries.js.map +1 -1
- package/dist/app/charts/series/timeSeriesChartData.d.ts +18 -10
- package/dist/app/charts/series/timeSeriesChartData.d.ts.map +1 -0
- package/dist/app/charts/series/timeSeriesChartData.js +28 -14
- package/dist/app/charts/series/timeSeriesChartData.js.map +1 -1
- package/dist/app/charts/styling/barPlotStyle.d.ts +46 -2
- package/dist/app/charts/styling/barPlotStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/barPlotStyle.js +37 -3
- package/dist/app/charts/styling/barPlotStyle.js.map +1 -1
- package/dist/app/charts/styling/canvasStyle.d.ts +53 -0
- package/dist/app/charts/styling/canvasStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/canvasStyle.js +71 -0
- package/dist/app/charts/styling/canvasStyle.js.map +1 -0
- package/dist/app/charts/styling/margins.d.ts +21 -2
- package/dist/app/charts/styling/margins.d.ts.map +1 -0
- package/dist/app/charts/styling/margins.js +25 -4
- package/dist/app/charts/styling/margins.js.map +1 -1
- package/dist/app/charts/styling/svgStyle.d.ts +10 -56
- package/dist/app/charts/styling/svgStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/svgStyle.js +3 -78
- package/dist/app/charts/styling/svgStyle.js.map +1 -1
- package/dist/app/charts/subscriptions/viewDrivers.d.ts +124 -0
- package/dist/app/charts/subscriptions/viewDrivers.d.ts.map +1 -0
- package/dist/app/charts/subscriptions/viewDrivers.js +338 -0
- package/dist/app/charts/subscriptions/viewDrivers.js.map +1 -0
- package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts +12 -78
- package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/BarPlotTooltipContent.js +65 -257
- package/dist/app/charts/tooltips/BarPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts +9 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js +16 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts +30 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js +26 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts +22 -72
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js +104 -171
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts +32 -8
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.js +62 -115
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts +39 -12
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js +162 -134
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/Tooltip.d.ts +27 -32
- package/dist/app/charts/tooltips/Tooltip.d.ts.map +1 -0
- package/dist/app/charts/tooltips/Tooltip.js +37 -81
- package/dist/app/charts/tooltips/Tooltip.js.map +1 -1
- package/dist/app/charts/tooltips/TooltipContent.d.ts +81 -0
- package/dist/app/charts/tooltips/TooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/TooltipContent.js +99 -0
- package/dist/app/charts/tooltips/TooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/tooltipUtils.d.ts +186 -36
- package/dist/app/charts/tooltips/tooltipUtils.d.ts.map +1 -0
- package/dist/app/charts/tooltips/tooltipUtils.js +277 -48
- package/dist/app/charts/tooltips/tooltipUtils.js.map +1 -1
- package/dist/app/charts/tooltips/useOutlierTooltip.d.ts +59 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.js +16 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.js.map +1 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.d.ts +51 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.js +52 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.js.map +1 -0
- package/dist/app/charts/tooltips/useTooltipStyle.d.ts +11 -0
- package/dist/app/charts/tooltips/useTooltipStyle.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useTooltipStyle.js +14 -0
- package/dist/app/charts/tooltips/useTooltipStyle.js.map +1 -0
- package/dist/app/charts/trackers/Tracker.d.ts +22 -6
- package/dist/app/charts/trackers/Tracker.d.ts.map +1 -0
- package/dist/app/charts/trackers/Tracker.js +36 -22
- package/dist/app/charts/trackers/Tracker.js.map +1 -1
- package/dist/app/charts/trackers/trackerUtils.d.ts +40 -18
- package/dist/app/charts/trackers/trackerUtils.d.ts.map +1 -0
- package/dist/app/charts/trackers/trackerUtils.js +213 -300
- package/dist/app/charts/trackers/trackerUtils.js.map +1 -1
- package/dist/app/charts/utils.d.ts +72 -33
- package/dist/app/charts/utils.d.ts.map +1 -0
- package/dist/app/charts/utils.js +87 -42
- package/dist/app/charts/utils.js.map +1 -1
- package/dist/index.d.ts +2 -45
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -72
- package/dist/index.js.map +1 -1
- package/package.json +87 -46
- package/src/app/charts/Chart.tsx +132 -168
- package/src/app/charts/axes/AxesState.ts +27 -29
- package/src/app/charts/axes/AxisInterval.ts +57 -32
- package/src/app/charts/axes/BaseAxisRange.ts +47 -27
- package/src/app/charts/axes/ContinuousAxis.tsx +235 -39
- package/src/app/charts/axes/ContinuousAxisRange.ts +29 -11
- package/src/app/charts/axes/EmptyAxis.tsx +52 -17
- package/src/app/charts/axes/OrdinalAxis.tsx +54 -28
- package/src/app/charts/axes/OrdinalAxisRange.ts +96 -16
- package/src/app/charts/axes/autoScale.ts +244 -0
- package/src/app/charts/axes/axes.ts +954 -735
- package/src/app/charts/d3types.ts +42 -13
- package/src/app/charts/datasources/StreamingDataSource.ts +214 -0
- package/src/app/charts/datasources/iteratesDataSource.ts +122 -0
- package/src/app/charts/datasources/ordinalDataSource.ts +205 -0
- package/src/app/charts/datasources/outlierDataSource.ts +90 -0
- package/src/app/charts/datasources/timeSeriesDataSource.ts +133 -0
- package/src/app/charts/filters/regexFilter.ts +45 -5
- package/src/app/charts/hooks/AxesProvider.tsx +301 -0
- package/src/app/charts/hooks/CanvasSurfaceProvider.tsx +117 -0
- package/src/app/charts/hooks/ChartProvider.tsx +79 -0
- package/src/app/charts/hooks/InteractionProvider.tsx +88 -0
- package/src/app/charts/hooks/PlotDimensionsProvider.tsx +109 -0
- package/src/app/charts/hooks/defaultAxesValues.ts +40 -0
- package/src/app/charts/hooks/defaultMouseValues.ts +24 -0
- package/src/app/charts/hooks/defaultPlotDimensions.ts +27 -0
- package/src/app/charts/hooks/defaultTooltipValues.tsx +23 -0
- package/src/app/charts/hooks/defaultUseChartValues.tsx +36 -0
- package/src/app/charts/hooks/useAxes.tsx +60 -228
- package/src/app/charts/hooks/useCanvasSurface.tsx +35 -0
- package/src/app/charts/hooks/useChart.tsx +47 -106
- package/src/app/charts/hooks/useDataSource.tsx +106 -0
- package/src/app/charts/hooks/useHoveredSeries.tsx +33 -0
- package/src/app/charts/hooks/useMouse.tsx +58 -82
- package/src/app/charts/hooks/usePlotDimensions.tsx +25 -89
- package/src/app/charts/hooks/useTooltip.tsx +32 -63
- package/src/app/charts/index.ts +213 -0
- package/src/app/charts/legends/Legend.tsx +198 -479
- package/src/app/charts/legends/constants.ts +37 -0
- package/src/app/charts/observables/iterates.ts +32 -12
- package/src/app/charts/observables/ordinals.ts +141 -67
- package/src/app/charts/observables/outliers.ts +20 -0
- package/src/app/charts/plots/BarPlot.tsx +784 -666
- package/src/app/charts/plots/OutlierPlot.tsx +685 -0
- package/src/app/charts/plots/PoincarePlot.tsx +707 -489
- package/src/app/charts/plots/RasterPlot.tsx +253 -445
- package/src/app/charts/plots/ScatterPlot.tsx +480 -463
- package/src/app/charts/plots/autoScaleYAxes.ts +102 -0
- package/src/app/charts/plots/colorizedLine.ts +185 -0
- package/src/app/charts/plots/constants.ts +16 -0
- package/src/app/charts/plots/hitTesting.ts +198 -0
- package/src/app/charts/plots/plot.ts +138 -44
- package/src/app/charts/plots/useCanvasZoomPan.ts +240 -0
- package/src/app/charts/plots/useStreamingTimeAxes.ts +384 -0
- package/src/app/charts/series/baseSeries.ts +81 -14
- package/src/app/charts/series/iterateSeries.ts +8 -8
- package/src/app/charts/series/ordinalSeries.ts +35 -20
- package/src/app/charts/series/outlierSeries.ts +188 -0
- package/src/app/charts/series/timeSeries.ts +14 -12
- package/src/app/charts/series/timeSeriesChartData.ts +31 -17
- package/src/app/charts/styling/barPlotStyle.ts +48 -5
- package/src/app/charts/styling/canvasStyle.ts +86 -0
- package/src/app/charts/styling/margins.ts +28 -4
- package/src/app/charts/styling/svgStyle.ts +10 -91
- package/src/app/charts/subscriptions/viewDrivers.ts +447 -0
- package/src/app/charts/tooltips/BarPlotTooltipContent.tsx +156 -380
- package/src/app/charts/tooltips/DefaultOutlierTooltipContent.tsx +40 -0
- package/src/app/charts/tooltips/OutlierPlotTooltipContent.tsx +67 -0
- package/src/app/charts/tooltips/PoincarePlotTooltipContent.tsx +229 -292
- package/src/app/charts/tooltips/RasterPlotTooltipContent.tsx +164 -217
- package/src/app/charts/tooltips/ScatterPlotTooltipContent.tsx +373 -236
- package/src/app/charts/tooltips/Tooltip.tsx +58 -124
- package/src/app/charts/tooltips/TooltipContent.tsx +177 -0
- package/src/app/charts/tooltips/tooltipUtils.ts +359 -61
- package/src/app/charts/tooltips/useOutlierTooltip.tsx +68 -0
- package/src/app/charts/tooltips/useTooltipPlacement.ts +86 -0
- package/src/app/charts/tooltips/useTooltipStyle.ts +15 -0
- package/src/app/charts/trackers/Tracker.tsx +68 -33
- package/src/app/charts/trackers/trackerUtils.ts +263 -376
- package/src/app/charts/utils.ts +90 -48
- package/src/index.ts +2 -322
- package/dist/app/charts/axes/AxesState.test.d.ts +0 -1
- package/dist/app/charts/axes/AxesState.test.js +0 -30
- package/dist/app/charts/axes/AxesState.test.js.map +0 -1
- package/dist/app/charts/axes/AxisInterval.test.d.ts +0 -1
- package/dist/app/charts/axes/AxisInterval.test.js +0 -120
- package/dist/app/charts/axes/AxisInterval.test.js.map +0 -1
- package/dist/app/charts/axes/ContinuousAxisRange.test.d.ts +0 -1
- package/dist/app/charts/axes/ContinuousAxisRange.test.js +0 -47
- package/dist/app/charts/axes/ContinuousAxisRange.test.js.map +0 -1
- package/dist/app/charts/axes/OrdinalAxisRange.test.d.ts +0 -1
- package/dist/app/charts/axes/OrdinalAxisRange.test.js +0 -48
- package/dist/app/charts/axes/OrdinalAxisRange.test.js.map +0 -1
- package/dist/app/charts/filters/regexFilter.test.d.ts +0 -1
- package/dist/app/charts/filters/regexFilter.test.js +0 -11
- package/dist/app/charts/filters/regexFilter.test.js.map +0 -1
- package/dist/app/charts/hooks/useDataObservable.d.ts +0 -72
- package/dist/app/charts/hooks/useDataObservable.js +0 -74
- package/dist/app/charts/hooks/useDataObservable.js.map +0 -1
- package/dist/app/charts/hooks/useInitialData.d.ts +0 -36
- package/dist/app/charts/hooks/useInitialData.js +0 -28
- package/dist/app/charts/hooks/useInitialData.js.map +0 -1
- package/dist/app/charts/observables/iterates.test.d.ts +0 -1
- package/dist/app/charts/observables/iterates.test.js +0 -180
- package/dist/app/charts/observables/iterates.test.js.map +0 -1
- package/dist/app/charts/observables/ordinals.test.d.ts +0 -1
- package/dist/app/charts/observables/ordinals.test.js +0 -102
- package/dist/app/charts/observables/ordinals.test.js.map +0 -1
- package/dist/app/charts/series/datumSeries.test.d.ts +0 -1
- package/dist/app/charts/series/datumSeries.test.js +0 -50
- package/dist/app/charts/series/datumSeries.test.js.map +0 -1
- package/dist/app/charts/styling/margins.test.d.ts +0 -1
- package/dist/app/charts/styling/margins.test.js +0 -19
- package/dist/app/charts/styling/margins.test.js.map +0 -1
- package/dist/app/charts/subscriptions/subscription.test.d.ts +0 -1
- package/dist/app/charts/subscriptions/subscription.test.js +0 -395
- package/dist/app/charts/subscriptions/subscription.test.js.map +0 -1
- package/dist/app/charts/subscriptions/subscriptions.d.ts +0 -100
- package/dist/app/charts/subscriptions/subscriptions.js +0 -449
- package/dist/app/charts/subscriptions/subscriptions.js.map +0 -1
- package/src/app/charts/axes/AxesState.test.ts +0 -34
- package/src/app/charts/axes/AxisInterval.test.ts +0 -143
- package/src/app/charts/axes/ContinuousAxisRange.test.ts +0 -55
- package/src/app/charts/axes/OrdinalAxisRange.test.ts +0 -55
- package/src/app/charts/filters/regexFilter.test.ts +0 -13
- package/src/app/charts/hooks/useDataObservable.tsx +0 -170
- package/src/app/charts/hooks/useInitialData.tsx +0 -64
- package/src/app/charts/observables/iterates.test.ts +0 -201
- package/src/app/charts/observables/ordinals.test.ts +0 -135
- package/src/app/charts/series/datumSeries.test.ts +0 -60
- package/src/app/charts/styling/margins.test.ts +0 -22
- package/src/app/charts/subscriptions/subscription.test.ts +0 -499
- package/src/app/charts/subscriptions/subscriptions.ts +0 -635
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The location of the legend, either in the plot or in an external container
|
|
3
|
+
* Note: replaces enums to support `erasableSyntaxOnly`
|
|
4
|
+
* TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
|
|
5
|
+
*/
|
|
6
|
+
export const LegendLocation = {
|
|
7
|
+
// noinspection JSUnusedGlobalSymbols
|
|
8
|
+
TOP_LEFT: "top-left",
|
|
9
|
+
TOP_RIGHT: "top-right",
|
|
10
|
+
BOTTOM_LEFT: "bottom-left",
|
|
11
|
+
BOTTOM_RIGHT: "bottom-right",
|
|
12
|
+
EXTERNAL_CONTAINER: "external-container"
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The legend's default style
|
|
16
|
+
*/
|
|
17
|
+
export const defaultLegendStyle = {
|
|
18
|
+
fontSize: 12,
|
|
19
|
+
fontFamily: "sans-serif",
|
|
20
|
+
fontColor: "#d2933f",
|
|
21
|
+
backgroundColor: "#202020",
|
|
22
|
+
backgroundOpacity: 0.85,
|
|
23
|
+
borderColor: "#d2933f",
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
borderOpacity: 0.7,
|
|
26
|
+
borderRadius: 4,
|
|
27
|
+
padding: 8,
|
|
28
|
+
rowGap: 6,
|
|
29
|
+
swatchWidth: 16,
|
|
30
|
+
swatchHeight: 3,
|
|
31
|
+
swatchLabelGap: 6,
|
|
32
|
+
transitionDuration: 350,
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/app/charts/legends/constants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,qCAAqC;IACrC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,kBAAkB,EAAE,oBAAoB;CAClC,CAAA;AAGV;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC3C,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,SAAS;IAC1B,iBAAiB,EAAE,IAAI;IACvB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,GAAG;IAClB,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,kBAAkB,EAAE,GAAG;CAC1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartData.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/observables/ChartData.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACtB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,CAI5C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS;;EAI5C"}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* 2. Accepts that chart-data observable and converts that observable to an iterate-chart-data observable
|
|
9
9
|
*/
|
|
10
10
|
import { Observable } from "rxjs";
|
|
11
|
-
import { TimeSeriesChartData } from "../series/timeSeriesChartData";
|
|
12
|
-
import { IterateDatum } from "../series/iterateSeries";
|
|
13
|
-
import { ChartData } from "./ChartData";
|
|
11
|
+
import type { TimeSeriesChartData } from "../series/timeSeriesChartData";
|
|
12
|
+
import { type IterateDatum } from "../series/iterateSeries";
|
|
13
|
+
import { type ChartData } from "./ChartData";
|
|
14
14
|
export interface IterateChartData extends ChartData {
|
|
15
15
|
/**
|
|
16
16
|
* The min values for (time, iterate n, and iterate n+1) for the data in the newPoints map
|
|
@@ -21,11 +21,13 @@ export interface IterateChartData extends ChartData {
|
|
|
21
21
|
*/
|
|
22
22
|
maxIterate: IterateDatum;
|
|
23
23
|
/**
|
|
24
|
-
* Holds the association of the series name to the
|
|
24
|
+
* Holds the association of the series name to the min values for (time, iterate n, and
|
|
25
|
+
* iterate n+1) for that series
|
|
25
26
|
*/
|
|
26
27
|
minIterates: Map<string, IterateDatum>;
|
|
27
28
|
/**
|
|
28
|
-
* Holds the association of the series name to the
|
|
29
|
+
* Holds the association of the series name to the max values for (time, iterate n, and
|
|
30
|
+
* iterate n+1) for that series
|
|
29
31
|
*/
|
|
30
32
|
maxIterates: Map<string, IterateDatum>;
|
|
31
33
|
/**
|
|
@@ -35,8 +37,10 @@ export interface IterateChartData extends ChartData {
|
|
|
35
37
|
newPoints: Map<string, Array<IterateDatum>>;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
|
-
* Makes a
|
|
40
|
+
* Makes a copy of the iterate chart data: new sets, maps, and arrays of points (the points
|
|
41
|
+
* themselves are shared)
|
|
39
42
|
* @param data The iterate chart data to copy
|
|
43
|
+
* @return The copy
|
|
40
44
|
*/
|
|
41
45
|
export declare const copyIterateDataFrom: (data: IterateChartData) => IterateChartData;
|
|
42
46
|
/**
|
|
@@ -47,6 +51,8 @@ export declare const copyIterateDataFrom: (data: IterateChartData) => IterateCha
|
|
|
47
51
|
* points `(f[m](x), f[m+n](x))` are n-iterates.
|
|
48
52
|
* @param dataObservable The observable over {@link TimeSeriesChartData}
|
|
49
53
|
* @param [n=1] The iterate distance
|
|
50
|
-
* @return An over {@link IterateChartData} holding the n-iterate for the incoming chart
|
|
54
|
+
* @return An observable over {@link IterateChartData} holding the n-iterate for the incoming chart
|
|
55
|
+
* data (nothing is emitted until the first iterate has been calculated)
|
|
51
56
|
*/
|
|
52
57
|
export declare function iteratesObservable(dataObservable: Observable<TimeSeriesChartData>, n?: number): Observable<IterateChartData>;
|
|
58
|
+
//# sourceMappingURL=iterates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterates.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/observables/iterates.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAChC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAGvE,OAAO,EAAoB,KAAK,YAAY,EAAuC,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAC,KAAK,SAAS,EAAkC,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAC/C;;OAEG;IACH,UAAU,EAAE,YAAY,CAAA;IAExB;;OAEG;IACH,UAAU,EAAE,YAAY,CAAA;IAExB;;;OAGG;IACH,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAEtC;;;OAGG;IACH,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAEtC;;;OAGG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAA;CAC9C;AAcD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,gBAAgB,KAAG,gBAO3D,CAAA;AAiBF;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC,GAAE,MAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAiE/H"}
|
|
@@ -2,12 +2,36 @@ import { filter, map, scan } from "rxjs/operators";
|
|
|
2
2
|
import { emptyDatum } from "../series/timeSeries";
|
|
3
3
|
import { emptyIterateDatum, iterateDatumOf, nonEmptyIterateDatum } from "../series/iterateSeries";
|
|
4
4
|
import { copyChartData, defaultChartData } from "./ChartData";
|
|
5
|
-
const emptyIterateData = () => (Object.assign(Object.assign({}, defaultChartData()), { minIterate: emptyIterateDatum, maxIterate: emptyIterateDatum, minIterates: new Map(), maxIterates: new Map(), newPoints: new Map() }));
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* @return Iterate chart data without any series or points, and with empty min and max iterates
|
|
7
|
+
*/
|
|
8
|
+
const emptyIterateData = () => ({
|
|
9
|
+
...defaultChartData(),
|
|
10
|
+
minIterate: emptyIterateDatum,
|
|
11
|
+
maxIterate: emptyIterateDatum,
|
|
12
|
+
minIterates: new Map(),
|
|
13
|
+
maxIterates: new Map(),
|
|
14
|
+
newPoints: new Map()
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Makes a copy of the iterate chart data: new sets, maps, and arrays of points (the points
|
|
18
|
+
* themselves are shared)
|
|
8
19
|
* @param data The iterate chart data to copy
|
|
20
|
+
* @return The copy
|
|
21
|
+
*/
|
|
22
|
+
export const copyIterateDataFrom = (data) => ({
|
|
23
|
+
...copyChartData(data),
|
|
24
|
+
minIterate: data.minIterate,
|
|
25
|
+
maxIterate: data.maxIterate,
|
|
26
|
+
minIterates: new Map(data.minIterates),
|
|
27
|
+
maxIterates: new Map(data.maxIterates),
|
|
28
|
+
newPoints: new Map(Array.from(data.newPoints.entries()).map(([name, points]) => [name, points.slice()])),
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* The accumulator to start calculating the n-iterates from
|
|
32
|
+
* @param n The iterate distance
|
|
33
|
+
* @return An accumulator with no points and no iterates
|
|
9
34
|
*/
|
|
10
|
-
export const copyIterateDataFrom = (data) => (Object.assign(Object.assign({}, copyChartData(data)), { minIterate: data.minIterate, maxIterate: data.maxIterate, minIterates: new Map(data.minIterates), maxIterates: new Map(data.maxIterates), newPoints: new Map(Array.from(data.newPoints.entries()).map(([name, points]) => [name, points.slice()])) }));
|
|
11
35
|
const initialAccumulate = (n) => ({ n, previous: new Map(), accumulated: emptyIterateData() });
|
|
12
36
|
/**
|
|
13
37
|
* Accepts a {@link TimeSeriesChartData} observable and converts it to an observable of {@link IterateChartData}
|
|
@@ -17,7 +41,8 @@ const initialAccumulate = (n) => ({ n, previous: new Map(), accumulated: emptyIt
|
|
|
17
41
|
* points `(f[m](x), f[m+n](x))` are n-iterates.
|
|
18
42
|
* @param dataObservable The observable over {@link TimeSeriesChartData}
|
|
19
43
|
* @param [n=1] The iterate distance
|
|
20
|
-
* @return An over {@link IterateChartData} holding the n-iterate for the incoming chart
|
|
44
|
+
* @return An observable over {@link IterateChartData} holding the n-iterate for the incoming chart
|
|
45
|
+
* data (nothing is emitted until the first iterate has been calculated)
|
|
21
46
|
*/
|
|
22
47
|
export function iteratesObservable(dataObservable, n = 1) {
|
|
23
48
|
return dataObservable
|
|
@@ -49,7 +74,7 @@ export function iteratesObservable(dataObservable, n = 1) {
|
|
|
49
74
|
// iteration of the while-loop
|
|
50
75
|
previous.set(name, updated);
|
|
51
76
|
// create the new iterate
|
|
52
|
-
const iterate = iterateDatumOf(first.
|
|
77
|
+
const iterate = iterateDatumOf(first.x, first.y, last.y);
|
|
53
78
|
// update the min, max values for all the series
|
|
54
79
|
accum.minIterate = minIterateFor(iterate, accum.minIterate);
|
|
55
80
|
accum.maxIterate = maxIterateFor(iterate, accum.maxIterate);
|
|
@@ -57,8 +82,7 @@ export function iteratesObservable(dataObservable, n = 1) {
|
|
|
57
82
|
accum.minIterates.set(name, minIterateFor(iterate, accum.minIterates.get(name)));
|
|
58
83
|
accum.maxIterates.set(name, maxIterateFor(iterate, accum.maxIterates.get(name)));
|
|
59
84
|
// add the newly calculated iterate, and then trim from the
|
|
60
|
-
// head of the array to
|
|
61
|
-
// to keep enough to create points (x(j), x(j+n))
|
|
85
|
+
// head of the array to the number of points in this chunk
|
|
62
86
|
const updatedPoints = accum.newPoints.get(name) || [];
|
|
63
87
|
if (updatedPoints.length === 0) {
|
|
64
88
|
accum.newPoints.set(name, updatedPoints);
|
|
@@ -71,7 +95,8 @@ export function iteratesObservable(dataObservable, n = 1) {
|
|
|
71
95
|
});
|
|
72
96
|
return { n, previous, accumulated: accum };
|
|
73
97
|
}, initialAccumulate(n)),
|
|
74
|
-
//
|
|
98
|
+
// skip the chunks until the first iterate has been calculated, and remove the empty
|
|
99
|
+
// new points
|
|
75
100
|
filter(accum => !isNaN(accum.accumulated.minIterate.iterateN) && !isNaN(accum.accumulated.minIterate.iterateN_1)), map(accum => removeEmptyNewPoints(accum)), map(accum => accum.accumulated === undefined ? emptyIterateData() : accum.accumulated));
|
|
76
101
|
}
|
|
77
102
|
/**
|
|
@@ -108,6 +133,11 @@ function maxIterateFor(iterate, maxIterate = emptyIterateDatum) {
|
|
|
108
133
|
iterateN_1: maxN_1
|
|
109
134
|
};
|
|
110
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Removes the empty iterates from the accumulated new points
|
|
138
|
+
* @param accum The accumulator
|
|
139
|
+
* @return A new accumulator, whose accumulated new points are the non-empty ones
|
|
140
|
+
*/
|
|
111
141
|
function removeEmptyNewPoints(accum) {
|
|
112
142
|
const newPoints = new Map(Array
|
|
113
143
|
.from(accum.accumulated.newPoints.entries())
|
|
@@ -115,7 +145,10 @@ function removeEmptyNewPoints(accum) {
|
|
|
115
145
|
return {
|
|
116
146
|
n: accum.n,
|
|
117
147
|
previous: accum.previous,
|
|
118
|
-
accumulated:
|
|
148
|
+
accumulated: {
|
|
149
|
+
...accum.accumulated,
|
|
150
|
+
newPoints
|
|
151
|
+
}
|
|
119
152
|
};
|
|
120
153
|
}
|
|
121
154
|
//# sourceMappingURL=iterates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterates.js","sourceRoot":"","sources":["../../../../src/app/charts/observables/iterates.ts"],"names":[],"mappings":"AAWA,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"iterates.js","sourceRo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KACJ,CAAA;AACL,CAAC"}
|
|
@@ -5,20 +5,21 @@
|
|
|
5
5
|
* 2. Accepts that chart-data observable and converts that observable to an ordinal-chart-data observable
|
|
6
6
|
*/
|
|
7
7
|
import { Observable } from "rxjs";
|
|
8
|
-
import { TimeSeriesChartData } from "../series/timeSeriesChartData";
|
|
9
|
-
import { OrdinalDatum } from "../series/ordinalSeries";
|
|
10
|
-
import { ChartData } from "./ChartData";
|
|
8
|
+
import type { TimeSeriesChartData } from "../series/timeSeriesChartData";
|
|
9
|
+
import { type OrdinalDatum } from "../series/ordinalSeries";
|
|
10
|
+
import { type ChartData } from "./ChartData";
|
|
11
|
+
import { FastShiftArray } from "fast-shift-array";
|
|
11
12
|
export interface OrdinalChartData extends ChartData {
|
|
12
13
|
/**
|
|
13
14
|
* Statistics for the chart. Holds the overall minimum and maximum (across all
|
|
14
|
-
* the series), and statistics for each
|
|
15
|
+
* the series), and statistics for each series.
|
|
15
16
|
*/
|
|
16
17
|
stats: OrdinalStats;
|
|
17
18
|
/**
|
|
18
19
|
* Map holding the name of the series (the time-series identifier) and the associated
|
|
19
20
|
* data points for that time-series (`map(series_name -> array(datum))`)
|
|
20
21
|
*/
|
|
21
|
-
newPoints: Map<string,
|
|
22
|
+
newPoints: Map<string, FastShiftArray<OrdinalDatum>>;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Statistics for the chart. Holds the overall minimum and maximum (across all
|
|
@@ -26,11 +27,11 @@ export interface OrdinalChartData extends ChartData {
|
|
|
26
27
|
*/
|
|
27
28
|
export interface OrdinalStats {
|
|
28
29
|
/**
|
|
29
|
-
* The
|
|
30
|
+
* The data with the min time, and with the min value, over all the data so far
|
|
30
31
|
*/
|
|
31
32
|
minDatum: OrdinalDatumExtremum;
|
|
32
33
|
/**
|
|
33
|
-
* The
|
|
34
|
+
* The data with the max time, and with the max value, over all the data so far
|
|
34
35
|
*/
|
|
35
36
|
maxDatum: OrdinalDatumExtremum;
|
|
36
37
|
/**
|
|
@@ -38,6 +39,10 @@ export interface OrdinalStats {
|
|
|
38
39
|
*/
|
|
39
40
|
valueStatsForSeries: Map<string, OrdinalValueStats>;
|
|
40
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Statistics about the values of a series: the data with the min and max values, the number of
|
|
44
|
+
* values, their sum, the sum of their squares, and their mean
|
|
45
|
+
*/
|
|
41
46
|
export type OrdinalValueStats = {
|
|
42
47
|
min: OrdinalDatum;
|
|
43
48
|
max: OrdinalDatum;
|
|
@@ -46,30 +51,83 @@ export type OrdinalValueStats = {
|
|
|
46
51
|
sumSquared: number;
|
|
47
52
|
mean: number;
|
|
48
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* The data with the extreme (min or max) time, and with the extreme value
|
|
56
|
+
*/
|
|
49
57
|
export type OrdinalDatumExtremum = {
|
|
50
58
|
time: OrdinalDatum;
|
|
51
59
|
value: OrdinalDatum;
|
|
52
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* @return The datum to start a search for the min value from: its value (`Infinity`) is larger
|
|
63
|
+
* than any other
|
|
64
|
+
*/
|
|
53
65
|
export declare const initialMinValueDatum: () => OrdinalDatum;
|
|
66
|
+
/**
|
|
67
|
+
* @return The datum to start a search for the max value from: its value (`-Infinity`) is smaller
|
|
68
|
+
* than any other
|
|
69
|
+
*/
|
|
54
70
|
export declare const initialMaxValueDatum: () => OrdinalDatum;
|
|
71
|
+
/**
|
|
72
|
+
* @return The datum to start a search for the min time from: its time (`Infinity`) is later than
|
|
73
|
+
* any other
|
|
74
|
+
*/
|
|
55
75
|
export declare const initialMinTimeDatum: () => OrdinalDatum;
|
|
76
|
+
/**
|
|
77
|
+
* @return The datum to start a search for the max time from: its time (`-Infinity`) is earlier
|
|
78
|
+
* than any other
|
|
79
|
+
*/
|
|
56
80
|
export declare const initialMaxTimeDatum: () => OrdinalDatum;
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Copies an extremum (and its data)
|
|
83
|
+
* @param datum The extremum to copy
|
|
84
|
+
* @return The copy
|
|
85
|
+
*/
|
|
59
86
|
export declare function copyOrdinalDatumExtremum(datum: OrdinalDatumExtremum): OrdinalDatumExtremum;
|
|
87
|
+
/**
|
|
88
|
+
* @return Stats for no data: extremes to start the searches from, and no series' stats
|
|
89
|
+
*/
|
|
60
90
|
export declare const defaultOrdinalStats: () => OrdinalStats;
|
|
91
|
+
/**
|
|
92
|
+
* @return Value stats for no data: a count, sum, and sum of squares of 0, a `NaN` mean, and min
|
|
93
|
+
* and max data to start the searches from
|
|
94
|
+
*/
|
|
61
95
|
export declare const defaultOrdinalValueStats: () => OrdinalValueStats;
|
|
96
|
+
/**
|
|
97
|
+
* Copies a series' value stats (and their min and max data)
|
|
98
|
+
* @param data The value stats to copy
|
|
99
|
+
* @return The copy
|
|
100
|
+
*/
|
|
62
101
|
export declare function copyOrdinalValueStats(data: OrdinalValueStats): OrdinalValueStats;
|
|
102
|
+
/**
|
|
103
|
+
* Copies the map of each series' value stats (and the stats)
|
|
104
|
+
* @param valueStats The value stats, by series name
|
|
105
|
+
* @return The copy
|
|
106
|
+
*/
|
|
63
107
|
export declare function copyValueStatsForSeries(valueStats: Map<string, OrdinalValueStats>): Map<string, OrdinalValueStats>;
|
|
108
|
+
/**
|
|
109
|
+
* Copies the stats (the extremes, and each series' value stats)
|
|
110
|
+
* @param data The stats to copy
|
|
111
|
+
* @return The copy
|
|
112
|
+
*/
|
|
64
113
|
export declare const copyOrdinalStats: (data: OrdinalStats) => OrdinalStats;
|
|
65
114
|
/**
|
|
66
|
-
* Makes a
|
|
115
|
+
* Makes a copy of the ordinal chart data: a new set of series names, copies of the stats, and new
|
|
116
|
+
* arrays of points (the points themselves are shared)
|
|
67
117
|
* @param data The ordinal chart data to copy
|
|
118
|
+
* @return The copy
|
|
68
119
|
*/
|
|
69
120
|
export declare const copyOrdinalDataFrom: (data: OrdinalChartData) => OrdinalChartData;
|
|
70
121
|
/**
|
|
71
|
-
* Accepts a {@link TimeSeriesChartData} observable and converts it to an observable of {@link OrdinalChartData}
|
|
122
|
+
* Accepts a {@link TimeSeriesChartData} observable and converts it to an observable of {@link OrdinalChartData}:
|
|
123
|
+
* each emission holds the incoming chunk's points (as ordinal data), and the stats accumulated over
|
|
124
|
+
* all the data so far.
|
|
72
125
|
* @param dataObservable The observable over {@link TimeSeriesChartData}
|
|
126
|
+
* @param [compactingSize=DEFAULT_COMPACTING_SIZE] The number of shifts a series' backing array accumulates before it's compacted
|
|
127
|
+
* @param initialStats Optional stats of the data that already exists (e.g. a chart's accumulated
|
|
128
|
+
* series, see `calculateOrdinalStats`), from which the stats accumulate -- so that the stats cover
|
|
129
|
+
* that data without the data having to be re-emitted through `dataObservable`
|
|
73
130
|
* @return An observable of {@link OrdinalChartData} holding the series for the incoming chart data
|
|
74
131
|
*/
|
|
75
|
-
export declare function ordinalsObservable(dataObservable: Observable<TimeSeriesChartData
|
|
132
|
+
export declare function ordinalsObservable(dataObservable: Observable<TimeSeriesChartData>, compactingSize?: number, initialStats?: OrdinalStats): Observable<OrdinalChartData>;
|
|
133
|
+
//# sourceMappingURL=ordinals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ordinals.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/observables/ordinals.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;AAChC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAGvE,OAAO,EAAyC,KAAK,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAClH,OAAO,EAAC,KAAK,SAAS,EAAkC,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAGhD,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAC/C;;;OAGG;IACH,KAAK,EAAE,YAAY,CAAA;IAEnB;;;OAGG;IAEH,SAAS,EAAE,GAAG,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AiB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAIlH;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,YAAY,KAAG,YAIpD,CAAA;AAYF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,gBAAgB,KAAG,gBAK3D,CAAA;AAeF;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAC9B,cAAc,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAC/C,cAAc,GAAE,MAAgC,EAChD,YAAY,CAAC,EAAE,YAAY,GAC5B,UAAU,CAAC,gBAAgB,CAAC,CA4E9B"}
|
|
@@ -1,35 +1,65 @@
|
|
|
1
1
|
import { map, scan } from "rxjs/operators";
|
|
2
2
|
import { copyOrdinalDatum, nonEmptyOrdinalDatum, ordinalDatumOf } from "../series/ordinalSeries";
|
|
3
3
|
import { copyChartData, defaultChartData } from "./ChartData";
|
|
4
|
+
import { FastShiftArray } from "fast-shift-array";
|
|
5
|
+
import { DEFAULT_COMPACTING_SIZE } from "../series/baseSeries";
|
|
6
|
+
/**
|
|
7
|
+
* @return The datum to start a search for the min value from: its value (`Infinity`) is larger
|
|
8
|
+
* than any other
|
|
9
|
+
*/
|
|
4
10
|
export const initialMinValueDatum = () => ordinalDatumOf(NaN, "", Infinity);
|
|
11
|
+
/**
|
|
12
|
+
* @return The datum to start a search for the max value from: its value (`-Infinity`) is smaller
|
|
13
|
+
* than any other
|
|
14
|
+
*/
|
|
5
15
|
export const initialMaxValueDatum = () => ordinalDatumOf(NaN, "", -Infinity);
|
|
16
|
+
/**
|
|
17
|
+
* @return The datum to start a search for the min time from: its time (`Infinity`) is later than
|
|
18
|
+
* any other
|
|
19
|
+
*/
|
|
6
20
|
export const initialMinTimeDatum = () => ordinalDatumOf(Infinity, "", NaN);
|
|
21
|
+
/**
|
|
22
|
+
* @return The datum to start a search for the max time from: its time (`-Infinity`) is earlier
|
|
23
|
+
* than any other
|
|
24
|
+
*/
|
|
7
25
|
export const initialMaxTimeDatum = () => ordinalDatumOf(-Infinity, "", NaN);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export function isDefaultValueStatsDatum(datum) {
|
|
12
|
-
return isNaN(datum.time) && datum.ordinal === "" && isNaN(datum.value);
|
|
13
|
-
}
|
|
26
|
+
/**
|
|
27
|
+
* @return The extremum to start a search for the min time and value from
|
|
28
|
+
*/
|
|
14
29
|
const initialMinOrdinalDatum = () => ({
|
|
15
30
|
time: ordinalDatumOf(Infinity, "", NaN),
|
|
16
31
|
value: initialMinValueDatum()
|
|
17
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* @return The extremum to start a search for the max time and value from
|
|
35
|
+
*/
|
|
18
36
|
const initialMaxOrdinalDatum = () => ({
|
|
19
37
|
time: ordinalDatumOf(-Infinity, "", NaN),
|
|
20
38
|
value: initialMaxValueDatum()
|
|
21
39
|
});
|
|
40
|
+
/**
|
|
41
|
+
* Copies an extremum (and its data)
|
|
42
|
+
* @param datum The extremum to copy
|
|
43
|
+
* @return The copy
|
|
44
|
+
*/
|
|
22
45
|
export function copyOrdinalDatumExtremum(datum) {
|
|
23
46
|
return {
|
|
24
47
|
time: copyOrdinalDatum(datum.time),
|
|
25
48
|
value: copyOrdinalDatum(datum.value)
|
|
26
49
|
};
|
|
27
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @return Stats for no data: extremes to start the searches from, and no series' stats
|
|
53
|
+
*/
|
|
28
54
|
export const defaultOrdinalStats = () => ({
|
|
29
55
|
minDatum: initialMinOrdinalDatum(),
|
|
30
56
|
maxDatum: initialMaxOrdinalDatum(),
|
|
31
57
|
valueStatsForSeries: new Map()
|
|
32
58
|
});
|
|
59
|
+
/**
|
|
60
|
+
* @return Value stats for no data: a count, sum, and sum of squares of 0, a `NaN` mean, and min
|
|
61
|
+
* and max data to start the searches from
|
|
62
|
+
*/
|
|
33
63
|
export const defaultOrdinalValueStats = () => ({
|
|
34
64
|
min: initialMinValueDatum(),
|
|
35
65
|
max: initialMaxValueDatum(),
|
|
@@ -38,35 +68,90 @@ export const defaultOrdinalValueStats = () => ({
|
|
|
38
68
|
mean: NaN,
|
|
39
69
|
sumSquared: 0,
|
|
40
70
|
});
|
|
71
|
+
/**
|
|
72
|
+
* Copies a series' value stats (and their min and max data)
|
|
73
|
+
* @param data The value stats to copy
|
|
74
|
+
* @return The copy
|
|
75
|
+
*/
|
|
41
76
|
export function copyOrdinalValueStats(data) {
|
|
42
|
-
return
|
|
77
|
+
return {
|
|
78
|
+
...data,
|
|
79
|
+
min: copyOrdinalDatum(data.min),
|
|
80
|
+
max: copyOrdinalDatum(data.max),
|
|
81
|
+
};
|
|
43
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Copies the map of each series' value stats (and the stats)
|
|
85
|
+
* @param valueStats The value stats, by series name
|
|
86
|
+
* @return The copy
|
|
87
|
+
*/
|
|
44
88
|
export function copyValueStatsForSeries(valueStats) {
|
|
45
89
|
return new Map(Array.from(valueStats.entries())
|
|
46
90
|
.map(([seriesName, valueStats]) => [seriesName, copyOrdinalValueStats(valueStats)]));
|
|
47
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Copies the stats (the extremes, and each series' value stats)
|
|
94
|
+
* @param data The stats to copy
|
|
95
|
+
* @return The copy
|
|
96
|
+
*/
|
|
48
97
|
export const copyOrdinalStats = (data) => ({
|
|
49
98
|
minDatum: copyOrdinalDatumExtremum(data.minDatum),
|
|
50
99
|
maxDatum: copyOrdinalDatumExtremum(data.maxDatum),
|
|
51
100
|
valueStatsForSeries: copyValueStatsForSeries(data.valueStatsForSeries),
|
|
52
101
|
});
|
|
53
|
-
const emptyOrdinalData = () => (Object.assign(Object.assign({}, defaultChartData()), { stats: defaultOrdinalStats(), newPoints: new Map() }));
|
|
54
102
|
/**
|
|
55
|
-
*
|
|
103
|
+
* @return Ordinal chart data without any series or points, and with the default stats
|
|
104
|
+
*/
|
|
105
|
+
const emptyOrdinalData = () => ({
|
|
106
|
+
...defaultChartData(),
|
|
107
|
+
stats: defaultOrdinalStats(),
|
|
108
|
+
newPoints: new Map()
|
|
109
|
+
// newPoints: new Map<string, Array<OrdinalDatum>>()
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Makes a copy of the ordinal chart data: a new set of series names, copies of the stats, and new
|
|
113
|
+
* arrays of points (the points themselves are shared)
|
|
56
114
|
* @param data The ordinal chart data to copy
|
|
115
|
+
* @return The copy
|
|
57
116
|
*/
|
|
58
|
-
export const copyOrdinalDataFrom = (data) => (
|
|
59
|
-
|
|
117
|
+
export const copyOrdinalDataFrom = (data) => ({
|
|
118
|
+
...copyChartData(data),
|
|
119
|
+
stats: copyOrdinalStats(data.stats),
|
|
120
|
+
newPoints: new Map(Array.from(data.newPoints.entries()).map(([name, points]) => [name, points.slice()])),
|
|
121
|
+
// newPoints: new Map<string, Array<OrdinalDatum>>(Array.from(data.newPoints.entries()).map(([name, points]) => [name, points.slice()])),
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* @param initialStats Optional stats to start the accumulation from (see {@link ordinalsObservable})
|
|
125
|
+
* @return The initial accumulated chart data
|
|
126
|
+
*/
|
|
127
|
+
const initialAccumulate = (initialStats) => initialStats === undefined ?
|
|
128
|
+
emptyOrdinalData() :
|
|
129
|
+
{
|
|
130
|
+
...emptyOrdinalData(),
|
|
131
|
+
seriesNames: new Set(initialStats.valueStatsForSeries.keys()),
|
|
132
|
+
stats: copyOrdinalStats(initialStats)
|
|
133
|
+
};
|
|
60
134
|
/**
|
|
61
|
-
* Accepts a {@link TimeSeriesChartData} observable and converts it to an observable of {@link OrdinalChartData}
|
|
135
|
+
* Accepts a {@link TimeSeriesChartData} observable and converts it to an observable of {@link OrdinalChartData}:
|
|
136
|
+
* each emission holds the incoming chunk's points (as ordinal data), and the stats accumulated over
|
|
137
|
+
* all the data so far.
|
|
62
138
|
* @param dataObservable The observable over {@link TimeSeriesChartData}
|
|
139
|
+
* @param [compactingSize=DEFAULT_COMPACTING_SIZE] The number of shifts a series' backing array accumulates before it's compacted
|
|
140
|
+
* @param initialStats Optional stats of the data that already exists (e.g. a chart's accumulated
|
|
141
|
+
* series, see `calculateOrdinalStats`), from which the stats accumulate -- so that the stats cover
|
|
142
|
+
* that data without the data having to be re-emitted through `dataObservable`
|
|
63
143
|
* @return An observable of {@link OrdinalChartData} holding the series for the incoming chart data
|
|
64
144
|
*/
|
|
65
|
-
export function ordinalsObservable(dataObservable) {
|
|
145
|
+
export function ordinalsObservable(dataObservable, compactingSize = DEFAULT_COMPACTING_SIZE, initialStats) {
|
|
66
146
|
return dataObservable
|
|
67
147
|
.pipe(
|
|
68
|
-
// calculate the
|
|
69
|
-
|
|
148
|
+
// calculate the stats for each series in the chart data
|
|
149
|
+
//
|
|
150
|
+
// note: only the stats and the latest new points are accumulated -- the incoming points
|
|
151
|
+
// themselves aren't kept (the data source holds the series). A previous version also
|
|
152
|
+
// appended every incoming point to a map that nothing ever read, which grew without bound
|
|
153
|
+
// for as long as the stream ran (one point per series per tick).
|
|
154
|
+
scan((accumulated, current) => {
|
|
70
155
|
// make a deep copy of the accumulated data (because the accumulated data object
|
|
71
156
|
// holds references to maps)
|
|
72
157
|
const accum = copyOrdinalDataFrom(accumulated);
|
|
@@ -74,68 +159,62 @@ export function ordinalsObservable(dataObservable) {
|
|
|
74
159
|
Array
|
|
75
160
|
.from(current.newPoints.entries())
|
|
76
161
|
.forEach(([name, series]) => {
|
|
77
|
-
// grab the points from the previous incoming data and add the new
|
|
78
|
-
// data to the end of the previous data (when the updated data
|
|
79
|
-
// didn't yet exist, add it to the map holding the previous series)
|
|
80
|
-
const updated = (previous.get(name) || []);
|
|
81
|
-
if (updated.length === 0) {
|
|
82
|
-
previous.set(name, updated);
|
|
83
|
-
}
|
|
84
|
-
updated.push(...series);
|
|
85
162
|
// add the series name to the list of all
|
|
86
163
|
accum.seriesNames.add(name);
|
|
87
164
|
// calculate the max-time, min-time, max-value, and min-value for
|
|
88
165
|
// all the data series
|
|
89
|
-
series.forEach(({
|
|
166
|
+
series.forEach(({ x, y }) => {
|
|
90
167
|
// calculate the min and max times over all series
|
|
91
|
-
if (
|
|
92
|
-
accum.stats.minDatum.time = ordinalDatumOf(
|
|
168
|
+
if (x < accum.stats.minDatum.time.time) {
|
|
169
|
+
accum.stats.minDatum.time = ordinalDatumOf(x, name, y);
|
|
93
170
|
}
|
|
94
|
-
|
|
95
|
-
accum.stats.maxDatum.time = ordinalDatumOf(
|
|
171
|
+
if (x > accum.stats.maxDatum.time.time) {
|
|
172
|
+
accum.stats.maxDatum.time = ordinalDatumOf(x, name, y);
|
|
96
173
|
}
|
|
97
174
|
// calculate the min and max values over all series
|
|
98
|
-
if (
|
|
99
|
-
accum.stats.minDatum.value = ordinalDatumOf(
|
|
175
|
+
if (y < accum.stats.minDatum.value.value) {
|
|
176
|
+
accum.stats.minDatum.value = ordinalDatumOf(x, name, y);
|
|
100
177
|
}
|
|
101
|
-
|
|
102
|
-
accum.stats.maxDatum.value = ordinalDatumOf(
|
|
178
|
+
if (y > accum.stats.maxDatum.value.value) {
|
|
179
|
+
accum.stats.maxDatum.value = ordinalDatumOf(x, name, y);
|
|
103
180
|
}
|
|
104
181
|
// calculate the min, max of the time and value for each series
|
|
105
182
|
let valueStats = accum.stats.valueStatsForSeries.get(name) || defaultOrdinalValueStats();
|
|
106
|
-
const minValue = (
|
|
107
|
-
ordinalDatumOf(
|
|
183
|
+
const minValue = (y < valueStats.min.value) ?
|
|
184
|
+
ordinalDatumOf(x, name, y) :
|
|
108
185
|
copyOrdinalDatum(valueStats.min);
|
|
109
|
-
const maxValue = (
|
|
110
|
-
ordinalDatumOf(
|
|
186
|
+
const maxValue = (y > valueStats.max.value) ?
|
|
187
|
+
ordinalDatumOf(x, name, y) :
|
|
111
188
|
copyOrdinalDatum(valueStats.max);
|
|
112
189
|
const count = valueStats.count + 1;
|
|
113
|
-
const sum = valueStats.sum +
|
|
190
|
+
const sum = valueStats.sum + y;
|
|
114
191
|
valueStats = {
|
|
115
192
|
min: minValue,
|
|
116
193
|
max: maxValue,
|
|
117
194
|
count,
|
|
118
195
|
sum,
|
|
119
|
-
sumSquared: isNaN(valueStats.sumSquared) ?
|
|
196
|
+
sumSquared: isNaN(valueStats.sumSquared) ? y * y : valueStats.sumSquared + y * y,
|
|
120
197
|
mean: sum / count
|
|
121
198
|
};
|
|
122
199
|
accum.stats.valueStatsForSeries.set(name, valueStats);
|
|
123
200
|
});
|
|
124
201
|
// convert the new points to ordinal datum
|
|
125
|
-
accum.newPoints.set(name, series.map(({
|
|
202
|
+
accum.newPoints.set(name, FastShiftArray.fromArray(series.map(({ x, y }) => ordinalDatumOf(x, name, y)), true, compactingSize));
|
|
203
|
+
// accum.newPoints.set(name, series.map(({x, y}: Datum) => ordinalDatumOf(x, name, y)))
|
|
126
204
|
});
|
|
127
|
-
return
|
|
128
|
-
}, initialAccumulate()),
|
|
205
|
+
return accum;
|
|
206
|
+
}, initialAccumulate(initialStats)),
|
|
129
207
|
// remove new points from the map that are empty
|
|
130
|
-
map(
|
|
208
|
+
map(accumulated => removeEmptyNewPoints(accumulated)));
|
|
131
209
|
}
|
|
132
|
-
|
|
210
|
+
/**
|
|
211
|
+
* @param data The ordinal chart data
|
|
212
|
+
* @return A copy of the chart data, without any empty new points
|
|
213
|
+
*/
|
|
214
|
+
function removeEmptyNewPoints(data) {
|
|
133
215
|
const newPoints = new Map(Array
|
|
134
|
-
.from(
|
|
216
|
+
.from(data.newPoints.entries())
|
|
135
217
|
.map(([name, points]) => [name, points.filter(point => nonEmptyOrdinalDatum(point))]));
|
|
136
|
-
return {
|
|
137
|
-
previous: accum.previous,
|
|
138
|
-
accumulated: Object.assign(Object.assign({}, accum.accumulated), { newPoints })
|
|
139
|
-
};
|
|
218
|
+
return { ...data, newPoints };
|
|
140
219
|
}
|
|
141
220
|
//# sourceMappingURL=ordinals.js.map
|