stream-charts 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +809 -1022
- package/changes.md +40 -0
- package/dist/app/charts/Chart.d.ts +35 -139
- package/dist/app/charts/Chart.d.ts.map +1 -0
- package/dist/app/charts/Chart.js +74 -65
- package/dist/app/charts/Chart.js.map +1 -1
- package/dist/app/charts/axes/AxesState.d.ts +26 -18
- package/dist/app/charts/axes/AxesState.d.ts.map +1 -0
- package/dist/app/charts/axes/AxesState.js +26 -24
- package/dist/app/charts/axes/AxesState.js.map +1 -1
- package/dist/app/charts/axes/AxisInterval.d.ts +44 -26
- package/dist/app/charts/axes/AxisInterval.d.ts.map +1 -0
- package/dist/app/charts/axes/AxisInterval.js +48 -29
- package/dist/app/charts/axes/AxisInterval.js.map +1 -1
- package/dist/app/charts/axes/BaseAxisRange.d.ts +46 -22
- package/dist/app/charts/axes/BaseAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/BaseAxisRange.js +17 -12
- package/dist/app/charts/axes/BaseAxisRange.js.map +1 -1
- package/dist/app/charts/axes/ContinuousAxis.d.ts +47 -6
- package/dist/app/charts/axes/ContinuousAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/ContinuousAxis.js +160 -27
- package/dist/app/charts/axes/ContinuousAxis.js.map +1 -1
- package/dist/app/charts/axes/ContinuousAxisRange.d.ts +29 -10
- package/dist/app/charts/axes/ContinuousAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/ContinuousAxisRange.js +29 -11
- package/dist/app/charts/axes/ContinuousAxisRange.js.map +1 -1
- package/dist/app/charts/axes/EmptyAxis.d.ts +5 -2
- package/dist/app/charts/axes/EmptyAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/EmptyAxis.js +30 -9
- package/dist/app/charts/axes/EmptyAxis.js.map +1 -1
- package/dist/app/charts/axes/OrdinalAxis.d.ts +5 -3
- package/dist/app/charts/axes/OrdinalAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/OrdinalAxis.js +39 -16
- package/dist/app/charts/axes/OrdinalAxis.js.map +1 -1
- package/dist/app/charts/axes/OrdinalAxisRange.d.ts +76 -13
- package/dist/app/charts/axes/OrdinalAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/OrdinalAxisRange.js +95 -16
- package/dist/app/charts/axes/OrdinalAxisRange.js.map +1 -1
- package/dist/app/charts/axes/autoScale.d.ts +111 -0
- package/dist/app/charts/axes/autoScale.d.ts.map +1 -0
- package/dist/app/charts/axes/autoScale.js +188 -0
- package/dist/app/charts/axes/autoScale.js.map +1 -0
- package/dist/app/charts/axes/axes.d.ts +273 -150
- package/dist/app/charts/axes/axes.d.ts.map +1 -0
- package/dist/app/charts/axes/axes.js +808 -583
- package/dist/app/charts/axes/axes.js.map +1 -1
- package/dist/app/charts/d3types.d.ts +40 -11
- package/dist/app/charts/d3types.d.ts.map +1 -0
- package/dist/app/charts/d3types.js +3 -0
- package/dist/app/charts/d3types.js.map +1 -1
- package/dist/app/charts/datasources/StreamingDataSource.d.ts +149 -0
- package/dist/app/charts/datasources/StreamingDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/StreamingDataSource.js +110 -0
- package/dist/app/charts/datasources/StreamingDataSource.js.map +1 -0
- package/dist/app/charts/datasources/iteratesDataSource.d.ts +73 -0
- package/dist/app/charts/datasources/iteratesDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/iteratesDataSource.js +87 -0
- package/dist/app/charts/datasources/iteratesDataSource.js.map +1 -0
- package/dist/app/charts/datasources/ordinalDataSource.d.ts +75 -0
- package/dist/app/charts/datasources/ordinalDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/ordinalDataSource.js +135 -0
- package/dist/app/charts/datasources/ordinalDataSource.js.map +1 -0
- package/dist/app/charts/datasources/outlierDataSource.d.ts +53 -0
- package/dist/app/charts/datasources/outlierDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/outlierDataSource.js +57 -0
- package/dist/app/charts/datasources/outlierDataSource.js.map +1 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.d.ts +77 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.js +85 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.js.map +1 -0
- package/dist/app/charts/filters/regexFilter.d.ts +31 -4
- package/dist/app/charts/filters/regexFilter.d.ts.map +1 -0
- package/dist/app/charts/filters/regexFilter.js +38 -4
- package/dist/app/charts/filters/regexFilter.js.map +1 -1
- package/dist/app/charts/hooks/AxesProvider.d.ts +21 -0
- package/dist/app/charts/hooks/AxesProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/AxesProvider.js +213 -0
- package/dist/app/charts/hooks/AxesProvider.js.map +1 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts +25 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.js +76 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.js.map +1 -0
- package/dist/app/charts/hooks/ChartProvider.d.ts +40 -0
- package/dist/app/charts/hooks/ChartProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/ChartProvider.js +33 -0
- package/dist/app/charts/hooks/ChartProvider.js.map +1 -0
- package/dist/app/charts/hooks/InteractionProvider.d.ts +23 -0
- package/dist/app/charts/hooks/InteractionProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/InteractionProvider.js +60 -0
- package/dist/app/charts/hooks/InteractionProvider.js.map +1 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts +16 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.js +76 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.js.map +1 -0
- package/dist/app/charts/hooks/defaultAxesValues.d.ts +11 -0
- package/dist/app/charts/hooks/defaultAxesValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultAxesValues.js +36 -0
- package/dist/app/charts/hooks/defaultAxesValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultMouseValues.d.ts +9 -0
- package/dist/app/charts/hooks/defaultMouseValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultMouseValues.js +23 -0
- package/dist/app/charts/hooks/defaultMouseValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.d.ts +13 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.js +23 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.js.map +1 -0
- package/dist/app/charts/hooks/defaultTooltipValues.d.ts +9 -0
- package/dist/app/charts/hooks/defaultTooltipValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultTooltipValues.js +21 -0
- package/dist/app/charts/hooks/defaultTooltipValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultUseChartValues.d.ts +14 -0
- package/dist/app/charts/hooks/defaultUseChartValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultUseChartValues.js +30 -0
- package/dist/app/charts/hooks/defaultUseChartValues.js.map +1 -0
- package/dist/app/charts/hooks/useAxes.d.ts +49 -36
- package/dist/app/charts/hooks/useAxes.d.ts.map +1 -0
- package/dist/app/charts/hooks/useAxes.js +16 -176
- package/dist/app/charts/hooks/useAxes.js.map +1 -1
- package/dist/app/charts/hooks/useCanvasSurface.d.ts +25 -0
- package/dist/app/charts/hooks/useCanvasSurface.d.ts.map +1 -0
- package/dist/app/charts/hooks/useCanvasSurface.js +18 -0
- package/dist/app/charts/hooks/useCanvasSurface.js.map +1 -0
- package/dist/app/charts/hooks/useChart.d.ts +30 -44
- package/dist/app/charts/hooks/useChart.d.ts.map +1 -0
- package/dist/app/charts/hooks/useChart.js +26 -48
- package/dist/app/charts/hooks/useChart.js.map +1 -1
- package/dist/app/charts/hooks/useDataSource.d.ts +68 -0
- package/dist/app/charts/hooks/useDataSource.d.ts.map +1 -0
- package/dist/app/charts/hooks/useDataSource.js +63 -0
- package/dist/app/charts/hooks/useDataSource.js.map +1 -0
- package/dist/app/charts/hooks/useHoveredSeries.d.ts +25 -0
- package/dist/app/charts/hooks/useHoveredSeries.d.ts.map +1 -0
- package/dist/app/charts/hooks/useHoveredSeries.js +15 -0
- package/dist/app/charts/hooks/useHoveredSeries.js.map +1 -0
- package/dist/app/charts/hooks/useMouse.d.ts +46 -22
- package/dist/app/charts/hooks/useMouse.d.ts.map +1 -0
- package/dist/app/charts/hooks/useMouse.js +12 -56
- package/dist/app/charts/hooks/useMouse.js.map +1 -1
- package/dist/app/charts/hooks/usePlotDimensions.d.ts +25 -13
- package/dist/app/charts/hooks/usePlotDimensions.d.ts.map +1 -0
- package/dist/app/charts/hooks/usePlotDimensions.js +6 -62
- package/dist/app/charts/hooks/usePlotDimensions.js.map +1 -1
- package/dist/app/charts/hooks/useTooltip.d.ts +24 -26
- package/dist/app/charts/hooks/useTooltip.d.ts.map +1 -0
- package/dist/app/charts/hooks/useTooltip.js +12 -42
- package/dist/app/charts/hooks/useTooltip.js.map +1 -1
- package/dist/app/charts/index.d.ts +66 -0
- package/dist/app/charts/index.d.ts.map +1 -0
- package/dist/app/charts/index.js +87 -0
- package/dist/app/charts/index.js.map +1 -0
- package/dist/app/charts/legends/Legend.d.ts +33 -12
- package/dist/app/charts/legends/Legend.d.ts.map +1 -0
- package/dist/app/charts/legends/Legend.js +138 -379
- package/dist/app/charts/legends/Legend.js.map +1 -1
- package/dist/app/charts/legends/constants.d.ts +19 -0
- package/dist/app/charts/legends/constants.d.ts.map +1 -0
- package/dist/app/charts/legends/constants.js +34 -0
- package/dist/app/charts/legends/constants.js.map +1 -0
- package/dist/app/charts/observables/ChartData.d.ts +1 -0
- package/dist/app/charts/observables/ChartData.d.ts.map +1 -0
- package/dist/app/charts/observables/iterates.d.ts +13 -7
- package/dist/app/charts/observables/iterates.d.ts.map +1 -0
- package/dist/app/charts/observables/iterates.js +42 -9
- package/dist/app/charts/observables/iterates.js.map +1 -1
- package/dist/app/charts/observables/ordinals.d.ts +70 -12
- package/dist/app/charts/observables/ordinals.d.ts.map +1 -0
- package/dist/app/charts/observables/ordinals.js +127 -48
- package/dist/app/charts/observables/ordinals.js.map +1 -1
- package/dist/app/charts/observables/outliers.d.ts +18 -0
- package/dist/app/charts/observables/outliers.d.ts.map +1 -0
- package/dist/app/charts/observables/outliers.js +2 -0
- package/dist/app/charts/observables/outliers.js.map +1 -0
- package/dist/app/charts/plots/BarPlot.d.ts +87 -13
- package/dist/app/charts/plots/BarPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/BarPlot.js +603 -356
- package/dist/app/charts/plots/BarPlot.js.map +1 -1
- package/dist/app/charts/plots/OutlierPlot.d.ts +123 -0
- package/dist/app/charts/plots/OutlierPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/OutlierPlot.js +430 -0
- package/dist/app/charts/plots/OutlierPlot.js.map +1 -0
- package/dist/app/charts/plots/PoincarePlot.d.ts +92 -14
- package/dist/app/charts/plots/PoincarePlot.d.ts.map +1 -0
- package/dist/app/charts/plots/PoincarePlot.js +523 -364
- package/dist/app/charts/plots/PoincarePlot.js.map +1 -1
- package/dist/app/charts/plots/RasterPlot.d.ts +31 -10
- package/dist/app/charts/plots/RasterPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/RasterPlot.js +198 -306
- package/dist/app/charts/plots/RasterPlot.js.map +1 -1
- package/dist/app/charts/plots/ScatterPlot.d.ts +77 -21
- package/dist/app/charts/plots/ScatterPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/ScatterPlot.js +359 -302
- package/dist/app/charts/plots/ScatterPlot.js.map +1 -1
- package/dist/app/charts/plots/autoScaleYAxes.d.ts +43 -0
- package/dist/app/charts/plots/autoScaleYAxes.d.ts.map +1 -0
- package/dist/app/charts/plots/autoScaleYAxes.js +71 -0
- package/dist/app/charts/plots/autoScaleYAxes.js.map +1 -0
- package/dist/app/charts/plots/colorizedLine.d.ts +61 -0
- package/dist/app/charts/plots/colorizedLine.d.ts.map +1 -0
- package/dist/app/charts/plots/colorizedLine.js +157 -0
- package/dist/app/charts/plots/colorizedLine.js.map +1 -0
- package/dist/app/charts/plots/constants.d.ts +7 -0
- package/dist/app/charts/plots/constants.d.ts.map +1 -0
- package/dist/app/charts/plots/constants.js +11 -0
- package/dist/app/charts/plots/constants.js.map +1 -0
- package/dist/app/charts/plots/hitTesting.d.ts +88 -0
- package/dist/app/charts/plots/hitTesting.d.ts.map +1 -0
- package/dist/app/charts/plots/hitTesting.js +136 -0
- package/dist/app/charts/plots/hitTesting.js.map +1 -0
- package/dist/app/charts/plots/plot.d.ts +52 -16
- package/dist/app/charts/plots/plot.d.ts.map +1 -0
- package/dist/app/charts/plots/plot.js +108 -35
- package/dist/app/charts/plots/plot.js.map +1 -1
- package/dist/app/charts/plots/useCanvasZoomPan.d.ts +119 -0
- package/dist/app/charts/plots/useCanvasZoomPan.d.ts.map +1 -0
- package/dist/app/charts/plots/useCanvasZoomPan.js +113 -0
- package/dist/app/charts/plots/useCanvasZoomPan.js.map +1 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.d.ts +103 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.d.ts.map +1 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.js +257 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.js.map +1 -0
- package/dist/app/charts/series/baseSeries.d.ts +60 -8
- package/dist/app/charts/series/baseSeries.d.ts.map +1 -0
- package/dist/app/charts/series/baseSeries.js +53 -8
- package/dist/app/charts/series/baseSeries.js.map +1 -1
- package/dist/app/charts/series/iterateSeries.d.ts +9 -8
- package/dist/app/charts/series/iterateSeries.d.ts.map +1 -0
- package/dist/app/charts/series/iterateSeries.js +7 -7
- package/dist/app/charts/series/iterateSeries.js.map +1 -1
- package/dist/app/charts/series/ordinalSeries.d.ts +27 -13
- package/dist/app/charts/series/ordinalSeries.d.ts.map +1 -0
- package/dist/app/charts/series/ordinalSeries.js +29 -15
- package/dist/app/charts/series/ordinalSeries.js.map +1 -1
- package/dist/app/charts/series/outlierSeries.d.ts +142 -0
- package/dist/app/charts/series/outlierSeries.d.ts.map +1 -0
- package/dist/app/charts/series/outlierSeries.js +82 -0
- package/dist/app/charts/series/outlierSeries.js.map +1 -0
- package/dist/app/charts/series/timeSeries.d.ts +13 -9
- package/dist/app/charts/series/timeSeries.d.ts.map +1 -0
- package/dist/app/charts/series/timeSeries.js +6 -3
- package/dist/app/charts/series/timeSeries.js.map +1 -1
- package/dist/app/charts/series/timeSeriesChartData.d.ts +18 -10
- package/dist/app/charts/series/timeSeriesChartData.d.ts.map +1 -0
- package/dist/app/charts/series/timeSeriesChartData.js +28 -14
- package/dist/app/charts/series/timeSeriesChartData.js.map +1 -1
- package/dist/app/charts/styling/barPlotStyle.d.ts +46 -2
- package/dist/app/charts/styling/barPlotStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/barPlotStyle.js +37 -3
- package/dist/app/charts/styling/barPlotStyle.js.map +1 -1
- package/dist/app/charts/styling/canvasStyle.d.ts +53 -0
- package/dist/app/charts/styling/canvasStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/canvasStyle.js +71 -0
- package/dist/app/charts/styling/canvasStyle.js.map +1 -0
- package/dist/app/charts/styling/margins.d.ts +21 -2
- package/dist/app/charts/styling/margins.d.ts.map +1 -0
- package/dist/app/charts/styling/margins.js +25 -4
- package/dist/app/charts/styling/margins.js.map +1 -1
- package/dist/app/charts/styling/svgStyle.d.ts +10 -56
- package/dist/app/charts/styling/svgStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/svgStyle.js +3 -78
- package/dist/app/charts/styling/svgStyle.js.map +1 -1
- package/dist/app/charts/subscriptions/viewDrivers.d.ts +124 -0
- package/dist/app/charts/subscriptions/viewDrivers.d.ts.map +1 -0
- package/dist/app/charts/subscriptions/viewDrivers.js +338 -0
- package/dist/app/charts/subscriptions/viewDrivers.js.map +1 -0
- package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts +12 -78
- package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/BarPlotTooltipContent.js +65 -257
- package/dist/app/charts/tooltips/BarPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts +9 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js +16 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts +30 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js +26 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts +22 -72
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js +104 -171
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts +32 -8
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.js +62 -115
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts +39 -12
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js +162 -134
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/Tooltip.d.ts +27 -32
- package/dist/app/charts/tooltips/Tooltip.d.ts.map +1 -0
- package/dist/app/charts/tooltips/Tooltip.js +37 -81
- package/dist/app/charts/tooltips/Tooltip.js.map +1 -1
- package/dist/app/charts/tooltips/TooltipContent.d.ts +81 -0
- package/dist/app/charts/tooltips/TooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/TooltipContent.js +99 -0
- package/dist/app/charts/tooltips/TooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/tooltipUtils.d.ts +186 -36
- package/dist/app/charts/tooltips/tooltipUtils.d.ts.map +1 -0
- package/dist/app/charts/tooltips/tooltipUtils.js +277 -48
- package/dist/app/charts/tooltips/tooltipUtils.js.map +1 -1
- package/dist/app/charts/tooltips/useOutlierTooltip.d.ts +59 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.js +16 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.js.map +1 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.d.ts +51 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.js +52 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.js.map +1 -0
- package/dist/app/charts/tooltips/useTooltipStyle.d.ts +11 -0
- package/dist/app/charts/tooltips/useTooltipStyle.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useTooltipStyle.js +14 -0
- package/dist/app/charts/tooltips/useTooltipStyle.js.map +1 -0
- package/dist/app/charts/trackers/Tracker.d.ts +22 -6
- package/dist/app/charts/trackers/Tracker.d.ts.map +1 -0
- package/dist/app/charts/trackers/Tracker.js +36 -22
- package/dist/app/charts/trackers/Tracker.js.map +1 -1
- package/dist/app/charts/trackers/trackerUtils.d.ts +40 -18
- package/dist/app/charts/trackers/trackerUtils.d.ts.map +1 -0
- package/dist/app/charts/trackers/trackerUtils.js +213 -300
- package/dist/app/charts/trackers/trackerUtils.js.map +1 -1
- package/dist/app/charts/utils.d.ts +72 -33
- package/dist/app/charts/utils.d.ts.map +1 -0
- package/dist/app/charts/utils.js +87 -42
- package/dist/app/charts/utils.js.map +1 -1
- package/dist/index.d.ts +2 -45
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -72
- package/dist/index.js.map +1 -1
- package/package.json +87 -46
- package/src/app/charts/Chart.tsx +132 -168
- package/src/app/charts/axes/AxesState.ts +27 -29
- package/src/app/charts/axes/AxisInterval.ts +57 -32
- package/src/app/charts/axes/BaseAxisRange.ts +47 -27
- package/src/app/charts/axes/ContinuousAxis.tsx +235 -39
- package/src/app/charts/axes/ContinuousAxisRange.ts +29 -11
- package/src/app/charts/axes/EmptyAxis.tsx +52 -17
- package/src/app/charts/axes/OrdinalAxis.tsx +54 -28
- package/src/app/charts/axes/OrdinalAxisRange.ts +96 -16
- package/src/app/charts/axes/autoScale.ts +244 -0
- package/src/app/charts/axes/axes.ts +954 -735
- package/src/app/charts/d3types.ts +42 -13
- package/src/app/charts/datasources/StreamingDataSource.ts +214 -0
- package/src/app/charts/datasources/iteratesDataSource.ts +122 -0
- package/src/app/charts/datasources/ordinalDataSource.ts +205 -0
- package/src/app/charts/datasources/outlierDataSource.ts +90 -0
- package/src/app/charts/datasources/timeSeriesDataSource.ts +133 -0
- package/src/app/charts/filters/regexFilter.ts +45 -5
- package/src/app/charts/hooks/AxesProvider.tsx +301 -0
- package/src/app/charts/hooks/CanvasSurfaceProvider.tsx +117 -0
- package/src/app/charts/hooks/ChartProvider.tsx +79 -0
- package/src/app/charts/hooks/InteractionProvider.tsx +88 -0
- package/src/app/charts/hooks/PlotDimensionsProvider.tsx +109 -0
- package/src/app/charts/hooks/defaultAxesValues.ts +40 -0
- package/src/app/charts/hooks/defaultMouseValues.ts +24 -0
- package/src/app/charts/hooks/defaultPlotDimensions.ts +27 -0
- package/src/app/charts/hooks/defaultTooltipValues.tsx +23 -0
- package/src/app/charts/hooks/defaultUseChartValues.tsx +36 -0
- package/src/app/charts/hooks/useAxes.tsx +60 -228
- package/src/app/charts/hooks/useCanvasSurface.tsx +35 -0
- package/src/app/charts/hooks/useChart.tsx +47 -106
- package/src/app/charts/hooks/useDataSource.tsx +106 -0
- package/src/app/charts/hooks/useHoveredSeries.tsx +33 -0
- package/src/app/charts/hooks/useMouse.tsx +58 -82
- package/src/app/charts/hooks/usePlotDimensions.tsx +25 -89
- package/src/app/charts/hooks/useTooltip.tsx +32 -63
- package/src/app/charts/index.ts +213 -0
- package/src/app/charts/legends/Legend.tsx +198 -479
- package/src/app/charts/legends/constants.ts +37 -0
- package/src/app/charts/observables/iterates.ts +32 -12
- package/src/app/charts/observables/ordinals.ts +141 -67
- package/src/app/charts/observables/outliers.ts +20 -0
- package/src/app/charts/plots/BarPlot.tsx +784 -666
- package/src/app/charts/plots/OutlierPlot.tsx +685 -0
- package/src/app/charts/plots/PoincarePlot.tsx +707 -489
- package/src/app/charts/plots/RasterPlot.tsx +253 -445
- package/src/app/charts/plots/ScatterPlot.tsx +480 -463
- package/src/app/charts/plots/autoScaleYAxes.ts +102 -0
- package/src/app/charts/plots/colorizedLine.ts +185 -0
- package/src/app/charts/plots/constants.ts +16 -0
- package/src/app/charts/plots/hitTesting.ts +198 -0
- package/src/app/charts/plots/plot.ts +138 -44
- package/src/app/charts/plots/useCanvasZoomPan.ts +240 -0
- package/src/app/charts/plots/useStreamingTimeAxes.ts +384 -0
- package/src/app/charts/series/baseSeries.ts +81 -14
- package/src/app/charts/series/iterateSeries.ts +8 -8
- package/src/app/charts/series/ordinalSeries.ts +35 -20
- package/src/app/charts/series/outlierSeries.ts +188 -0
- package/src/app/charts/series/timeSeries.ts +14 -12
- package/src/app/charts/series/timeSeriesChartData.ts +31 -17
- package/src/app/charts/styling/barPlotStyle.ts +48 -5
- package/src/app/charts/styling/canvasStyle.ts +86 -0
- package/src/app/charts/styling/margins.ts +28 -4
- package/src/app/charts/styling/svgStyle.ts +10 -91
- package/src/app/charts/subscriptions/viewDrivers.ts +447 -0
- package/src/app/charts/tooltips/BarPlotTooltipContent.tsx +156 -380
- package/src/app/charts/tooltips/DefaultOutlierTooltipContent.tsx +40 -0
- package/src/app/charts/tooltips/OutlierPlotTooltipContent.tsx +67 -0
- package/src/app/charts/tooltips/PoincarePlotTooltipContent.tsx +229 -292
- package/src/app/charts/tooltips/RasterPlotTooltipContent.tsx +164 -217
- package/src/app/charts/tooltips/ScatterPlotTooltipContent.tsx +373 -236
- package/src/app/charts/tooltips/Tooltip.tsx +58 -124
- package/src/app/charts/tooltips/TooltipContent.tsx +177 -0
- package/src/app/charts/tooltips/tooltipUtils.ts +359 -61
- package/src/app/charts/tooltips/useOutlierTooltip.tsx +68 -0
- package/src/app/charts/tooltips/useTooltipPlacement.ts +86 -0
- package/src/app/charts/tooltips/useTooltipStyle.ts +15 -0
- package/src/app/charts/trackers/Tracker.tsx +68 -33
- package/src/app/charts/trackers/trackerUtils.ts +263 -376
- package/src/app/charts/utils.ts +90 -48
- package/src/index.ts +2 -322
- package/dist/app/charts/axes/AxesState.test.d.ts +0 -1
- package/dist/app/charts/axes/AxesState.test.js +0 -30
- package/dist/app/charts/axes/AxesState.test.js.map +0 -1
- package/dist/app/charts/axes/AxisInterval.test.d.ts +0 -1
- package/dist/app/charts/axes/AxisInterval.test.js +0 -120
- package/dist/app/charts/axes/AxisInterval.test.js.map +0 -1
- package/dist/app/charts/axes/ContinuousAxisRange.test.d.ts +0 -1
- package/dist/app/charts/axes/ContinuousAxisRange.test.js +0 -47
- package/dist/app/charts/axes/ContinuousAxisRange.test.js.map +0 -1
- package/dist/app/charts/axes/OrdinalAxisRange.test.d.ts +0 -1
- package/dist/app/charts/axes/OrdinalAxisRange.test.js +0 -48
- package/dist/app/charts/axes/OrdinalAxisRange.test.js.map +0 -1
- package/dist/app/charts/filters/regexFilter.test.d.ts +0 -1
- package/dist/app/charts/filters/regexFilter.test.js +0 -11
- package/dist/app/charts/filters/regexFilter.test.js.map +0 -1
- package/dist/app/charts/hooks/useDataObservable.d.ts +0 -72
- package/dist/app/charts/hooks/useDataObservable.js +0 -74
- package/dist/app/charts/hooks/useDataObservable.js.map +0 -1
- package/dist/app/charts/hooks/useInitialData.d.ts +0 -36
- package/dist/app/charts/hooks/useInitialData.js +0 -28
- package/dist/app/charts/hooks/useInitialData.js.map +0 -1
- package/dist/app/charts/observables/iterates.test.d.ts +0 -1
- package/dist/app/charts/observables/iterates.test.js +0 -180
- package/dist/app/charts/observables/iterates.test.js.map +0 -1
- package/dist/app/charts/observables/ordinals.test.d.ts +0 -1
- package/dist/app/charts/observables/ordinals.test.js +0 -102
- package/dist/app/charts/observables/ordinals.test.js.map +0 -1
- package/dist/app/charts/series/datumSeries.test.d.ts +0 -1
- package/dist/app/charts/series/datumSeries.test.js +0 -50
- package/dist/app/charts/series/datumSeries.test.js.map +0 -1
- package/dist/app/charts/styling/margins.test.d.ts +0 -1
- package/dist/app/charts/styling/margins.test.js +0 -19
- package/dist/app/charts/styling/margins.test.js.map +0 -1
- package/dist/app/charts/subscriptions/subscription.test.d.ts +0 -1
- package/dist/app/charts/subscriptions/subscription.test.js +0 -395
- package/dist/app/charts/subscriptions/subscription.test.js.map +0 -1
- package/dist/app/charts/subscriptions/subscriptions.d.ts +0 -100
- package/dist/app/charts/subscriptions/subscriptions.js +0 -449
- package/dist/app/charts/subscriptions/subscriptions.js.map +0 -1
- package/src/app/charts/axes/AxesState.test.ts +0 -34
- package/src/app/charts/axes/AxisInterval.test.ts +0 -143
- package/src/app/charts/axes/ContinuousAxisRange.test.ts +0 -55
- package/src/app/charts/axes/OrdinalAxisRange.test.ts +0 -55
- package/src/app/charts/filters/regexFilter.test.ts +0 -13
- package/src/app/charts/hooks/useDataObservable.tsx +0 -170
- package/src/app/charts/hooks/useInitialData.tsx +0 -64
- package/src/app/charts/observables/iterates.test.ts +0 -201
- package/src/app/charts/observables/ordinals.test.ts +0 -135
- package/src/app/charts/series/datumSeries.test.ts +0 -60
- package/src/app/charts/styling/margins.test.ts +0 -22
- package/src/app/charts/subscriptions/subscription.test.ts +0 -499
- package/src/app/charts/subscriptions/subscriptions.ts +0 -635
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { BaseSeries } from "./baseSeries";
|
|
1
|
+
import { type BaseSeries } from "./baseSeries";
|
|
2
2
|
/**
|
|
3
|
-
* An immutable datum object that holds
|
|
3
|
+
* An immutable datum object that holds an (x, y) value -- for a time series, a (time, value) pair
|
|
4
|
+
* (e.g. a neuron spike, or a weight)
|
|
4
5
|
*/
|
|
5
6
|
export interface Datum {
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* Creates a datum from a (time, value) pair
|
|
@@ -13,18 +14,21 @@ export interface Datum {
|
|
|
13
14
|
* @return A {@link Datum} instance with the specified (time, value)
|
|
14
15
|
*/
|
|
15
16
|
export declare const datumOf: (time: number, value: number) => Datum;
|
|
17
|
+
/**
|
|
18
|
+
* @return An empty datum (its x and y are `NaN`)
|
|
19
|
+
*/
|
|
16
20
|
export declare const emptyDatum: () => Datum;
|
|
21
|
+
/**
|
|
22
|
+
* A series of (time, value) data (e.g. for the scatter and raster plots)
|
|
23
|
+
*/
|
|
17
24
|
export type TimeSeries = BaseSeries<Datum>;
|
|
18
25
|
/**
|
|
19
26
|
* Creates a series from the name and the optional array of (x, y) pairs (tuples)
|
|
20
27
|
* @param name The name of the series
|
|
21
28
|
* @param data The optional array of (x, y) pairs (tuples)
|
|
22
|
-
* @return A
|
|
29
|
+
* @return A {@link TimeSeries} that can be used by, e.g., the `ScatterPlot` and the `RasterPlot`
|
|
23
30
|
* @see seriesFrom
|
|
24
31
|
* @see emptySeries
|
|
25
32
|
*/
|
|
26
33
|
export declare const timeSeriesFromTuples: (name: string, data?: Array<[number, number]>) => TimeSeries;
|
|
27
|
-
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
|
-
}
|
|
34
|
+
//# sourceMappingURL=timeSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeSeries.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/series/timeSeries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,UAAU,EAAa,MAAM,cAAc,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,KAA8B,CAAA;AAEpF;;GAEG;AACH,eAAO,MAAM,UAAU,QAAO,KAA2B,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;AAG1C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,EAAE,OAAM,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,KAAG,UAC/B,CAAA"}
|
|
@@ -5,13 +5,16 @@ import { seriesFrom } from "./baseSeries";
|
|
|
5
5
|
* @param value The value
|
|
6
6
|
* @return A {@link Datum} instance with the specified (time, value)
|
|
7
7
|
*/
|
|
8
|
-
export const datumOf = (time, value) => ({ time, value });
|
|
9
|
-
|
|
8
|
+
export const datumOf = (time, value) => ({ x: time, y: value });
|
|
9
|
+
/**
|
|
10
|
+
* @return An empty datum (its x and y are `NaN`)
|
|
11
|
+
*/
|
|
12
|
+
export const emptyDatum = () => ({ x: NaN, y: NaN });
|
|
10
13
|
/**
|
|
11
14
|
* Creates a series from the name and the optional array of (x, y) pairs (tuples)
|
|
12
15
|
* @param name The name of the series
|
|
13
16
|
* @param data The optional array of (x, y) pairs (tuples)
|
|
14
|
-
* @return A
|
|
17
|
+
* @return A {@link TimeSeries} that can be used by, e.g., the `ScatterPlot` and the `RasterPlot`
|
|
15
18
|
* @see seriesFrom
|
|
16
19
|
* @see emptySeries
|
|
17
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeSeries.js","sourceRoot":"","sources":["../../../../src/app/charts/series/timeSeries.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"timeSeries.js","sourceRoot":"","sources":["../../../../src/app/charts/series/timeSeries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAC,MAAM,cAAc,CAAC;AAWzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,KAAa,EAAS,EAAE,CAAC,CAAC,EAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,CAAC,CAAA;AAEpF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAU,EAAE,CAAC,CAAC,EAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAC,CAAC,CAAA;AAQzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,OAAgC,EAAE,EAAc,EAAE,CACjG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Datum, TimeSeries } from "./timeSeries";
|
|
2
|
-
import { ChartData } from "../observables/ChartData";
|
|
1
|
+
import type { Datum, TimeSeries } from "./timeSeries";
|
|
2
|
+
import { type ChartData } from "../observables/ChartData";
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The time-series chart data produced by the rxjs observable that is pushed to a streaming chart
|
|
5
|
+
* (e.g. the scatter and raster charts): each chunk's new points, and the latest times
|
|
5
6
|
*/
|
|
6
7
|
export interface TimeSeriesChartData extends ChartData {
|
|
7
8
|
/**
|
|
@@ -23,15 +24,22 @@ export interface TimeSeriesChartData extends ChartData {
|
|
|
23
24
|
currentTime?: number;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* Creates
|
|
27
|
-
*
|
|
28
|
-
* @
|
|
27
|
+
* Creates a chart data object for the specified series whose times are all 0, and whose new
|
|
28
|
+
* points are a single (0, 0) point for each series
|
|
29
|
+
* @param series The list of series names (identifiers) to update
|
|
30
|
+
* @return The chart data object
|
|
29
31
|
*/
|
|
30
32
|
export declare function emptyTimeSeriesChartData(series: Array<string>): TimeSeriesChartData;
|
|
31
33
|
/**
|
|
32
|
-
* Creates
|
|
33
|
-
*
|
|
34
|
+
* Creates the chart data object to start a stream from, for the specified series: its new points
|
|
35
|
+
* are each series' last datum (or (0, 0), for an empty series), each series' max time is the
|
|
36
|
+
* time of its last datum (or 0), and the max time is the latest of those (or `-Infinity`, when
|
|
37
|
+
* there are no series)
|
|
38
|
+
* @param seriesList The series
|
|
34
39
|
* @param [currentTime=0] The current time
|
|
35
|
-
* @
|
|
40
|
+
* @param [compactingSize=DEFAULT_COMPACTING_SIZE] The number of shifts each new-points array
|
|
41
|
+
* accumulates before it's compacted
|
|
42
|
+
* @return The chart data object
|
|
36
43
|
*/
|
|
37
|
-
export declare function initialTimeSeriesChartData(seriesList: Array<TimeSeries>, currentTime?: number): TimeSeriesChartData;
|
|
44
|
+
export declare function initialTimeSeriesChartData(seriesList: Array<TimeSeries>, currentTime?: number, compactingSize?: number): TimeSeriesChartData;
|
|
45
|
+
//# sourceMappingURL=timeSeriesChartData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeSeriesChartData.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/series/timeSeriesChartData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,KAAK,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,KAAK,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AAI1E;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IAClD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE7B;;;OAGG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IAEpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,mBAAmB,CAQnF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACtC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,EAC7B,WAAW,GAAE,MAAU,EACvB,cAAc,GAAE,MAAgC,GACjD,mBAAmB,CAkBrB"}
|
|
@@ -1,30 +1,44 @@
|
|
|
1
1
|
import { defaultChartData } from "../observables/ChartData";
|
|
2
|
+
import { FastShiftArray } from "fast-shift-array";
|
|
3
|
+
import { DEFAULT_COMPACTING_SIZE } from "./baseSeries";
|
|
2
4
|
/**
|
|
3
|
-
* Creates
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
5
|
+
* Creates a chart data object for the specified series whose times are all 0, and whose new
|
|
6
|
+
* points are a single (0, 0) point for each series
|
|
7
|
+
* @param series The list of series names (identifiers) to update
|
|
8
|
+
* @return The chart data object
|
|
6
9
|
*/
|
|
7
10
|
export function emptyTimeSeriesChartData(series) {
|
|
8
|
-
return
|
|
11
|
+
return {
|
|
12
|
+
...defaultChartData(),
|
|
13
|
+
seriesNames: new Set(series),
|
|
14
|
+
maxTime: 0,
|
|
15
|
+
maxTimes: new Map(series.map(name => [name, 0])),
|
|
16
|
+
newPoints: new Map(series.map(name => [name, [{ x: 0, y: 0 }]]))
|
|
17
|
+
};
|
|
9
18
|
}
|
|
10
19
|
/**
|
|
11
|
-
* Creates
|
|
12
|
-
*
|
|
20
|
+
* Creates the chart data object to start a stream from, for the specified series: its new points
|
|
21
|
+
* are each series' last datum (or (0, 0), for an empty series), each series' max time is the
|
|
22
|
+
* time of its last datum (or 0), and the max time is the latest of those (or `-Infinity`, when
|
|
23
|
+
* there are no series)
|
|
24
|
+
* @param seriesList The series
|
|
13
25
|
* @param [currentTime=0] The current time
|
|
14
|
-
* @
|
|
26
|
+
* @param [compactingSize=DEFAULT_COMPACTING_SIZE] The number of shifts each new-points array
|
|
27
|
+
* accumulates before it's compacted
|
|
28
|
+
* @return The chart data object
|
|
15
29
|
*/
|
|
16
|
-
export function initialTimeSeriesChartData(seriesList, currentTime = 0) {
|
|
17
|
-
const maxTime = seriesList.reduce((tMax, series) => Math.max(tMax, series.last().map(datum => datum.
|
|
30
|
+
export function initialTimeSeriesChartData(seriesList, currentTime = 0, compactingSize = DEFAULT_COMPACTING_SIZE) {
|
|
31
|
+
const maxTime = seriesList.reduce((tMax, series) => Math.max(tMax, series.last().map(datum => datum.x).getOrElse(-Infinity)), -Infinity);
|
|
18
32
|
return {
|
|
19
33
|
seriesNames: new Set(seriesList.map(series => series.name)),
|
|
20
34
|
maxTime,
|
|
21
|
-
maxTimes: new Map(seriesList.map(series => [series.name, series.last().map(datum => datum.
|
|
35
|
+
maxTimes: new Map(seriesList.map(series => [series.name, series.last().map(datum => datum.x).getOrElse(0)])),
|
|
22
36
|
newPoints: new Map(seriesList.map(series => [
|
|
23
37
|
series.name,
|
|
24
|
-
[{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}]
|
|
38
|
+
FastShiftArray.fromArray([{
|
|
39
|
+
x: series.last().map(datum => datum.x).getOrElse(0),
|
|
40
|
+
y: series.last().map(datum => datum.y).getOrElse(0)
|
|
41
|
+
}], true, compactingSize)
|
|
28
42
|
])),
|
|
29
43
|
currentTime: currentTime
|
|
30
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeSeriesChartData.js","sourceRoot":"","sources":["../../../../src/app/charts/series/timeSeriesChartData.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"timeSeriesChartData.js","sourceRoot":"","sources":["../../../../src/app/charts/series/timeSeriesChartData.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AA6BrD;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAqB;IAC1D,OAAO;QACH,GAAG,gBAAgB,EAAE;QACrB,WAAW,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC;QAC5B,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,SAAS,EAAE,IAAI,GAAG,CAAuB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC;KACvF,CAAA;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,0BAA0B,CACtC,UAA6B,EAC7B,cAAsB,CAAC,EACvB,iBAAyB,uBAAuB;IAEhD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAC7B,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,EAC1F,CAAC,QAAQ,CACZ,CAAA;IACD,OAAO;QACH,WAAW,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3D,OAAO;QACP,QAAQ,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5G,SAAS,EAAE,IAAI,GAAG,CAAuB,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9D,MAAM,CAAC,IAAI;YACX,cAAc,CAAC,SAAS,CAAC,CAAC;oBACtB,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;oBACnD,CAAC,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;iBACtD,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC;SAC5B,CAAC,CAAC;QACH,WAAW,EAAE,WAAW;KAC3B,CAAA;AACL,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { SeriesStyle } from "../axes/axes";
|
|
2
|
-
import { SvgFillStyle, SvgStrokeStyle } from "./svgStyle";
|
|
1
|
+
import type { SeriesStyle } from "../axes/axes";
|
|
2
|
+
import type { SvgFillStyle, SvgStrokeStyle } from "./svgStyle";
|
|
3
|
+
/**
|
|
4
|
+
* The style of a bar series: the style of each of its bars and lines
|
|
5
|
+
*/
|
|
3
6
|
export interface BarSeriesStyle extends SeriesStyle {
|
|
4
7
|
/**
|
|
5
8
|
* The bar style for the lifetime min/max range bar. The style is for the width, fill,
|
|
@@ -24,18 +27,59 @@ export interface BarSeriesStyle extends SeriesStyle {
|
|
|
24
27
|
*/
|
|
25
28
|
windowedMeanValueLine: LineStyle;
|
|
26
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* The style of a bar: its width (as a fraction of the category's width), its fill, and its stroke
|
|
32
|
+
*/
|
|
27
33
|
export interface BarStyle {
|
|
28
34
|
widthFraction: number;
|
|
29
35
|
fill: SvgFillStyle;
|
|
30
36
|
stroke: SvgStrokeStyle;
|
|
31
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The style of a line: normally, and when highlighted
|
|
40
|
+
*/
|
|
32
41
|
export interface LineStyle {
|
|
33
42
|
regular: SvgStrokeStyle;
|
|
34
43
|
highlight: SvgStrokeStyle;
|
|
35
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The default style for the lifetime min/max bar: 65% of the category's width, a translucent fill,
|
|
47
|
+
* and a thin stroke
|
|
48
|
+
* @param [color="#008aad"] The bar's fill and stroke color
|
|
49
|
+
* @return The bar style
|
|
50
|
+
*/
|
|
36
51
|
export declare function defaultMinMaxBarStyle(color?: string): BarStyle;
|
|
52
|
+
/**
|
|
53
|
+
* The default style for the windowed min/max bar: 25% of the category's width (narrower than the
|
|
54
|
+
* lifetime bar, so both can be seen), filled with a slightly darker color, and no stroke
|
|
55
|
+
* @param [color="#008aad"] The color to darken for the bar's fill (used as-is when it can't be parsed)
|
|
56
|
+
* @return The bar style
|
|
57
|
+
*/
|
|
37
58
|
export declare function defaultWindowedMinMaxBarStyle(color?: string): BarStyle;
|
|
59
|
+
/**
|
|
60
|
+
* The default style for the current-value line: 3 pixels wide (5 when highlighted)
|
|
61
|
+
* @param [color="#008aad"] The line's color
|
|
62
|
+
* @return The line style
|
|
63
|
+
*/
|
|
38
64
|
export declare function defaultValueLineStyle(color?: string): LineStyle;
|
|
65
|
+
/**
|
|
66
|
+
* The default style for the (lifetime) mean-value line: 1 pixel wide (3 when highlighted)
|
|
67
|
+
* @param [color="#008aad"] The line's color
|
|
68
|
+
* @return The line style
|
|
69
|
+
*/
|
|
39
70
|
export declare function defaultMeanValueLineStyle(color?: string): LineStyle;
|
|
71
|
+
/**
|
|
72
|
+
* The default style for the windowed mean-value line: 1 pixel wide (3 when highlighted), and red
|
|
73
|
+
* by default to set it apart from the other lines
|
|
74
|
+
* @param [color="#ad0000"] The line's color
|
|
75
|
+
* @return The line style
|
|
76
|
+
*/
|
|
40
77
|
export declare function defaultWindowedMeanValueLineStyle(color?: string): LineStyle;
|
|
78
|
+
/**
|
|
79
|
+
* The default style for a bar series: all the bars and lines in the specified color (see the
|
|
80
|
+
* default styles above), except for the windowed min/max bar's darker fill
|
|
81
|
+
* @param [color="#008aad"] The series' color
|
|
82
|
+
* @return The bar series style
|
|
83
|
+
*/
|
|
41
84
|
export declare function defaultBarSeriesStyle(color?: string): BarSeriesStyle;
|
|
85
|
+
//# sourceMappingURL=barPlotStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"barPlotStyle.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/styling/barPlotStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAG7D;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IAC/C;;;OAGG;IACH,SAAS,EAAE,QAAQ,CAAA;IACnB;;;OAGG;IACH,iBAAiB,EAAE,QAAQ,CAAA;IAC3B;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,aAAa,EAAE,SAAS,CAAA;IACxB;;OAEG;IACH,qBAAqB,EAAE,SAAS,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,YAAY,CAAA;IAClB,MAAM,EAAE,cAAc,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,cAAc,CAAA;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,MAAkB,GAAG,QAAQ,CAazE;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,GAAE,MAAkB,GAAG,QAAQ,CAajF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,MAAkB,GAAG,SAAS,CAa1E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,GAAE,MAAkB,GAAG,SAAS,CAa9E;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,GAAE,MAAkB,GAAG,SAAS,CAatF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,MAAkB,GAAG,cAAc,CAU/E"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import * as d3 from "d3";
|
|
2
|
+
/**
|
|
3
|
+
* The default style for the lifetime min/max bar: 65% of the category's width, a translucent fill,
|
|
4
|
+
* and a thin stroke
|
|
5
|
+
* @param [color="#008aad"] The bar's fill and stroke color
|
|
6
|
+
* @return The bar style
|
|
7
|
+
*/
|
|
2
8
|
export function defaultMinMaxBarStyle(color = "#008aad") {
|
|
3
9
|
return {
|
|
4
10
|
widthFraction: 0.65,
|
|
@@ -13,6 +19,12 @@ export function defaultMinMaxBarStyle(color = "#008aad") {
|
|
|
13
19
|
}
|
|
14
20
|
};
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* The default style for the windowed min/max bar: 25% of the category's width (narrower than the
|
|
24
|
+
* lifetime bar, so both can be seen), filled with a slightly darker color, and no stroke
|
|
25
|
+
* @param [color="#008aad"] The color to darken for the bar's fill (used as-is when it can't be parsed)
|
|
26
|
+
* @return The bar style
|
|
27
|
+
*/
|
|
16
28
|
export function defaultWindowedMinMaxBarStyle(color = "#008aad") {
|
|
17
29
|
var _a, _b, _c, _d;
|
|
18
30
|
return {
|
|
@@ -28,6 +40,11 @@ export function defaultWindowedMinMaxBarStyle(color = "#008aad") {
|
|
|
28
40
|
}
|
|
29
41
|
};
|
|
30
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The default style for the current-value line: 3 pixels wide (5 when highlighted)
|
|
45
|
+
* @param [color="#008aad"] The line's color
|
|
46
|
+
* @return The line style
|
|
47
|
+
*/
|
|
31
48
|
export function defaultValueLineStyle(color = "#008aad") {
|
|
32
49
|
return {
|
|
33
50
|
regular: {
|
|
@@ -42,6 +59,11 @@ export function defaultValueLineStyle(color = "#008aad") {
|
|
|
42
59
|
}
|
|
43
60
|
};
|
|
44
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The default style for the (lifetime) mean-value line: 1 pixel wide (3 when highlighted)
|
|
64
|
+
* @param [color="#008aad"] The line's color
|
|
65
|
+
* @return The line style
|
|
66
|
+
*/
|
|
45
67
|
export function defaultMeanValueLineStyle(color = "#008aad") {
|
|
46
68
|
return {
|
|
47
69
|
regular: {
|
|
@@ -56,20 +78,32 @@ export function defaultMeanValueLineStyle(color = "#008aad") {
|
|
|
56
78
|
}
|
|
57
79
|
};
|
|
58
80
|
}
|
|
59
|
-
|
|
81
|
+
/**
|
|
82
|
+
* The default style for the windowed mean-value line: 1 pixel wide (3 when highlighted), and red
|
|
83
|
+
* by default to set it apart from the other lines
|
|
84
|
+
* @param [color="#ad0000"] The line's color
|
|
85
|
+
* @return The line style
|
|
86
|
+
*/
|
|
87
|
+
export function defaultWindowedMeanValueLineStyle(color = "#ad0000") {
|
|
60
88
|
return {
|
|
61
89
|
regular: {
|
|
62
|
-
color:
|
|
90
|
+
color: color,
|
|
63
91
|
opacity: 0.6,
|
|
64
92
|
width: 1
|
|
65
93
|
},
|
|
66
94
|
highlight: {
|
|
67
|
-
color:
|
|
95
|
+
color: color,
|
|
68
96
|
opacity: 1,
|
|
69
97
|
width: 3
|
|
70
98
|
}
|
|
71
99
|
};
|
|
72
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The default style for a bar series: all the bars and lines in the specified color (see the
|
|
103
|
+
* default styles above), except for the windowed min/max bar's darker fill
|
|
104
|
+
* @param [color="#008aad"] The series' color
|
|
105
|
+
* @return The bar series style
|
|
106
|
+
*/
|
|
73
107
|
export function defaultBarSeriesStyle(color = "#008aad") {
|
|
74
108
|
return {
|
|
75
109
|
color,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barPlotStyle.js","sourceRoot":"","sources":["../../../../src/app/charts/styling/barPlotStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"barPlotStyle.js","sourceRoot":"","sources":["../../../../src/app/charts/styling/barPlotStyle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AA+CzB;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,SAAS;IAC3D,OAAO;QACH,aAAa,EAAE,IAAI;QACnB,IAAI,EAAE;YACF,KAAK;YACL,OAAO,EAAE,GAAG;SACf;QACD,MAAM,EAAE;YACJ,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,GAAG;YACZ,KAAK;SACR;KACJ,CAAA;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAC,QAAgB,SAAS;;IACnE,OAAO;QACH,aAAa,EAAE,IAAI;QACnB,IAAI,EAAE;YACF,KAAK,EAAE,MAAA,MAAA,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,0CAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,mCAAI,KAAK;YACvD,OAAO,EAAE,GAAG;SACf;QACD,MAAM,EAAE;YACJ,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,MAAA,MAAA,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,0CAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,mCAAI,KAAK;SAC1D;KACJ,CAAA;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,SAAS;IAC3D,OAAO;QACH,OAAO,EAAE;YACL,KAAK;YACL,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE,CAAC;SACX;QACD,SAAS,EAAE;YACP,KAAK;YACL,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,CAAC;SACX;KACJ,CAAA;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAgB,SAAS;IAC/D,OAAO;QACH,OAAO,EAAE;YACL,KAAK;YACL,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE,CAAC;SACX;QACD,SAAS,EAAE;YACP,KAAK;YACL,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,CAAC;SACX;KACJ,CAAA;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,QAAgB,SAAS;IACvE,OAAO;QACH,OAAO,EAAE;YACL,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE,CAAC;SACX;QACD,SAAS,EAAE;YACP,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC;YACV,KAAK,EAAE,CAAC;SACX;KACJ,CAAA;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,SAAS;IAC3D,OAAO;QACH,KAAK;QACL,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,qBAAqB,CAAC,KAAK,CAAC;QACvC,iBAAiB,EAAE,6BAA6B,CAAC,KAAK,CAAC;QACvD,SAAS,EAAE,qBAAqB,CAAC,KAAK,CAAC;QACvC,aAAa,EAAE,yBAAyB,CAAC,KAAK,CAAC;QAC/C,qBAAqB,EAAE,iCAAiC,CAAC,KAAK,CAAC;KAClE,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The style of a stroke (a line, or a shape's outline)
|
|
3
|
+
*/
|
|
4
|
+
export interface CanvasStrokeStyle {
|
|
5
|
+
readonly color: string;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly opacity: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Applies a stroke style to the canvas context. Call this immediately before `ctx.stroke()` --
|
|
11
|
+
* unlike the old SVG version, the effect is not persistent.
|
|
12
|
+
* @param context The canvas 2D context to apply the style to
|
|
13
|
+
* @param style The (partial) stroke style to apply; unset fields are left untouched on `ctx`
|
|
14
|
+
* @return `ctx`, for chaining
|
|
15
|
+
*/
|
|
16
|
+
export declare function applyStrokeStyle(context: CanvasRenderingContext2D, style: Partial<CanvasStrokeStyle>): CanvasRenderingContext2D;
|
|
17
|
+
/**
|
|
18
|
+
* The style of a (shape's) fill
|
|
19
|
+
*/
|
|
20
|
+
export interface CanvasFillStyle {
|
|
21
|
+
readonly color: string;
|
|
22
|
+
readonly opacity: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Applies a fill style to the canvas context. Call this immediately before `ctx.fill()`/
|
|
26
|
+
* `ctx.fillText()`/`ctx.fillRect()` -- unlike the old SVG version, the effect is not persistent.
|
|
27
|
+
* @param context The canvas 2D context to apply the style to
|
|
28
|
+
* @param style The (partial) fill style to apply; unset fields are left untouched on `ctx`
|
|
29
|
+
* @return `ctx`, for chaining
|
|
30
|
+
*/
|
|
31
|
+
export declare function applyFillStyle(context: CanvasRenderingContext2D, style: Partial<CanvasFillStyle>): CanvasRenderingContext2D;
|
|
32
|
+
/**
|
|
33
|
+
* Bakes an opacity into a color string by resolving it to `rgba(...)`. Needed because canvas has
|
|
34
|
+
* a single `globalAlpha` shared between stroke and fill (see the module-level note above); when a
|
|
35
|
+
* shape needs independent stroke and fill opacity, use this to bake opacity into the color passed
|
|
36
|
+
* to `applyStrokeStyle`/`applyFillStyle` instead of setting `opacity` on both.
|
|
37
|
+
*
|
|
38
|
+
* Uses `d3.color(...)` (already the project's convention for this elsewhere -- see `Legend.tsx`,
|
|
39
|
+
* `barPlotStyle.ts`) rather than the previous approach of assigning `color` to a single
|
|
40
|
+
* module-level, lazily-created `<canvas>` context's `fillStyle` and reading back the browser's
|
|
41
|
+
* normalized value: assigning an unparseable CSS string to `fillStyle` is a silent no-op per the
|
|
42
|
+
* Canvas 2D spec, so an invalid `color` would have silently resolved to whatever the *previous,
|
|
43
|
+
* unrelated* `withAlpha` call (from any chart/tooltip/legend on the page, since the context was a
|
|
44
|
+
* single shared singleton) happened to leave `fillStyle` at -- order-dependent and effectively
|
|
45
|
+
* nondeterministic. `d3.color` instead returns `null` for unparseable input, so an invalid color
|
|
46
|
+
* falls through to the same "fall back to the original string" behavior this always had for the
|
|
47
|
+
* "no canvas 2d support" case, deterministically, with no shared state at all.
|
|
48
|
+
* @param color Any valid CSS color string (named, hex, rgb, rgba, hsl, etc)
|
|
49
|
+
* @param opacity The opacity to bake in, from 0 (transparent) to 1 (opaque)
|
|
50
|
+
* @return An `rgba(...)` string equivalent to `color` at the given `opacity`
|
|
51
|
+
*/
|
|
52
|
+
export declare function withAlpha(color: string, opacity: number): string;
|
|
53
|
+
//# sourceMappingURL=canvasStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvasStyle.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/styling/canvasStyle.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,wBAAwB,CAK/H;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,wBAAwB,CAI3H;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQhE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Canvas equivalents of the stroke/fill helpers that used to live in svgStyle.ts. The old versions
|
|
2
|
+
// mutated a *persistent* SVG element's CSS style (`selection.style('stroke', ...)`), so it stuck
|
|
3
|
+
// around until changed again. Canvas has no persistent elements -- `ctx.strokeStyle`/`ctx.fillStyle`
|
|
4
|
+
// /`ctx.lineWidth` are transient 2D-context state that only affects the *next* stroke()/fill() call,
|
|
5
|
+
// so these must be (re-)applied immediately before every draw, every frame.
|
|
6
|
+
//
|
|
7
|
+
// IMPORTANT DIFFERENCE FROM SVG: canvas has a single `ctx.globalAlpha` shared between stroke and
|
|
8
|
+
// fill, unlike SVG's independent `stroke-opacity`/`fill-opacity`. If a shape needs different
|
|
9
|
+
// stroke and fill opacity in the same draw call, bake the opacity into the color string with
|
|
10
|
+
// `withAlpha(...)` instead of relying on `globalAlpha` for one of them.
|
|
11
|
+
import * as d3 from "d3";
|
|
12
|
+
/**
|
|
13
|
+
* Applies a stroke style to the canvas context. Call this immediately before `ctx.stroke()` --
|
|
14
|
+
* unlike the old SVG version, the effect is not persistent.
|
|
15
|
+
* @param context The canvas 2D context to apply the style to
|
|
16
|
+
* @param style The (partial) stroke style to apply; unset fields are left untouched on `ctx`
|
|
17
|
+
* @return `ctx`, for chaining
|
|
18
|
+
*/
|
|
19
|
+
export function applyStrokeStyle(context, style) {
|
|
20
|
+
if (style.color !== undefined)
|
|
21
|
+
context.strokeStyle = style.color;
|
|
22
|
+
if (style.width !== undefined)
|
|
23
|
+
context.lineWidth = style.width;
|
|
24
|
+
if (style.opacity !== undefined)
|
|
25
|
+
context.globalAlpha = style.opacity;
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Applies a fill style to the canvas context. Call this immediately before `ctx.fill()`/
|
|
30
|
+
* `ctx.fillText()`/`ctx.fillRect()` -- unlike the old SVG version, the effect is not persistent.
|
|
31
|
+
* @param context The canvas 2D context to apply the style to
|
|
32
|
+
* @param style The (partial) fill style to apply; unset fields are left untouched on `ctx`
|
|
33
|
+
* @return `ctx`, for chaining
|
|
34
|
+
*/
|
|
35
|
+
export function applyFillStyle(context, style) {
|
|
36
|
+
if (style.color !== undefined)
|
|
37
|
+
context.fillStyle = style.color;
|
|
38
|
+
if (style.opacity !== undefined)
|
|
39
|
+
context.globalAlpha = style.opacity;
|
|
40
|
+
return context;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Bakes an opacity into a color string by resolving it to `rgba(...)`. Needed because canvas has
|
|
44
|
+
* a single `globalAlpha` shared between stroke and fill (see the module-level note above); when a
|
|
45
|
+
* shape needs independent stroke and fill opacity, use this to bake opacity into the color passed
|
|
46
|
+
* to `applyStrokeStyle`/`applyFillStyle` instead of setting `opacity` on both.
|
|
47
|
+
*
|
|
48
|
+
* Uses `d3.color(...)` (already the project's convention for this elsewhere -- see `Legend.tsx`,
|
|
49
|
+
* `barPlotStyle.ts`) rather than the previous approach of assigning `color` to a single
|
|
50
|
+
* module-level, lazily-created `<canvas>` context's `fillStyle` and reading back the browser's
|
|
51
|
+
* normalized value: assigning an unparseable CSS string to `fillStyle` is a silent no-op per the
|
|
52
|
+
* Canvas 2D spec, so an invalid `color` would have silently resolved to whatever the *previous,
|
|
53
|
+
* unrelated* `withAlpha` call (from any chart/tooltip/legend on the page, since the context was a
|
|
54
|
+
* single shared singleton) happened to leave `fillStyle` at -- order-dependent and effectively
|
|
55
|
+
* nondeterministic. `d3.color` instead returns `null` for unparseable input, so an invalid color
|
|
56
|
+
* falls through to the same "fall back to the original string" behavior this always had for the
|
|
57
|
+
* "no canvas 2d support" case, deterministically, with no shared state at all.
|
|
58
|
+
* @param color Any valid CSS color string (named, hex, rgb, rgba, hsl, etc)
|
|
59
|
+
* @param opacity The opacity to bake in, from 0 (transparent) to 1 (opaque)
|
|
60
|
+
* @return An `rgba(...)` string equivalent to `color` at the given `opacity`
|
|
61
|
+
*/
|
|
62
|
+
export function withAlpha(color, opacity) {
|
|
63
|
+
const parsed = d3.color(color);
|
|
64
|
+
if (parsed === null) {
|
|
65
|
+
// unparseable color string; nothing sensible to bake an opacity into
|
|
66
|
+
return color;
|
|
67
|
+
}
|
|
68
|
+
const { r, g, b } = parsed.rgb();
|
|
69
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=canvasStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvasStyle.js","sourceRoot":"","sources":["../../../../src/app/charts/styling/canvasStyle.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,iGAAiG;AACjG,qGAAqG;AACrG,qGAAqG;AACrG,4EAA4E;AAC5E,EAAE;AACF,iGAAiG;AACjG,6FAA6F;AAC7F,6FAA6F;AAC7F,wEAAwE;AAExE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAWxB;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAiC,EAAE,KAAiC;IACjG,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAA;IAChE,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAA;IAC9D,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAA;IACpE,OAAO,OAAO,CAAA;AAClB,CAAC;AAUD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,OAAiC,EAAE,KAA+B;IAC7F,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAA;IAC9D,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,OAAO,CAAA;IACpE,OAAO,OAAO,CAAA;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,OAAe;IACpD,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC9B,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAClB,qEAAqE;QACrE,OAAO,KAAK,CAAA;IAChB,CAAC;IACD,MAAM,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAA;IAC9B,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,OAAO,GAAG,CAAA;AAC/C,CAAC"}
|
|
@@ -7,14 +7,20 @@ export interface Margin {
|
|
|
7
7
|
bottom: number;
|
|
8
8
|
left: number;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @return Margins of 0 on every side
|
|
12
|
+
*/
|
|
10
13
|
export declare function noMargins(): Margin;
|
|
14
|
+
/**
|
|
15
|
+
* A width and height (in pixels)
|
|
16
|
+
*/
|
|
11
17
|
export interface Dimensions {
|
|
12
18
|
readonly width: number;
|
|
13
19
|
readonly height: number;
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
22
|
+
* Calculates the dimensions of the actual plot from the container's width and height, and the
|
|
23
|
+
* plot's margins, by subtracting the margins (never less than 0).
|
|
18
24
|
* @param containerWidth The overall width of the container (plot and margins)
|
|
19
25
|
* @param containerHeight The overall height of the container (plot and margins)
|
|
20
26
|
* @param plotMargins The margins around the plot (top, bottom, left, right)
|
|
@@ -32,5 +38,18 @@ export declare function plotDimensionsFrom(containerWidth: number, containerHeig
|
|
|
32
38
|
* @see plotDimensionsFrom
|
|
33
39
|
*/
|
|
34
40
|
export declare function containerDimensionsFrom(plotDimensions: Dimensions, plotMargin: Margin): Dimensions;
|
|
41
|
+
/**
|
|
42
|
+
* Whether two dimensions have the same width and height
|
|
43
|
+
* @param dimension1 The first dimensions
|
|
44
|
+
* @param dimension2 The second dimensions
|
|
45
|
+
* @return `true` when the widths and heights are equal; `false` otherwise
|
|
46
|
+
*/
|
|
35
47
|
export declare function dimensionsEqual(dimension1: Dimensions, dimension2: Dimensions): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether two dimensions differ in width or height (the negation of {@link dimensionsEqual})
|
|
50
|
+
* @param dimension1 The first dimensions
|
|
51
|
+
* @param dimension2 The second dimensions
|
|
52
|
+
* @return `true` when the widths or heights differ; `false` otherwise
|
|
53
|
+
*/
|
|
36
54
|
export declare function dimensionsNotEqual(dimension1: Dimensions, dimension2: Dimensions): boolean;
|
|
55
|
+
//# sourceMappingURL=margins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"margins.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/styling/margins.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAWnH;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAKlG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,WAE7E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,WAEhF"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @return Margins of 0 on every side
|
|
3
|
+
*/
|
|
1
4
|
export function noMargins() {
|
|
2
5
|
return { top: 0, bottom: 0, left: 0, right: 0 };
|
|
3
6
|
}
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
8
|
+
* Calculates the dimensions of the actual plot from the container's width and height, and the
|
|
9
|
+
* plot's margins, by subtracting the margins (never less than 0).
|
|
7
10
|
* @param containerWidth The overall width of the container (plot and margins)
|
|
8
11
|
* @param containerHeight The overall height of the container (plot and margins)
|
|
9
12
|
* @param plotMargins The margins around the plot (top, bottom, left, right)
|
|
@@ -12,9 +15,15 @@ export function noMargins() {
|
|
|
12
15
|
* @see containerDimensionsFrom
|
|
13
16
|
*/
|
|
14
17
|
export function plotDimensionsFrom(containerWidth, containerHeight, plotMargins) {
|
|
18
|
+
// floor at zero -- margins larger than the container would otherwise produce negative
|
|
19
|
+
// width/height, which propagates into D3 scale ranges, tracker/tooltip clamping math, and
|
|
20
|
+
// canvas draw coordinates as silent garbage. Mirrors the same Math.max(0, ...) convention
|
|
21
|
+
// already used defensively at some (but not all) points of use, e.g. plot.ts's
|
|
22
|
+
// resizeCanvasTo/clipToArea -- clamping here makes Dimensions a non-negative invariant for
|
|
23
|
+
// every downstream consumer instead of relying on each one to remember to clamp itself.
|
|
15
24
|
return {
|
|
16
|
-
width: containerWidth - plotMargins.left - plotMargins.right,
|
|
17
|
-
height: containerHeight - plotMargins.top - plotMargins.bottom
|
|
25
|
+
width: Math.max(0, containerWidth - plotMargins.left - plotMargins.right),
|
|
26
|
+
height: Math.max(0, containerHeight - plotMargins.top - plotMargins.bottom)
|
|
18
27
|
};
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
@@ -31,9 +40,21 @@ export function containerDimensionsFrom(plotDimensions, plotMargin) {
|
|
|
31
40
|
height: plotDimensions.height + plotMargin.top + plotMargin.bottom
|
|
32
41
|
};
|
|
33
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Whether two dimensions have the same width and height
|
|
45
|
+
* @param dimension1 The first dimensions
|
|
46
|
+
* @param dimension2 The second dimensions
|
|
47
|
+
* @return `true` when the widths and heights are equal; `false` otherwise
|
|
48
|
+
*/
|
|
34
49
|
export function dimensionsEqual(dimension1, dimension2) {
|
|
35
50
|
return dimension1.height === dimension2.height && dimension1.width === dimension2.width;
|
|
36
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether two dimensions differ in width or height (the negation of {@link dimensionsEqual})
|
|
54
|
+
* @param dimension1 The first dimensions
|
|
55
|
+
* @param dimension2 The second dimensions
|
|
56
|
+
* @return `true` when the widths or heights differ; `false` otherwise
|
|
57
|
+
*/
|
|
37
58
|
export function dimensionsNotEqual(dimension1, dimension2) {
|
|
38
59
|
return !dimensionsEqual(dimension1, dimension2);
|
|
39
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"margins.js","sourceRoot":"","sources":["../../../../src/app/charts/styling/margins.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,SAAS;IACrB,OAAO,EAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAA;AACjD,CAAC;
|
|
1
|
+
{"version":3,"file":"margins.js","sourceRoot":"","sources":["../../../../src/app/charts/styling/margins.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,UAAU,SAAS;IACrB,OAAO,EAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,CAAA;AACjD,CAAC;AAUD;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,cAAsB,EAAE,eAAuB,EAAE,WAAmB;IACnG,sFAAsF;IACtF,0FAA0F;IAC1F,0FAA0F;IAC1F,+EAA+E;IAC/E,2FAA2F;IAC3F,wFAAwF;IACxF,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC;QACzE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,eAAe,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC;KAC9E,CAAA;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,cAA0B,EAAE,UAAkB;IAClF,OAAO;QACH,KAAK,EAAE,cAAc,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,KAAK;QAChE,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM;KACrE,CAAA;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,UAAsB,EAAE,UAAsB;IAC1E,OAAO,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK,CAAA;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAsB,EAAE,UAAsB;IAC7E,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AACnD,CAAC"}
|