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
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Dimensions, Margin } from "../styling/margins";
|
|
1
|
+
import type { Dimensions, Margin } from "../styling/margins";
|
|
2
2
|
import { ContinuousAxisRange } from "./ContinuousAxisRange";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { AutoScale } from "./autoScale";
|
|
4
|
+
import { type ScaleBand, type ScaleContinuousNumeric } from "d3";
|
|
5
|
+
import type { CanvasContext } from "../d3types";
|
|
5
6
|
import { AxesState } from "./AxesState";
|
|
6
|
-
import { AxesAssignment } from "../plots/plot";
|
|
7
|
-
import { BaseSeries } from "../series/baseSeries";
|
|
7
|
+
import type { AxesAssignment } from "../plots/plot";
|
|
8
|
+
import type { BaseSeries } from "../series/baseSeries";
|
|
8
9
|
import { OrdinalAxisRange } from "./OrdinalAxisRange";
|
|
9
10
|
import { BaseAxisRange } from "./BaseAxisRange";
|
|
10
11
|
import { AxisInterval } from "./AxisInterval";
|
|
@@ -18,7 +19,8 @@ export type AxisTickStyle = {
|
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* Factory function to create a default AxisTickStyle with the default font,
|
|
21
|
-
* no rotation, and no
|
|
22
|
+
* no rotation, and no autorotation.
|
|
23
|
+
* @return The default axis tick style
|
|
22
24
|
*/
|
|
23
25
|
export declare function defaultAxisTickStyle(): AxisTickStyle;
|
|
24
26
|
/**
|
|
@@ -33,6 +35,7 @@ export interface AxesFont {
|
|
|
33
35
|
/**
|
|
34
36
|
* Factory function to create a default AxesFont with the default font size, color,
|
|
35
37
|
* family, and weight.
|
|
38
|
+
* @return The default axes font
|
|
36
39
|
*/
|
|
37
40
|
export declare function defaultAxesFont(): AxesFont;
|
|
38
41
|
/**
|
|
@@ -53,19 +56,59 @@ export interface SeriesLineStyle extends SeriesStyle {
|
|
|
53
56
|
/**
|
|
54
57
|
* Factory function to create a default SeriesLineStyle with the default color, line width,
|
|
55
58
|
* highlight color, and highlight width.
|
|
59
|
+
* @return The default series line style
|
|
56
60
|
*/
|
|
57
61
|
export declare function defaultLineStyle(): SeriesLineStyle;
|
|
58
62
|
/**
|
|
59
|
-
* The
|
|
60
|
-
*
|
|
63
|
+
* The concrete kind of an axis, set by every axis-creator function to its own unique value.
|
|
64
|
+
* Lets code that only has a `BaseAxis` (e.g. a plot's `axesFor` validating an `axisAssignments`
|
|
65
|
+
* entry) discriminate the concrete axis shape at runtime -- `BaseAxis`/`ContinuousNumericAxis`/
|
|
66
|
+
* `OrdinalStringAxis` are plain structural interfaces, so a type-level cast (`as ContinuousNumericAxis`)
|
|
67
|
+
* cannot do that; this field is what actually can.
|
|
68
|
+
* Note: replaces enums to support `erasableSyntaxOnly`
|
|
69
|
+
* TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AxisType: {
|
|
72
|
+
readonly ContinuousNumeric: "ContinuousNumeric";
|
|
73
|
+
readonly OrdinalString: "OrdinalString";
|
|
74
|
+
};
|
|
75
|
+
export type AxisType = (typeof AxisType)[keyof typeof AxisType];
|
|
76
|
+
/**
|
|
77
|
+
* Checks that a plot's axis is of the type the plot needs (e.g. a bar plot needs an ordinal x-axis).
|
|
78
|
+
* A missing axis passes, since the plots already skip the series whose axes aren't found.
|
|
79
|
+
* @param plotName The name of the plot's component (e.g. "RasterPlot")
|
|
80
|
+
* @param dimension Whether the axis is the plot's x-axis or its y-axis
|
|
81
|
+
* @param axis The axis (`undefined` when it isn't found)
|
|
82
|
+
* @param expected The axis type the plot needs
|
|
83
|
+
* @throws Error when the axis isn't of the expected type, naming the axis component it needs to be
|
|
84
|
+
*/
|
|
85
|
+
export declare function checkAxisType(plotName: string, dimension: 'x' | 'y', axis: BaseAxis | undefined, expected: AxisType): void;
|
|
86
|
+
/**
|
|
87
|
+
* The base interface that all Axes must implement. Each axis must have a unique ID and a location
|
|
88
|
+
* (top, bottom, left, right). Under the old SVG-backed implementation this also carried a
|
|
89
|
+
* `selection`; that's gone now that axes draw onto a shared canvas instead of owning their own DOM
|
|
90
|
+
* elements.
|
|
61
91
|
*/
|
|
62
92
|
export interface BaseAxis {
|
|
63
93
|
axisId: string;
|
|
64
94
|
location: AxisLocation;
|
|
65
|
-
|
|
95
|
+
/**
|
|
96
|
+
* The concrete kind of this axis (see {@link AxisType}). Every axis-creator function sets this
|
|
97
|
+
* to its own unique value.
|
|
98
|
+
*/
|
|
99
|
+
axisType: AxisType;
|
|
100
|
+
/**
|
|
101
|
+
* True for a placeholder axis added via `addEmptyXAxis`/`addEmptyYAxis` (just a
|
|
102
|
+
* line, with no real data domain behind it). Consumers that report a value for the mouse
|
|
103
|
+
* position -- e.g., the tracker's axis labels -- should skip axes marked this way, since their
|
|
104
|
+
* scale doesn't reflect anything meaningful.
|
|
105
|
+
*/
|
|
106
|
+
isEmpty?: boolean;
|
|
66
107
|
}
|
|
67
108
|
/**
|
|
68
|
-
* Represents a continuous numeric axis.
|
|
109
|
+
* Represents a continuous numeric axis. Draws itself by registering a draw function with the
|
|
110
|
+
* chart's {@link CanvasContext} (see `addContinuousNumericXAxis` and
|
|
111
|
+
* `addContinuousNumericYAxis`, below) rather than owning an SVG element.
|
|
69
112
|
*/
|
|
70
113
|
export interface ContinuousNumericAxis extends BaseAxis {
|
|
71
114
|
/**
|
|
@@ -73,200 +116,270 @@ export interface ContinuousNumericAxis extends BaseAxis {
|
|
|
73
116
|
*/
|
|
74
117
|
scale: ScaleContinuousNumeric<number, number>;
|
|
75
118
|
/**
|
|
76
|
-
*
|
|
119
|
+
* When set, the axis' domain grows to fit the data plotted against it, within the settings'
|
|
120
|
+
* limits (see `ContinuousAxis`'s `autoScale` prop). Set by the axis component, and applied by
|
|
121
|
+
* the plots that support it (for y-axes).
|
|
77
122
|
*/
|
|
78
|
-
|
|
79
|
-
valueOf(): number;
|
|
80
|
-
}>;
|
|
123
|
+
autoScale?: AutoScale;
|
|
81
124
|
/**
|
|
82
|
-
* Updates the axis based on the specified domain and plot dimensions
|
|
125
|
+
* Updates the axis based on the specified domain and plot dimensions and requests the plot
|
|
126
|
+
* to be redrawn.
|
|
83
127
|
* @param domain The interval representing the domain of the axis.
|
|
84
128
|
* @param plotDimensions The dimensions of the plot (without the margins).
|
|
85
129
|
* @param margin The margins for the plot
|
|
86
130
|
*/
|
|
87
131
|
update: (domain: AxisInterval, plotDimensions: Dimensions, margin: Margin) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Updates the font (color, size, family, weight) used for ticks and the axis label, without
|
|
134
|
+
* recreating the axis or touching its domain. Used to keep the label color in sync with the
|
|
135
|
+
* chart's `color` prop (e.g., on a theme change) between full axis updates.
|
|
136
|
+
*/
|
|
137
|
+
updateFont: (font: AxesFont) => void;
|
|
138
|
+
/**
|
|
139
|
+
* Highlights (or un-highlights) this axis -- used, for example, to indicate which axis a
|
|
140
|
+
* currently-hovered series is plotted against. When `highlighted` is true, the axis' domain
|
|
141
|
+
* line, ticks, and labels are drawn in `color` at `lineWidth` instead of the normal font color
|
|
142
|
+
* and 1px line; `color`/`lineWidth` are remembered across calls, so a later `setHighlighted(true)`
|
|
143
|
+
* without them reuses whatever was last passed (or the built-in default on the first call).
|
|
144
|
+
* @param highlighted Whether the axis should be drawn highlighted
|
|
145
|
+
* @param color The highlight color
|
|
146
|
+
* @param lineWidth The highlight line width
|
|
147
|
+
*/
|
|
148
|
+
setHighlighted: (highlighted: boolean, color?: string, lineWidth?: number) => void;
|
|
88
149
|
}
|
|
89
150
|
/**
|
|
90
|
-
* Represents an ordinal string axis.
|
|
151
|
+
* Represents an ordinal string axis. Draws itself by registering a draw function with the chart's
|
|
152
|
+
* {@link CanvasContext} rather than owning an SVG element.
|
|
91
153
|
*/
|
|
92
154
|
export interface OrdinalStringAxis extends BaseAxis {
|
|
93
155
|
/**
|
|
94
156
|
* A d3 scale for an ordinal string axis.
|
|
95
157
|
*/
|
|
96
158
|
scale: ScaleBand<string>;
|
|
97
|
-
/**
|
|
98
|
-
* A d3 axis generator for an ordinal string axis.
|
|
99
|
-
*/
|
|
100
|
-
generator: Axis<string>;
|
|
101
159
|
/**
|
|
102
160
|
* The size of each category on the axis.
|
|
103
161
|
*/
|
|
104
162
|
categorySize: number;
|
|
105
163
|
/**
|
|
106
|
-
* Updates the axis based on the specified
|
|
164
|
+
* Updates the axis based on the specified categories, range, and plot dimensions, and requests
|
|
165
|
+
* the plot to be redrawn.
|
|
166
|
+
* @param categories The category names for the axis, in order -- replaces the scale's domain,
|
|
167
|
+
* so passing a different set of categories (e.g. because the number of series changed) is how
|
|
168
|
+
* an axis reflects a new category count. Pass `axis.scale.domain()` to leave the categories
|
|
169
|
+
* unchanged (e.g. from a pan/zoom call site that isn't varying the category set).
|
|
107
170
|
* @param range An interval representing the range of the axis.
|
|
108
171
|
* @param originalRange An interval representing the original range of the axis (before zooming or panning).
|
|
109
172
|
* @param plotDimensions The dimensions of the plot (without the margins).
|
|
110
173
|
* @param margin The margins for the plot
|
|
111
174
|
* @return The number of pixels for each category on the axis.
|
|
112
175
|
*/
|
|
113
|
-
update: (range: AxisInterval, originalRange: AxisInterval, plotDimensions: Dimensions, margin: Margin) => number;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
176
|
+
update: (categories: Array<string>, range: AxisInterval, originalRange: AxisInterval, plotDimensions: Dimensions, margin: Margin) => number;
|
|
177
|
+
/**
|
|
178
|
+
* Updates the font used for the axis label without recreating the axis. The font's color is
|
|
179
|
+
* also the color of the axis line, the ticks, and the tick labels; the tick labels' size,
|
|
180
|
+
* family, and weight, though, stay fixed at whatever the tick style's font was set to when
|
|
181
|
+
* the axis was created.
|
|
182
|
+
*/
|
|
183
|
+
updateFont: (font: AxesFont) => void;
|
|
184
|
+
/**
|
|
185
|
+
* Highlights (or un-highlights) this axis -- see {@link ContinuousNumericAxis.setHighlighted}
|
|
186
|
+
* for the full explanation. `color`/`lineWidth` are remembered across calls, so a later
|
|
187
|
+
* `setHighlighted(true)` without them reuses whatever was last passed (or the built-in
|
|
188
|
+
* default on the first call).
|
|
189
|
+
* @param highlighted Whether the axis should be drawn highlighted
|
|
190
|
+
* @param color The highlight color
|
|
191
|
+
* @param lineWidth The highlight line width
|
|
192
|
+
*/
|
|
193
|
+
setHighlighted: (highlighted: boolean, color?: string, lineWidth?: number) => void;
|
|
123
194
|
}
|
|
124
195
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* @param chartId The ID of the chart to which the clip area is to be added
|
|
129
|
-
* @param axisId The ID of the axis to which the clip area is to be added
|
|
130
|
-
* @param svg The SVG element to which the clip area is to be added
|
|
131
|
-
* @param location The location of the axis
|
|
132
|
-
* @param plotDimensions The dimensions of the plot
|
|
133
|
-
* @param margin The margins around the plot
|
|
134
|
-
* @return The ID of the clip-path
|
|
196
|
+
* The possible locations of an axis.
|
|
197
|
+
* Note: replaces enums to support `erasableSyntaxOnly`
|
|
198
|
+
* TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
|
|
135
199
|
*/
|
|
136
|
-
export declare
|
|
200
|
+
export declare const AxisLocation: {
|
|
201
|
+
readonly Left: "Left";
|
|
202
|
+
readonly Right: "Right";
|
|
203
|
+
readonly Bottom: "Bottom";
|
|
204
|
+
readonly Top: "Top";
|
|
205
|
+
};
|
|
206
|
+
export type AxisLocation = (typeof AxisLocation)[keyof typeof AxisLocation];
|
|
137
207
|
/**
|
|
138
|
-
* Adds a category axis to the specified location
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* @param
|
|
208
|
+
* Adds a category axis to the specified location, registering its draw function with the canvas
|
|
209
|
+
* context. When the location is top or bottom, the category axis represents the x-axis; when the
|
|
210
|
+
* location is left or right, it represents the y-axis.
|
|
211
|
+
* @param cc The canvas context to register the axis' draw function with
|
|
142
212
|
* @param axisId A unique ID for the axis
|
|
143
|
-
* @param svg The SVG selection (d3)
|
|
144
213
|
* @param location The location of the axis
|
|
145
|
-
* @param categories
|
|
214
|
+
* @param categories The category names (the axis' `update` function can replace them later)
|
|
146
215
|
* @param axisLabel The axis label
|
|
147
216
|
* @param axesLabelFont The font for the axis label
|
|
148
|
-
* @param axisTickStyle Styling information for the ticks (
|
|
217
|
+
* @param axisTickStyle Styling information for the ticks (font, rotation, etc.)
|
|
149
218
|
* @param plotDimensions The dimensions of the plot
|
|
150
219
|
* @param margin The plot margin
|
|
151
|
-
* @param setAxisRangeFor
|
|
152
|
-
* @param setOriginalAxisRangeFor
|
|
153
|
-
* @return
|
|
220
|
+
* @param setAxisRangeFor Callback that sets the axis range for the specified axis
|
|
221
|
+
* @param setOriginalAxisRangeFor Callback that sets the original axis range for the specified axis
|
|
222
|
+
* @return An {@link OrdinalStringAxis}
|
|
154
223
|
*/
|
|
155
|
-
export declare function addOrdinalStringAxis(
|
|
224
|
+
export declare function addOrdinalStringAxis(cc: CanvasContext, axisId: string, location: AxisLocation, categories: Array<string>, axisLabel: string, axesLabelFont: AxesFont, axisTickStyle: AxisTickStyle, plotDimensions: Dimensions, margin: Margin, setAxisRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalAxisRangeFor: (axisId: string, range: AxisInterval) => void): OrdinalStringAxis;
|
|
156
225
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
226
|
+
* Removes a category x-axis' draw function from the canvas context (e.g. when the axis unmounts)
|
|
227
|
+
* @param cc The canvas context the axis' draw function is registered with
|
|
228
|
+
* @param axisId The ID of the axis
|
|
229
|
+
*/
|
|
230
|
+
export declare function removeOrdinalXAxis(cc: CanvasContext, axisId: string): void;
|
|
231
|
+
/**
|
|
232
|
+
* Removes a category y-axis' draw function from the canvas context (e.g. when the axis unmounts)
|
|
233
|
+
* @param cc The canvas context the axis' draw function is registered with
|
|
159
234
|
* @param axisId The ID of the axis
|
|
160
|
-
* @param svg The SVG selection to which to add the axis
|
|
161
|
-
* @param plotDimensions The dimensions of the plot
|
|
162
|
-
* @param location The location of the axis
|
|
163
|
-
* @param scaleGenerator The higher-order function that returns the axis d3 "scale" function
|
|
164
|
-
* @param domain The axis range (start, end)
|
|
165
|
-
* @param margin The plot margins for the border of main SVG group
|
|
166
|
-
* @param setAxisRangeFor A callback used to set the axis range
|
|
167
|
-
* @return A {@link ContinuousNumericAxis} based on the arguments to this function
|
|
168
235
|
*/
|
|
169
|
-
export declare function
|
|
236
|
+
export declare function removeOrdinalYAxis(cc: CanvasContext, axisId: string): void;
|
|
170
237
|
/**
|
|
171
|
-
* Adds a new empty
|
|
238
|
+
* Adds a new, empty x-axis (a line with no ticks or label) to the canvas context. An empty axis
|
|
172
239
|
* is just a line where the axis would be, without any ticks or labels.
|
|
240
|
+
* @param canvasContext The canvas context to register the axis' draw function with
|
|
173
241
|
* @param axisId The ID of the axis
|
|
174
|
-
* @param svg The SVG selection to which to add the axis
|
|
175
242
|
* @param plotDimensions The dimensions of the plot
|
|
176
243
|
* @param location The location of the axis
|
|
177
|
-
* @param scaleGenerator The
|
|
178
|
-
* @param
|
|
179
|
-
* @param
|
|
180
|
-
* @param
|
|
181
|
-
* @
|
|
244
|
+
* @param scaleGenerator The d3 scale to use for the axis (its domain and range get overwritten)
|
|
245
|
+
* @param margin The plot margins
|
|
246
|
+
* @param setAxisRangeFor A callback used to report the axis' domain when it's updated
|
|
247
|
+
* @param color The color of the axis line (the axis' `updateFont` updates it with the font's color)
|
|
248
|
+
* @param [domain=[0, 1]] The axis' initial domain (min, max)
|
|
249
|
+
* @return A {@link ContinuousNumericAxis} (marked `isEmpty`) based on the arguments to this function
|
|
182
250
|
*/
|
|
183
|
-
export declare function
|
|
251
|
+
export declare function addEmptyXAxis(canvasContext: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Bottom | typeof AxisLocation.Top, scaleGenerator: ScaleContinuousNumeric<number, number>, margin: Margin, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void, color: string, domain?: [minValue: number, maxValue: number]): ContinuousNumericAxis;
|
|
184
252
|
/**
|
|
185
|
-
* Adds a new
|
|
186
|
-
* @param
|
|
253
|
+
* Adds a new, empty y-axis (a line with no ticks or label) to the canvas context.
|
|
254
|
+
* @param cc The canvas context to register the axis' draw function with
|
|
187
255
|
* @param axisId The ID of the axis
|
|
188
|
-
* @param svg The SVG selection to which to add the axis
|
|
189
256
|
* @param plotDimensions The dimensions of the plot
|
|
190
257
|
* @param location The location of the axis
|
|
191
|
-
* @param scaleGenerator The
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
258
|
+
* @param scaleGenerator The d3 scale to use for the axis (its domain and range get overwritten)
|
|
259
|
+
* @param margin The plot margins
|
|
260
|
+
* @param setAxisRangeFor A callback used to report the axis' domain when it's updated
|
|
261
|
+
* @param color The color of the axis line (the axis' `updateFont` updates it with the font's color)
|
|
262
|
+
* @param [domain=[0, 1]] The axis' initial domain (min, max)
|
|
263
|
+
* @return A {@link ContinuousNumericAxis} (marked `isEmpty`) based on the arguments to this function
|
|
264
|
+
*/
|
|
265
|
+
export declare function addEmptyYAxis(cc: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Left | typeof AxisLocation.Right, scaleGenerator: ScaleContinuousNumeric<number, number>, margin: Margin, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void, color: string, domain?: [minValue: number, maxValue: number]): ContinuousNumericAxis;
|
|
266
|
+
/**
|
|
267
|
+
* Adds a new x-axis, registering its draw function with the canvas context.
|
|
268
|
+
* @param cc The canvas context to register the axis' draw function with
|
|
269
|
+
* @param axisId A unique ID for the axis
|
|
270
|
+
* @param plotDimensions The dimensions of the plot
|
|
271
|
+
* @param location The location of the axis (top or bottom)
|
|
272
|
+
* @param scaleGenerator The d3 scale to use for the axis (its domain/range get overwritten)
|
|
273
|
+
* @param domain The axis' initial domain (min, max)
|
|
274
|
+
* @param axesLabelFont The font for the axis label and ticks
|
|
275
|
+
* @param margin The plot margins
|
|
195
276
|
* @param axisLabel The label for the axis
|
|
196
|
-
* @param setAxisRangeFor
|
|
197
|
-
* @return A {@link ContinuousNumericAxis}
|
|
277
|
+
* @param setAxisRangeFor Callback used to report the axis' domain when it's updated
|
|
278
|
+
* @return A {@link ContinuousNumericAxis}
|
|
198
279
|
*/
|
|
199
|
-
export declare function addContinuousNumericXAxis(
|
|
280
|
+
export declare function addContinuousNumericXAxis(cc: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Bottom | typeof AxisLocation.Top, scaleGenerator: ScaleContinuousNumeric<number, number>, domain: [minValue: number, maxValue: number], axesLabelFont: AxesFont, margin: Margin, axisLabel: string, setAxisRangeFor: (axisId: string, timeRange: AxisInterval) => void): ContinuousNumericAxis;
|
|
200
281
|
/**
|
|
201
|
-
* Adds a new y-axis
|
|
202
|
-
* @param
|
|
203
|
-
* @param axisId
|
|
204
|
-
* @param svg The SVG selection to which to add the axis
|
|
282
|
+
* Adds a new y-axis, registering its draw function with the canvas context.
|
|
283
|
+
* @param cc The canvas context to register the axis' draw function with
|
|
284
|
+
* @param axisId A unique ID for the axis
|
|
205
285
|
* @param plotDimensions The dimensions of the plot
|
|
206
|
-
* @param location The location of the axis
|
|
207
|
-
* @param scaleGenerator The
|
|
208
|
-
* @param domain The axis
|
|
209
|
-
* @param axesLabelFont The font for the axis
|
|
210
|
-
* @param margin The plot margins
|
|
286
|
+
* @param location The location of the axis (left or right)
|
|
287
|
+
* @param scaleGenerator The d3 scale to use for the axis (its domain/range get overwritten)
|
|
288
|
+
* @param domain The axis' initial domain (min, max)
|
|
289
|
+
* @param axesLabelFont The font for the axis label and ticks
|
|
290
|
+
* @param margin The plot margins
|
|
211
291
|
* @param axisLabel The label for the axis
|
|
212
|
-
* @param setAxisRangeFor
|
|
213
|
-
* @return A {@link ContinuousNumericAxis}
|
|
292
|
+
* @param setAxisRangeFor Callback used to report the axis' domain when it's updated
|
|
293
|
+
* @return A {@link ContinuousNumericAxis}
|
|
214
294
|
*/
|
|
215
|
-
export declare function addContinuousNumericYAxis(
|
|
295
|
+
export declare function addContinuousNumericYAxis(cc: CanvasContext, axisId: string, plotDimensions: Dimensions, location: typeof AxisLocation.Left | typeof AxisLocation.Right, scaleGenerator: ScaleContinuousNumeric<number, number>, domain: [minValue: number, maxValue: number], axesLabelFont: AxesFont, margin: Margin, axisLabel: string, setAxisRangeFor: (axisId: string, range: AxisInterval) => void): ContinuousNumericAxis;
|
|
216
296
|
/**
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* @param
|
|
220
|
-
* @
|
|
297
|
+
* Removes a continuous x-axis' draw function from the canvas context (called on "unmount" to avoid
|
|
298
|
+
* leaking a draw registration for an axis that's no longer part of the chart).
|
|
299
|
+
* @param cc The canvas context the axis' draw function is registered with
|
|
300
|
+
* @param axisId The ID of the axis
|
|
221
301
|
*/
|
|
222
|
-
export declare function
|
|
302
|
+
export declare function removeContinuousXAxis(cc: CanvasContext, axisId: string): void;
|
|
303
|
+
/**
|
|
304
|
+
* Removes a continuous y-axis' draw function from the canvas context (called on "unmount" to avoid
|
|
305
|
+
* leaking a draw registration for an axis that's no longer part of the chart).
|
|
306
|
+
* @param cc The canvas context the axis' draw function is registered with
|
|
307
|
+
* @param axisId The ID of the axis
|
|
308
|
+
*/
|
|
309
|
+
export declare function removeContinuousYAxis(cc: CanvasContext, axisId: string): void;
|
|
223
310
|
/**
|
|
224
311
|
* The result of a zoom action
|
|
225
312
|
*/
|
|
226
313
|
export interface ZoomResult<AR extends BaseAxisRange> {
|
|
227
314
|
range: AR;
|
|
228
|
-
zoomFactor: number;
|
|
229
315
|
}
|
|
230
316
|
/**
|
|
231
317
|
* Called when the user uses the scroll wheel (or scroll gesture) to zoom in or out. Zooms in/out
|
|
232
|
-
*
|
|
233
|
-
* the
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
318
|
+
* around the specified domain value (the pivot), while ensuring that the range (start, end) is
|
|
319
|
+
* contained within the constraint (min, max). The pivot is a domain value rather than a pixel
|
|
320
|
+
* position -- while streaming, callers pin it to the axis's current "now" rather than to wherever
|
|
321
|
+
* the mouse happens to be (see `calcZoomAndUpdate`'s `pivotDomainValueFor`), which is what keeps
|
|
322
|
+
* "now" fixed on screen as the zoom widens/narrows the window around it.
|
|
323
|
+
*
|
|
324
|
+
* `zoomFactor` is *incremental* (relative to the range's `.current`, not its `.original`) -- see
|
|
325
|
+
* {@link BaseAxisRange.scaledRange}. d3-zoom's own `transform.k` is cumulative from wherever
|
|
326
|
+
* `__zoom` was last reset to identity, so callers must convert it to an incremental factor (this
|
|
327
|
+
* event's `k` divided by the previously-applied `k`) before calling this -- see
|
|
328
|
+
* `useCanvasZoomPan`.
|
|
329
|
+
* @param zoomFactor The incremental zoom scale factor for this event
|
|
330
|
+
* @param domainValue The domain value to zoom around (the pivot)
|
|
237
331
|
* @param range The current range for the axis being zoomed
|
|
238
332
|
* @param constraint The minimum and maximum value the scaled range can have
|
|
239
|
-
* @return The updated range
|
|
333
|
+
* @return The updated range
|
|
240
334
|
*/
|
|
241
|
-
export declare function calculateConstrainedZoomFor(
|
|
335
|
+
export declare function calculateConstrainedZoomFor(zoomFactor: number, domainValue: number, range: ContinuousAxisRange, constraint: [min: number, max: number]): ZoomResult<ContinuousAxisRange>;
|
|
242
336
|
/**
|
|
243
|
-
* Calculates the zoom for an ordinal axis.
|
|
244
|
-
*
|
|
337
|
+
* Calculates the zoom for an ordinal axis. Unlike {@link calculateConstrainedZoomFor}'s continuous
|
|
338
|
+
* axis, `zoomFactor` here is *cumulative* (d3-zoom's own `event.transform.k`, passed through
|
|
339
|
+
* unmodified) -- see {@link OrdinalAxisRange.scaledCumulative} for why: the range is scaled from
|
|
340
|
+
* `.current` by the incremental step the cumulative factor implies, except that a factor of
|
|
341
|
+
* exactly 1 snaps it back to `.original`, so that zooming all the way out always shows every
|
|
342
|
+
* category, whatever pivots were used along the way.
|
|
343
|
+
* @param zoomFactor The cumulative zoom scale factor for this event
|
|
245
344
|
* @param x The x-position of the mouse when the scroll wheel or gesture is used
|
|
246
345
|
* @param range The current range for the axis being zoomed
|
|
247
346
|
* @param constraint The minimum and maximum value the scaled range can have
|
|
248
|
-
* @return A ZoomResult holding the updated range
|
|
347
|
+
* @return A ZoomResult holding the updated range
|
|
249
348
|
*/
|
|
250
|
-
export declare function calculateOrdinalConstrainedZoomFor(
|
|
349
|
+
export declare function calculateOrdinalConstrainedZoomFor(zoomFactor: number, x: number, range: OrdinalAxisRange, constraint: [min: number, max: number]): ZoomResult<OrdinalAxisRange>;
|
|
251
350
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
* @param
|
|
255
|
-
* @param
|
|
351
|
+
* Calculates the axis range after the plot is dragged to the left or right (x-axis) or up or down
|
|
352
|
+
* (y-axis).
|
|
353
|
+
* @param delta The amount (in pixels) that the plot is dragged
|
|
354
|
+
* @param axis The axis being panned
|
|
355
|
+
* @param range The current range for the axis being panned
|
|
256
356
|
* @param [constrainToOriginalRange=false] When set to `true` then the pan requires that the axis
|
|
257
|
-
* range remains a subset of the
|
|
357
|
+
* range remains a subset of the original axis range (a pan that would leave it isn't made); when
|
|
358
|
+
* `false` the pan allows any range
|
|
258
359
|
* @return The updated range
|
|
259
360
|
*/
|
|
260
361
|
export declare function calculatePanFor(delta: number, axis: ContinuousNumericAxis, range: ContinuousAxisRange, constrainToOriginalRange?: boolean): ContinuousAxisRange;
|
|
261
|
-
|
|
362
|
+
/**
|
|
363
|
+
* Calculates the ordinal axis range after the plot is dragged to the left or right (x-axis) or up
|
|
364
|
+
* or down (y-axis). A pan that would leave part of the plot without categories (i.e. take the
|
|
365
|
+
* range's start past 0, or its end short of the plot's width or height) isn't made.
|
|
366
|
+
* @param delta The amount (in pixels) to pan the axis by.
|
|
367
|
+
* @param range The current axis range.
|
|
368
|
+
* @param plotDimensions The dimensions of the plot.
|
|
369
|
+
* @param location The location of the axis.
|
|
370
|
+
* @param constrainToOriginalRange Whether to constrain the pan to the original range.
|
|
371
|
+
* @returns The new axis range.
|
|
372
|
+
*/
|
|
373
|
+
export declare function calculateOrdinalPanFor(delta: number, range: OrdinalAxisRange, plotDimensions: Dimensions, location: AxisLocation, constrainToOriginalRange?: boolean): OrdinalAxisRange;
|
|
262
374
|
/**
|
|
263
375
|
* Accepts the series, the assignment of the series to axes, and the current x-axes state, and
|
|
264
|
-
* returns an array of the distinct axis IDs that cover all the series in the plot
|
|
376
|
+
* returns an array of the distinct x-axis IDs that cover all the series in the plot (a series
|
|
377
|
+
* without an x-axis assignment uses the default x-axis).
|
|
265
378
|
*
|
|
266
379
|
* @param series The array of series
|
|
267
380
|
* @param axisAssignments A map association a series name with its axis assignments
|
|
268
|
-
* @param axesState The current
|
|
269
|
-
* @return an array of the distinct
|
|
381
|
+
* @param axesState The current x-axes state
|
|
382
|
+
* @return an array of the distinct x-axis IDs that cover all the series in the plot
|
|
270
383
|
*/
|
|
271
384
|
export declare function axesForSeriesGen<D, A extends BaseAxis>(series: Array<BaseSeries<D>>, axisAssignments: Map<string, AxesAssignment>, axesState: AxesState<A>): Array<string>;
|
|
272
385
|
/**
|
|
@@ -276,7 +389,7 @@ export declare function axesForSeriesGen<D, A extends BaseAxis>(series: Array<Ba
|
|
|
276
389
|
* to the left or right. After calling the handler function, the plot needs to be updated as well, and this is
|
|
277
390
|
* left for the caller.
|
|
278
391
|
*
|
|
279
|
-
* Please note that the function generated by this function has side effects -- it updates the
|
|
392
|
+
* Please note that the function generated by this function has side effects -- it updates the axis ranges.
|
|
280
393
|
*
|
|
281
394
|
* @param axesForSeries The distinct axes that cover all the series
|
|
282
395
|
* @param margin The plot margin
|
|
@@ -294,7 +407,7 @@ export declare function panHandler(axesForSeries: Array<string>, margin: Margin,
|
|
|
294
407
|
* to the left or right. After calling the handler function, the plot needs to be updated as well, and this is
|
|
295
408
|
* left for the caller.
|
|
296
409
|
*
|
|
297
|
-
* Please note that the function generated by this function has side effects -- it updates the axes ranges.
|
|
410
|
+
* Please note that the function generated by this function has side effects -- it updates the axes' ranges.
|
|
298
411
|
*
|
|
299
412
|
* @param axesForSeries The distinct axes that cover all the series
|
|
300
413
|
* @param margin The plot margin
|
|
@@ -312,7 +425,7 @@ export declare function ordinalPanHandler(axesForSeries: Array<string>, margin:
|
|
|
312
425
|
* to the left or right. After calling the handler function, the plot needs to be updated as well, and this is
|
|
313
426
|
* left for the caller.
|
|
314
427
|
*
|
|
315
|
-
* Please note that the function generated by this function has side effects -- it updates the axes ranges.
|
|
428
|
+
* Please note that the function generated by this function has side effects -- it updates the axes' ranges.
|
|
316
429
|
*
|
|
317
430
|
* @param xAxesForSeries The distinct x-axes that cover all the series
|
|
318
431
|
* @param yAxesForSeries The distinct y-axes that cover all the series
|
|
@@ -331,40 +444,40 @@ export declare function panHandler2D(xAxesForSeries: Array<string>, yAxesForSeri
|
|
|
331
444
|
* function returns a handler function. And this handler function adjusts the range when the plot is zoomed.
|
|
332
445
|
* After calling the handler function, the plot needs to be updated as well, and this is left for the caller.
|
|
333
446
|
*
|
|
334
|
-
* Please note that the function generated by this function has side effects -- it updates the axes ranges.
|
|
447
|
+
* Please note that the function generated by this function has side effects -- it updates the axes' ranges.
|
|
335
448
|
*
|
|
336
449
|
* @param axesForSeries The distinct axes that cover all the series
|
|
337
450
|
* @param margin The plot margin
|
|
338
451
|
* @param setRangeFor Function for setting the new time-range for a specific axis
|
|
339
452
|
* @param axesState The current state of the x- or y-axes
|
|
340
|
-
* @param scaleExtent The minimum and maximum allowed scale factors
|
|
341
|
-
* @return A handler function for
|
|
453
|
+
* @param [scaleExtent=[0, Infinity]] The minimum and maximum allowed scale factors
|
|
454
|
+
* @return A handler function for zoom events
|
|
342
455
|
*/
|
|
343
|
-
export declare function continuousAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<ContinuousNumericAxis>, scaleExtent?: [min: number, max: number]): (
|
|
456
|
+
export declare function continuousAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<ContinuousNumericAxis>, scaleExtent?: [min: number, max: number]): (zoomFactor: number, pivotDomainValueFor: (axisId: string, axis: ContinuousNumericAxis) => number, plotDimensions: Dimensions, ranges: Map<string, ContinuousAxisRange>) => void;
|
|
344
457
|
/**
|
|
345
458
|
* Higher-order function that generates a handler for zoom events, given the distinct series IDs that cover all
|
|
346
459
|
* the axes in the chart, the margin, range update function, and the current state of the x- or y-axes. This
|
|
347
460
|
* function returns a handler function. And this handler function adjusts the range when the plot is zoomed.
|
|
348
461
|
* After calling the handler function, the plot needs to be updated as well, and this is left for the caller.
|
|
349
462
|
*
|
|
350
|
-
* Please note that the function generated by this function has side effects -- it updates the axes ranges.
|
|
463
|
+
* Please note that the function generated by this function has side effects -- it updates the axes' ranges.
|
|
351
464
|
*
|
|
352
465
|
* @param axesForSeries The distinct axes that cover all the series
|
|
353
466
|
* @param margin The plot margin
|
|
354
467
|
* @param setRangeFor Function for setting the new time-range for a specific axis
|
|
355
468
|
* @param setOriginalRangeFor Function for setting the new original range for a specific axis
|
|
356
469
|
* @param axesState The current state of the x- or y-axes
|
|
357
|
-
* @param scaleExtent The minimum and maximum allowed scale factors
|
|
358
|
-
* @return A handler function for
|
|
470
|
+
* @param [scaleExtent=[0, Infinity]] The minimum and maximum allowed scale factors
|
|
471
|
+
* @return A handler function for zoom events
|
|
359
472
|
*/
|
|
360
|
-
export declare function ordinalAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<OrdinalStringAxis>, scaleExtent?: [min: number, max: number]): (
|
|
473
|
+
export declare function ordinalAxisZoomHandler(axesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, setOriginalRangeFor: (axisId: string, range: AxisInterval) => void, axesState: AxesState<OrdinalStringAxis>, scaleExtent?: [min: number, max: number]): (zoomFactor: number, x: number, plotDimensions: Dimensions, ranges: Map<string, OrdinalAxisRange>) => void;
|
|
361
474
|
/**
|
|
362
475
|
* Higher-order function that generates a handler for zoom events, given the distinct series IDs that cover all
|
|
363
476
|
* the axes in the chart, the margin, range update function, and the current state of the x- or y-axes. This
|
|
364
477
|
* function returns a handler function. And this handler function adjusts the time-range when the plot is zoomed.
|
|
365
478
|
* After calling the handler function, the plot needs to be updated as well, and this is left for the caller.
|
|
366
479
|
*
|
|
367
|
-
* Please note that the function generated by this function has side effects -- it updates the axes ranges.
|
|
480
|
+
* Please note that the function generated by this function has side effects -- it updates the axes' ranges.
|
|
368
481
|
*
|
|
369
482
|
* @param xAxesForSeries The distinct x-axes that cover all the series
|
|
370
483
|
* @param yAxesForSeries The distinct y-axes that cover all the series
|
|
@@ -373,47 +486,57 @@ export declare function ordinalAxisZoomHandler(axesForSeries: Array<string>, mar
|
|
|
373
486
|
* @param xAxesState The current state of the x-axes
|
|
374
487
|
* @param yAxesState The current state of the y-axes
|
|
375
488
|
* @param scaleExtent The smallest and largest scale factors allowed
|
|
376
|
-
* @return A handler function for
|
|
489
|
+
* @return A handler function for zoom events
|
|
377
490
|
*/
|
|
378
|
-
export declare function axesZoomHandler(xAxesForSeries: Array<string>, yAxesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, xAxesState: AxesState<ContinuousNumericAxis>, yAxesState: AxesState<ContinuousNumericAxis>, scaleExtent: [min: number, max: number]): (
|
|
491
|
+
export declare function axesZoomHandler(xAxesForSeries: Array<string>, yAxesForSeries: Array<string>, margin: Margin, setRangeFor: (axisId: string, range: AxisInterval) => void, xAxesState: AxesState<ContinuousNumericAxis>, yAxesState: AxesState<ContinuousNumericAxis>, scaleExtent: [min: number, max: number]): (zoomFactor: number, mousePosition: [x: number, y: number], plotDimensions: Dimensions, xRanges: Map<string, ContinuousAxisRange>, yRanges: Map<string, ContinuousAxisRange>) => void;
|
|
379
492
|
/**
|
|
380
|
-
* Calculates the axis-ranges for each of the continuous numeric axes in the map
|
|
493
|
+
* Calculates the axis-ranges for each of the continuous numeric axes in the map, from each axis'
|
|
494
|
+
* current domain (see {@link continuousRange})
|
|
381
495
|
* @param axes The map containing the axes and their associated IDs
|
|
382
|
-
* @return a map associating the axis IDs
|
|
496
|
+
* @return a map associating the axis IDs with their continuous axis-range
|
|
383
497
|
*/
|
|
384
498
|
export declare function continuousAxisRanges(axes: Map<string, ContinuousNumericAxis>): Map<string, ContinuousAxisRange>;
|
|
385
499
|
/**
|
|
386
|
-
* Calculates the axis-ranges for each of the ordinal axes in the map
|
|
500
|
+
* Calculates the axis-ranges for each of the ordinal axes in the map, read from each axis's own
|
|
501
|
+
* scale range.
|
|
387
502
|
* @param axes The map containing the axes and their associated IDs
|
|
388
|
-
* @
|
|
389
|
-
* @return a map associating the axis IDs to their ordinal axis-range
|
|
503
|
+
* @return a map associating the axis IDs with their ordinal axis-range
|
|
390
504
|
*/
|
|
391
|
-
export declare function ordinalAxisRanges(axes: Map<string, OrdinalStringAxis
|
|
505
|
+
export declare function ordinalAxisRanges(axes: Map<string, OrdinalStringAxis>): Map<string, OrdinalAxisRange>;
|
|
392
506
|
/**
|
|
393
|
-
* Calculates the axis interval (start, end)
|
|
394
|
-
* @param axes The axes
|
|
395
|
-
* @return A map associating each axis with
|
|
507
|
+
* Calculates the axis interval (start, end) of each axis' current domain
|
|
508
|
+
* @param axes The axes, by their IDs
|
|
509
|
+
* @return A map associating each axis ID with its domain's (start, end) interval
|
|
396
510
|
*/
|
|
397
511
|
export declare function continuousAxisIntervals(axes: Map<string, ContinuousNumericAxis>): Map<string, AxisInterval>;
|
|
398
512
|
/**
|
|
399
|
-
* Calculates the
|
|
400
|
-
*
|
|
401
|
-
* @
|
|
513
|
+
* Calculates the pixel interval (start, end) of each ordinal axis' current range, along with its
|
|
514
|
+
* categories
|
|
515
|
+
* @param axes The axes, by their IDs
|
|
516
|
+
* @return A map associating each axis ID with its range's (start, end) interval and its categories
|
|
402
517
|
*/
|
|
403
518
|
export declare function ordinalAxisIntervals(axes: Map<string, OrdinalStringAxis>): Map<string, {
|
|
404
519
|
interval: AxisInterval;
|
|
405
520
|
categories: Array<string>;
|
|
406
521
|
}>;
|
|
407
522
|
/**
|
|
408
|
-
* Returns the bounds on the specified continuous numeric axes
|
|
523
|
+
* Returns the bounds on the specified continuous numeric axes: a new axis range (with its original
|
|
524
|
+
* range the same as its current range) from each axis' current domain
|
|
409
525
|
* @param axes A map associating an axis ID with a {@link ContinuousNumericAxis}
|
|
410
526
|
* @return A map associating each specified axis ID with the interval covered (bounds) by the axis
|
|
411
527
|
*/
|
|
412
528
|
export declare function continuousRange(axes: Map<string, ContinuousNumericAxis>): Map<string, ContinuousAxisRange>;
|
|
413
529
|
/**
|
|
414
|
-
* Returns the bounds on the specified
|
|
530
|
+
* Returns the bounds on the specified ordinal axes, read from each axis's own scale range.
|
|
531
|
+
*
|
|
532
|
+
* Previously mapped every axis ID to one shared, caller-supplied `originalRange`, discarding the
|
|
533
|
+
* axis object entirely (`[id, ]`) -- harmless today only because there's no per-axis margin/offset
|
|
534
|
+
* mechanism anywhere in this codebase, so every ordinal axis in a chart is architecturally
|
|
535
|
+
* guaranteed to span the same pixel range already. Reading each axis's own `.scale.range()`
|
|
536
|
+
* instead (mirroring {@link ordinalAxisIntervals}, which already does this correctly) removes that
|
|
537
|
+
* latent footgun for a chart with multiple category axes whose ranges genuinely differ.
|
|
415
538
|
* @param axes A map associating an axis ID with a {@link OrdinalStringAxis}
|
|
416
|
-
* @param originalRange The original range of the axis
|
|
417
539
|
* @return A map associating each specified axis ID with the interval covered (bounds) by the axis
|
|
418
540
|
*/
|
|
419
|
-
export declare function ordinalRange(axes: Map<string, OrdinalStringAxis
|
|
541
|
+
export declare function ordinalRange(axes: Map<string, OrdinalStringAxis>): Map<string, OrdinalAxisRange>;
|
|
542
|
+
//# sourceMappingURL=axes.d.ts.map
|