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,430 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
import { useStreamingTimeAxes } from "./useStreamingTimeAxes";
|
|
3
|
+
import { useHoveredSeries } from "../hooks/useHoveredSeries";
|
|
4
|
+
import * as d3 from "d3";
|
|
5
|
+
import { useChart } from "../hooks/useChart";
|
|
6
|
+
import { useDataSource, useDataSourceRunning, useInitialData } from "../hooks/useDataSource";
|
|
7
|
+
import { usePlotDimensions } from "../hooks/usePlotDimensions";
|
|
8
|
+
import { clipToArea } from "./plot";
|
|
9
|
+
import { seriesAt, canvasLocalPoint } from "./hitTesting";
|
|
10
|
+
import { noop } from "../utils";
|
|
11
|
+
import { extentWith, visibleExtent } from "../axes/autoScale";
|
|
12
|
+
import { growAutoScaledYAxes, useAutoScaleRestart } from "./autoScaleYAxes";
|
|
13
|
+
import { AxisType, checkAxisType, defaultLineStyle } from "../axes/axes";
|
|
14
|
+
import { outlierAxisTimes, TimeWindowBehavior } from "../subscriptions/viewDrivers";
|
|
15
|
+
import { FastShiftArray } from "fast-shift-array";
|
|
16
|
+
/**
|
|
17
|
+
* Renders a streaming outlier plot. Each series consists of {@link OutlierDatum} points, where every
|
|
18
|
+
* datum carries an (x, y) value plus a set of (lower, upper) bounds — one per measure. The plot
|
|
19
|
+
* draws the central y-line for the series and a translucent band per measure, filled between
|
|
20
|
+
* the corresponding lower and upper bounds. The x-axis scrolls as new points arrive past the
|
|
21
|
+
* end of the visible window, in the same fashion as {@link ScatterPlot}.
|
|
22
|
+
*
|
|
23
|
+
* Internally, this no longer creates/updates SVG `<path>`/`<circle>` elements. Instead, it
|
|
24
|
+
* registers a single draw function with the chart's {@link CanvasContext} that redraws every
|
|
25
|
+
* series' bands, line, and markers from scratch each time the canvas repaints. Band hover uses
|
|
26
|
+
* `ctx.isPointInPath` against the band's actual filled path (captured each draw); outlier-marker
|
|
27
|
+
* hover uses the shared point-hit-testing in `hitTesting.ts`, same as {@link ScatterPlot}'s markers.
|
|
28
|
+
* When the data source is paused, hovering over a band shows the tooltip (when there's one); a
|
|
29
|
+
* y-axis with `autoScale` set grows to fit the data on screen (bands included).
|
|
30
|
+
* @param props The properties associated with the outlier plot
|
|
31
|
+
* @return `null` (the plot draws onto the chart's canvas)
|
|
32
|
+
* @template M The type of the measures (a tuple of numbers)
|
|
33
|
+
*/
|
|
34
|
+
export function OutlierPlot(props) {
|
|
35
|
+
var _a;
|
|
36
|
+
const { chartId, canvasContext, axes, seriesStyles, seriesFilter, mouse, } = useChart();
|
|
37
|
+
const { hoveredSeriesName } = useHoveredSeries();
|
|
38
|
+
const { mouseOverHandlerFor, mouseLeaveHandlerFor } = mouse;
|
|
39
|
+
const { initialData } = useInitialData();
|
|
40
|
+
const { xAxesState, yAxesState, updateAxisRanges = noop, axisRangeFor, } = axes;
|
|
41
|
+
const { plotDimensions, margin } = usePlotDimensions();
|
|
42
|
+
// the application-owned source of the data, and whether it's running (streaming)
|
|
43
|
+
const dataSource = useDataSource();
|
|
44
|
+
const running = useDataSourceRunning(dataSource);
|
|
45
|
+
const { axisAssignments = new Map(), interpolation = d3.curveLinear, panEnabled = false, zoomEnabled = false, zoomKeyModifiersRequired = true, timeWindowBehavior = TimeWindowBehavior.SCROLL, withCadenceOf, bandOpacity = 0.15, bandOpacityStep = 0.12, markerRadius, outlierMarkerColors, highlightAxesOnMouseOver = false, onZoomReset = noop, } = props;
|
|
46
|
+
// seriesRef is the single source of truth for what to render: the data source's own (live)
|
|
47
|
+
// series map, which grows as series first appear in the stream. the draw function iterates this
|
|
48
|
+
// directly (rather than a parallel dataRef array) so dynamically-arriving series get rendered.
|
|
49
|
+
const seriesRef = useRef((_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.series) !== null && _a !== void 0 ? _a : new Map(initialData.map(series => [series.name, series])));
|
|
50
|
+
// captured band fill-regions and outlier-marker geometry, in canvas coordinates, used for
|
|
51
|
+
// hit-testing mouse hover on `mousemove` (see the effect below that wires up the listener)
|
|
52
|
+
const bandsRef = useRef([]);
|
|
53
|
+
const outlierGeometryRef = useRef(new Map());
|
|
54
|
+
const outlierDatumsRef = useRef(new Map());
|
|
55
|
+
// what's currently hovered: a band (series + band index) or an outlier point (series + point
|
|
56
|
+
// index) -- mutually exclusive, so we know when to fire a "leave" before an "over"
|
|
57
|
+
const lastHoveredRef = useRef(undefined);
|
|
58
|
+
/**
|
|
59
|
+
* (Re-)registers this plot's draw function with the canvas context and requests a redraw.
|
|
60
|
+
* Replaces the old version, which directly mutated SVG `<path>`/`<circle>` elements bound via
|
|
61
|
+
* d3's enter/update/exit join. Canvas has no persistent elements to join against, so the draw
|
|
62
|
+
* function just redraws every band/line/marker from current data/scale state each time it's
|
|
63
|
+
* invoked.
|
|
64
|
+
*
|
|
65
|
+
* Pan/zoom behavior setup lives in a separate effect (see below), not here -- this function
|
|
66
|
+
* runs on every data tick (each `windowingTime` interval), and recreating/reattaching a
|
|
67
|
+
* `d3.drag()`/`d3.zoom()` behavior that often is pure overhead unrelated to drawing the new
|
|
68
|
+
* data.
|
|
69
|
+
* @param cc The canvas context to register the draw function with
|
|
70
|
+
*/
|
|
71
|
+
const updatePlot = useCallback((cc) => {
|
|
72
|
+
const draw = (context) => {
|
|
73
|
+
const { context2D } = context;
|
|
74
|
+
context2D.save();
|
|
75
|
+
clipToArea(context, plotDimensions, { x: margin.left, y: margin.top });
|
|
76
|
+
context2D.translate(margin.left, margin.top);
|
|
77
|
+
const newBands = [];
|
|
78
|
+
const newOutlierGeometry = new Map();
|
|
79
|
+
const newOutlierDatums = new Map();
|
|
80
|
+
seriesRef.current.forEach(series => {
|
|
81
|
+
var _a, _b, _c;
|
|
82
|
+
const [xAxis, yAxis] = axesFor(series.name, axisAssignments, id => xAxesState.axisFor(id).getOrUndefined(), id => yAxesState.axisFor(id).getOrUndefined());
|
|
83
|
+
if (xAxis === undefined || yAxis === undefined)
|
|
84
|
+
return;
|
|
85
|
+
const style = (_a = seriesStyles.get(series.name)) !== null && _a !== void 0 ? _a : defaultLineStyle();
|
|
86
|
+
const plotData = series.name.match(seriesFilter) ? series.data : FastShiftArray.empty();
|
|
87
|
+
const numBands = plotData.length > 0 ? plotData[0].bounds.length : 0;
|
|
88
|
+
// render the widest (highest-index) band first so the narrower, more-confident
|
|
89
|
+
// bands stack on top with darker opacity
|
|
90
|
+
for (let bandIndex = numBands - 1; bandIndex >= 0; bandIndex--) {
|
|
91
|
+
const opacity = Math.min(1, bandOpacity + (numBands - 1 - bandIndex) * bandOpacityStep);
|
|
92
|
+
const areaGen = d3.area()
|
|
93
|
+
.x(d => xAxis.scale(d.datum.x) || 0)
|
|
94
|
+
.y0(d => yAxis.scale(d.bounds[bandIndex].lower) || 0)
|
|
95
|
+
.y1(d => yAxis.scale(d.bounds[bandIndex].upper) || 0)
|
|
96
|
+
.curve(interpolation);
|
|
97
|
+
const upperMeasure = series.measures[bandIndex];
|
|
98
|
+
const lowerMeasure = bandIndex > 0 ? series.measures[bandIndex - 1] : undefined;
|
|
99
|
+
const path = new Path2D((_b = areaGen(Array.from(plotData))) !== null && _b !== void 0 ? _b : "");
|
|
100
|
+
context2D.fillStyle = style.color;
|
|
101
|
+
context2D.globalAlpha = opacity;
|
|
102
|
+
context2D.fill(path);
|
|
103
|
+
context2D.globalAlpha = 1;
|
|
104
|
+
// pushed in draw order (widest first, narrowest/topmost last); hit-testing
|
|
105
|
+
// iterates this backwards so the topmost band wins, matching visual stacking
|
|
106
|
+
newBands.push({ path, seriesName: series.name, bandIndex, upperMeasure, lowerMeasure, plotData });
|
|
107
|
+
}
|
|
108
|
+
// central line for the series y-value
|
|
109
|
+
const isHovered = hoveredSeriesName === series.name;
|
|
110
|
+
const stroke = isHovered ? style.highlightColor : style.color;
|
|
111
|
+
const strokeWidth = isHovered ? style.highlightWidth : style.lineWidth;
|
|
112
|
+
const lineGen = d3.line()
|
|
113
|
+
.x(d => xAxis.scale(d.datum.x) || 0)
|
|
114
|
+
.y(d => yAxis.scale(d.datum.y) || 0)
|
|
115
|
+
.curve(interpolation);
|
|
116
|
+
context2D.strokeStyle = stroke;
|
|
117
|
+
context2D.lineWidth = strokeWidth;
|
|
118
|
+
context2D.stroke(new Path2D((_c = lineGen(Array.from(plotData))) !== null && _c !== void 0 ? _c : ""));
|
|
119
|
+
// for the markers, we split the data into two categories: regular and outlier
|
|
120
|
+
const { regular, outlier } = categorizePoints(plotData, outlierMarkerColors);
|
|
121
|
+
// point markers (one circle per datum) -- decorative only, no hover/tooltip
|
|
122
|
+
if (markerRadius != null && markerRadius >= 0 && !running) {
|
|
123
|
+
context2D.fillStyle = stroke;
|
|
124
|
+
regular.forEach(d => {
|
|
125
|
+
const x = xAxis.scale(d.datum.x) || 0;
|
|
126
|
+
const y = yAxis.scale(d.datum.y) || 0;
|
|
127
|
+
context2D.beginPath();
|
|
128
|
+
context2D.arc(x, y, markerRadius, 0, 2 * Math.PI);
|
|
129
|
+
context2D.fill();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// outlier markers -- these DO get hover/tooltip, so we record their screen
|
|
133
|
+
// positions (and the underlying datum, for the tooltip) for hit-testing
|
|
134
|
+
const outlierPoints = [];
|
|
135
|
+
outlier.forEach(o => {
|
|
136
|
+
const x = xAxis.scale(o.datum.datum.x) || 0;
|
|
137
|
+
const y = yAxis.scale(o.datum.datum.y) || 0;
|
|
138
|
+
context2D.fillStyle = o.color;
|
|
139
|
+
context2D.beginPath();
|
|
140
|
+
context2D.arc(x, y, 4, 0, 2 * Math.PI);
|
|
141
|
+
context2D.fill();
|
|
142
|
+
outlierPoints.push([x + margin.left, y + margin.top]);
|
|
143
|
+
});
|
|
144
|
+
newOutlierGeometry.set(`${series.name}::outlier`, {
|
|
145
|
+
points: outlierPoints,
|
|
146
|
+
hitRadius: 6
|
|
147
|
+
});
|
|
148
|
+
newOutlierDatums.set(series.name, outlier);
|
|
149
|
+
});
|
|
150
|
+
bandsRef.current = newBands;
|
|
151
|
+
outlierGeometryRef.current = newOutlierGeometry;
|
|
152
|
+
outlierDatumsRef.current = newOutlierDatums;
|
|
153
|
+
context2D.restore();
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Grows the auto-scaling y-axes (see `ContinuousAxis`'s `autoScale` prop) to fit the
|
|
157
|
+
* data that's on screen: for each shown series (those matching the filter), the values
|
|
158
|
+
* and the bands' lower and upper bounds of its points within the x-axis' current
|
|
159
|
+
* window, along with where their lines cross the window's edges (see `visibleExtent`).
|
|
160
|
+
* Since an axis only ever grows, only the visible data needs checking each frame.
|
|
161
|
+
* Registered to run before the axes draw (they're at z-index 0), so the axes and the
|
|
162
|
+
* series are drawn with the grown domain in the same frame.
|
|
163
|
+
*/
|
|
164
|
+
const autoScaleYAxes = () => {
|
|
165
|
+
const extents = new Map();
|
|
166
|
+
seriesRef.current.forEach(series => {
|
|
167
|
+
if (!series.name.match(seriesFilter))
|
|
168
|
+
return;
|
|
169
|
+
const [xAxis, yAxis] = axesFor(series.name, axisAssignments, id => xAxesState.axisFor(id).getOrUndefined(), id => yAxesState.axisFor(id).getOrUndefined());
|
|
170
|
+
if (xAxis === undefined || (yAxis === null || yAxis === void 0 ? void 0 : yAxis.autoScale) === undefined)
|
|
171
|
+
return;
|
|
172
|
+
const [start, end] = xAxis.scale.domain();
|
|
173
|
+
// (the series' line and its bands' edges are always drawn as lines)
|
|
174
|
+
const seriesExtent = visibleExtent(series.data, [start, end], yAxis.scale, true, point => point.datum.x, point => [point.datum.y, ...point.bounds.flatMap(({ lower, upper }) => [lower, upper])]);
|
|
175
|
+
if (seriesExtent === undefined)
|
|
176
|
+
return;
|
|
177
|
+
const extent = extents.get(yAxis.axisId);
|
|
178
|
+
extents.set(yAxis.axisId, extent === undefined ? seriesExtent : extentWith(extentWith(extent, seriesExtent[0]), seriesExtent[1]));
|
|
179
|
+
});
|
|
180
|
+
growAutoScaledYAxes(extents, { yAxes: yAxesState.axes, axisRangeFor, updateAxisRanges });
|
|
181
|
+
};
|
|
182
|
+
cc.register(`outlier-plot-autoscale-${chartId}`, autoScaleYAxes, -10);
|
|
183
|
+
cc.register(`outlier-plot-${chartId}`, draw, 10);
|
|
184
|
+
cc.requestRedraw();
|
|
185
|
+
},
|
|
186
|
+
// note: my WebStorm claims that bandOpacityStep is not a dependency, but it is and the
|
|
187
|
+
// linter flags is as missing when it is removed
|
|
188
|
+
[
|
|
189
|
+
chartId, plotDimensions, axisAssignments, xAxesState, yAxesState, seriesStyles, seriesFilter,
|
|
190
|
+
interpolation, bandOpacity, bandOpacityStep, markerRadius, outlierMarkerColors, hoveredSeriesName, running,
|
|
191
|
+
axisRangeFor, updateAxisRanges, margin.left, margin.top
|
|
192
|
+
]);
|
|
193
|
+
// new data, new scale: restarts the auto-scaling y-axes when the data source is replaced
|
|
194
|
+
useAutoScaleRestart(dataSource, { yAxes: yAxesState.axes, axisRangeFor, updateAxisRanges });
|
|
195
|
+
// the time axes: their ranges, the view driver, panning and zooming, highlighting, and
|
|
196
|
+
// reporting the axes' intervals -- see `useStreamingTimeAxes`
|
|
197
|
+
useStreamingTimeAxes({
|
|
198
|
+
canvasContext,
|
|
199
|
+
dataSource,
|
|
200
|
+
running,
|
|
201
|
+
initialData,
|
|
202
|
+
timeOf: datum => datum.datum.x,
|
|
203
|
+
axisTimesFor: outlierAxisTimes(axisAssignments, xAxesState),
|
|
204
|
+
axisAssignments,
|
|
205
|
+
updatePlot,
|
|
206
|
+
onDataReset: () => {
|
|
207
|
+
var _a;
|
|
208
|
+
seriesRef.current = (_a = dataSource === null || dataSource === void 0 ? void 0 : dataSource.series) !== null && _a !== void 0 ? _a : new Map(initialData.map(series => [series.name, series]));
|
|
209
|
+
},
|
|
210
|
+
panEnabled,
|
|
211
|
+
zoomEnabled,
|
|
212
|
+
zoomKeyModifiersRequired,
|
|
213
|
+
onZoomReset,
|
|
214
|
+
withCadenceOf,
|
|
215
|
+
timeWindowBehavior,
|
|
216
|
+
highlightAxesOnMouseOver,
|
|
217
|
+
});
|
|
218
|
+
// wires up a single mousemove/mouseleave listener on the shared canvas to replace the old
|
|
219
|
+
// per-element SVG mouseover/mouseleave handlers on the band paths and outlier-marker circles.
|
|
220
|
+
// Bands are hit-tested via `ctx.isPointInPath` against their captured fill path (checked
|
|
221
|
+
// topmost/narrowest-first, matching visual stacking); outlier markers use the shared
|
|
222
|
+
// point-hit-testing in `hitTesting.ts`. Outlier markers are checked first since they're drawn
|
|
223
|
+
// on top of the bands.
|
|
224
|
+
useEffect(() => {
|
|
225
|
+
if (!canvasContext)
|
|
226
|
+
return;
|
|
227
|
+
const canvas = canvasContext.canvas;
|
|
228
|
+
const { context2D, dpr } = canvasContext;
|
|
229
|
+
const handleMove = (event) => {
|
|
230
|
+
var _a, _b, _c, _d;
|
|
231
|
+
const [x, y] = canvasLocalPoint(event, canvas);
|
|
232
|
+
// check outlier markers first (drawn on top of the bands)
|
|
233
|
+
const outlierHit = seriesAt(x, y, outlierGeometryRef.current);
|
|
234
|
+
// The band's `Path2D` is built from raw (pre-margin) local coordinates -- the same
|
|
235
|
+
// space `x - margin.left, y - margin.top` (the "local" point) is in -- but
|
|
236
|
+
// `ctx.isPointInPath` only reported correct hits once that local point was ALSO
|
|
237
|
+
// scaled by `dpr`. (An earlier version of this instead dropped the margin
|
|
238
|
+
// subtraction and scaled the raw canvas-relative point by `dpr` -- that's wrong:
|
|
239
|
+
// verified against the actual rendered band, rigorously, by isolating a single
|
|
240
|
+
// band layer's on-screen pixels via `getImageData` and testing candidate query
|
|
241
|
+
// points against the real `Path2D` object captured from a live hover. Dropping the
|
|
242
|
+
// margin subtraction was close enough to pass a single, less careful spot-check,
|
|
243
|
+
// but consistently mislocated the hit region by `margin.left`/`margin.top`, which
|
|
244
|
+
// is what produced "hover ~margin-worth of pixels to the side of the band" in
|
|
245
|
+
// practice.) The exact reason `dpr` needs to be reapplied here, on top of a
|
|
246
|
+
// transform that already includes it, isn't fully pinned down -- this is the
|
|
247
|
+
// empirically-verified formula, not a re-derivation from the Canvas 2D spec.
|
|
248
|
+
const localX = (x - margin.left) * dpr;
|
|
249
|
+
const localY = (y - margin.top) * dpr;
|
|
250
|
+
const current = outlierHit !== undefined ?
|
|
251
|
+
{ kind: 'outlier', seriesName: outlierHit.name.replace(/::outlier$/, ''), index: outlierHit.index } :
|
|
252
|
+
findHoveredBand(bandsRef.current, context2D, localX, localY);
|
|
253
|
+
const previous = lastHoveredRef.current;
|
|
254
|
+
const sameAsBefore = previous !== undefined && current !== undefined &&
|
|
255
|
+
previous.kind === current.kind && previous.seriesName === current.seriesName &&
|
|
256
|
+
((previous.kind === 'band' && current.kind === 'band' && previous.bandIndex === current.bandIndex) ||
|
|
257
|
+
(previous.kind === 'outlier' && current.kind === 'outlier' && previous.index === current.index));
|
|
258
|
+
if (sameAsBefore)
|
|
259
|
+
return;
|
|
260
|
+
if (previous !== undefined) {
|
|
261
|
+
(_a = mouseLeaveHandlerFor(`tooltip-${chartId}`)) === null || _a === void 0 ? void 0 : _a(previous.seriesName);
|
|
262
|
+
}
|
|
263
|
+
if (current !== undefined) {
|
|
264
|
+
if (current.kind === 'band') {
|
|
265
|
+
const band = bandsRef.current.find(b => b.seriesName === current.seriesName && b.bandIndex === current.bandIndex);
|
|
266
|
+
if (band !== undefined && band.upperMeasure != null) {
|
|
267
|
+
const pointsInBand = calcPointsInBand(band.plotData, band.bandIndex);
|
|
268
|
+
(_b = mouseOverHandlerFor(`tooltip-${chartId}`)) === null || _b === void 0 ? void 0 : _b(current.seriesName, current.bandIndex, {
|
|
269
|
+
series: band.plotData,
|
|
270
|
+
metadata: {
|
|
271
|
+
upperMeasure: band.upperMeasure,
|
|
272
|
+
lowerMeasure: band.lowerMeasure,
|
|
273
|
+
bandIndex: current.bandIndex,
|
|
274
|
+
pointsInBand,
|
|
275
|
+
}
|
|
276
|
+
}, [x, y]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
const series = seriesRef.current.get(current.seriesName);
|
|
281
|
+
const outlierDatum = (_c = outlierDatumsRef.current.get(current.seriesName)) === null || _c === void 0 ? void 0 : _c[current.index];
|
|
282
|
+
if (series !== undefined && outlierDatum !== undefined) {
|
|
283
|
+
const plotData = series.name.match(seriesFilter) ? series.data : FastShiftArray.empty();
|
|
284
|
+
const datum = outlierDatum.datum;
|
|
285
|
+
const bandIndex = largestExceededBoundIndex(datum) + 1;
|
|
286
|
+
const upperMeasure = bandIndex < series.measures.length ? series.measures[bandIndex] : undefined;
|
|
287
|
+
const lowerMeasure = bandIndex > 0 ? series.measures[bandIndex - 1] : undefined;
|
|
288
|
+
const pointsInBand = calcPointsInBand(plotData, bandIndex);
|
|
289
|
+
(_d = mouseOverHandlerFor(`tooltip-${chartId}`)) === null || _d === void 0 ? void 0 : _d(current.seriesName, datum.datum.x, {
|
|
290
|
+
series: series.data,
|
|
291
|
+
metadata: { datum, upperMeasure, lowerMeasure, bandIndex, pointsInBand }
|
|
292
|
+
}, [x, y]);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
lastHoveredRef.current = current;
|
|
297
|
+
};
|
|
298
|
+
const handleLeaveCanvas = () => {
|
|
299
|
+
var _a;
|
|
300
|
+
const previous = lastHoveredRef.current;
|
|
301
|
+
if (previous !== undefined) {
|
|
302
|
+
(_a = mouseLeaveHandlerFor(`tooltip-${chartId}`)) === null || _a === void 0 ? void 0 : _a(previous.seriesName);
|
|
303
|
+
lastHoveredRef.current = undefined;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
canvas.addEventListener('mousemove', handleMove);
|
|
307
|
+
canvas.addEventListener('mouseleave', handleLeaveCanvas);
|
|
308
|
+
return () => {
|
|
309
|
+
canvas.removeEventListener('mousemove', handleMove);
|
|
310
|
+
canvas.removeEventListener('mouseleave', handleLeaveCanvas);
|
|
311
|
+
};
|
|
312
|
+
}, [canvasContext, chartId, margin, seriesFilter, mouseOverHandlerFor, mouseLeaveHandlerFor]);
|
|
313
|
+
// this plot needs a data source (see the `Chart`'s `dataSource` prop)
|
|
314
|
+
useEffect(() => {
|
|
315
|
+
if (dataSource === undefined) {
|
|
316
|
+
console.error("OutlierPlot requires a data source; set the enclosing Chart's `dataSource` prop");
|
|
317
|
+
}
|
|
318
|
+
}, [dataSource]);
|
|
319
|
+
// unregister this plot's draw function on unmount
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
return () => {
|
|
322
|
+
if (canvasContext) {
|
|
323
|
+
canvasContext.unregister(`outlier-plot-autoscale-${chartId}`);
|
|
324
|
+
canvasContext.unregister(`outlier-plot-${chartId}`);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}, [canvasContext, chartId]);
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Finds the topmost (narrowest, most-confident) band whose fill path contains `(localX, localY)`.
|
|
332
|
+
* `bands` is in draw order (widest first, narrowest/topmost last), so this iterates backwards to
|
|
333
|
+
* check the topmost band first, matching visual stacking.
|
|
334
|
+
* @param bands The bands' fill regions, as last drawn, in draw order
|
|
335
|
+
* @param context The canvas 2D context (for `isPointInPath`)
|
|
336
|
+
* @param localX The mouse's x-coordinate, in the coordinates `isPointInPath` tests against (see
|
|
337
|
+
* the caller for why that's the plot-area position scaled by the device-pixel ratio)
|
|
338
|
+
* @param localY The mouse's y-coordinate, in the same coordinates
|
|
339
|
+
* @return The hovered band's series and index, or `undefined` when the mouse isn't over a band
|
|
340
|
+
*/
|
|
341
|
+
function findHoveredBand(bands, context, localX, localY) {
|
|
342
|
+
for (let i = bands.length - 1; i >= 0; i--) {
|
|
343
|
+
const band = bands[i];
|
|
344
|
+
if (context.isPointInPath(band.path, localX, localY)) {
|
|
345
|
+
return { kind: 'band', seriesName: band.seriesName, bandIndex: band.bandIndex };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Returns the index of the largest bound the datum's y-value is outside of, or -1 if the value
|
|
352
|
+
* is inside every bound. Bounds are expected to be ordered from tightest (index 0) to widest
|
|
353
|
+
* (highest index), so the highest-index match identifies the most severe outlier tier.
|
|
354
|
+
* @param datum The datum
|
|
355
|
+
* @return The index of the largest bound the datum is outside of, or -1
|
|
356
|
+
*/
|
|
357
|
+
function largestExceededBoundIndex(datum) {
|
|
358
|
+
for (let i = datum.bounds.length - 1; i >= 0; i--) {
|
|
359
|
+
const { lower, upper } = datum.bounds[i];
|
|
360
|
+
if (datum.datum.y < lower || datum.datum.y > upper)
|
|
361
|
+
return i;
|
|
362
|
+
}
|
|
363
|
+
return -1;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Attempts to locate the x- and y-axes for the specified series. If the series has no axis
|
|
367
|
+
* assignment, then uses the default (first) x- and y-axes.
|
|
368
|
+
* @param seriesName Name of the series for which to retrieve the axis
|
|
369
|
+
* @param axisAssignments A map holding the series name and the associated x- and y-axes assigned
|
|
370
|
+
* to that series
|
|
371
|
+
* @param xAxisFor The function that accepts an axis ID and returns the corresponding x-axis
|
|
372
|
+
* @param yAxisFor The function that accepts an axis ID and returns the corresponding y-axis
|
|
373
|
+
* @return The x- and y-axes (`undefined` when not found)
|
|
374
|
+
* @throws Error when either axis isn't a continuous numeric axis
|
|
375
|
+
*/
|
|
376
|
+
function axesFor(seriesName, axisAssignments, xAxisFor, yAxisFor) {
|
|
377
|
+
const assigned = axisAssignments.get(seriesName);
|
|
378
|
+
const xAxisRaw = xAxisFor((assigned === null || assigned === void 0 ? void 0 : assigned.xAxis) || "");
|
|
379
|
+
const yAxisRaw = yAxisFor((assigned === null || assigned === void 0 ? void 0 : assigned.yAxis) || "");
|
|
380
|
+
checkAxisType("OutlierPlot", "x", xAxisRaw, AxisType.ContinuousNumeric);
|
|
381
|
+
checkAxisType("OutlierPlot", "y", yAxisRaw, AxisType.ContinuousNumeric);
|
|
382
|
+
const xAxis = xAxisRaw;
|
|
383
|
+
const yAxis = yAxisRaw;
|
|
384
|
+
return [xAxis, yAxis];
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Calculate the number of points within a specific outlier band.
|
|
388
|
+
* @param plotData The array of outlier data points.
|
|
389
|
+
* @param bandIndex The index of the outlier band to calculate points for.
|
|
390
|
+
* @param [subtractLowerBandCount=true] Whether to subtract the count of points in the lower band. Defaults to true.
|
|
391
|
+
* @returns The number of points within the specified outlier band.
|
|
392
|
+
*/
|
|
393
|
+
function calcPointsInBand(plotData, bandIndex, subtractLowerBandCount = true) {
|
|
394
|
+
// function to count the points in a specific outlier band
|
|
395
|
+
const countPointsInBand = (bandIndex) => plotData
|
|
396
|
+
.filter(datum => {
|
|
397
|
+
if (bandIndex < datum.bounds.length) {
|
|
398
|
+
return datum.datum.y >= datum.bounds[bandIndex].lower && datum.datum.y <= datum.bounds[bandIndex].upper;
|
|
399
|
+
}
|
|
400
|
+
return true;
|
|
401
|
+
}).length;
|
|
402
|
+
const pointsInBand = countPointsInBand(bandIndex);
|
|
403
|
+
// we need to subtract the points in the lower band. recall that each band has ALL the points
|
|
404
|
+
// in the band's range, not what we may think of visually
|
|
405
|
+
if (bandIndex > 0 && subtractLowerBandCount) {
|
|
406
|
+
return pointsInBand - countPointsInBand(bandIndex - 1);
|
|
407
|
+
}
|
|
408
|
+
return pointsInBand;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Categorizes outlier data into regular and outlier points based on provided marker colors.
|
|
412
|
+
* @param data Array of outlier data to categorize
|
|
413
|
+
* @param outlierMarkerColors Array of colors to use for outlier markers
|
|
414
|
+
* @returns Object with regular and outlier data arrays
|
|
415
|
+
* @template M Type of the measure
|
|
416
|
+
*/
|
|
417
|
+
function categorizePoints(data, outlierMarkerColors = []) {
|
|
418
|
+
return data.reduce((accum, datum) => {
|
|
419
|
+
var _a;
|
|
420
|
+
const bandIndex = largestExceededBoundIndex(datum);
|
|
421
|
+
if (bandIndex < 0) {
|
|
422
|
+
accum.regular.push(datum);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
accum.outlier.push({ datum, color: (_a = outlierMarkerColors[bandIndex]) !== null && _a !== void 0 ? _a : "red" });
|
|
426
|
+
}
|
|
427
|
+
return accum;
|
|
428
|
+
}, { regular: [], outlier: [] });
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=OutlierPlot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlierPlot.js","sourceRoot":"","sources":["../../../../src/app/charts/plots/OutlierPlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAA;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAExB,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAC,aAAa,EAAE,oBAAoB,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAsB,UAAU,EAAC,MAAM,QAAQ,CAAA;AAEtD,OAAO,EAAC,QAAQ,EAAE,gBAAgB,EAAsB,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAC,IAAI,EAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAEH,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAEnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAGlF,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,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C,CAAA;QAC/E,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC,EACD,EAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAuB,CACnD,CAAA;AACL,CAAC"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import * as d3 from "d3";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A snapshot of the Poincaré plot's zoom/pan state, in a form that can be held outside the plot
|
|
4
|
+
* (e.g. in an application store) and handed back to a later instance of the plot (see the
|
|
5
|
+
* {@link Props.zoomState} and {@link Props.onZoomStateChange} props) -- so that zooming, navigating
|
|
6
|
+
* away, and navigating back doesn't reset the zoom.
|
|
7
|
+
*/
|
|
8
|
+
export interface PoincarePlotZoomState {
|
|
9
|
+
/**
|
|
10
|
+
* d3-zoom's cumulative scale factor (`transform.k`) at the time of the snapshot. It must be
|
|
11
|
+
* restored onto the new canvas along with the ranges: d3-zoom's `scaleExtent` (see
|
|
12
|
+
* {@link Props.zoomMaxScaleFactor}) limits `k`, so a remounted canvas starting back at `k = 1`
|
|
13
|
+
* would otherwise mis-measure how much further the user may zoom in or out.
|
|
14
|
+
*/
|
|
15
|
+
k: number;
|
|
16
|
+
/**
|
|
17
|
+
* Maps each axis ID (x and y) to its current (zoomed, panned) domain
|
|
18
|
+
*/
|
|
19
|
+
ranges: Record<string, [start: number, end: number]>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The properties of the {@link PoincarePlot}
|
|
23
|
+
*/
|
|
4
24
|
export interface Props {
|
|
5
25
|
/**
|
|
6
26
|
* The line interpolation curve factory. See the d3 documentation for curves at
|
|
@@ -8,14 +28,38 @@ export interface Props {
|
|
|
8
28
|
*/
|
|
9
29
|
interpolation?: d3.CurveFactory;
|
|
10
30
|
/**
|
|
11
|
-
* When set to `true` plots the data points as well as the line.
|
|
31
|
+
* When set to `true` (the default) plots the data points as well as the line.
|
|
12
32
|
*/
|
|
13
33
|
showPoints?: boolean;
|
|
14
34
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
35
|
+
* When `true`, the lines connecting the points change color along their length, one step per
|
|
36
|
+
* point: from `lineStartColor` at each series' first point to `lineEndColor` after
|
|
37
|
+
* `lineColorSteps` points, then back to `lineStartColor` over the next `lineColorSteps` points,
|
|
38
|
+
* and so on, sweeping the colors of the spectrum in between (the long way around the hue
|
|
39
|
+
* circle -- e.g. from blue, through cyan, green, and yellow, to red). A point keeps its color
|
|
40
|
+
* as old points are dropped (with an {@link IteratesDataSource}, which counts them), so that
|
|
41
|
+
* the path's direction, and its age, can be seen. The points are filled with the color of the
|
|
42
|
+
* line leaving them (except while hovered, when they're highlighted as usual). When `false`
|
|
43
|
+
* (the default), the lines and points are drawn in the series' own color.
|
|
44
|
+
*/
|
|
45
|
+
colorizeLines?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The number of points (steps) it takes the colorized lines' color to sweep from
|
|
48
|
+
* `lineStartColor` to `lineEndColor` (and as many to sweep back) -- the larger, the slower the
|
|
49
|
+
* color changes. Defaults to {@link DEFAULT_LINE_COLOR_STEPS} (1,000). Only used when
|
|
50
|
+
* `colorizeLines` is `true`.
|
|
51
|
+
*/
|
|
52
|
+
lineColorSteps?: number;
|
|
53
|
+
/**
|
|
54
|
+
* The color the colorized lines' sweep starts at (each series' first point). Defaults to a blue
|
|
55
|
+
* ({@link DEFAULT_LINE_START_COLOR}). Only used when `colorizeLines` is `true`.
|
|
56
|
+
*/
|
|
57
|
+
lineStartColor?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The color the colorized lines' sweep ends at (after `lineColorSteps` points). Defaults to a red
|
|
60
|
+
* ({@link DEFAULT_LINE_END_COLOR}). Only used when `colorizeLines` is `true`.
|
|
17
61
|
*/
|
|
18
|
-
|
|
62
|
+
lineEndColor?: string;
|
|
19
63
|
/**
|
|
20
64
|
* Enables panning (default is false)
|
|
21
65
|
*/
|
|
@@ -42,6 +86,25 @@ export interface Props {
|
|
|
42
86
|
* the larger this factor, the more the user can "zoom out". Default value is 1.0.
|
|
43
87
|
*/
|
|
44
88
|
zoomMaxScaleFactor?: number;
|
|
89
|
+
/**
|
|
90
|
+
* An (optional) zoom/pan state to restore when this plot mounts -- commonly the last value
|
|
91
|
+
* reported through {@link onZoomStateChange} and held by the application (e.g. in a store) so
|
|
92
|
+
* that the zoom survives the plot being unmounted and remounted (e.g. navigating away and
|
|
93
|
+
* back). Only read once, when the plot's axes are first available.
|
|
94
|
+
*/
|
|
95
|
+
zoomState?: PoincarePlotZoomState;
|
|
96
|
+
/**
|
|
97
|
+
* (Optional) callback that is handed the plot's zoom/pan state after each zoom event, at the
|
|
98
|
+
* end of each pan, and when the axes' bounds are changed from outside (which resets the zoom)
|
|
99
|
+
*/
|
|
100
|
+
onZoomStateChange?: (zoomState: PoincarePlotZoomState) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Called whenever this plot (re)creates its zoom behavior, handing the caller a `resetZoom`
|
|
103
|
+
* function that clears d3-zoom's own accumulated scale back to identity and restores every axis
|
|
104
|
+
* to its original (un-zoomed, un-panned) domain -- e.g. for a "Clear" action. Only meaningful
|
|
105
|
+
* (called) while `zoomEnabled` is true.
|
|
106
|
+
*/
|
|
107
|
+
onZoomReset?: (resetZoom: () => void) => void;
|
|
45
108
|
/**
|
|
46
109
|
* When set, uses a cadence with the specified refresh period (in milliseconds). For plots
|
|
47
110
|
* where the updates are slow (> 100 ms) using a cadence of 10 to 25 ms smooths out the
|
|
@@ -49,24 +112,38 @@ export interface Props {
|
|
|
49
112
|
* then setting the cadence period too small will result in poor update performance. Generally
|
|
50
113
|
* at high update speeds, the cadence is unnecessary. Finally, using cadence, sets the max time
|
|
51
114
|
* to the current time.
|
|
115
|
+
*
|
|
116
|
+
* Note: the Poincaré plot accepts this, but doesn't (yet) use it -- its axes don't follow time.
|
|
52
117
|
*/
|
|
53
118
|
withCadenceOf?: number;
|
|
119
|
+
/**
|
|
120
|
+
* When true, hovering over a point also highlights the (single, shared) x- and y-axes it is
|
|
121
|
+
* plotted against, in the series' own highlight color/width. Defaults to `false`.
|
|
122
|
+
*/
|
|
123
|
+
highlightAxesOnMouseOver?: boolean;
|
|
54
124
|
}
|
|
55
125
|
/**
|
|
56
|
-
* Renders a streaming Poincare (iterates) plot for the series
|
|
57
|
-
*
|
|
126
|
+
* Renders a streaming Poincare (iterates) plot for the series held by the {@link StreamingDataSource}
|
|
127
|
+
* handed to the {@link Chart} (its `dataSource` prop). This component uses the {@link useChart}
|
|
58
128
|
* hook, and therefore must be a child of the {@link Chart} in order to be plugged in to the
|
|
59
129
|
* chart ecosystem (axes, tracker, tooltip).
|
|
60
130
|
*
|
|
61
|
-
*
|
|
131
|
+
* Internally, this no longer creates/updates SVG `<path>`/`<circle>`/`<text>` elements. Instead, it
|
|
132
|
+
* registers a single draw function with the chart's {@link CanvasContext} that redraws every
|
|
133
|
+
* series' line and points from scratch each time the canvas repaints. The old version's
|
|
134
|
+
* hover-a-point-and-annotate-its-neighbors behavior used direct `d3.select('#specific-id')` lookups
|
|
135
|
+
* into already-rendered SVG elements from a separate pass after the main render; since canvas has
|
|
136
|
+
* no persistent elements to reach back into, this is restructured so the single draw pass checks
|
|
137
|
+
* "is this point hovered, or a neighbor of the hovered point" and renders the highlight/label
|
|
138
|
+
* inline, driven by a `hoveredPointRef` updated on `mousemove`.
|
|
139
|
+
*
|
|
140
|
+
* @param props The properties associated with the Poincaré plot
|
|
141
|
+
* @return `null` (the plot draws onto the chart's canvas)
|
|
62
142
|
* @example
|
|
63
143
|
* ```typescript
|
|
64
|
-
* <
|
|
144
|
+
* <PoincarePlot
|
|
65
145
|
* interpolation={interpolation}
|
|
66
|
-
*
|
|
67
|
-
* ['test2', assignAxes("x-axis-2", "y-axis-2")],
|
|
68
|
-
* ])}
|
|
69
|
-
* dropDataAfter={10000}
|
|
146
|
+
* showPoints={true}
|
|
70
147
|
* panEnabled={true}
|
|
71
148
|
* zoomEnabled={true}
|
|
72
149
|
* zoomKeyModifiersRequired={true}
|
|
@@ -74,3 +151,4 @@ export interface Props {
|
|
|
74
151
|
* ```
|
|
75
152
|
*/
|
|
76
153
|
export declare function PoincarePlot(props: Props): null;
|
|
154
|
+
//# sourceMappingURL=PoincarePlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoincarePlot.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/plots/PoincarePlot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAqDzB;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;;;OAKG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAA;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,EAAE,CAAC,YAAY,CAAA;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,qBAAqB,CAAA;IACjC;;;OAGG;IACH,iBAA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