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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { TooltipContent } from "./TooltipContent";
|
|
3
|
+
import { DefaultOutlierTooltipContent } from "./DefaultOutlierTooltipContent";
|
|
4
|
+
import { UseOutlierTooltip } from "./useOutlierTooltip";
|
|
5
|
+
/**
|
|
6
|
+
* The tooltip content for an {@link OutlierPlot}: when the mouse is over a band, or an outlier,
|
|
7
|
+
* shows the series' name, the outlier (if any), the band, the probabilities of a point being in
|
|
8
|
+
* and outside the band, and the number of points in the band. Put it inside a {@link Tooltip}.
|
|
9
|
+
*
|
|
10
|
+
* To lay the content out yourself, put your own component inside this one: it gets what the
|
|
11
|
+
* tooltip shows, its style, and the formatters, from {@link useOutlierTooltip}.
|
|
12
|
+
* @param props The style, the formatters, and the (optional) custom content
|
|
13
|
+
* @return The tooltip's box (a portal), or `null` when no band or outlier is hovered
|
|
14
|
+
*/
|
|
15
|
+
export function OutlierPlotTooltipContent(props) {
|
|
16
|
+
const { style, children, datumFormatter = (x, y) => `(${x}, ${y})`, bandFormatter = (lower, upper) => `Band: ${lower} ⭢ ${upper}`, measureFormatter = (innerProb, outerProb) => `Points have a ${(innerProb * 100).toFixed(1)}% probability of being in this band, and a ${(outerProb * 100).toFixed(1)}% probability of being outside this band`, } = props;
|
|
17
|
+
// (a description given as lines is shown one per line)
|
|
18
|
+
const measureDescription = (innerProb, outerProb) => {
|
|
19
|
+
const description = measureFormatter(innerProb, outerProb);
|
|
20
|
+
return Array.isArray(description) ?
|
|
21
|
+
_jsx(_Fragment, { children: description.map((line, index) => _jsx("div", { children: line }, index)) }) :
|
|
22
|
+
description;
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(TooltipContent, { style: style, boxStyle: { lineHeight: 1.6 }, capture: (seriesName, _time, { metadata }) => ({ ...metadata, seriesName }), children: (tooltipContent, tooltipStyle) => _jsx(UseOutlierTooltip.Provider, { value: { tooltipContent, tooltipStyle, datumFormatter, bandFormatter, measureFormatter: measureDescription }, children: children !== null && children !== void 0 ? children : _jsx(DefaultOutlierTooltipContent, {}) }) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=OutlierPlotTooltipContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutlierPlotTooltipContent.js","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/OutlierPlotTooltipContent.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAG/C,OAAO,EAAC,4BAA4B,EAAC,MAAM,gCAAgC,CAAA;AAC3E,OAAO,EAAgE,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAkBpH;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAY;IAClD,MAAM,EACF,KAAK,EACL,QAAQ,EACR,cAAc,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EACzD,aAAa,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAAC,SAAS,KAAK,MAAM,KAAK,EAAE,EAC7E,gBAAgB,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,8CAA8C,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,0CAA0C,GACjO,GAAG,KAAK,CAAA;IAET,uDAAuD;IACvD,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAwB,EAAE;QACtF,MAAM,WAAW,GAAG,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;YAC/B,4BAAG,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,wBAAkB,IAAI,IAAZ,KAAK,CAAc,CAAC,GAAI,CAAC,CAAC;YACxE,WAAW,CAAA;IACnB,CAAC,CAAA;IAED,OAAO,CACH,KAAC,cAAc,IACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,EAAC,UAAU,EAAE,GAAG,EAAC,EAC3B,OAAO,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,QAAQ,EAAE,UAAU,EAAC,CAAC,YAEtE,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE,CAC9B,KAAC,iBAAiB,CAAC,QAAQ,IACvB,KAAK,EAAE,EAAC,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAC,YAEzG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,KAAC,4BAA4B,KAAE,GACnB,GAEpB,CACpB,CAAA;AACL,CAAC"}
|
|
@@ -1,68 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
# Want to write your own tooltip-content component?
|
|
4
|
-
|
|
5
|
-
Here's how to write your own tooltip-content component.
|
|
6
|
-
|
|
7
|
-
To create your own tooltip content `<MyTooltipContent/>` you must do the following:
|
|
8
|
-
1. Create a react component for your tooltip content (see for example, {@link PoincarePlotTooltipContent}
|
|
9
|
-
as a reference.
|
|
10
|
-
2. Use the {@link useChart} hook to get the {@link registerTooltipContentProvider} registration function.
|
|
11
|
-
3. When your tooltip content component (`<MyTooltipContent/>`) mounts, use the {@link registerTooltipContentProvider}
|
|
12
|
-
function to register your tooltip content provider.
|
|
13
|
-
4. When the chart dimensions, margin, container, etc, change, register your tooltip content provider
|
|
14
|
-
again (you can register as many times as you like because it only uses the last content provider
|
|
15
|
-
registered).
|
|
16
|
-
|
|
17
|
-
That's it! A few more details are below.
|
|
18
|
-
|
|
19
|
-
The {@link registerTooltipContentProvider} function from the {@link useChart} hook allows you to register
|
|
20
|
-
one tooltip content provider. A second call to this function will cause the {@link useChart} hook to drop
|
|
21
|
-
the first one in favor of the second one.
|
|
22
|
-
|
|
23
|
-
The {@link registerTooltipContentProvider} function from the {@link useChart} hook accepts a higher-order
|
|
24
|
-
function that allowing a closure on content/chart-specific data. Specifically, you must hand the
|
|
25
|
-
{@link registerTooltipContentProvider} a function of the form:
|
|
26
|
-
|
|
27
|
-
`(seriesName: string, time: number, series: TimeSeries, mouseCoords: [x: number, y: number]) => TooltipDimensions`
|
|
28
|
-
|
|
29
|
-
Your function to add that actual content will be what this function calls whenever d3 fires a mouse-over
|
|
30
|
-
event on one you the time-series in the chart.
|
|
31
|
-
|
|
32
|
-
The code snippet below is from the `useEffect` call in the {@link PoincarePlotTooltipContent}.
|
|
33
|
-
Note that the first four arguments to the {@link addTooltipContent} function are those provided by the {@link useChart} hook
|
|
34
|
-
when a d3 mouse-over event occurs on one of your series. The additional six arguments are from the closure formed
|
|
35
|
-
on the variables in your component. The `chartId`, `container`, `margin`, and `plotDimensions` are from the
|
|
36
|
-
{@link useChart} hook called by the {@link PoincarePlotTooltipContent} component. The last two
|
|
37
|
-
arguments, `defaultTooltipStyle` and `options` are specific to the {@link PoincarePlotTooltipContent}.
|
|
38
|
-
For example, the `options` property is set by the caller of the {@link PoincarePlotTooltipContent}
|
|
39
|
-
component.
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
// register the tooltip content provider function with the chart hook (useChart) so that
|
|
43
|
-
// it is visible to all children of the Chart (i.e. the <Tooltip>).
|
|
44
|
-
registerTooltipContentProvider(
|
|
45
|
-
(seriesName: string, time: number, series: TimeSeries, mouseCoords: [x: number, y: number]) =>
|
|
46
|
-
addTooltipContent(
|
|
47
|
-
seriesName, time, series, mouseCoords,
|
|
48
|
-
chartId, container, margin, plotDimensions,
|
|
49
|
-
defaultTooltipStyle, options
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
This pattern allows you to supplement that `useChart` mouse-over callback with information specific to your component.
|
|
55
|
-
|
|
56
|
-
*/
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { type TooltipStyle } from "./tooltipUtils";
|
|
57
3
|
/**
|
|
58
4
|
* Properties for rendering the tooltip content. The properties are applied as
|
|
59
5
|
* shown below.
|
|
60
6
|
* ```
|
|
61
7
|
* series name
|
|
62
|
-
*
|
|
63
|
-
* xLabel xValueFormatter xValueFormatter
|
|
64
|
-
* yLabel yValueFormatter yValueFormatter
|
|
8
|
+
* f[n-1](x) f[n](x) f[n+1](x)
|
|
9
|
+
* xLabel xValueFormatter xValueFormatter xValueFormatter
|
|
10
|
+
* yLabel yValueFormatter yValueFormatter yValueFormatter
|
|
65
11
|
* ```
|
|
12
|
+
* The column headers are always the `f[i](x)` form, built from the hovered point's index: the
|
|
13
|
+
* `nMinusLagHeader`, `nHeader`, and `nPlusLagHeader` properties, and the `xChangeFormatter` and
|
|
14
|
+
* `yChangeFormatter` properties, are accepted, but not (yet) used.
|
|
66
15
|
*/
|
|
67
16
|
export interface Props {
|
|
68
17
|
xLabel: string;
|
|
@@ -77,22 +26,23 @@ export interface Props {
|
|
|
77
26
|
style?: Partial<TooltipStyle>;
|
|
78
27
|
}
|
|
79
28
|
/**
|
|
80
|
-
* Adds tooltip content as a table. The columns of the table are the
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
29
|
+
* Adds tooltip content as a table. The columns of the table are the previous, current, and next
|
|
30
|
+
* iterate (relative to the hovered point). The rows of the table are the time values for the
|
|
31
|
+
* first row, and the iterate values (each point's `f[n+1](x)`) for the second row. Below the
|
|
32
|
+
* table, as wide as it, a sparkline of the series' values over time -- the 60 points around the
|
|
33
|
+
* hovered point -- with the hovered point marked.
|
|
84
34
|
* ```
|
|
85
35
|
* series name
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* value
|
|
36
|
+
* f[n-1](x) f[n](x) f[n+1](x)
|
|
37
|
+
* t (ms) t_p t_c t_n
|
|
38
|
+
* value v_p v_c v_n
|
|
39
|
+
* value over time
|
|
40
|
+
* sparkline
|
|
89
41
|
* ```
|
|
90
42
|
*
|
|
91
|
-
*
|
|
92
|
-
* event on a series. The content provider is returns the {@link addTooltipContent} function
|
|
93
|
-
* when called. And when called the {@link addTooltipContent} function adds the actual tooltip
|
|
94
|
-
* content to the SVG element.
|
|
43
|
+
* Built on {@link TooltipContent}; put it inside a {@link Tooltip}.
|
|
95
44
|
* @param props The properties describing the tooltip content
|
|
96
|
-
* @return null
|
|
45
|
+
* @return The tooltip's portal, or `null` when nothing is being hovered
|
|
97
46
|
*/
|
|
98
|
-
export declare function PoincarePlotTooltipContent(props: Props): null;
|
|
47
|
+
export declare function PoincarePlotTooltipContent(props: Props): ReactElement | null;
|
|
48
|
+
//# sourceMappingURL=PoincarePlotTooltipContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoincarePlotTooltipContent.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/PoincarePlotTooltipContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,YAAY,EAAC,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAsC,KAAK,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAOtF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,KAAK;IAElB,MAAM,EAAE,MAAM,CAAA;IAEd,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC3C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC3C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CAChC;AAgCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY,GAAG,IAAI,CAyB5E"}
|
|
@@ -1,189 +1,122 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { usePlotDimensions } from "../hooks/usePlotDimensions";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useState, useRef } from "react";
|
|
3
|
+
import { findPointAndNeighbors, sparklineFor } from "./tooltipUtils";
|
|
4
|
+
import { TooltipContent } from "./TooltipContent";
|
|
5
|
+
import { formatTime, formatValue } from "../utils";
|
|
7
6
|
import { emptyIterateDatum } from "../series/iterateSeries";
|
|
8
|
-
|
|
7
|
+
// the height of the tooltip's sparkline (of the series' values over time); it's as wide as the
|
|
8
|
+
// tooltip's content (at least this wide)
|
|
9
|
+
const SPARKLINE_HEIGHT = 36;
|
|
10
|
+
const MIN_SPARKLINE_WIDTH = 120;
|
|
11
|
+
// the number of points (around the hovered point) the sparkline shows
|
|
12
|
+
const SPARKLINE_POINTS = 60;
|
|
9
13
|
/**
|
|
10
|
-
* Adds tooltip content as a table. The columns of the table are the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* Adds tooltip content as a table. The columns of the table are the previous, current, and next
|
|
15
|
+
* iterate (relative to the hovered point). The rows of the table are the time values for the
|
|
16
|
+
* first row, and the iterate values (each point's `f[n+1](x)`) for the second row. Below the
|
|
17
|
+
* table, as wide as it, a sparkline of the series' values over time -- the 60 points around the
|
|
18
|
+
* hovered point -- with the hovered point marked.
|
|
14
19
|
* ```
|
|
15
20
|
* series name
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* value
|
|
21
|
+
* f[n-1](x) f[n](x) f[n+1](x)
|
|
22
|
+
* t (ms) t_p t_c t_n
|
|
23
|
+
* value v_p v_c v_n
|
|
24
|
+
* value over time
|
|
25
|
+
* sparkline
|
|
19
26
|
* ```
|
|
20
27
|
*
|
|
21
|
-
*
|
|
22
|
-
* event on a series. The content provider is returns the {@link addTooltipContent} function
|
|
23
|
-
* when called. And when called the {@link addTooltipContent} function adds the actual tooltip
|
|
24
|
-
* content to the SVG element.
|
|
28
|
+
* Built on {@link TooltipContent}; put it inside a {@link Tooltip}.
|
|
25
29
|
* @param props The properties describing the tooltip content
|
|
26
|
-
* @return null
|
|
30
|
+
* @return The tooltip's portal, or `null` when nothing is being hovered
|
|
27
31
|
*/
|
|
28
32
|
export function PoincarePlotTooltipContent(props) {
|
|
29
|
-
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// register the tooltip content provider, which when called on mouse-enter-series events
|
|
35
|
-
// will render the tooltip container and then the tooltip content. recall that the
|
|
36
|
-
// tooltip content is generated in this plot (because this is the plot that holds all the
|
|
37
|
-
// information needed to render it), and the container for the content is rendered by
|
|
38
|
-
// the <Tooltip>, which this knows nothing about.
|
|
39
|
-
//
|
|
40
|
-
// the 'registration function accepts a function of the form (seriesName, time, series) => TooltipDimensions.
|
|
41
|
-
// and that function has a closure on the content-specific information needed to add the
|
|
42
|
-
// actual content
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (container) {
|
|
45
|
-
// register the tooltip content provider function with the chart hook (useChart) so that
|
|
46
|
-
// it is visible to all children of the Chart (i.e. the <Tooltip>).
|
|
47
|
-
registerTooltipContentProvider((seriesName, time, tooltipData, mouseCoords) => addTooltipContent(seriesName, time, tooltipData, mouseCoords, chartId, container, margin, plotDimensions, tooltipStyle));
|
|
48
|
-
}
|
|
49
|
-
}, [
|
|
50
|
-
chartId, container, margin, plotDimensions, registerTooltipContentProvider,
|
|
51
|
-
xLabel, xChangeFormatter, xValueFormatter,
|
|
52
|
-
yLabel, yChangeFormatter, yValueFormatter,
|
|
53
|
-
nMinusLagHeader, nHeader, nPlusLagHeader,
|
|
54
|
-
tooltipStyle
|
|
55
|
-
]);
|
|
56
|
-
return null;
|
|
33
|
+
const { xLabel, yLabel,
|
|
34
|
+
// (the `nMinusLagHeader`, `nHeader`, and `nPlusLagHeader` properties aren't used: the
|
|
35
|
+
// column headers are always the `f[i](x)` form, built from the point's index)
|
|
36
|
+
xValueFormatter = formatTime, yValueFormatter = formatValue, style, } = props;
|
|
37
|
+
return (_jsx(TooltipContent, { style: style, capture: (seriesName, time, tooltipData) => captureTooltipContent(seriesName, time, tooltipData, { xLabel, yLabel, xValueFormatter, yValueFormatter }), children: (tooltipContent, tooltipStyle) => _jsx(PoincareTooltipBody, { tooltipContent: tooltipContent, tooltipStyle: tooltipStyle }, tooltipContent.hoveredTime) }));
|
|
57
38
|
}
|
|
58
|
-
const dimension = {
|
|
59
|
-
width: 60,
|
|
60
|
-
defaultWidth: 70,
|
|
61
|
-
minWidth: 50,
|
|
62
|
-
maxWidth: 100,
|
|
63
|
-
height: 15,
|
|
64
|
-
defaultHeight: 15,
|
|
65
|
-
minHeight: 10,
|
|
66
|
-
maxHeight: 50
|
|
67
|
-
};
|
|
68
39
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
40
|
+
* The Poincaré tooltip's content: the series' name, the table of the hovered iterate and its
|
|
41
|
+
* neighbors, and, as wide as the table (or the name, when that's wider), the sparkline of the
|
|
42
|
+
* series' values around the hovered point
|
|
43
|
+
* @param props The captured content, and the tooltip's style
|
|
44
|
+
* @return The tooltip's content
|
|
45
|
+
*/
|
|
46
|
+
function PoincareTooltipBody(props) {
|
|
47
|
+
const { tooltipContent, tooltipStyle } = props;
|
|
48
|
+
// the sparkline is as wide as the tooltip's content: its table, or its title when that's wider.
|
|
49
|
+
// Both are measured at their natural widths (rather than the sparkline-stretched width of the
|
|
50
|
+
// tooltip itself), before the tooltip is painted.
|
|
51
|
+
const titleRef = useRef(null);
|
|
52
|
+
const tableRef = useRef(null);
|
|
53
|
+
const [sparklineWidth, setSparklineWidth] = useState(MIN_SPARKLINE_WIDTH);
|
|
54
|
+
useLayoutEffect(() => {
|
|
55
|
+
var _a, _b, _c, _d;
|
|
56
|
+
const contentWidth = Math.max(MIN_SPARKLINE_WIDTH, (_b = (_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0, (_d = (_c = titleRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth) !== null && _d !== void 0 ? _d : 0);
|
|
57
|
+
if (contentWidth !== sparklineWidth)
|
|
58
|
+
setSparklineWidth(contentWidth);
|
|
59
|
+
}, [tooltipContent, sparklineWidth]);
|
|
60
|
+
const cellStyle = { padding: '1px 8px', textAlign: 'right', border: 'none' };
|
|
61
|
+
const rowLabelStyle = { ...cellStyle, textAlign: 'left', paddingLeft: 0 };
|
|
62
|
+
const headerCellStyle = { ...cellStyle, fontWeight: tooltipStyle.fontWeight + 550 };
|
|
63
|
+
// the "current" (middle) column stands out
|
|
64
|
+
const currentColumnStyle = { ...cellStyle, fontWeight: tooltipStyle.fontWeight + 300 };
|
|
65
|
+
// the series' values around the hovered point, over time, with the hovered point marked (when
|
|
66
|
+
// there are enough values to draw)
|
|
67
|
+
const sparkline = sparklineFor(tooltipContent.sparklineValues, sparklineWidth, SPARKLINE_HEIGHT, 2, undefined, tooltipContent.hoveredTime);
|
|
68
|
+
return _jsxs(_Fragment, { children: [_jsx("div", { ref: titleRef, style: { fontSize: tooltipStyle.fontSize, fontWeight: tooltipStyle.fontWeight, marginBottom: 4, width: 'fit-content' }, children: tooltipContent.seriesName }), _jsxs("table", { ref: tableRef, style: { fontSize: tooltipStyle.fontSize, borderCollapse: 'collapse', border: 'none', width: 'auto' }, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("td", { style: rowLabelStyle }), _jsx("td", { style: headerCellStyle, children: tooltipContent.prevHeader }), _jsx("td", { style: { ...headerCellStyle, ...currentColumnStyle }, children: tooltipContent.currentHeader }), _jsx("td", { style: headerCellStyle, children: tooltipContent.nextHeader })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { style: rowLabelStyle, children: tooltipContent.xLabel }), _jsx("td", { style: cellStyle, children: tooltipContent.xPrev }), _jsx("td", { style: currentColumnStyle, children: tooltipContent.xCurrent }), _jsx("td", { style: cellStyle, children: tooltipContent.xNext })] }), _jsxs("tr", { children: [_jsx("td", { style: rowLabelStyle, children: tooltipContent.yLabel }), _jsx("td", { style: cellStyle, children: tooltipContent.yPrev }), _jsx("td", { style: currentColumnStyle, children: tooltipContent.yCurrent }), _jsx("td", { style: cellStyle, children: tooltipContent.yNext })] })] })] }), sparkline !== undefined && _jsxs(_Fragment, { children: [_jsxs("div", { style: { fontSize: tooltipStyle.fontSize, marginTop: 8 }, children: [tooltipContent.yLabel, " over time"] }), _jsxs("svg", { width: sparklineWidth, height: SPARKLINE_HEIGHT, style: { display: 'block', marginTop: 4 }, "aria-hidden": "true", children: [_jsx("path", { d: sparkline.path, fill: "none", stroke: tooltipStyle.fontColor, strokeWidth: 1, strokeLinejoin: "round", strokeLinecap: "round" }), sparkline.mark !== undefined &&
|
|
69
|
+
_jsx("circle", { cx: sparkline.mark[0], cy: sparkline.mark[1], r: 2.5, fill: tooltipStyle.fontColor })] })] })] });
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Captures the data needed to render the tooltip's content: the table (the hovered point, the
|
|
73
|
+
* first point within 0.1 of the plot's time, and its neighbors), and the series' values around
|
|
74
|
+
* the hovered point, over time, for the sparkline
|
|
75
|
+
* @param seriesName The name of the series
|
|
76
|
+
* @param time The time of the hovered point
|
|
72
77
|
* @param tooltipData The series data and metadata
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
75
|
-
* @param container The plot container (SVGSVGElement)
|
|
76
|
-
* @param margin The plot margins
|
|
77
|
-
* @param tooltipStyle The style properties for the tooltip
|
|
78
|
-
* @param plotDimensions The dimensions of the plot
|
|
79
|
-
* @return The width and text height of the tooltip content
|
|
78
|
+
* @param options Header labels and value formatters
|
|
79
|
+
* @return The tooltip's content
|
|
80
80
|
*/
|
|
81
|
-
function
|
|
82
|
-
const [x, y] = mouseCoords;
|
|
81
|
+
function captureTooltipContent(seriesName, time, tooltipData, options) {
|
|
83
82
|
const { series } = tooltipData;
|
|
84
83
|
const [lower, point, upper, index] = findPointAndNeighbors(series, time, 0.1, value => value.time, () => emptyIterateDatum);
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
size: tooltipStyle.fontSize,
|
|
103
|
-
family: tooltipStyle.fontFamily,
|
|
104
|
-
color: tooltipStyle.fontColor,
|
|
105
|
-
weight: tooltipStyle.fontWeight
|
|
84
|
+
const { xLabel, yLabel, xValueFormatter, yValueFormatter } = options;
|
|
85
|
+
return {
|
|
86
|
+
seriesName,
|
|
87
|
+
// (the headers are always the f[i](x) form, built from the point's index)
|
|
88
|
+
prevHeader: index > 0 ? `f[${index - 1}](x)` : '- n/a -',
|
|
89
|
+
currentHeader: `f[${index}](x)`,
|
|
90
|
+
nextHeader: index < series.length - 1 ? `f[${index + 1}](x)` : '- n/a -',
|
|
91
|
+
xLabel,
|
|
92
|
+
xPrev: xValueFormatter(lower.time),
|
|
93
|
+
xCurrent: xValueFormatter(point.time),
|
|
94
|
+
xNext: xValueFormatter(upper.time),
|
|
95
|
+
yLabel,
|
|
96
|
+
yPrev: yValueFormatter(lower.iterateN_1),
|
|
97
|
+
yCurrent: yValueFormatter(point.iterateN_1),
|
|
98
|
+
yNext: yValueFormatter(upper.iterateN_1),
|
|
99
|
+
sparklineValues: valuesAround(series, index, SPARKLINE_POINTS),
|
|
100
|
+
hoveredTime: point.time,
|
|
106
101
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
])
|
|
127
|
-
// create the table data that has the column headers
|
|
128
|
-
.flatMap(df => TableData
|
|
129
|
-
.fromDataFrame(df)
|
|
130
|
-
.withColumnHeader([
|
|
131
|
-
index > 0 ? `f[${index - 1}](x)` : '- n/a -',
|
|
132
|
-
`f[${index}](x)`,
|
|
133
|
-
index < series.length - 1 ? `f[${index + 1}](x)` : '- n/a -'
|
|
134
|
-
])
|
|
135
|
-
.flatMap(td => td.withRowHeader(['t (ms)', 'value'])))
|
|
136
|
-
// add the dat formatters for the (x, y) values of the iterates
|
|
137
|
-
.flatMap(tableData => TableFormatter.fromTableData(tableData)
|
|
138
|
-
.addRowFormatter(1, value => formatTime(value, ""))
|
|
139
|
-
.flatMap(tf => tf.addRowFormatter(2, value => formatValue(value)))
|
|
140
|
-
.flatMap(tf => tf.formatTable()))
|
|
141
|
-
.map(tableData => TableStyler.fromTableData(tableData)
|
|
142
|
-
.withTableFont(font)
|
|
143
|
-
.withPadding(padding)
|
|
144
|
-
.withColumnHeaderStyle({
|
|
145
|
-
font: Object.assign(Object.assign({}, font), { weight: 650 }),
|
|
146
|
-
padding: { top: 0, bottom: 10 },
|
|
147
|
-
dimension: Object.assign(Object.assign({}, dimension), { maxHeight: 70 }),
|
|
148
|
-
alignText: 'center',
|
|
149
|
-
})
|
|
150
|
-
.withRowHeaderStyle({
|
|
151
|
-
font: Object.assign(Object.assign({}, font), { weight: 650 }),
|
|
152
|
-
padding: { left: 0, right: 10 },
|
|
153
|
-
dimension: dimension,
|
|
154
|
-
alignText: 'center',
|
|
155
|
-
})
|
|
156
|
-
.withColumnStyles([], {
|
|
157
|
-
padding: { left: 10, right: 10 },
|
|
158
|
-
alignText: 'right',
|
|
159
|
-
})
|
|
160
|
-
.withCellStyle(1, 2, currentIterateStyle)
|
|
161
|
-
.withCellStyle(2, 2, currentIterateStyle)
|
|
162
|
-
.withRowStyles([], {
|
|
163
|
-
font,
|
|
164
|
-
dimension: Object.assign(Object.assign({}, dimension), { maxHeight: 20 }),
|
|
165
|
-
padding: { top: 0, bottom: 0 }
|
|
166
|
-
})
|
|
167
|
-
.styleTable())
|
|
168
|
-
.flatMap(styledTable => createTable(styledTable, container, `t${time}-${seriesName}-header-${chartId}`, tooltipCoordinates))
|
|
169
|
-
.map(renderingInfo => {
|
|
170
|
-
const { tableX: x, tableY: y, tableWidth: contentWidth, tableHeight: contentHeight } = renderingInfo;
|
|
171
|
-
return { x, y, contentWidth, contentHeight };
|
|
172
|
-
})
|
|
173
|
-
.getOrThrow();
|
|
174
|
-
/**
|
|
175
|
-
* Calculates the coordinates of the tooltip based on the width and height of the SVG
|
|
176
|
-
* table. This is needed because the tooltip needs to be adjusted relative mouse location
|
|
177
|
-
* when the mouse coordinates are too close to an edge.
|
|
178
|
-
* @param width The SVG table width
|
|
179
|
-
* @param height The SVG table height
|
|
180
|
-
* @return The updated tooltip coordinates
|
|
181
|
-
*/
|
|
182
|
-
function tooltipCoordinates(width, height) {
|
|
183
|
-
return [
|
|
184
|
-
tooltipX(x, width, plotDimensions, tooltipStyle, margin),
|
|
185
|
-
tooltipY(y, height, plotDimensions, tooltipStyle, margin)
|
|
186
|
-
];
|
|
187
|
-
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The values (each point's `f[n+1](x)`) of (at most) the specified number of points around the
|
|
105
|
+
* hovered point, over time: centered on the hovered point, or shifted to stay within the series
|
|
106
|
+
* when the hovered point is near its start or end
|
|
107
|
+
* @param series The series' iterates, ordered by time
|
|
108
|
+
* @param index The index of the hovered point (or -1, when it wasn't found)
|
|
109
|
+
* @param count The (largest) number of points
|
|
110
|
+
* @return The points' times and values, in order
|
|
111
|
+
*/
|
|
112
|
+
function valuesAround(series, index, count) {
|
|
113
|
+
if (index < 0)
|
|
114
|
+
return [];
|
|
115
|
+
const start = Math.max(0, Math.min(index - Math.floor(count / 2), series.length - count));
|
|
116
|
+
const end = Math.min(series.length, start + count);
|
|
117
|
+
const values = [];
|
|
118
|
+
for (let i = start; i < end; i++)
|
|
119
|
+
values.push({ time: series[i].time, value: series[i].iterateN_1 });
|
|
120
|
+
return values;
|
|
188
121
|
}
|
|
189
122
|
//# sourceMappingURL=PoincarePlotTooltipContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PoincarePlotTooltipContent.js","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/PoincarePlotTooltipContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PoincarePlotTooltipContent.js","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/PoincarePlotTooltipContent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAC,qBAAqB,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAC,iBAAiB,EAAoB,MAAM,yBAAyB,CAAC;AAsD7E,+FAA+F;AAC/F,yCAAyC;AACzC,MAAM,gBAAgB,GAAG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AE,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC;QACxC,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC;QAC3C,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC;QACxC,eAAe,EAAE,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC;QAC9D,WAAW,EAAE,KAAK,CAAC,IAAI;KAC1B,CAAA;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY,CACjB,MAAyD,EACzD,KAAa,EACb,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,EAAE,CAAA;IACxB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAA;IACzF,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,CAAA;IAClD,MAAM,MAAM,GAA2C,EAAE,CAAA;IACzD,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,EAAC,CAAC,CAAA;IAClG,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { type TooltipStyle } from "./tooltipUtils";
|
|
3
|
+
/**
|
|
4
|
+
* Options for displaying the tooltip content. These options are specific to this
|
|
5
|
+
* particular implementation of a tooltip content. The options effect are applied
|
|
6
|
+
* as shown below.
|
|
7
|
+
* ```
|
|
8
|
+
* series name
|
|
9
|
+
* formatters.x(x), formatters.y(y)
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
2
12
|
/**
|
|
3
13
|
* Properties for rendering the tooltip content. The properties are applied as
|
|
4
14
|
* shown below.
|
|
@@ -6,24 +16,38 @@ import { TooltipStyle } from "./tooltipUtils";
|
|
|
6
16
|
* series name
|
|
7
17
|
* xFormatter, yFormatter
|
|
8
18
|
* ```
|
|
19
|
+
* Below that, the spikes' statistics: the mean value and standard deviation (formatted by
|
|
20
|
+
* `yFormatter`), and the mean time between spikes (formatted by `intervalFormatter`).
|
|
9
21
|
*/
|
|
10
22
|
export interface Props {
|
|
23
|
+
/** formats the spike's time */
|
|
11
24
|
xFormatter?: (value: number) => string;
|
|
25
|
+
/** formats the values (the spike's value, and the mean and standard deviation of the values) */
|
|
12
26
|
yFormatter?: (value: number) => string;
|
|
27
|
+
/**
|
|
28
|
+
* formats the mean time between spikes (a duration, in the times' units). Defaults to the
|
|
29
|
+
* `xFormatter`, so give it its own formatter when the times are formatted as something that isn't
|
|
30
|
+
* a duration, such as the time of day
|
|
31
|
+
*/
|
|
32
|
+
intervalFormatter?: (interval: number) => string;
|
|
33
|
+
/** the style of the tooltip */
|
|
13
34
|
style?: Partial<TooltipStyle>;
|
|
14
35
|
}
|
|
15
36
|
/**
|
|
16
|
-
* Adds tooltip content that shows the series name
|
|
37
|
+
* Adds tooltip content that shows the series name, the (time, value) of the selected spike, the
|
|
38
|
+
* statistics of the series' spikes in the window of data the chart holds (their count, the mean
|
|
39
|
+
* and standard deviation of their values, and the mean time between them), and a sparkline of
|
|
40
|
+
* their values over the window, with the selected spike marked.
|
|
17
41
|
* ```
|
|
18
42
|
* series name
|
|
19
43
|
* time, value
|
|
44
|
+
* statistics
|
|
45
|
+
* sparkline
|
|
20
46
|
* ```
|
|
21
47
|
*
|
|
22
|
-
*
|
|
23
|
-
* event on a series. The content provider is returns the {@link addTooltipContent} function
|
|
24
|
-
* when called. And when called the {@link addTooltipContent} function adds the actual tooltip
|
|
25
|
-
* content to the SVG element.
|
|
48
|
+
* Built on {@link TooltipContent}; put it inside a {@link Tooltip}.
|
|
26
49
|
* @param props The properties describing the tooltip content
|
|
27
|
-
* @return null
|
|
50
|
+
* @return The tooltip's portal, or `null` when nothing is being hovered
|
|
28
51
|
*/
|
|
29
|
-
export declare function RasterPlotTooltipContent(props: Props): null;
|
|
52
|
+
export declare function RasterPlotTooltipContent(props: Props): ReactElement | null;
|
|
53
|
+
//# sourceMappingURL=RasterPlotTooltipContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RasterPlotTooltipContent.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/RasterPlotTooltipContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAOH,KAAK,YAAY,EAEpB,MAAM,gBAAgB,CAAC;AAUxB;;;;;;;;GAQG;AAQH;;;;;;;;;GASG;AACH,MAAM,WAAW,KAAK;IAClB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC,gGAAgG;IAChG,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAChD,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CAChC;AAqBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY,GAAG,IAAI,CAmF1E"}
|