stream-charts 1.2.0 → 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 +40 -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
package/src/app/charts/utils.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {Dimensions, Margin} from "./styling/margins"
|
|
1
|
+
import type {Dimensions, Margin} from "./styling/margins"
|
|
2
2
|
import * as d3 from "d3";
|
|
3
|
-
import {Selection} from "d3";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* No operation function for use when a default function is needed
|
|
@@ -14,7 +13,7 @@ export const noop = () => {
|
|
|
14
13
|
* @param x The x-coordinate of the mouse's position
|
|
15
14
|
* @param y The y-coordinate of the mouse's position
|
|
16
15
|
* @param margin The plot margins
|
|
17
|
-
* @param dimensions The
|
|
16
|
+
* @param dimensions The overall dimensions (plot dimensions plus margin)
|
|
18
17
|
* @return `true` if the mouse is in the plot area; `false` if the mouse is not in the plot area
|
|
19
18
|
*/
|
|
20
19
|
export function mouseInPlotAreaFor(x: number, y: number, margin: Margin, dimensions: Dimensions): boolean {
|
|
@@ -25,85 +24,128 @@ export function mouseInPlotAreaFor(x: number, y: number, margin: Margin, dimensi
|
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @return The width in pixels, or 0 if SVG text element has not children
|
|
31
|
-
*/
|
|
32
|
-
export function textWidthOf(elem: Selection<SVGTextElement, any, any, any>): number {
|
|
33
|
-
return elem.node()?.getBBox()?.width || 0
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Type for representing the dimensions and location of the bounding box for an
|
|
38
|
-
* SVG text element.
|
|
27
|
+
* The dimensions (and location) of a text's bounding box. `x`/`y` are always `0` for canvas
|
|
28
|
+
* text, which `measureText` measures from its own origin.
|
|
39
29
|
*/
|
|
40
30
|
export type BoundingBox = { x: number, y: number, width: number, height: number }
|
|
41
31
|
|
|
42
32
|
/**
|
|
43
|
-
*
|
|
33
|
+
* Measures the width and height (its ascent plus descent) of `text` as it would be rendered with
|
|
34
|
+
* the font currently set on the context.
|
|
35
|
+
* @param context The canvas 2D context; its `.font` must already be set to the font to measure with
|
|
36
|
+
* @param text The text to measure
|
|
37
|
+
* @return The bounding box for the text (`x`/`y` are always `0`)
|
|
44
38
|
*/
|
|
45
|
-
export function
|
|
46
|
-
|
|
39
|
+
export function textDimensions(context: CanvasRenderingContext2D, text: string): BoundingBox {
|
|
40
|
+
const metrics = context.measureText(text)
|
|
41
|
+
const ascent = metrics.actualBoundingBoxAscent ?? metrics.fontBoundingBoxAscent ?? 0
|
|
42
|
+
const descent = metrics.actualBoundingBoxDescent ?? metrics.fontBoundingBoxDescent ?? 0
|
|
43
|
+
return {
|
|
44
|
+
x: 0,
|
|
45
|
+
y: 0,
|
|
46
|
+
width: metrics.width || 0,
|
|
47
|
+
height: ascent + descent
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param
|
|
52
|
-
* @
|
|
52
|
+
* Builds a CSS font shorthand string suitable for assigning to `ctx.font`.
|
|
53
|
+
* @param size The font size, in pixels
|
|
54
|
+
* @param family The font family (e.g. `'sans-serif'`)
|
|
55
|
+
* @param weight The font weight (e.g. `300`)
|
|
56
|
+
* @return The font string (e.g. `"300 12px sans-serif"`)
|
|
53
57
|
*/
|
|
54
|
-
export function
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
width: boundingBox?.width || 0,
|
|
58
|
-
height: boundingBox?.height || 0,
|
|
59
|
-
x: boundingBox?.x || 0,
|
|
60
|
-
y: boundingBox?.y || 0
|
|
61
|
-
}
|
|
58
|
+
export function fontStringFor(size: number, family: string, weight: number): string {
|
|
59
|
+
return `${weight} ${size}px ${family}`
|
|
62
60
|
}
|
|
63
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Formats a number with a d3 format specifier
|
|
64
|
+
* @param value The number
|
|
65
|
+
* @param format The d3 format specifier (e.g. `" ,.3f"`)
|
|
66
|
+
* @return The formatted number, or `"---"` when the number is `NaN`
|
|
67
|
+
*/
|
|
64
68
|
export function formatNumber(value: number, format: string): string {
|
|
65
69
|
return isNaN(value) ? '---' : d3.format(format)(value)
|
|
66
70
|
}
|
|
67
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Formats a time as a whole number, with thousands separators, followed by the units
|
|
74
|
+
* @param value The time
|
|
75
|
+
* @param [units=""] The units (e.g. `"ms"`), appended after a space (unless the time is `NaN`)
|
|
76
|
+
* @return The formatted time, or `"---"` when the time is `NaN`
|
|
77
|
+
*/
|
|
68
78
|
export function formatTime(value: number, units: string = ""): string {
|
|
69
79
|
return `${formatNumber(value, " ,.0f")}${!isNaN(value) && units ? ` ${units}` : ""}`
|
|
70
80
|
}
|
|
71
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Formats a value with three decimal places, and thousands separators
|
|
84
|
+
* @param value The value
|
|
85
|
+
* @return The formatted value, or `"---"` when the value is `NaN`
|
|
86
|
+
*/
|
|
72
87
|
export function formatValue(value: number): string {
|
|
73
88
|
return formatNumber(value, " ,.3f")
|
|
74
89
|
}
|
|
75
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Formats the change from one number to another (`v2 - v1`) with a d3 format specifier
|
|
93
|
+
* @param v1 The number before
|
|
94
|
+
* @param v2 The number after
|
|
95
|
+
* @param format The d3 format specifier (e.g. `" ,.3f"`)
|
|
96
|
+
* @return The formatted change, or `"---"` when either number is `NaN`
|
|
97
|
+
*/
|
|
76
98
|
export function formatChange(v1: number, v2: number, format: string): string {
|
|
77
99
|
return isNaN(v1) || isNaN(v2) ? '---' : d3.format(format)(v2 - v1)
|
|
78
100
|
}
|
|
79
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Formats the change from one time to another (`v2 - v1`) as a whole number, with thousands separators
|
|
104
|
+
* @param v1 The time before
|
|
105
|
+
* @param v2 The time after
|
|
106
|
+
* @return The formatted change, or `"---"` when either time is `NaN`
|
|
107
|
+
*/
|
|
80
108
|
export function formatTimeChange(v1: number, v2: number): string {
|
|
81
109
|
return formatChange(v1, v2, " ,.0f")
|
|
82
110
|
}
|
|
83
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Formats the change from one value to another (`v2 - v1`) with three decimal places, and
|
|
114
|
+
* thousands separators
|
|
115
|
+
* @param v1 The value before
|
|
116
|
+
* @param v2 The value after
|
|
117
|
+
* @return The formatted change, or `"---"` when either value is `NaN`
|
|
118
|
+
*/
|
|
84
119
|
export function formatValueChange(v1: number, v2: number): string {
|
|
85
120
|
return formatChange(v1, v2, " ,.3f")
|
|
86
121
|
}
|
|
87
122
|
|
|
88
123
|
/**
|
|
89
|
-
*
|
|
90
|
-
* (
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* @
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
minMaxOf((datum: [number, number]): number => datum[1])
|
|
124
|
+
* Finds the index of the first element whose x-value (per `xFrom`) is `>= value`, in a
|
|
125
|
+
* time-ordered (ascending) array-like collection, via binary search. Used to cheaply skip
|
|
126
|
+
* retained-but-off-screen data before doing per-point work (scaling, segment building) in a
|
|
127
|
+
* plot's draw function -- retained data (governed by `dropDataAfter`) is often much larger than
|
|
128
|
+
* what's actually visible in the current axis domain (a scrolling window), so iterating the full
|
|
129
|
+
* retained array every frame does a lot of work whose result is immediately discarded as
|
|
130
|
+
* off-screen. Finding the visible slice's start index up front makes per-frame cost scale with
|
|
131
|
+
* what's on screen, not with how much history is retained.
|
|
132
|
+
* @param data An array-like collection (supports `.length` and index access), sorted ascending by `xFrom`
|
|
133
|
+
* @param value The x-value to search for
|
|
134
|
+
* @param xFrom A function that extracts the x-value from an element
|
|
135
|
+
* @return The index of the first element with `xFrom(element) >= value`, or `data.length` if
|
|
136
|
+
* every element is before `value`
|
|
137
|
+
* @template D The type of the elements in `data`
|
|
104
138
|
*/
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
139
|
+
export function firstIndexAtOrAfter<D>(data: {length: number, [index: number]: D}, value: number, xFrom: (datum: D) => number): number {
|
|
140
|
+
let lo = 0
|
|
141
|
+
let hi = data.length
|
|
142
|
+
while (lo < hi) {
|
|
143
|
+
const mid = (lo + hi) >>> 1
|
|
144
|
+
if (xFrom(data[mid]) < value) {
|
|
145
|
+
lo = mid + 1
|
|
146
|
+
} else {
|
|
147
|
+
hi = mid
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return lo
|
|
151
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,322 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
type AxisElementSelection,
|
|
5
|
-
type SvgSelection,
|
|
6
|
-
type GSelection,
|
|
7
|
-
type LineSelection,
|
|
8
|
-
type TextSelection,
|
|
9
|
-
type RadialMagnifierSelection,
|
|
10
|
-
type BarMagnifierSelection,
|
|
11
|
-
type MagnifierTextSelection,
|
|
12
|
-
type TrackerSelection
|
|
13
|
-
} from './app/charts/d3types'
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
noop,
|
|
17
|
-
mouseInPlotAreaFor,
|
|
18
|
-
textWidthOf,
|
|
19
|
-
textDimensions,
|
|
20
|
-
formatNumber, formatTime, formatValue, formatChange, formatTimeChange, formatValueChange,
|
|
21
|
-
minMaxOf
|
|
22
|
-
} from './app/charts/utils'
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
// axes
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
type AxisTickStyle, defaultAxisTickStyle,
|
|
30
|
-
type AxesFont, defaultAxesFont,
|
|
31
|
-
type SeriesStyle,
|
|
32
|
-
type SeriesLineStyle, defaultLineStyle,
|
|
33
|
-
type BaseAxis, type ContinuousNumericAxis, type OrdinalStringAxis,
|
|
34
|
-
AxisLocation,
|
|
35
|
-
addOrdinalStringAxis,
|
|
36
|
-
labelIdFor,
|
|
37
|
-
type ZoomResult,
|
|
38
|
-
calculateOrdinalConstrainedZoomFor, calculateConstrainedZoomFor,
|
|
39
|
-
ordinalAxisZoomHandler, axesZoomHandler,
|
|
40
|
-
calculatePanFor, panHandler, panHandler2D,
|
|
41
|
-
axesForSeriesGen,
|
|
42
|
-
continuousAxisRanges, continuousAxisIntervals, continuousRange
|
|
43
|
-
} from './app/charts/axes/axes'
|
|
44
|
-
|
|
45
|
-
export {AxisInterval} from './app/charts/axes/AxisInterval'
|
|
46
|
-
|
|
47
|
-
export {
|
|
48
|
-
ContinuousAxis,
|
|
49
|
-
} from './app/charts/axes/ContinuousAxis'
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
type ContinuousAxisRange,
|
|
53
|
-
} from './app/charts/axes/ContinuousAxisRange'
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
OrdinalAxis,
|
|
57
|
-
} from './app/charts/axes/OrdinalAxis'
|
|
58
|
-
|
|
59
|
-
export {
|
|
60
|
-
type OrdinalAxisRange,
|
|
61
|
-
} from './app/charts/axes/OrdinalAxisRange'
|
|
62
|
-
|
|
63
|
-
export {
|
|
64
|
-
EmptyAxis,
|
|
65
|
-
} from './app/charts/axes/EmptyAxis'
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
// filters
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
export {
|
|
72
|
-
regexFilter
|
|
73
|
-
} from './app/charts/filters/regexFilter'
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
// hooks
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
export {
|
|
80
|
-
type AxesState,
|
|
81
|
-
} from './app/charts/axes/AxesState'
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
useAxes,
|
|
85
|
-
type UseAxesValues, defaultAxesValues,
|
|
86
|
-
} from './app/charts/hooks/useAxes'
|
|
87
|
-
|
|
88
|
-
export {
|
|
89
|
-
useChart,
|
|
90
|
-
type NoTooltipMetadata,
|
|
91
|
-
type UseChartValues,
|
|
92
|
-
} from './app/charts/hooks/useChart'
|
|
93
|
-
|
|
94
|
-
export {
|
|
95
|
-
useDataObservable,
|
|
96
|
-
type UseObservableValues,
|
|
97
|
-
} from './app/charts/hooks/useDataObservable'
|
|
98
|
-
|
|
99
|
-
export {
|
|
100
|
-
useInitialData,
|
|
101
|
-
type UseInitialDataValues,
|
|
102
|
-
} from './app/charts/hooks/useInitialData'
|
|
103
|
-
|
|
104
|
-
export {
|
|
105
|
-
useMouse,
|
|
106
|
-
type UseMouseValues, defaultMouseValues,
|
|
107
|
-
} from './app/charts/hooks/useMouse'
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
usePlotDimensions,
|
|
111
|
-
type UsePlotDimensionsValues, defaultPlotDimensions,
|
|
112
|
-
defaultMargin,
|
|
113
|
-
} from './app/charts/hooks/usePlotDimensions'
|
|
114
|
-
|
|
115
|
-
export {
|
|
116
|
-
useTooltip,
|
|
117
|
-
type UseTooltipValues, defaultTooltipValues,
|
|
118
|
-
type TooltipData,
|
|
119
|
-
type TooltipContentProvider,
|
|
120
|
-
} from './app/charts/hooks/useTooltip'
|
|
121
|
-
|
|
122
|
-
//
|
|
123
|
-
// observables
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
type ChartData, defaultChartData,
|
|
129
|
-
copyChartData
|
|
130
|
-
} from './app/charts/observables/ChartData'
|
|
131
|
-
|
|
132
|
-
export {
|
|
133
|
-
type IterateChartData,
|
|
134
|
-
copyIterateDataFrom,
|
|
135
|
-
iteratesObservable
|
|
136
|
-
} from './app/charts/observables/iterates'
|
|
137
|
-
|
|
138
|
-
export {
|
|
139
|
-
ordinalsObservable,
|
|
140
|
-
type OrdinalChartData,
|
|
141
|
-
type OrdinalStats, defaultOrdinalStats,
|
|
142
|
-
type OrdinalValueStats, defaultOrdinalValueStats,
|
|
143
|
-
type OrdinalDatumExtremum,
|
|
144
|
-
initialMinValueDatum, initialMaxValueDatum,
|
|
145
|
-
initialMinTimeDatum, initialMaxTimeDatum,
|
|
146
|
-
valueStatusDatumOfDefault,
|
|
147
|
-
isDefaultValueStatsDatum,
|
|
148
|
-
copyOrdinalDataFrom, copyOrdinalStats, copyOrdinalValueStats,
|
|
149
|
-
copyValueStatsForSeries, copyOrdinalDatumExtremum,
|
|
150
|
-
} from './app/charts/observables/ordinals'
|
|
151
|
-
|
|
152
|
-
//
|
|
153
|
-
// plots
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
export {
|
|
157
|
-
type Series,
|
|
158
|
-
createPlotContainer,
|
|
159
|
-
type AxesAssignment,
|
|
160
|
-
setClipPathG,
|
|
161
|
-
assignAxes
|
|
162
|
-
} from './app/charts/plots/plot'
|
|
163
|
-
|
|
164
|
-
export {
|
|
165
|
-
BarPlot,
|
|
166
|
-
} from './app/charts/plots/BarPlot'
|
|
167
|
-
|
|
168
|
-
export {
|
|
169
|
-
NoCurveFactory,
|
|
170
|
-
PoincarePlot,
|
|
171
|
-
} from './app/charts/plots/PoincarePlot'
|
|
172
|
-
|
|
173
|
-
export {
|
|
174
|
-
RasterPlot,
|
|
175
|
-
} from './app/charts/plots/RasterPlot'
|
|
176
|
-
|
|
177
|
-
export {
|
|
178
|
-
ScatterPlot,
|
|
179
|
-
} from './app/charts/plots/ScatterPlot'
|
|
180
|
-
|
|
181
|
-
//
|
|
182
|
-
// series
|
|
183
|
-
//
|
|
184
|
-
export {
|
|
185
|
-
type BaseSeries,
|
|
186
|
-
seriesFrom,
|
|
187
|
-
emptySeries,
|
|
188
|
-
emptySeriesFor
|
|
189
|
-
} from './app/charts/series/baseSeries'
|
|
190
|
-
|
|
191
|
-
export {
|
|
192
|
-
type IterateDatum, emptyIterateDatum, iterateDatumOf, nonEmptyIterateDatum,
|
|
193
|
-
type IterateSeries,
|
|
194
|
-
iterateSeriesFromTuples,
|
|
195
|
-
} from './app/charts/series/iterateSeries'
|
|
196
|
-
|
|
197
|
-
export {
|
|
198
|
-
type OrdinalDatum, emptyOrdinalDatum, copyOrdinalDatum, ordinalDatumOf, nonEmptyOrdinalDatum,
|
|
199
|
-
type OrdinalSeries,
|
|
200
|
-
ordinateSeriesFromTuples,
|
|
201
|
-
initialOrdinalChartData,
|
|
202
|
-
} from './app/charts/series/ordinalSeries'
|
|
203
|
-
|
|
204
|
-
export {
|
|
205
|
-
type TimeSeriesChartData,
|
|
206
|
-
emptyTimeSeriesChartData,
|
|
207
|
-
initialTimeSeriesChartData,
|
|
208
|
-
} from './app/charts/series/timeSeriesChartData'
|
|
209
|
-
|
|
210
|
-
export {
|
|
211
|
-
type Datum,
|
|
212
|
-
datumOf,
|
|
213
|
-
emptyDatum,
|
|
214
|
-
type TimeSeries,
|
|
215
|
-
timeSeriesFromTuples,
|
|
216
|
-
type PixelDatum
|
|
217
|
-
} from './app/charts/series/timeSeries'
|
|
218
|
-
|
|
219
|
-
//
|
|
220
|
-
// styling
|
|
221
|
-
//
|
|
222
|
-
|
|
223
|
-
export {
|
|
224
|
-
type BarSeriesStyle, type BarStyle, type LineStyle,
|
|
225
|
-
defaultBarSeriesStyle,
|
|
226
|
-
defaultMinMaxBarStyle, defaultWindowedMinMaxBarStyle, defaultWindowedMeanValueLineStyle,
|
|
227
|
-
defaultValueLineStyle, defaultMeanValueLineStyle
|
|
228
|
-
} from './app/charts/styling/barPlotStyle'
|
|
229
|
-
|
|
230
|
-
export {
|
|
231
|
-
type Margin,
|
|
232
|
-
noMargins,
|
|
233
|
-
type Dimensions,
|
|
234
|
-
plotDimensionsFrom, containerDimensionsFrom
|
|
235
|
-
} from './app/charts/styling/margins'
|
|
236
|
-
|
|
237
|
-
export {
|
|
238
|
-
type SvgStyle, initialSvgStyle,
|
|
239
|
-
grabWidth, grabHeight,
|
|
240
|
-
type SvgStrokeStyle,
|
|
241
|
-
STROKE_COLOR, STROKE_WIDTH, STROKE_OPACITY,
|
|
242
|
-
updateSvgStrokeColor, updateSvgStrokeWidth, updateSvgStrokeOpacity, applyStrokeStylesTo,
|
|
243
|
-
type SvgFillStyle,
|
|
244
|
-
updateSvgFillColor, updateSvgFillOpacity, applyFillStylesTo
|
|
245
|
-
|
|
246
|
-
} from './app/charts/styling/svgStyle'
|
|
247
|
-
|
|
248
|
-
//
|
|
249
|
-
// subscriptions
|
|
250
|
-
//
|
|
251
|
-
|
|
252
|
-
export {
|
|
253
|
-
TimeWindowBehavior,
|
|
254
|
-
subscriptionTimeSeriesFor, subscriptionTimeSeriesWithCadenceFor,
|
|
255
|
-
subscriptionIteratesFor,
|
|
256
|
-
type WindowedOrdinalStats,
|
|
257
|
-
subscriptionOrdinalXFor
|
|
258
|
-
} from './app/charts/subscriptions/subscriptions'
|
|
259
|
-
|
|
260
|
-
//
|
|
261
|
-
// tooltips
|
|
262
|
-
//
|
|
263
|
-
|
|
264
|
-
export {
|
|
265
|
-
BarPlotTooltipContent,
|
|
266
|
-
} from './app/charts/tooltips/BarPlotTooltipContent'
|
|
267
|
-
|
|
268
|
-
export {
|
|
269
|
-
PoincarePlotTooltipContent,
|
|
270
|
-
} from './app/charts/tooltips/PoincarePlotTooltipContent'
|
|
271
|
-
|
|
272
|
-
export {
|
|
273
|
-
RasterPlotTooltipContent,
|
|
274
|
-
} from './app/charts/tooltips/RasterPlotTooltipContent'
|
|
275
|
-
|
|
276
|
-
export {
|
|
277
|
-
ScatterPlotTooltipContent,
|
|
278
|
-
} from './app/charts/tooltips/ScatterPlotTooltipContent'
|
|
279
|
-
|
|
280
|
-
export {
|
|
281
|
-
Tooltip,
|
|
282
|
-
} from './app/charts/tooltips/Tooltip'
|
|
283
|
-
|
|
284
|
-
export {
|
|
285
|
-
type TooltipStyle, defaultTooltipStyle,
|
|
286
|
-
type TooltipDimensions,
|
|
287
|
-
removeTooltip,
|
|
288
|
-
tooltipX, tooltipY,
|
|
289
|
-
categoryTooltipY,
|
|
290
|
-
boundingPoints,
|
|
291
|
-
findPointAndNeighbors
|
|
292
|
-
} from './app/charts/tooltips/tooltipUtils'
|
|
293
|
-
|
|
294
|
-
//
|
|
295
|
-
// trackers
|
|
296
|
-
//
|
|
297
|
-
|
|
298
|
-
export {
|
|
299
|
-
type TrackerAxisInfo,
|
|
300
|
-
type TrackerAxisUpdate,
|
|
301
|
-
TrackerLabelLocation,
|
|
302
|
-
Tracker,
|
|
303
|
-
} from './app/charts/trackers/Tracker'
|
|
304
|
-
|
|
305
|
-
export {
|
|
306
|
-
type TrackerLabelFont, defaultTrackerLabelFont,
|
|
307
|
-
type TrackerStyle, defaultTrackerStyle,
|
|
308
|
-
trackerControlInstance,
|
|
309
|
-
removeTrackerControl,
|
|
310
|
-
} from './app/charts/trackers/trackerUtils'
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
//
|
|
314
|
-
// legend
|
|
315
|
-
//
|
|
316
|
-
|
|
317
|
-
export {
|
|
318
|
-
Legend,
|
|
319
|
-
defaultLegendStyle,
|
|
320
|
-
LegendLocation,
|
|
321
|
-
type LegendStyle
|
|
322
|
-
} from './app/charts/legends/Legend'
|
|
1
|
+
// the public API lives in app/charts/index.ts
|
|
2
|
+
export * from './app/charts'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AxesState } from "./AxesState";
|
|
2
|
-
import { AxisLocation } from "./axes";
|
|
3
|
-
describe('AxesState', () => {
|
|
4
|
-
describe('creating axes-state', () => {
|
|
5
|
-
it('should create an empty axes state', () => {
|
|
6
|
-
expect(AxesState.empty().isEmpty()).toBe(true);
|
|
7
|
-
});
|
|
8
|
-
it('should create an axes state with one axis', () => {
|
|
9
|
-
const axis = {
|
|
10
|
-
axisId: 'new-axis',
|
|
11
|
-
location: AxisLocation.Bottom,
|
|
12
|
-
selection: undefined
|
|
13
|
-
};
|
|
14
|
-
const axesState = AxesState.from(new Map([['new-added-axis', axis]]));
|
|
15
|
-
expect(axesState.isEmpty()).toBe(false);
|
|
16
|
-
});
|
|
17
|
-
it('should be able to start with an empty axes state and add to it', () => {
|
|
18
|
-
const axesState = AxesState.empty();
|
|
19
|
-
expect(axesState.isEmpty()).toBe(true);
|
|
20
|
-
const axis = {
|
|
21
|
-
axisId: 'new-axis',
|
|
22
|
-
location: AxisLocation.Bottom,
|
|
23
|
-
selection: undefined
|
|
24
|
-
};
|
|
25
|
-
const updatedAxesState = axesState.addAxis(axis, 'new-added-axis');
|
|
26
|
-
expect(updatedAxesState.isEmpty()).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=AxesState.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AxesState.test.js","sourceRoot":"","sources":["../../../../src/app/charts/axes/AxesState.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,YAAY,EAAW,MAAM,QAAQ,CAAC;AAG9C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACvB,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YACzC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAY,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACjD,MAAM,IAAI,GAAa;gBACnB,MAAM,EAAE,UAAU;gBAClB,QAAQ,EAAE,YAAY,CAAC,MAAM;gBAC7B,SAAS,EAAE,SAA4C;aAC1D,CAAA;YACD,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAW,IAAI,GAAG,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAChF,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACtE,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,EAAY,CAAC;YAC9C,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEvC,MAAM,IAAI,GAAa;gBACnB,MAAM,EAAE,UAAU;gBAClB,QAAQ,EAAE,YAAY,CAAC,MAAM;gBAC7B,SAAS,EAAE,SAA4C;aAC1D,CAAA;YACD,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YACnE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { AxisInterval, copyRangeMap } from "./AxisInterval";
|
|
2
|
-
describe('AxisInterval', () => {
|
|
3
|
-
describe('AxisInterval creation', () => {
|
|
4
|
-
it('should create an AxisInterval with valid start and end values', () => {
|
|
5
|
-
const interval = AxisInterval.from(1, 5);
|
|
6
|
-
expect(interval.start).toBe(1);
|
|
7
|
-
expect(interval.end).toBe(5);
|
|
8
|
-
});
|
|
9
|
-
it('should create an AxisInterval with correct start and end when the start is greater than the end', () => {
|
|
10
|
-
const interval = AxisInterval.from(5, 1);
|
|
11
|
-
expect(interval.start).toBe(1);
|
|
12
|
-
expect(interval.end).toBe(5);
|
|
13
|
-
});
|
|
14
|
-
it('should create an AxisInterval from a tuple holding start and end values', () => {
|
|
15
|
-
const interval = AxisInterval.as([1, 5]);
|
|
16
|
-
expect(interval.start).toBe(1);
|
|
17
|
-
expect(interval.end).toBe(5);
|
|
18
|
-
});
|
|
19
|
-
it('should create an empty AxisInterval', () => {
|
|
20
|
-
const interval = AxisInterval.empty();
|
|
21
|
-
expect(interval.start).toBeNaN();
|
|
22
|
-
expect(interval.end).toBeNaN();
|
|
23
|
-
});
|
|
24
|
-
it('should create an empty AxisInterval with start and end NaN', () => {
|
|
25
|
-
const interval = AxisInterval.from(NaN, NaN);
|
|
26
|
-
expect(interval.start).toBeNaN();
|
|
27
|
-
expect(interval.end).toBeNaN();
|
|
28
|
-
});
|
|
29
|
-
it('should create a new copy of an existing AxisInterval', () => {
|
|
30
|
-
const interval = AxisInterval.from(1, 5);
|
|
31
|
-
const copy = interval.copy();
|
|
32
|
-
expect(copy.start).toBe(1);
|
|
33
|
-
expect(copy.end).toBe(5);
|
|
34
|
-
expect(copy).not.toBe(interval);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
describe('AxisInterval comparison', () => {
|
|
38
|
-
const interval1 = AxisInterval.from(1, 5);
|
|
39
|
-
const interval2 = AxisInterval.from(1, 5);
|
|
40
|
-
const interval3 = AxisInterval.from(2, 5);
|
|
41
|
-
const emptyInterval = AxisInterval.empty();
|
|
42
|
-
it('should return true when comparing two AxisIntervals with the same start and end values', () => {
|
|
43
|
-
expect(interval1.equals(interval2)).toBe(true);
|
|
44
|
-
expect(interval1.equalsInterval(1, 5)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
it('should return not-equal when comparing two AxisIntervals with different start and end values', () => {
|
|
47
|
-
expect(interval1.equals(interval3)).toBe(false);
|
|
48
|
-
expect(interval1.equalsInterval(1, 3)).toBe(false);
|
|
49
|
-
});
|
|
50
|
-
it('should return true when comparing two empty intervals', () => {
|
|
51
|
-
expect(AxisInterval.empty().equals(emptyInterval)).toBe(true);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
describe('AxisInterval conversion', () => {
|
|
55
|
-
it('should convert an AxisInterval to a tuple', () => {
|
|
56
|
-
const interval = AxisInterval.from(1, 5);
|
|
57
|
-
const tuple = interval.asTuple();
|
|
58
|
-
expect(tuple).toEqual([1, 5]);
|
|
59
|
-
});
|
|
60
|
-
it('should map an AxisInterval to a new AxisInterval', () => {
|
|
61
|
-
const interval = AxisInterval.from(1, 5);
|
|
62
|
-
const mappedInterval = interval.map((start, end) => ([start * 2, end * 3]));
|
|
63
|
-
expect(mappedInterval.start).toBe(2);
|
|
64
|
-
expect(mappedInterval.end).toBe(15);
|
|
65
|
-
expect(mappedInterval).not.toBe(interval);
|
|
66
|
-
});
|
|
67
|
-
it('should calculate the measure of an AxisInterval', () => {
|
|
68
|
-
const interval = AxisInterval.from(1, 5);
|
|
69
|
-
expect(interval.measure()).toBe(4);
|
|
70
|
-
});
|
|
71
|
-
it('should calculate the measure of an empty AxisInterval', () => {
|
|
72
|
-
const interval = AxisInterval.empty();
|
|
73
|
-
expect(interval.measure()).toBe(0);
|
|
74
|
-
});
|
|
75
|
-
it('should translate the start of the AxisInterval', () => {
|
|
76
|
-
const interval = AxisInterval.from(1, 5);
|
|
77
|
-
const translatedInterval = interval.translateStart(12);
|
|
78
|
-
expect(translatedInterval.start).toBe(5);
|
|
79
|
-
expect(translatedInterval.end).toBe(13);
|
|
80
|
-
expect(translatedInterval).not.toBe(interval);
|
|
81
|
-
});
|
|
82
|
-
it('should translate the start of an empty interval into an empty interval', () => {
|
|
83
|
-
expect(AxisInterval.empty().translateStart(12)).toEqual(AxisInterval.empty());
|
|
84
|
-
});
|
|
85
|
-
it('should translate the end of the AxisInterval', () => {
|
|
86
|
-
const interval = AxisInterval.from(1, 5);
|
|
87
|
-
const translatedInterval = interval.translateEnd(-12);
|
|
88
|
-
expect(translatedInterval.start).toBe(-7);
|
|
89
|
-
expect(translatedInterval.end).toBe(1);
|
|
90
|
-
expect(translatedInterval).not.toBe(interval);
|
|
91
|
-
});
|
|
92
|
-
it('should translate the end of an empty interval into an empty interval', () => {
|
|
93
|
-
expect(AxisInterval.empty().translateEnd(12)).toEqual(AxisInterval.empty());
|
|
94
|
-
});
|
|
95
|
-
it('should translate an AxisInterval', () => {
|
|
96
|
-
const interval = AxisInterval.from(1, 5);
|
|
97
|
-
const translatedInterval = interval.translate(-12);
|
|
98
|
-
expect(translatedInterval.start).toBe(-11);
|
|
99
|
-
expect(translatedInterval.end).toBe(-7);
|
|
100
|
-
expect(translatedInterval).not.toBe(interval);
|
|
101
|
-
});
|
|
102
|
-
it('should translate an empty interval into an empty interval', () => {
|
|
103
|
-
expect(AxisInterval.empty().translate(12)).toEqual(AxisInterval.empty());
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
describe('Copy a range map', () => {
|
|
107
|
-
it('should create a copy of a range map', () => {
|
|
108
|
-
const ranges = new Map([
|
|
109
|
-
['a', AxisInterval.from(1, 5)],
|
|
110
|
-
['b', AxisInterval.from(10, 20)]
|
|
111
|
-
]);
|
|
112
|
-
const copy = copyRangeMap(ranges);
|
|
113
|
-
expect(copy).not.toBe(ranges);
|
|
114
|
-
expect(copy.size).toBe(ranges.size);
|
|
115
|
-
expect(copy.get('a')).toEqual(ranges.get('a'));
|
|
116
|
-
expect(copy.get('b')).toEqual(ranges.get('b'));
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=AxisInterval.test.js.map
|