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,87 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {Dimensions, Margin} from "../styling/margins";
|
|
3
|
-
import {boundingPoints, defaultTooltipStyle, TooltipDimensions, TooltipStyle, tooltipX, tooltipY} from "./tooltipUtils";
|
|
1
|
+
import type {CSSProperties, ReactElement} from "react";
|
|
4
2
|
import * as d3 from "d3";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
1. Create a react component for your tooltip content (see for example, {@link ScatterPlotTooltipContent}
|
|
22
|
-
as a reference.
|
|
23
|
-
2. Use the {@link useChart} hook to get the {@link registerTooltipContentProvider} registration function.
|
|
24
|
-
3. When your tooltip content component (`<MyTooltipContent/>`) mounts, use the {@link registerTooltipContentProvider}
|
|
25
|
-
function to register your tooltip content provider.
|
|
26
|
-
4. When the chart dimensions, margin, container, etc, change, register your tooltip content provider
|
|
27
|
-
again (you can register as many times as you like because it only uses the last content provider
|
|
28
|
-
registered).
|
|
29
|
-
|
|
30
|
-
That's it! A bit more details below.
|
|
31
|
-
|
|
32
|
-
The {@link registerTooltipContentProvider} function from the {@link useChart} hook allows you to register
|
|
33
|
-
one tooltip content provider. A second call to this function will cause the {@link useChart} hook to drop
|
|
34
|
-
the first one in favor of the second one.
|
|
35
|
-
|
|
36
|
-
The {@link registerTooltipContentProvider} function from the {@link useChart} hook accepts a higher-order
|
|
37
|
-
function that allowing a closure on content/chart-specific data. Specifically, you must hand the
|
|
38
|
-
{@link registerTooltipContentProvider} a function of the form:
|
|
39
|
-
|
|
40
|
-
`(seriesName: string, time: number, series: TimeSeries, mouseCoords: [x: number, y: number]) => TooltipDimensions`
|
|
41
|
-
|
|
42
|
-
Your function to add that actual content will be what this function calls whenever d3 fires a mouse-over
|
|
43
|
-
event on one you the time-series in the chart.
|
|
44
|
-
|
|
45
|
-
The code snippet below is from the `useEffect` call in the {@link ScatterPlotTooltipContent}.
|
|
46
|
-
Note that the first four arguments to the {@link addTooltipContent} function are those provided by the {@link useChart} hook
|
|
47
|
-
when a d3 mouse-over event occurs on one of your series. The additional six arguments are from the closure formed
|
|
48
|
-
on the variables in your component. The `chartId`, `container`, `margin`, and `plotDimensions` are from the
|
|
49
|
-
{@link useChart} hook called by the {@link ScatterPlotTooltipContent} component. The last two
|
|
50
|
-
arguments, `defaultTooltipStyle` and `options` are specific to the {@link ScatterPlotTooltipContent}.
|
|
51
|
-
For example, the `options` property is set by the caller of the {@link ScatterPlotTooltipContent}
|
|
52
|
-
component.
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
// register the tooltip content provider function with the chart hook (useChart) so that
|
|
56
|
-
// it is visible to all children of the Chart (i.e. the <Tooltip>).
|
|
57
|
-
registerTooltipContentProvider(
|
|
58
|
-
(seriesName: string, time: number, series: TimeSeries, mouseCoords: [x: number, y: number]) =>
|
|
59
|
-
addTooltipContent(
|
|
60
|
-
seriesName, time, series, mouseCoords,
|
|
61
|
-
chartId, container, margin, plotDimensions,
|
|
62
|
-
defaultTooltipStyle, options
|
|
63
|
-
)
|
|
64
|
-
)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
This pattern allows you to supplement that `useChart` mouse-over callback with information specific to you component.
|
|
68
|
-
|
|
69
|
-
*/
|
|
3
|
+
import {type Series} from "../plots/plot";
|
|
4
|
+
import {
|
|
5
|
+
autocorrelation,
|
|
6
|
+
boundingPoints,
|
|
7
|
+
type Sparkline,
|
|
8
|
+
sparklineFor,
|
|
9
|
+
type SeriesStatistics,
|
|
10
|
+
seriesStatistics,
|
|
11
|
+
valueOrMissing,
|
|
12
|
+
type ScatterTooltipMetadata,
|
|
13
|
+
type ScatterTooltipPoints,
|
|
14
|
+
type TooltipStyle
|
|
15
|
+
} from "./tooltipUtils";
|
|
16
|
+
import {TooltipContent} from "./TooltipContent";
|
|
17
|
+
import {formatNumber, formatTime, formatTimeChange, formatValue, formatValueChange} from "../utils";
|
|
18
|
+
import {type Datum, emptyDatum} from "../series/timeSeries";
|
|
70
19
|
|
|
71
20
|
/**
|
|
72
21
|
* Options for displaying the tooltip content. These options are specific to this
|
|
73
22
|
* particular implementation of a tooltip content. The options effect are applied
|
|
74
|
-
* as shown below.
|
|
23
|
+
* as shown below (over a segment; and over a point).
|
|
75
24
|
* ```
|
|
76
25
|
* series name
|
|
77
26
|
* headers.before headers.after headers.delta
|
|
78
27
|
* labels.x formatters.x.value formatters.x.value formatters.x.change
|
|
79
28
|
* labels.y formatters.y.value formatters.y.value formatters.y.change
|
|
29
|
+
*
|
|
30
|
+
* series name
|
|
31
|
+
* headers.before headers.point headers.after
|
|
32
|
+
* labels.x formatters.x.value formatters.x.value formatters.x.value
|
|
33
|
+
* labels.y formatters.y.value formatters.y.value formatters.y.value
|
|
80
34
|
* ```
|
|
81
35
|
*/
|
|
82
36
|
interface TooltipOptions {
|
|
83
37
|
labels: { x: string, y: string }
|
|
84
|
-
headers: {before: string, after: string, delta: string}
|
|
38
|
+
headers: {before: string, point: string, after: string, delta: string}
|
|
85
39
|
formatters: {
|
|
86
40
|
x: { value: (value: number) => string, change: (value1: number, value2: number) => string },
|
|
87
41
|
y: { value: (value: number) => string, change: (value1: number, value2: number) => string },
|
|
@@ -90,33 +44,90 @@ interface TooltipOptions {
|
|
|
90
44
|
|
|
91
45
|
/**
|
|
92
46
|
* Properties for rendering the tooltip content. The properties are applied as
|
|
93
|
-
* shown below.
|
|
47
|
+
* shown below (over a segment; and over a point).
|
|
94
48
|
* ```
|
|
95
49
|
* series name
|
|
96
50
|
* beforeHeader afterHeader deltaHeader
|
|
97
51
|
* xLabel xValueFormatter xValueFormatter xChangeFormatter
|
|
98
52
|
* yLabel yValueFormatter yValueFormatter yChangeFormatter
|
|
53
|
+
*
|
|
54
|
+
* series name
|
|
55
|
+
* beforeHeader pointHeader afterHeader
|
|
56
|
+
* xLabel xValueFormatter xValueFormatter xValueFormatter
|
|
57
|
+
* yLabel yValueFormatter yValueFormatter yValueFormatter
|
|
99
58
|
* ```
|
|
59
|
+
* Below the table, the series' statistics: the mean value and standard deviation (formatted by
|
|
60
|
+
* `yValueFormatter`), and the mean interval between points (formatted by `intervalFormatter`).
|
|
100
61
|
*/
|
|
101
62
|
export interface Props {
|
|
102
63
|
// label for the x-values (x-value row header)
|
|
103
64
|
xLabel: string
|
|
65
|
+
// label for the y-values (y-value row header)
|
|
104
66
|
yLabel: string
|
|
67
|
+
// header of the column for the point before the mouse (or before the point under the mouse)
|
|
105
68
|
beforeHeader?: string
|
|
69
|
+
// header of the column for the point under the mouse (when the mouse is directly over a point)
|
|
70
|
+
pointHeader?: string
|
|
71
|
+
// header of the column for the point after the mouse (or after the point under the mouse)
|
|
106
72
|
afterHeader?: string
|
|
73
|
+
// header of the column for the change from the point before the mouse to the point after it
|
|
107
74
|
deltaHeader?: string
|
|
75
|
+
// formats the x-values
|
|
108
76
|
xValueFormatter?: (value: number) => string
|
|
77
|
+
// formats the y-values
|
|
109
78
|
yValueFormatter?: (value: number) => string
|
|
79
|
+
// formats the change in the x-values (from the first value to the second)
|
|
110
80
|
xChangeFormatter?: (value1: number, value2: number) => string,
|
|
81
|
+
// formats the change in the y-values (from the first value to the second)
|
|
111
82
|
yChangeFormatter?: (value1: number, value2: number) => string,
|
|
83
|
+
// formats the mean interval between the series' points (a duration, in the x-values' units).
|
|
84
|
+
// Defaults to the `xValueFormatter`, so give it its own formatter when the x-values are
|
|
85
|
+
// formatted as something that isn't a duration, such as the time of day
|
|
86
|
+
intervalFormatter?: (interval: number) => string
|
|
87
|
+
// the style of the tooltip
|
|
112
88
|
style?: Partial<TooltipStyle>
|
|
113
89
|
}
|
|
114
90
|
|
|
91
|
+
// the size of the autocorrelation's sparkline (its plot area, without the axes' labels)
|
|
92
|
+
const SPARKLINE_WIDTH = 180
|
|
93
|
+
const SPARKLINE_HEIGHT = 48
|
|
94
|
+
// the space around the sparkline's line, within its plot area
|
|
95
|
+
const SPARKLINE_PADDING = 2
|
|
96
|
+
// the space around the sparkline's plot area for the axes: their ticks and labels (the y-axis'
|
|
97
|
+
// on the left; the x-axis' below, with its "lag" caption to the right of its end)
|
|
98
|
+
const AXES_MARGIN = {left: 24, right: 22, top: 4, bottom: 14}
|
|
99
|
+
// the length of the axes' ticks
|
|
100
|
+
const TICK_LENGTH = 3
|
|
101
|
+
// the (most) ticks on the x-axis (the lags)
|
|
102
|
+
const LAG_TICK_COUNT = 5
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The data needed to render the tooltip's content, captured when the mouse moves over an element
|
|
106
|
+
*/
|
|
107
|
+
interface ScatterTooltipContent {
|
|
108
|
+
seriesName: string
|
|
109
|
+
// the column headers (e.g. before, after, and the change between them)
|
|
110
|
+
headers: Array<string>
|
|
111
|
+
xLabel: string
|
|
112
|
+
xValues: Array<string>
|
|
113
|
+
yLabel: string
|
|
114
|
+
yValues: Array<string>
|
|
115
|
+
// the column to emphasize (the point under the mouse), if any
|
|
116
|
+
emphasizedColumn?: number
|
|
117
|
+
// statistics of the series' points in the window (the data the chart holds)
|
|
118
|
+
statistics: SeriesStatistics
|
|
119
|
+
// the autocorrelation of the series' values over the window (by lag, in points), when there
|
|
120
|
+
// are enough points to calculate it
|
|
121
|
+
autocorrelation: AutocorrelationSparkline | undefined
|
|
122
|
+
}
|
|
123
|
+
|
|
115
124
|
/**
|
|
116
|
-
* Adds tooltip content as a table
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
125
|
+
* Adds tooltip content as a table, whose rows are the x-values and the y-values, and whose
|
|
126
|
+
* columns depend on where the mouse is over the series (as the plot reports it, see
|
|
127
|
+
* `ScatterTooltipMetadata` -- the plot also highlights the same points):
|
|
128
|
+
*
|
|
129
|
+
* When the mouse is over a line segment, the points before and after the mouse, and the
|
|
130
|
+
* difference between them:
|
|
120
131
|
* ```
|
|
121
132
|
* series name
|
|
122
133
|
* before after ∆
|
|
@@ -124,197 +135,323 @@ export interface Props {
|
|
|
124
135
|
* y-label y_tb y_ta y_ta - y_tb
|
|
125
136
|
* ```
|
|
126
137
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
138
|
+
* When the mouse is directly over a data point, that point (in bold), and the points before and
|
|
139
|
+
* after it:
|
|
140
|
+
* ```
|
|
141
|
+
* series name
|
|
142
|
+
* before point after
|
|
143
|
+
* x-label x_b x_p x_a
|
|
144
|
+
* y-label y_b y_p y_a
|
|
145
|
+
* ```
|
|
146
|
+
* A point that doesn't exist (e.g. before the series' first point) shows a dash.
|
|
147
|
+
*
|
|
148
|
+
* Below the table, the statistics of the series' points in the window of data the chart holds:
|
|
149
|
+
* their count, the mean and (sample) standard deviation of their values, and the mean time
|
|
150
|
+
* between consecutive points. And below that, a sparkline of the autocorrelation of their values,
|
|
151
|
+
* by lag (in points, from 0 on the left), drawn from -1 (bottom) to 1 (top): with a y-axis (ticks
|
|
152
|
+
* at -1, 0, and 1), and an x-axis along the (dashed) zero line, with ticks at round lags, captioned
|
|
153
|
+
* "lag" (just to the right of the axis' end).
|
|
154
|
+
*
|
|
155
|
+
* Built on {@link TooltipContent}; put it inside a {@link Tooltip}.
|
|
131
156
|
* @param props The properties describing the tooltip content
|
|
132
|
-
* @return null
|
|
157
|
+
* @return The tooltip's portal, or `null` when nothing is being hovered
|
|
133
158
|
*/
|
|
134
|
-
export function ScatterPlotTooltipContent(props: Props): null {
|
|
135
|
-
const {
|
|
136
|
-
chartId,
|
|
137
|
-
container,
|
|
138
|
-
tooltip
|
|
139
|
-
} = useChart<Datum, SeriesLineStyle, NoTooltipMetadata, ContinuousAxisRange, ContinuousNumericAxis>()
|
|
140
|
-
|
|
141
|
-
const {registerTooltipContentProvider} = tooltip
|
|
142
|
-
|
|
143
|
-
const {margin, plotDimensions} = usePlotDimensions()
|
|
144
|
-
|
|
159
|
+
export function ScatterPlotTooltipContent(props: Props): ReactElement | null {
|
|
145
160
|
const {
|
|
146
161
|
xLabel,
|
|
147
162
|
yLabel,
|
|
148
163
|
beforeHeader = 'before',
|
|
164
|
+
pointHeader = 'point',
|
|
149
165
|
afterHeader = 'after',
|
|
150
166
|
deltaHeader = '∆',
|
|
151
167
|
xValueFormatter = formatTime,
|
|
152
168
|
yValueFormatter = formatValue,
|
|
153
169
|
xChangeFormatter = formatTimeChange,
|
|
154
170
|
yChangeFormatter = formatValueChange,
|
|
171
|
+
intervalFormatter = xValueFormatter,
|
|
155
172
|
style,
|
|
156
173
|
} = props
|
|
157
174
|
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
// the 'registration function accepts a function of the form (seriesName, time, series) => TooltipDimensions.
|
|
167
|
-
// and that function has a closure on the content-specific information needed to add the
|
|
168
|
-
// actual content
|
|
169
|
-
useEffect(
|
|
170
|
-
() => {
|
|
171
|
-
if (container) {
|
|
172
|
-
// assemble the options for adding the tooltip
|
|
173
|
-
const options: TooltipOptions = {
|
|
174
|
-
labels: {x: xLabel, y: yLabel},
|
|
175
|
-
headers: {before: beforeHeader, after: afterHeader, delta: deltaHeader},
|
|
176
|
-
formatters: {
|
|
177
|
-
x: {value: xValueFormatter, change: xChangeFormatter},
|
|
178
|
-
y: {value: yValueFormatter, change: yChangeFormatter},
|
|
179
|
-
}
|
|
180
|
-
}
|
|
175
|
+
const options: TooltipOptions = {
|
|
176
|
+
labels: {x: xLabel, y: yLabel},
|
|
177
|
+
headers: {before: beforeHeader, point: pointHeader, after: afterHeader, delta: deltaHeader},
|
|
178
|
+
formatters: {
|
|
179
|
+
x: {value: xValueFormatter, change: xChangeFormatter},
|
|
180
|
+
y: {value: yValueFormatter, change: yChangeFormatter},
|
|
181
|
+
}
|
|
182
|
+
}
|
|
181
183
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
seriesName, time, tooltipData.series, mouseCoords,
|
|
188
|
-
chartId, container, margin, plotDimensions, tooltipStyle,
|
|
189
|
-
options
|
|
190
|
-
)
|
|
191
|
-
)
|
|
184
|
+
return (
|
|
185
|
+
<TooltipContent<Datum, Partial<ScatterTooltipMetadata>, ScatterTooltipContent>
|
|
186
|
+
style={style}
|
|
187
|
+
capture={(seriesName, time, tooltipData) =>
|
|
188
|
+
captureTooltipContent(seriesName, time, tooltipData.series, tooltipData.metadata.points, options)
|
|
192
189
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
>
|
|
191
|
+
{(tooltipContent, tooltipStyle) => {
|
|
192
|
+
const cellStyle: CSSProperties = {padding: '1px 8px', textAlign: 'right', border: 'none'}
|
|
193
|
+
const rowLabelStyle: CSSProperties = {...cellStyle, textAlign: 'left', paddingLeft: 0}
|
|
194
|
+
// the point under the mouse stands out (as it does on the plot)
|
|
195
|
+
const cellStyleFor = (column: number): CSSProperties => column === tooltipContent.emphasizedColumn ?
|
|
196
|
+
{...cellStyle, fontWeight: tooltipStyle.fontWeight + 650} :
|
|
197
|
+
cellStyle
|
|
198
|
+
|
|
199
|
+
return <>
|
|
200
|
+
<div style={{fontSize: tooltipStyle.fontSize, fontWeight: tooltipStyle.fontWeight, marginBottom: 4}}>
|
|
201
|
+
{tooltipContent.seriesName}
|
|
202
|
+
</div>
|
|
203
|
+
<table style={{fontSize: tooltipStyle.fontSize + 2, fontWeight: tooltipStyle.fontWeight + 150, borderCollapse: 'collapse', border: 'none'}}>
|
|
204
|
+
<thead>
|
|
205
|
+
<tr style={{fontWeight: tooltipStyle.fontWeight + 550}}>
|
|
206
|
+
<td style={rowLabelStyle}/>
|
|
207
|
+
{tooltipContent.headers.map((header, column) => (
|
|
208
|
+
<td key={column} style={cellStyleFor(column)}>{header}</td>
|
|
209
|
+
))}
|
|
210
|
+
</tr>
|
|
211
|
+
</thead>
|
|
212
|
+
<tbody>
|
|
213
|
+
<tr>
|
|
214
|
+
<td style={rowLabelStyle}>{tooltipContent.xLabel}</td>
|
|
215
|
+
{tooltipContent.xValues.map((value, column) => (
|
|
216
|
+
<td key={column} style={cellStyleFor(column)}>{value}</td>
|
|
217
|
+
))}
|
|
218
|
+
</tr>
|
|
219
|
+
<tr>
|
|
220
|
+
<td style={rowLabelStyle}>{tooltipContent.yLabel}</td>
|
|
221
|
+
{tooltipContent.yValues.map((value, column) => (
|
|
222
|
+
<td key={column} style={cellStyleFor(column)}>{value}</td>
|
|
223
|
+
))}
|
|
224
|
+
</tr>
|
|
225
|
+
</tbody>
|
|
226
|
+
</table>
|
|
227
|
+
{/* the series' points over the window (the data the chart holds) */}
|
|
228
|
+
{/* (sized to its content, rather than the app's default full-width tables, so that the
|
|
229
|
+
values sit next to their labels) */}
|
|
230
|
+
{tooltipContent.statistics.count > 0 &&
|
|
231
|
+
<table style={{fontSize: tooltipStyle.fontSize, borderCollapse: 'collapse', border: 'none', marginTop: 6, width: 'auto'}}>
|
|
232
|
+
<tbody>
|
|
233
|
+
{[
|
|
234
|
+
['Points', formatNumber(tooltipContent.statistics.count, " ,.0f")],
|
|
235
|
+
['Mean value', valueOrMissing(tooltipContent.statistics.meanValue, yValueFormatter)],
|
|
236
|
+
['Std. deviation', valueOrMissing(tooltipContent.statistics.valueStandardDeviation, yValueFormatter)],
|
|
237
|
+
['Mean interval', valueOrMissing(tooltipContent.statistics.meanInterval, intervalFormatter)],
|
|
238
|
+
].map(([label, value]) => (
|
|
239
|
+
<tr key={label}>
|
|
240
|
+
<td style={{padding: '1px 12px 1px 0', textAlign: 'left', border: 'none'}}>{label}</td>
|
|
241
|
+
<td style={{padding: '1px 0', textAlign: 'right', border: 'none'}}>{value}</td>
|
|
242
|
+
</tr>
|
|
243
|
+
))}
|
|
244
|
+
</tbody>
|
|
245
|
+
</table>
|
|
246
|
+
}
|
|
247
|
+
{/* the autocorrelation of the series' values, by lag */}
|
|
248
|
+
{tooltipContent.autocorrelation !== undefined && <>
|
|
249
|
+
<div style={{fontSize: tooltipStyle.fontSize, marginTop: 8}}>
|
|
250
|
+
Autocorrelation
|
|
251
|
+
</div>
|
|
252
|
+
<AutocorrelationChart
|
|
253
|
+
autocorrelation={tooltipContent.autocorrelation}
|
|
254
|
+
color={tooltipStyle.fontColor}
|
|
255
|
+
fontSize={tooltipStyle.fontSize - 3}
|
|
256
|
+
/>
|
|
257
|
+
</>}
|
|
258
|
+
</>
|
|
259
|
+
}}
|
|
260
|
+
</TooltipContent>
|
|
201
261
|
)
|
|
202
|
-
|
|
203
|
-
return null
|
|
204
262
|
}
|
|
205
263
|
|
|
206
264
|
/**
|
|
207
|
-
*
|
|
265
|
+
* Captures the data needed to render the tooltip's content: the table of the points the tooltip
|
|
266
|
+
* shows, and the statistics and autocorrelation of the series' points.
|
|
208
267
|
* @param seriesName The name of the series (i.e. the neuron ID)
|
|
209
268
|
* @param time The time (x-coordinate value) corresponding to the mouse location
|
|
210
|
-
* @param series The
|
|
211
|
-
* @param
|
|
212
|
-
*
|
|
213
|
-
* @param
|
|
214
|
-
* @
|
|
215
|
-
* @param tooltipStyle The style properties for the tooltip
|
|
216
|
-
* @param plotDimensions The dimensions of the plot
|
|
217
|
-
* @param options The options passed through the function that adds the tooltip content
|
|
218
|
-
* @return The width and text height of the tooltip content
|
|
269
|
+
* @param series The series' data (the window of data the chart holds -- for the statistics too)
|
|
270
|
+
* @param points The points to show, as the plot determined them (see {@link scatterTooltipPoints});
|
|
271
|
+
* when `undefined`, the points on either side of the mouse's time are shown
|
|
272
|
+
* @param options The tooltip's labels, headers, and formatters
|
|
273
|
+
* @return The tooltip's content
|
|
219
274
|
*/
|
|
220
|
-
function
|
|
275
|
+
function captureTooltipContent(
|
|
221
276
|
seriesName: string,
|
|
222
277
|
time: number,
|
|
223
278
|
series: Series<Datum>,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
.
|
|
245
|
-
.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const vrHeader = table.append<SVGTextElement>("text").text(() => labels.y)
|
|
273
|
-
const vrLower = table.append<SVGTextElement>("text").text(() => formatters.y.value(lower.value))
|
|
274
|
-
const vrUpper = table.append<SVGTextElement>("text").text(() => formatters.y.value(upper.value))
|
|
275
|
-
const vrDelta = table.append<SVGTextElement>("text").text(() => formatters.y.change(lower.value, upper.value))
|
|
276
|
-
|
|
277
|
-
const textWidthOf = (elem: TextSelection) => elem.node()?.getBBox()?.width || 0
|
|
278
|
-
const textHeightOf = (elem: TextSelection) => elem.node()?.getBBox()?.height || 0
|
|
279
|
-
const spacesWidthFor = (spaces: number) => spaces * textWidthOf(hrLower) / 5
|
|
280
|
-
|
|
281
|
-
// calculate the max width and height of the text
|
|
282
|
-
const tooltipWidth = Math.max(textWidthOf(header), spacesWidthFor(33))
|
|
283
|
-
const headerTextHeight = textHeightOf(header)
|
|
284
|
-
const headerRowHeight = textHeightOf(hrLower)
|
|
285
|
-
const timeRowHeight = textHeightOf(trHeader)
|
|
286
|
-
const valueRowHeight = textHeightOf(vrHeader)
|
|
287
|
-
const textHeight = headerTextHeight + headerRowHeight + timeRowHeight + valueRowHeight
|
|
288
|
-
|
|
289
|
-
// set the header text location
|
|
290
|
-
const xCoord = tooltipX(x, tooltipWidth, plotDimensions, tooltipStyle, margin)
|
|
291
|
-
const yCoord = tooltipY(y, textHeight, plotDimensions, tooltipStyle, margin)
|
|
292
|
-
const xTooltip = xCoord + tooltipStyle.paddingLeft
|
|
293
|
-
const yTooltip = yCoord + tooltipStyle.paddingTop
|
|
294
|
-
header
|
|
295
|
-
.attr('x', () => xTooltip)
|
|
296
|
-
.attr('y', () => yTooltip - (headerRowHeight + timeRowHeight + valueRowHeight) + textHeight)
|
|
279
|
+
points: ScatterTooltipPoints | undefined,
|
|
280
|
+
options: TooltipOptions,
|
|
281
|
+
): ScatterTooltipContent {
|
|
282
|
+
const {labels, headers, formatters} = options
|
|
283
|
+
// the points to show, as determined by the plot -- or, when the plot doesn't say, the points on
|
|
284
|
+
// either side of the mouse's time
|
|
285
|
+
const shown = points ?? segmentAround(series, time)
|
|
286
|
+
|
|
287
|
+
// a value, or a dash for a point that doesn't exist (e.g. before the series' first point)
|
|
288
|
+
const valueOf = (datum: Datum | undefined, formatter: (value: number) => string, value: (datum: Datum) => number): string =>
|
|
289
|
+
datum === undefined ? MISSING_VALUE : formatter(value(datum))
|
|
290
|
+
const changeOf = (formatter: (value1: number, value2: number) => string, value: (datum: Datum) => number): string =>
|
|
291
|
+
shown.before === undefined || shown.after === undefined ?
|
|
292
|
+
MISSING_VALUE :
|
|
293
|
+
formatter(value(shown.before), value(shown.after))
|
|
294
|
+
|
|
295
|
+
const xOf = (datum: Datum) => datum.x
|
|
296
|
+
const yOf = (datum: Datum) => datum.y
|
|
297
|
+
return {
|
|
298
|
+
seriesName,
|
|
299
|
+
xLabel: labels.x,
|
|
300
|
+
yLabel: labels.y,
|
|
301
|
+
statistics: seriesStatistics(series),
|
|
302
|
+
autocorrelation: autocorrelationSparkline(series),
|
|
303
|
+
...(shown.kind === 'point' ?
|
|
304
|
+
// directly over a point: the point before it, the point, and the point after it
|
|
305
|
+
{
|
|
306
|
+
headers: [headers.before, headers.point, headers.after],
|
|
307
|
+
xValues: [shown.before, shown.point, shown.after].map(datum => valueOf(datum, formatters.x.value, xOf)),
|
|
308
|
+
yValues: [shown.before, shown.point, shown.after].map(datum => valueOf(datum, formatters.y.value, yOf)),
|
|
309
|
+
emphasizedColumn: 1,
|
|
310
|
+
} :
|
|
311
|
+
// over a segment: the points on either side of the mouse, and the change between them
|
|
312
|
+
{
|
|
313
|
+
headers: [headers.before, headers.after, headers.delta],
|
|
314
|
+
xValues: [
|
|
315
|
+
valueOf(shown.before, formatters.x.value, xOf),
|
|
316
|
+
valueOf(shown.after, formatters.x.value, xOf),
|
|
317
|
+
changeOf(formatters.x.change, xOf)
|
|
318
|
+
],
|
|
319
|
+
yValues: [
|
|
320
|
+
valueOf(shown.before, formatters.y.value, yOf),
|
|
321
|
+
valueOf(shown.after, formatters.y.value, yOf),
|
|
322
|
+
changeOf(formatters.y.change, yOf)
|
|
323
|
+
],
|
|
324
|
+
})
|
|
325
|
+
}
|
|
326
|
+
}
|
|
297
327
|
|
|
328
|
+
// shown in place of the values of a point that doesn't exist (e.g. before the series' first point)
|
|
329
|
+
const MISSING_VALUE = '–'
|
|
298
330
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
331
|
+
/**
|
|
332
|
+
* The points on either side of the specified time (the segment it's on)
|
|
333
|
+
* @param series The series' data
|
|
334
|
+
* @param time The time
|
|
335
|
+
* @return The points before and after the time (undefined where there's none)
|
|
336
|
+
*/
|
|
337
|
+
function segmentAround(series: Series<Datum>, time: number): ScatterTooltipPoints {
|
|
338
|
+
const [before, after] = boundingPoints(series, time, value => value.x, () => emptyDatum())
|
|
339
|
+
const orUndefined = (datum: Datum) => isNaN(datum.x) ? undefined : datum
|
|
340
|
+
return {kind: 'segment', before: orUndefined(before), after: orUndefined(after)}
|
|
341
|
+
}
|
|
306
342
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
343
|
+
/**
|
|
344
|
+
* The sparkline of the autocorrelation of a series' values (see {@link autocorrelation}): the lags
|
|
345
|
+
* run left to right across the width, and the correlations from -1 (at the bottom) to 1 (at the
|
|
346
|
+
* top), so that the zero line is at the middle
|
|
347
|
+
* @param series The series' data
|
|
348
|
+
* @return The sparkline, or `undefined` when there are too few points (or
|
|
349
|
+
* the values don't vary)
|
|
350
|
+
*/
|
|
351
|
+
function autocorrelationSparkline(series: Series<Datum>): AutocorrelationSparkline | undefined {
|
|
352
|
+
const correlations = autocorrelation(series)
|
|
353
|
+
if (correlations === undefined) return undefined
|
|
354
|
+
const sparkline = sparklineFor(
|
|
355
|
+
correlations.map((value, lag) => ({time: lag, value})),
|
|
356
|
+
SPARKLINE_WIDTH, SPARKLINE_HEIGHT, SPARKLINE_PADDING, [-1, 1]
|
|
357
|
+
)
|
|
358
|
+
return sparkline === undefined ? undefined : {sparkline, maxLag: correlations.length - 1}
|
|
359
|
+
}
|
|
312
360
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
vrDelta.attr('x', () => xTooltip + hrDeltaX - textWidthOf(vrDelta)).attr('y', () => vrRowY)
|
|
361
|
+
/**
|
|
362
|
+
* The autocorrelation's sparkline, and its largest lag (for the x-axis' ticks)
|
|
363
|
+
*/
|
|
364
|
+
type AutocorrelationSparkline = {sparkline: Sparkline, maxLag: number}
|
|
318
365
|
|
|
319
|
-
|
|
366
|
+
/**
|
|
367
|
+
* The autocorrelation's sparkline, with its axes: a y-axis on the left, with ticks (and labels) at
|
|
368
|
+
* -1, 0, and 1; and an x-axis along the dashed zero line, with ticks at round lags (labelled below
|
|
369
|
+
* the plot, out of the line's way), captioned "lag" just to the right of its end
|
|
370
|
+
* @param props The autocorrelation's sparkline (and largest lag), the color of the line and the
|
|
371
|
+
* axes, and the font size of the axes' labels
|
|
372
|
+
* @return The sparkline, with its axes
|
|
373
|
+
*/
|
|
374
|
+
function AutocorrelationChart(props: {
|
|
375
|
+
autocorrelation: AutocorrelationSparkline,
|
|
376
|
+
color: string,
|
|
377
|
+
fontSize: number
|
|
378
|
+
}): ReactElement {
|
|
379
|
+
const {autocorrelation: {sparkline, maxLag}, color, fontSize} = props
|
|
380
|
+
// where a lag, and a correlation, are within the plot area (as `sparklineFor` places them)
|
|
381
|
+
const innerWidth = SPARKLINE_WIDTH - 2 * SPARKLINE_PADDING
|
|
382
|
+
const innerHeight = SPARKLINE_HEIGHT - 2 * SPARKLINE_PADDING
|
|
383
|
+
const xOf = (lag: number) => SPARKLINE_PADDING + lag / maxLag * innerWidth
|
|
384
|
+
const yOf = (correlation: number) => SPARKLINE_PADDING + (1 - correlation) / 2 * innerHeight
|
|
385
|
+
// (the y-axis sits just left of lag 0, so it doesn't cover the line's start)
|
|
386
|
+
const yAxisX = SPARKLINE_PADDING - TICK_LENGTH
|
|
387
|
+
const lagTicks = d3.ticks(0, maxLag, Math.min(LAG_TICK_COUNT, maxLag)).filter(Number.isInteger)
|
|
388
|
+
const axisStyle = {stroke: color, strokeOpacity: 0.6, strokeWidth: 1}
|
|
389
|
+
const labelStyle = {fill: color, fillOpacity: 0.8, fontSize}
|
|
390
|
+
|
|
391
|
+
return (
|
|
392
|
+
<svg
|
|
393
|
+
width={AXES_MARGIN.left + SPARKLINE_WIDTH + AXES_MARGIN.right}
|
|
394
|
+
height={AXES_MARGIN.top + SPARKLINE_HEIGHT + AXES_MARGIN.bottom}
|
|
395
|
+
style={{display: 'block', marginTop: 2}}
|
|
396
|
+
aria-hidden="true"
|
|
397
|
+
>
|
|
398
|
+
<g transform={`translate(${AXES_MARGIN.left}, ${AXES_MARGIN.top})`}>
|
|
399
|
+
{/* the y-axis: -1 (bottom) to 1 (top) */}
|
|
400
|
+
<line x1={yAxisX} y1={yOf(1)} x2={yAxisX} y2={yOf(-1)} {...axisStyle}/>
|
|
401
|
+
{[-1, 0, 1].map(correlation => (
|
|
402
|
+
<g key={correlation}>
|
|
403
|
+
<line
|
|
404
|
+
x1={yAxisX - TICK_LENGTH} y1={yOf(correlation)}
|
|
405
|
+
x2={yAxisX} y2={yOf(correlation)}
|
|
406
|
+
{...axisStyle}
|
|
407
|
+
/>
|
|
408
|
+
<text
|
|
409
|
+
x={yAxisX - TICK_LENGTH - 2} y={yOf(correlation)}
|
|
410
|
+
textAnchor="end" dominantBaseline="middle"
|
|
411
|
+
{...labelStyle}
|
|
412
|
+
>
|
|
413
|
+
{correlation}
|
|
414
|
+
</text>
|
|
415
|
+
</g>
|
|
416
|
+
))}
|
|
417
|
+
{/* the x-axis: the (dashed) zero line, with ticks at round lags */}
|
|
418
|
+
<line
|
|
419
|
+
x1={yAxisX} y1={yOf(0)} x2={xOf(maxLag)} y2={yOf(0)}
|
|
420
|
+
{...axisStyle} strokeOpacity={0.35} strokeDasharray="2 2"
|
|
421
|
+
/>
|
|
422
|
+
{lagTicks.map(lag => (
|
|
423
|
+
<g key={lag}>
|
|
424
|
+
<line
|
|
425
|
+
x1={xOf(lag)} y1={yOf(0) - TICK_LENGTH / 2}
|
|
426
|
+
x2={xOf(lag)} y2={yOf(0) + TICK_LENGTH / 2}
|
|
427
|
+
{...axisStyle}
|
|
428
|
+
/>
|
|
429
|
+
<text
|
|
430
|
+
x={xOf(lag)} y={SPARKLINE_HEIGHT + AXES_MARGIN.bottom - 3}
|
|
431
|
+
textAnchor="middle"
|
|
432
|
+
{...labelStyle}
|
|
433
|
+
>
|
|
434
|
+
{lag}
|
|
435
|
+
</text>
|
|
436
|
+
</g>
|
|
437
|
+
))}
|
|
438
|
+
{/* the x-axis' caption, just to the right of its end */}
|
|
439
|
+
<text
|
|
440
|
+
x={xOf(maxLag) + TICK_LENGTH} y={yOf(0)}
|
|
441
|
+
textAnchor="start" dominantBaseline="middle"
|
|
442
|
+
{...labelStyle}
|
|
443
|
+
>
|
|
444
|
+
lag
|
|
445
|
+
</text>
|
|
446
|
+
<path
|
|
447
|
+
d={sparkline.path}
|
|
448
|
+
fill="none"
|
|
449
|
+
stroke={color}
|
|
450
|
+
strokeWidth={1.25}
|
|
451
|
+
strokeLinejoin="round"
|
|
452
|
+
strokeLinecap="round"
|
|
453
|
+
/>
|
|
454
|
+
</g>
|
|
455
|
+
</svg>
|
|
456
|
+
)
|
|
320
457
|
}
|