stream-charts 1.2.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +809 -1022
- package/changes.md +36 -0
- package/dist/app/charts/Chart.d.ts +35 -139
- package/dist/app/charts/Chart.d.ts.map +1 -0
- package/dist/app/charts/Chart.js +74 -65
- package/dist/app/charts/Chart.js.map +1 -1
- package/dist/app/charts/axes/AxesState.d.ts +26 -18
- package/dist/app/charts/axes/AxesState.d.ts.map +1 -0
- package/dist/app/charts/axes/AxesState.js +26 -24
- package/dist/app/charts/axes/AxesState.js.map +1 -1
- package/dist/app/charts/axes/AxisInterval.d.ts +44 -26
- package/dist/app/charts/axes/AxisInterval.d.ts.map +1 -0
- package/dist/app/charts/axes/AxisInterval.js +48 -29
- package/dist/app/charts/axes/AxisInterval.js.map +1 -1
- package/dist/app/charts/axes/BaseAxisRange.d.ts +46 -22
- package/dist/app/charts/axes/BaseAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/BaseAxisRange.js +17 -12
- package/dist/app/charts/axes/BaseAxisRange.js.map +1 -1
- package/dist/app/charts/axes/ContinuousAxis.d.ts +47 -6
- package/dist/app/charts/axes/ContinuousAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/ContinuousAxis.js +160 -27
- package/dist/app/charts/axes/ContinuousAxis.js.map +1 -1
- package/dist/app/charts/axes/ContinuousAxisRange.d.ts +29 -10
- package/dist/app/charts/axes/ContinuousAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/ContinuousAxisRange.js +29 -11
- package/dist/app/charts/axes/ContinuousAxisRange.js.map +1 -1
- package/dist/app/charts/axes/EmptyAxis.d.ts +5 -2
- package/dist/app/charts/axes/EmptyAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/EmptyAxis.js +30 -9
- package/dist/app/charts/axes/EmptyAxis.js.map +1 -1
- package/dist/app/charts/axes/OrdinalAxis.d.ts +5 -3
- package/dist/app/charts/axes/OrdinalAxis.d.ts.map +1 -0
- package/dist/app/charts/axes/OrdinalAxis.js +39 -16
- package/dist/app/charts/axes/OrdinalAxis.js.map +1 -1
- package/dist/app/charts/axes/OrdinalAxisRange.d.ts +76 -13
- package/dist/app/charts/axes/OrdinalAxisRange.d.ts.map +1 -0
- package/dist/app/charts/axes/OrdinalAxisRange.js +95 -16
- package/dist/app/charts/axes/OrdinalAxisRange.js.map +1 -1
- package/dist/app/charts/axes/autoScale.d.ts +111 -0
- package/dist/app/charts/axes/autoScale.d.ts.map +1 -0
- package/dist/app/charts/axes/autoScale.js +188 -0
- package/dist/app/charts/axes/autoScale.js.map +1 -0
- package/dist/app/charts/axes/axes.d.ts +273 -150
- package/dist/app/charts/axes/axes.d.ts.map +1 -0
- package/dist/app/charts/axes/axes.js +808 -583
- package/dist/app/charts/axes/axes.js.map +1 -1
- package/dist/app/charts/d3types.d.ts +40 -11
- package/dist/app/charts/d3types.d.ts.map +1 -0
- package/dist/app/charts/d3types.js +3 -0
- package/dist/app/charts/d3types.js.map +1 -1
- package/dist/app/charts/datasources/StreamingDataSource.d.ts +149 -0
- package/dist/app/charts/datasources/StreamingDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/StreamingDataSource.js +110 -0
- package/dist/app/charts/datasources/StreamingDataSource.js.map +1 -0
- package/dist/app/charts/datasources/iteratesDataSource.d.ts +73 -0
- package/dist/app/charts/datasources/iteratesDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/iteratesDataSource.js +87 -0
- package/dist/app/charts/datasources/iteratesDataSource.js.map +1 -0
- package/dist/app/charts/datasources/ordinalDataSource.d.ts +75 -0
- package/dist/app/charts/datasources/ordinalDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/ordinalDataSource.js +135 -0
- package/dist/app/charts/datasources/ordinalDataSource.js.map +1 -0
- package/dist/app/charts/datasources/outlierDataSource.d.ts +53 -0
- package/dist/app/charts/datasources/outlierDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/outlierDataSource.js +57 -0
- package/dist/app/charts/datasources/outlierDataSource.js.map +1 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.d.ts +77 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.d.ts.map +1 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.js +85 -0
- package/dist/app/charts/datasources/timeSeriesDataSource.js.map +1 -0
- package/dist/app/charts/filters/regexFilter.d.ts +31 -4
- package/dist/app/charts/filters/regexFilter.d.ts.map +1 -0
- package/dist/app/charts/filters/regexFilter.js +38 -4
- package/dist/app/charts/filters/regexFilter.js.map +1 -1
- package/dist/app/charts/hooks/AxesProvider.d.ts +21 -0
- package/dist/app/charts/hooks/AxesProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/AxesProvider.js +213 -0
- package/dist/app/charts/hooks/AxesProvider.js.map +1 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts +25 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.js +76 -0
- package/dist/app/charts/hooks/CanvasSurfaceProvider.js.map +1 -0
- package/dist/app/charts/hooks/ChartProvider.d.ts +40 -0
- package/dist/app/charts/hooks/ChartProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/ChartProvider.js +33 -0
- package/dist/app/charts/hooks/ChartProvider.js.map +1 -0
- package/dist/app/charts/hooks/InteractionProvider.d.ts +23 -0
- package/dist/app/charts/hooks/InteractionProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/InteractionProvider.js +60 -0
- package/dist/app/charts/hooks/InteractionProvider.js.map +1 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts +16 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.d.ts.map +1 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.js +76 -0
- package/dist/app/charts/hooks/PlotDimensionsProvider.js.map +1 -0
- package/dist/app/charts/hooks/defaultAxesValues.d.ts +11 -0
- package/dist/app/charts/hooks/defaultAxesValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultAxesValues.js +36 -0
- package/dist/app/charts/hooks/defaultAxesValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultMouseValues.d.ts +9 -0
- package/dist/app/charts/hooks/defaultMouseValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultMouseValues.js +23 -0
- package/dist/app/charts/hooks/defaultMouseValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.d.ts +13 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.js +23 -0
- package/dist/app/charts/hooks/defaultPlotDimensions.js.map +1 -0
- package/dist/app/charts/hooks/defaultTooltipValues.d.ts +9 -0
- package/dist/app/charts/hooks/defaultTooltipValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultTooltipValues.js +21 -0
- package/dist/app/charts/hooks/defaultTooltipValues.js.map +1 -0
- package/dist/app/charts/hooks/defaultUseChartValues.d.ts +14 -0
- package/dist/app/charts/hooks/defaultUseChartValues.d.ts.map +1 -0
- package/dist/app/charts/hooks/defaultUseChartValues.js +30 -0
- package/dist/app/charts/hooks/defaultUseChartValues.js.map +1 -0
- package/dist/app/charts/hooks/useAxes.d.ts +49 -36
- package/dist/app/charts/hooks/useAxes.d.ts.map +1 -0
- package/dist/app/charts/hooks/useAxes.js +16 -176
- package/dist/app/charts/hooks/useAxes.js.map +1 -1
- package/dist/app/charts/hooks/useCanvasSurface.d.ts +25 -0
- package/dist/app/charts/hooks/useCanvasSurface.d.ts.map +1 -0
- package/dist/app/charts/hooks/useCanvasSurface.js +18 -0
- package/dist/app/charts/hooks/useCanvasSurface.js.map +1 -0
- package/dist/app/charts/hooks/useChart.d.ts +30 -44
- package/dist/app/charts/hooks/useChart.d.ts.map +1 -0
- package/dist/app/charts/hooks/useChart.js +26 -48
- package/dist/app/charts/hooks/useChart.js.map +1 -1
- package/dist/app/charts/hooks/useDataSource.d.ts +68 -0
- package/dist/app/charts/hooks/useDataSource.d.ts.map +1 -0
- package/dist/app/charts/hooks/useDataSource.js +63 -0
- package/dist/app/charts/hooks/useDataSource.js.map +1 -0
- package/dist/app/charts/hooks/useHoveredSeries.d.ts +25 -0
- package/dist/app/charts/hooks/useHoveredSeries.d.ts.map +1 -0
- package/dist/app/charts/hooks/useHoveredSeries.js +15 -0
- package/dist/app/charts/hooks/useHoveredSeries.js.map +1 -0
- package/dist/app/charts/hooks/useMouse.d.ts +46 -22
- package/dist/app/charts/hooks/useMouse.d.ts.map +1 -0
- package/dist/app/charts/hooks/useMouse.js +12 -56
- package/dist/app/charts/hooks/useMouse.js.map +1 -1
- package/dist/app/charts/hooks/usePlotDimensions.d.ts +25 -13
- package/dist/app/charts/hooks/usePlotDimensions.d.ts.map +1 -0
- package/dist/app/charts/hooks/usePlotDimensions.js +6 -62
- package/dist/app/charts/hooks/usePlotDimensions.js.map +1 -1
- package/dist/app/charts/hooks/useTooltip.d.ts +24 -26
- package/dist/app/charts/hooks/useTooltip.d.ts.map +1 -0
- package/dist/app/charts/hooks/useTooltip.js +12 -42
- package/dist/app/charts/hooks/useTooltip.js.map +1 -1
- package/dist/app/charts/index.d.ts +66 -0
- package/dist/app/charts/index.d.ts.map +1 -0
- package/dist/app/charts/index.js +87 -0
- package/dist/app/charts/index.js.map +1 -0
- package/dist/app/charts/legends/Legend.d.ts +33 -12
- package/dist/app/charts/legends/Legend.d.ts.map +1 -0
- package/dist/app/charts/legends/Legend.js +138 -379
- package/dist/app/charts/legends/Legend.js.map +1 -1
- package/dist/app/charts/legends/constants.d.ts +19 -0
- package/dist/app/charts/legends/constants.d.ts.map +1 -0
- package/dist/app/charts/legends/constants.js +34 -0
- package/dist/app/charts/legends/constants.js.map +1 -0
- package/dist/app/charts/observables/ChartData.d.ts +1 -0
- package/dist/app/charts/observables/ChartData.d.ts.map +1 -0
- package/dist/app/charts/observables/iterates.d.ts +13 -7
- package/dist/app/charts/observables/iterates.d.ts.map +1 -0
- package/dist/app/charts/observables/iterates.js +42 -9
- package/dist/app/charts/observables/iterates.js.map +1 -1
- package/dist/app/charts/observables/ordinals.d.ts +70 -12
- package/dist/app/charts/observables/ordinals.d.ts.map +1 -0
- package/dist/app/charts/observables/ordinals.js +127 -48
- package/dist/app/charts/observables/ordinals.js.map +1 -1
- package/dist/app/charts/observables/outliers.d.ts +18 -0
- package/dist/app/charts/observables/outliers.d.ts.map +1 -0
- package/dist/app/charts/observables/outliers.js +2 -0
- package/dist/app/charts/observables/outliers.js.map +1 -0
- package/dist/app/charts/plots/BarPlot.d.ts +87 -13
- package/dist/app/charts/plots/BarPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/BarPlot.js +603 -356
- package/dist/app/charts/plots/BarPlot.js.map +1 -1
- package/dist/app/charts/plots/OutlierPlot.d.ts +123 -0
- package/dist/app/charts/plots/OutlierPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/OutlierPlot.js +430 -0
- package/dist/app/charts/plots/OutlierPlot.js.map +1 -0
- package/dist/app/charts/plots/PoincarePlot.d.ts +92 -14
- package/dist/app/charts/plots/PoincarePlot.d.ts.map +1 -0
- package/dist/app/charts/plots/PoincarePlot.js +523 -364
- package/dist/app/charts/plots/PoincarePlot.js.map +1 -1
- package/dist/app/charts/plots/RasterPlot.d.ts +31 -10
- package/dist/app/charts/plots/RasterPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/RasterPlot.js +198 -306
- package/dist/app/charts/plots/RasterPlot.js.map +1 -1
- package/dist/app/charts/plots/ScatterPlot.d.ts +77 -21
- package/dist/app/charts/plots/ScatterPlot.d.ts.map +1 -0
- package/dist/app/charts/plots/ScatterPlot.js +359 -302
- package/dist/app/charts/plots/ScatterPlot.js.map +1 -1
- package/dist/app/charts/plots/autoScaleYAxes.d.ts +43 -0
- package/dist/app/charts/plots/autoScaleYAxes.d.ts.map +1 -0
- package/dist/app/charts/plots/autoScaleYAxes.js +71 -0
- package/dist/app/charts/plots/autoScaleYAxes.js.map +1 -0
- package/dist/app/charts/plots/colorizedLine.d.ts +61 -0
- package/dist/app/charts/plots/colorizedLine.d.ts.map +1 -0
- package/dist/app/charts/plots/colorizedLine.js +157 -0
- package/dist/app/charts/plots/colorizedLine.js.map +1 -0
- package/dist/app/charts/plots/constants.d.ts +7 -0
- package/dist/app/charts/plots/constants.d.ts.map +1 -0
- package/dist/app/charts/plots/constants.js +11 -0
- package/dist/app/charts/plots/constants.js.map +1 -0
- package/dist/app/charts/plots/hitTesting.d.ts +88 -0
- package/dist/app/charts/plots/hitTesting.d.ts.map +1 -0
- package/dist/app/charts/plots/hitTesting.js +136 -0
- package/dist/app/charts/plots/hitTesting.js.map +1 -0
- package/dist/app/charts/plots/plot.d.ts +52 -16
- package/dist/app/charts/plots/plot.d.ts.map +1 -0
- package/dist/app/charts/plots/plot.js +108 -35
- package/dist/app/charts/plots/plot.js.map +1 -1
- package/dist/app/charts/plots/useCanvasZoomPan.d.ts +119 -0
- package/dist/app/charts/plots/useCanvasZoomPan.d.ts.map +1 -0
- package/dist/app/charts/plots/useCanvasZoomPan.js +113 -0
- package/dist/app/charts/plots/useCanvasZoomPan.js.map +1 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.d.ts +103 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.d.ts.map +1 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.js +257 -0
- package/dist/app/charts/plots/useStreamingTimeAxes.js.map +1 -0
- package/dist/app/charts/series/baseSeries.d.ts +60 -8
- package/dist/app/charts/series/baseSeries.d.ts.map +1 -0
- package/dist/app/charts/series/baseSeries.js +53 -8
- package/dist/app/charts/series/baseSeries.js.map +1 -1
- package/dist/app/charts/series/iterateSeries.d.ts +9 -8
- package/dist/app/charts/series/iterateSeries.d.ts.map +1 -0
- package/dist/app/charts/series/iterateSeries.js +7 -7
- package/dist/app/charts/series/iterateSeries.js.map +1 -1
- package/dist/app/charts/series/ordinalSeries.d.ts +27 -13
- package/dist/app/charts/series/ordinalSeries.d.ts.map +1 -0
- package/dist/app/charts/series/ordinalSeries.js +29 -15
- package/dist/app/charts/series/ordinalSeries.js.map +1 -1
- package/dist/app/charts/series/outlierSeries.d.ts +142 -0
- package/dist/app/charts/series/outlierSeries.d.ts.map +1 -0
- package/dist/app/charts/series/outlierSeries.js +82 -0
- package/dist/app/charts/series/outlierSeries.js.map +1 -0
- package/dist/app/charts/series/timeSeries.d.ts +13 -9
- package/dist/app/charts/series/timeSeries.d.ts.map +1 -0
- package/dist/app/charts/series/timeSeries.js +6 -3
- package/dist/app/charts/series/timeSeries.js.map +1 -1
- package/dist/app/charts/series/timeSeriesChartData.d.ts +18 -10
- package/dist/app/charts/series/timeSeriesChartData.d.ts.map +1 -0
- package/dist/app/charts/series/timeSeriesChartData.js +28 -14
- package/dist/app/charts/series/timeSeriesChartData.js.map +1 -1
- package/dist/app/charts/styling/barPlotStyle.d.ts +46 -2
- package/dist/app/charts/styling/barPlotStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/barPlotStyle.js +37 -3
- package/dist/app/charts/styling/barPlotStyle.js.map +1 -1
- package/dist/app/charts/styling/canvasStyle.d.ts +53 -0
- package/dist/app/charts/styling/canvasStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/canvasStyle.js +71 -0
- package/dist/app/charts/styling/canvasStyle.js.map +1 -0
- package/dist/app/charts/styling/margins.d.ts +21 -2
- package/dist/app/charts/styling/margins.d.ts.map +1 -0
- package/dist/app/charts/styling/margins.js +25 -4
- package/dist/app/charts/styling/margins.js.map +1 -1
- package/dist/app/charts/styling/svgStyle.d.ts +10 -56
- package/dist/app/charts/styling/svgStyle.d.ts.map +1 -0
- package/dist/app/charts/styling/svgStyle.js +3 -78
- package/dist/app/charts/styling/svgStyle.js.map +1 -1
- package/dist/app/charts/subscriptions/viewDrivers.d.ts +124 -0
- package/dist/app/charts/subscriptions/viewDrivers.d.ts.map +1 -0
- package/dist/app/charts/subscriptions/viewDrivers.js +338 -0
- package/dist/app/charts/subscriptions/viewDrivers.js.map +1 -0
- package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts +12 -78
- package/dist/app/charts/tooltips/BarPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/BarPlotTooltipContent.js +65 -257
- package/dist/app/charts/tooltips/BarPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts +9 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js +16 -0
- package/dist/app/charts/tooltips/DefaultOutlierTooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts +30 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js +26 -0
- package/dist/app/charts/tooltips/OutlierPlotTooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts +22 -72
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js +104 -171
- package/dist/app/charts/tooltips/PoincarePlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts +32 -8
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.js +62 -115
- package/dist/app/charts/tooltips/RasterPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts +39 -12
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js +162 -134
- package/dist/app/charts/tooltips/ScatterPlotTooltipContent.js.map +1 -1
- package/dist/app/charts/tooltips/Tooltip.d.ts +27 -32
- package/dist/app/charts/tooltips/Tooltip.d.ts.map +1 -0
- package/dist/app/charts/tooltips/Tooltip.js +37 -81
- package/dist/app/charts/tooltips/Tooltip.js.map +1 -1
- package/dist/app/charts/tooltips/TooltipContent.d.ts +81 -0
- package/dist/app/charts/tooltips/TooltipContent.d.ts.map +1 -0
- package/dist/app/charts/tooltips/TooltipContent.js +99 -0
- package/dist/app/charts/tooltips/TooltipContent.js.map +1 -0
- package/dist/app/charts/tooltips/tooltipUtils.d.ts +186 -36
- package/dist/app/charts/tooltips/tooltipUtils.d.ts.map +1 -0
- package/dist/app/charts/tooltips/tooltipUtils.js +277 -48
- package/dist/app/charts/tooltips/tooltipUtils.js.map +1 -1
- package/dist/app/charts/tooltips/useOutlierTooltip.d.ts +59 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.js +16 -0
- package/dist/app/charts/tooltips/useOutlierTooltip.js.map +1 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.d.ts +51 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.js +52 -0
- package/dist/app/charts/tooltips/useTooltipPlacement.js.map +1 -0
- package/dist/app/charts/tooltips/useTooltipStyle.d.ts +11 -0
- package/dist/app/charts/tooltips/useTooltipStyle.d.ts.map +1 -0
- package/dist/app/charts/tooltips/useTooltipStyle.js +14 -0
- package/dist/app/charts/tooltips/useTooltipStyle.js.map +1 -0
- package/dist/app/charts/trackers/Tracker.d.ts +22 -6
- package/dist/app/charts/trackers/Tracker.d.ts.map +1 -0
- package/dist/app/charts/trackers/Tracker.js +36 -22
- package/dist/app/charts/trackers/Tracker.js.map +1 -1
- package/dist/app/charts/trackers/trackerUtils.d.ts +40 -18
- package/dist/app/charts/trackers/trackerUtils.d.ts.map +1 -0
- package/dist/app/charts/trackers/trackerUtils.js +213 -300
- package/dist/app/charts/trackers/trackerUtils.js.map +1 -1
- package/dist/app/charts/utils.d.ts +72 -33
- package/dist/app/charts/utils.d.ts.map +1 -0
- package/dist/app/charts/utils.js +87 -42
- package/dist/app/charts/utils.js.map +1 -1
- package/dist/index.d.ts +2 -45
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -72
- package/dist/index.js.map +1 -1
- package/package.json +87 -46
- package/src/app/charts/Chart.tsx +132 -168
- package/src/app/charts/axes/AxesState.ts +27 -29
- package/src/app/charts/axes/AxisInterval.ts +57 -32
- package/src/app/charts/axes/BaseAxisRange.ts +47 -27
- package/src/app/charts/axes/ContinuousAxis.tsx +235 -39
- package/src/app/charts/axes/ContinuousAxisRange.ts +29 -11
- package/src/app/charts/axes/EmptyAxis.tsx +52 -17
- package/src/app/charts/axes/OrdinalAxis.tsx +54 -28
- package/src/app/charts/axes/OrdinalAxisRange.ts +96 -16
- package/src/app/charts/axes/autoScale.ts +244 -0
- package/src/app/charts/axes/axes.ts +954 -735
- package/src/app/charts/d3types.ts +42 -13
- package/src/app/charts/datasources/StreamingDataSource.ts +214 -0
- package/src/app/charts/datasources/iteratesDataSource.ts +122 -0
- package/src/app/charts/datasources/ordinalDataSource.ts +205 -0
- package/src/app/charts/datasources/outlierDataSource.ts +90 -0
- package/src/app/charts/datasources/timeSeriesDataSource.ts +133 -0
- package/src/app/charts/filters/regexFilter.ts +45 -5
- package/src/app/charts/hooks/AxesProvider.tsx +301 -0
- package/src/app/charts/hooks/CanvasSurfaceProvider.tsx +117 -0
- package/src/app/charts/hooks/ChartProvider.tsx +79 -0
- package/src/app/charts/hooks/InteractionProvider.tsx +88 -0
- package/src/app/charts/hooks/PlotDimensionsProvider.tsx +109 -0
- package/src/app/charts/hooks/defaultAxesValues.ts +40 -0
- package/src/app/charts/hooks/defaultMouseValues.ts +24 -0
- package/src/app/charts/hooks/defaultPlotDimensions.ts +27 -0
- package/src/app/charts/hooks/defaultTooltipValues.tsx +23 -0
- package/src/app/charts/hooks/defaultUseChartValues.tsx +36 -0
- package/src/app/charts/hooks/useAxes.tsx +60 -228
- package/src/app/charts/hooks/useCanvasSurface.tsx +35 -0
- package/src/app/charts/hooks/useChart.tsx +47 -106
- package/src/app/charts/hooks/useDataSource.tsx +106 -0
- package/src/app/charts/hooks/useHoveredSeries.tsx +33 -0
- package/src/app/charts/hooks/useMouse.tsx +58 -82
- package/src/app/charts/hooks/usePlotDimensions.tsx +25 -89
- package/src/app/charts/hooks/useTooltip.tsx +32 -63
- package/src/app/charts/index.ts +213 -0
- package/src/app/charts/legends/Legend.tsx +198 -479
- package/src/app/charts/legends/constants.ts +37 -0
- package/src/app/charts/observables/iterates.ts +32 -12
- package/src/app/charts/observables/ordinals.ts +141 -67
- package/src/app/charts/observables/outliers.ts +20 -0
- package/src/app/charts/plots/BarPlot.tsx +784 -666
- package/src/app/charts/plots/OutlierPlot.tsx +685 -0
- package/src/app/charts/plots/PoincarePlot.tsx +707 -489
- package/src/app/charts/plots/RasterPlot.tsx +253 -445
- package/src/app/charts/plots/ScatterPlot.tsx +480 -463
- package/src/app/charts/plots/autoScaleYAxes.ts +102 -0
- package/src/app/charts/plots/colorizedLine.ts +185 -0
- package/src/app/charts/plots/constants.ts +16 -0
- package/src/app/charts/plots/hitTesting.ts +198 -0
- package/src/app/charts/plots/plot.ts +138 -44
- package/src/app/charts/plots/useCanvasZoomPan.ts +240 -0
- package/src/app/charts/plots/useStreamingTimeAxes.ts +384 -0
- package/src/app/charts/series/baseSeries.ts +81 -14
- package/src/app/charts/series/iterateSeries.ts +8 -8
- package/src/app/charts/series/ordinalSeries.ts +35 -20
- package/src/app/charts/series/outlierSeries.ts +188 -0
- package/src/app/charts/series/timeSeries.ts +14 -12
- package/src/app/charts/series/timeSeriesChartData.ts +31 -17
- package/src/app/charts/styling/barPlotStyle.ts +48 -5
- package/src/app/charts/styling/canvasStyle.ts +86 -0
- package/src/app/charts/styling/margins.ts +28 -4
- package/src/app/charts/styling/svgStyle.ts +10 -91
- package/src/app/charts/subscriptions/viewDrivers.ts +447 -0
- package/src/app/charts/tooltips/BarPlotTooltipContent.tsx +156 -380
- package/src/app/charts/tooltips/DefaultOutlierTooltipContent.tsx +40 -0
- package/src/app/charts/tooltips/OutlierPlotTooltipContent.tsx +67 -0
- package/src/app/charts/tooltips/PoincarePlotTooltipContent.tsx +229 -292
- package/src/app/charts/tooltips/RasterPlotTooltipContent.tsx +164 -217
- package/src/app/charts/tooltips/ScatterPlotTooltipContent.tsx +373 -236
- package/src/app/charts/tooltips/Tooltip.tsx +58 -124
- package/src/app/charts/tooltips/TooltipContent.tsx +177 -0
- package/src/app/charts/tooltips/tooltipUtils.ts +359 -61
- package/src/app/charts/tooltips/useOutlierTooltip.tsx +68 -0
- package/src/app/charts/tooltips/useTooltipPlacement.ts +86 -0
- package/src/app/charts/tooltips/useTooltipStyle.ts +15 -0
- package/src/app/charts/trackers/Tracker.tsx +68 -33
- package/src/app/charts/trackers/trackerUtils.ts +263 -376
- package/src/app/charts/utils.ts +90 -48
- package/src/index.ts +2 -322
- package/dist/app/charts/axes/AxesState.test.d.ts +0 -1
- package/dist/app/charts/axes/AxesState.test.js +0 -30
- package/dist/app/charts/axes/AxesState.test.js.map +0 -1
- package/dist/app/charts/axes/AxisInterval.test.d.ts +0 -1
- package/dist/app/charts/axes/AxisInterval.test.js +0 -120
- package/dist/app/charts/axes/AxisInterval.test.js.map +0 -1
- package/dist/app/charts/axes/ContinuousAxisRange.test.d.ts +0 -1
- package/dist/app/charts/axes/ContinuousAxisRange.test.js +0 -47
- package/dist/app/charts/axes/ContinuousAxisRange.test.js.map +0 -1
- package/dist/app/charts/axes/OrdinalAxisRange.test.d.ts +0 -1
- package/dist/app/charts/axes/OrdinalAxisRange.test.js +0 -48
- package/dist/app/charts/axes/OrdinalAxisRange.test.js.map +0 -1
- package/dist/app/charts/filters/regexFilter.test.d.ts +0 -1
- package/dist/app/charts/filters/regexFilter.test.js +0 -11
- package/dist/app/charts/filters/regexFilter.test.js.map +0 -1
- package/dist/app/charts/hooks/useDataObservable.d.ts +0 -72
- package/dist/app/charts/hooks/useDataObservable.js +0 -74
- package/dist/app/charts/hooks/useDataObservable.js.map +0 -1
- package/dist/app/charts/hooks/useInitialData.d.ts +0 -36
- package/dist/app/charts/hooks/useInitialData.js +0 -28
- package/dist/app/charts/hooks/useInitialData.js.map +0 -1
- package/dist/app/charts/observables/iterates.test.d.ts +0 -1
- package/dist/app/charts/observables/iterates.test.js +0 -180
- package/dist/app/charts/observables/iterates.test.js.map +0 -1
- package/dist/app/charts/observables/ordinals.test.d.ts +0 -1
- package/dist/app/charts/observables/ordinals.test.js +0 -102
- package/dist/app/charts/observables/ordinals.test.js.map +0 -1
- package/dist/app/charts/series/datumSeries.test.d.ts +0 -1
- package/dist/app/charts/series/datumSeries.test.js +0 -50
- package/dist/app/charts/series/datumSeries.test.js.map +0 -1
- package/dist/app/charts/styling/margins.test.d.ts +0 -1
- package/dist/app/charts/styling/margins.test.js +0 -19
- package/dist/app/charts/styling/margins.test.js.map +0 -1
- package/dist/app/charts/subscriptions/subscription.test.d.ts +0 -1
- package/dist/app/charts/subscriptions/subscription.test.js +0 -395
- package/dist/app/charts/subscriptions/subscription.test.js.map +0 -1
- package/dist/app/charts/subscriptions/subscriptions.d.ts +0 -100
- package/dist/app/charts/subscriptions/subscriptions.js +0 -449
- package/dist/app/charts/subscriptions/subscriptions.js.map +0 -1
- package/src/app/charts/axes/AxesState.test.ts +0 -34
- package/src/app/charts/axes/AxisInterval.test.ts +0 -143
- package/src/app/charts/axes/ContinuousAxisRange.test.ts +0 -55
- package/src/app/charts/axes/OrdinalAxisRange.test.ts +0 -55
- package/src/app/charts/filters/regexFilter.test.ts +0 -13
- package/src/app/charts/hooks/useDataObservable.tsx +0 -170
- package/src/app/charts/hooks/useInitialData.tsx +0 -64
- package/src/app/charts/observables/iterates.test.ts +0 -201
- package/src/app/charts/observables/ordinals.test.ts +0 -135
- package/src/app/charts/series/datumSeries.test.ts +0 -60
- package/src/app/charts/styling/margins.test.ts +0 -22
- package/src/app/charts/subscriptions/subscription.test.ts +0 -499
- package/src/app/charts/subscriptions/subscriptions.ts +0 -635
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as d3 from "d3";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { usePlotDimensions } from "../hooks/usePlotDimensions";
|
|
3
|
+
import { autocorrelation, boundingPoints, sparklineFor, seriesStatistics, valueOrMissing } from "./tooltipUtils";
|
|
4
|
+
import { TooltipContent } from "./TooltipContent";
|
|
5
|
+
import { formatNumber, formatTime, formatTimeChange, formatValue, formatValueChange } from "../utils";
|
|
7
6
|
import { emptyDatum } from "../series/timeSeries";
|
|
7
|
+
// the size of the autocorrelation's sparkline (its plot area, without the axes' labels)
|
|
8
|
+
const SPARKLINE_WIDTH = 180;
|
|
9
|
+
const SPARKLINE_HEIGHT = 48;
|
|
10
|
+
// the space around the sparkline's line, within its plot area
|
|
11
|
+
const SPARKLINE_PADDING = 2;
|
|
12
|
+
// the space around the sparkline's plot area for the axes: their ticks and labels (the y-axis'
|
|
13
|
+
// on the left; the x-axis' below, with its "lag" caption to the right of its end)
|
|
14
|
+
const AXES_MARGIN = { left: 24, right: 22, top: 4, bottom: 14 };
|
|
15
|
+
// the length of the axes' ticks
|
|
16
|
+
const TICK_LENGTH = 3;
|
|
17
|
+
// the (most) ticks on the x-axis (the lags)
|
|
18
|
+
const LAG_TICK_COUNT = 5;
|
|
8
19
|
/**
|
|
9
|
-
* Adds tooltip content as a table
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
20
|
+
* Adds tooltip content as a table, whose rows are the x-values and the y-values, and whose
|
|
21
|
+
* columns depend on where the mouse is over the series (as the plot reports it, see
|
|
22
|
+
* `ScatterTooltipMetadata` -- the plot also highlights the same points):
|
|
23
|
+
*
|
|
24
|
+
* When the mouse is over a line segment, the points before and after the mouse, and the
|
|
25
|
+
* difference between them:
|
|
13
26
|
* ```
|
|
14
27
|
* series name
|
|
15
28
|
* before after ∆
|
|
@@ -17,139 +30,154 @@ import { emptyDatum } from "../series/timeSeries";
|
|
|
17
30
|
* y-label y_tb y_ta y_ta - y_tb
|
|
18
31
|
* ```
|
|
19
32
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
33
|
+
* When the mouse is directly over a data point, that point (in bold), and the points before and
|
|
34
|
+
* after it:
|
|
35
|
+
* ```
|
|
36
|
+
* series name
|
|
37
|
+
* before point after
|
|
38
|
+
* x-label x_b x_p x_a
|
|
39
|
+
* y-label y_b y_p y_a
|
|
40
|
+
* ```
|
|
41
|
+
* A point that doesn't exist (e.g. before the series' first point) shows a dash.
|
|
42
|
+
*
|
|
43
|
+
* Below the table, the statistics of the series' points in the window of data the chart holds:
|
|
44
|
+
* their count, the mean and (sample) standard deviation of their values, and the mean time
|
|
45
|
+
* between consecutive points. And below that, a sparkline of the autocorrelation of their values,
|
|
46
|
+
* by lag (in points, from 0 on the left), drawn from -1 (bottom) to 1 (top): with a y-axis (ticks
|
|
47
|
+
* at -1, 0, and 1), and an x-axis along the (dashed) zero line, with ticks at round lags, captioned
|
|
48
|
+
* "lag" (just to the right of the axis' end).
|
|
49
|
+
*
|
|
50
|
+
* Built on {@link TooltipContent}; put it inside a {@link Tooltip}.
|
|
24
51
|
* @param props The properties describing the tooltip content
|
|
25
|
-
* @return null
|
|
52
|
+
* @return The tooltip's portal, or `null` when nothing is being hovered
|
|
26
53
|
*/
|
|
27
54
|
export function ScatterPlotTooltipContent(props) {
|
|
28
|
-
const {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// tooltip content is generated in this plot (because this is the plot that holds all the
|
|
36
|
-
// information needed to render it), and the container for the content is rendered by
|
|
37
|
-
// the <Tooltip>, which this know nothing about.
|
|
38
|
-
//
|
|
39
|
-
// the 'registration function accepts a function of the form (seriesName, time, series) => TooltipDimensions.
|
|
40
|
-
// and that function has a closure on the content-specific information needed to add the
|
|
41
|
-
// actual content
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (container) {
|
|
44
|
-
// assemble the options for adding the tooltip
|
|
45
|
-
const options = {
|
|
46
|
-
labels: { x: xLabel, y: yLabel },
|
|
47
|
-
headers: { before: beforeHeader, after: afterHeader, delta: deltaHeader },
|
|
48
|
-
formatters: {
|
|
49
|
-
x: { value: xValueFormatter, change: xChangeFormatter },
|
|
50
|
-
y: { value: yValueFormatter, change: yChangeFormatter },
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
// register the tooltip content provider function with the chart hook (useChart) so that
|
|
54
|
-
// it is visible to all children of the Chart (i.e. the <Tooltip>).
|
|
55
|
-
registerTooltipContentProvider((seriesName, time, tooltipData, mouseCoords) => addTooltipContent(seriesName, time, tooltipData.series, mouseCoords, chartId, container, margin, plotDimensions, tooltipStyle, options));
|
|
55
|
+
const { xLabel, yLabel, beforeHeader = 'before', pointHeader = 'point', afterHeader = 'after', deltaHeader = '∆', xValueFormatter = formatTime, yValueFormatter = formatValue, xChangeFormatter = formatTimeChange, yChangeFormatter = formatValueChange, intervalFormatter = xValueFormatter, style, } = props;
|
|
56
|
+
const options = {
|
|
57
|
+
labels: { x: xLabel, y: yLabel },
|
|
58
|
+
headers: { before: beforeHeader, point: pointHeader, after: afterHeader, delta: deltaHeader },
|
|
59
|
+
formatters: {
|
|
60
|
+
x: { value: xValueFormatter, change: xChangeFormatter },
|
|
61
|
+
y: { value: yValueFormatter, change: yChangeFormatter },
|
|
56
62
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
};
|
|
64
|
+
return (_jsx(TooltipContent, { style: style, capture: (seriesName, time, tooltipData) => captureTooltipContent(seriesName, time, tooltipData.series, tooltipData.metadata.points, options), children: (tooltipContent, tooltipStyle) => {
|
|
65
|
+
const cellStyle = { padding: '1px 8px', textAlign: 'right', border: 'none' };
|
|
66
|
+
const rowLabelStyle = { ...cellStyle, textAlign: 'left', paddingLeft: 0 };
|
|
67
|
+
// the point under the mouse stands out (as it does on the plot)
|
|
68
|
+
const cellStyleFor = (column) => column === tooltipContent.emphasizedColumn ?
|
|
69
|
+
{ ...cellStyle, fontWeight: tooltipStyle.fontWeight + 650 } :
|
|
70
|
+
cellStyle;
|
|
71
|
+
return _jsxs(_Fragment, { children: [_jsx("div", { style: { fontSize: tooltipStyle.fontSize, fontWeight: tooltipStyle.fontWeight, marginBottom: 4 }, children: tooltipContent.seriesName }), _jsxs("table", { style: { fontSize: tooltipStyle.fontSize + 2, fontWeight: tooltipStyle.fontWeight + 150, borderCollapse: 'collapse', border: 'none' }, children: [_jsx("thead", { children: _jsxs("tr", { style: { fontWeight: tooltipStyle.fontWeight + 550 }, children: [_jsx("td", { style: rowLabelStyle }), tooltipContent.headers.map((header, column) => (_jsx("td", { style: cellStyleFor(column), children: header }, column)))] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { style: rowLabelStyle, children: tooltipContent.xLabel }), tooltipContent.xValues.map((value, column) => (_jsx("td", { style: cellStyleFor(column), children: value }, column)))] }), _jsxs("tr", { children: [_jsx("td", { style: rowLabelStyle, children: tooltipContent.yLabel }), tooltipContent.yValues.map((value, column) => (_jsx("td", { style: cellStyleFor(column), children: value }, column)))] })] })] }), tooltipContent.statistics.count > 0 &&
|
|
72
|
+
_jsx("table", { style: { fontSize: tooltipStyle.fontSize, borderCollapse: 'collapse', border: 'none', marginTop: 6, width: 'auto' }, children: _jsx("tbody", { children: [
|
|
73
|
+
['Points', formatNumber(tooltipContent.statistics.count, " ,.0f")],
|
|
74
|
+
['Mean value', valueOrMissing(tooltipContent.statistics.meanValue, yValueFormatter)],
|
|
75
|
+
['Std. deviation', valueOrMissing(tooltipContent.statistics.valueStandardDeviation, yValueFormatter)],
|
|
76
|
+
['Mean interval', valueOrMissing(tooltipContent.statistics.meanInterval, intervalFormatter)],
|
|
77
|
+
].map(([label, value]) => (_jsxs("tr", { children: [_jsx("td", { style: { padding: '1px 12px 1px 0', textAlign: 'left', border: 'none' }, children: label }), _jsx("td", { style: { padding: '1px 0', textAlign: 'right', border: 'none' }, children: value })] }, label))) }) }), tooltipContent.autocorrelation !== undefined && _jsxs(_Fragment, { children: [_jsx("div", { style: { fontSize: tooltipStyle.fontSize, marginTop: 8 }, children: "Autocorrelation" }), _jsx(AutocorrelationChart, { autocorrelation: tooltipContent.autocorrelation, color: tooltipStyle.fontColor, fontSize: tooltipStyle.fontSize - 3 })] })] });
|
|
78
|
+
} }));
|
|
65
79
|
}
|
|
66
80
|
/**
|
|
67
|
-
*
|
|
81
|
+
* Captures the data needed to render the tooltip's content: the table of the points the tooltip
|
|
82
|
+
* shows, and the statistics and autocorrelation of the series' points.
|
|
68
83
|
* @param seriesName The name of the series (i.e. the neuron ID)
|
|
69
84
|
* @param time The time (x-coordinate value) corresponding to the mouse location
|
|
70
|
-
* @param series The
|
|
71
|
-
* @param
|
|
72
|
-
*
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
* @param series The series' data (the window of data the chart holds -- for the statistics too)
|
|
86
|
+
* @param points The points to show, as the plot determined them (see {@link scatterTooltipPoints});
|
|
87
|
+
* when `undefined`, the points on either side of the mouse's time are shown
|
|
88
|
+
* @param options The tooltip's labels, headers, and formatters
|
|
89
|
+
* @return The tooltip's content
|
|
90
|
+
*/
|
|
91
|
+
function captureTooltipContent(seriesName, time, series, points, options) {
|
|
92
|
+
const { labels, headers, formatters } = options;
|
|
93
|
+
// the points to show, as determined by the plot -- or, when the plot doesn't say, the points on
|
|
94
|
+
// either side of the mouse's time
|
|
95
|
+
const shown = points !== null && points !== void 0 ? points : segmentAround(series, time);
|
|
96
|
+
// a value, or a dash for a point that doesn't exist (e.g. before the series' first point)
|
|
97
|
+
const valueOf = (datum, formatter, value) => datum === undefined ? MISSING_VALUE : formatter(value(datum));
|
|
98
|
+
const changeOf = (formatter, value) => shown.before === undefined || shown.after === undefined ?
|
|
99
|
+
MISSING_VALUE :
|
|
100
|
+
formatter(value(shown.before), value(shown.after));
|
|
101
|
+
const xOf = (datum) => datum.x;
|
|
102
|
+
const yOf = (datum) => datum.y;
|
|
103
|
+
return {
|
|
104
|
+
seriesName,
|
|
105
|
+
xLabel: labels.x,
|
|
106
|
+
yLabel: labels.y,
|
|
107
|
+
statistics: seriesStatistics(series),
|
|
108
|
+
autocorrelation: autocorrelationSparkline(series),
|
|
109
|
+
...(shown.kind === 'point' ?
|
|
110
|
+
// directly over a point: the point before it, the point, and the point after it
|
|
111
|
+
{
|
|
112
|
+
headers: [headers.before, headers.point, headers.after],
|
|
113
|
+
xValues: [shown.before, shown.point, shown.after].map(datum => valueOf(datum, formatters.x.value, xOf)),
|
|
114
|
+
yValues: [shown.before, shown.point, shown.after].map(datum => valueOf(datum, formatters.y.value, yOf)),
|
|
115
|
+
emphasizedColumn: 1,
|
|
116
|
+
} :
|
|
117
|
+
// over a segment: the points on either side of the mouse, and the change between them
|
|
118
|
+
{
|
|
119
|
+
headers: [headers.before, headers.after, headers.delta],
|
|
120
|
+
xValues: [
|
|
121
|
+
valueOf(shown.before, formatters.x.value, xOf),
|
|
122
|
+
valueOf(shown.after, formatters.x.value, xOf),
|
|
123
|
+
changeOf(formatters.x.change, xOf)
|
|
124
|
+
],
|
|
125
|
+
yValues: [
|
|
126
|
+
valueOf(shown.before, formatters.y.value, yOf),
|
|
127
|
+
valueOf(shown.after, formatters.y.value, yOf),
|
|
128
|
+
changeOf(formatters.y.change, yOf)
|
|
129
|
+
],
|
|
130
|
+
})
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// shown in place of the values of a point that doesn't exist (e.g. before the series' first point)
|
|
134
|
+
const MISSING_VALUE = '–';
|
|
135
|
+
/**
|
|
136
|
+
* The points on either side of the specified time (the segment it's on)
|
|
137
|
+
* @param series The series' data
|
|
138
|
+
* @param time The time
|
|
139
|
+
* @return The points before and after the time (undefined where there's none)
|
|
140
|
+
*/
|
|
141
|
+
function segmentAround(series, time) {
|
|
142
|
+
const [before, after] = boundingPoints(series, time, value => value.x, () => emptyDatum());
|
|
143
|
+
const orUndefined = (datum) => isNaN(datum.x) ? undefined : datum;
|
|
144
|
+
return { kind: 'segment', before: orUndefined(before), after: orUndefined(after) };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The sparkline of the autocorrelation of a series' values (see {@link autocorrelation}): the lags
|
|
148
|
+
* run left to right across the width, and the correlations from -1 (at the bottom) to 1 (at the
|
|
149
|
+
* top), so that the zero line is at the middle
|
|
150
|
+
* @param series The series' data
|
|
151
|
+
* @return The sparkline, or `undefined` when there are too few points (or
|
|
152
|
+
* the values don't vary)
|
|
153
|
+
*/
|
|
154
|
+
function autocorrelationSparkline(series) {
|
|
155
|
+
const correlations = autocorrelation(series);
|
|
156
|
+
if (correlations === undefined)
|
|
157
|
+
return undefined;
|
|
158
|
+
const sparkline = sparklineFor(correlations.map((value, lag) => ({ time: lag, value })), SPARKLINE_WIDTH, SPARKLINE_HEIGHT, SPARKLINE_PADDING, [-1, 1]);
|
|
159
|
+
return sparkline === undefined ? undefined : { sparkline, maxLag: correlations.length - 1 };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The autocorrelation's sparkline, with its axes: a y-axis on the left, with ticks (and labels) at
|
|
163
|
+
* -1, 0, and 1; and an x-axis along the dashed zero line, with ticks at round lags (labelled below
|
|
164
|
+
* the plot, out of the line's way), captioned "lag" just to the right of its end
|
|
165
|
+
* @param props The autocorrelation's sparkline (and largest lag), the color of the line and the
|
|
166
|
+
* axes, and the font size of the axes' labels
|
|
167
|
+
* @return The sparkline, with its axes
|
|
79
168
|
*/
|
|
80
|
-
function
|
|
81
|
-
const {
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.attr('fill-opacity', tooltipStyle.borderOpacity)
|
|
94
|
-
.text(() => seriesName);
|
|
95
|
-
// create the table that shows the points that come before and after the mouse time, and the
|
|
96
|
-
// changes in the time and value
|
|
97
|
-
const table = d3.select(container)
|
|
98
|
-
.append("g")
|
|
99
|
-
.attr('id', `t${time}-${seriesName}-header-${chartId}`)
|
|
100
|
-
.attr('class', 'tooltip')
|
|
101
|
-
.attr('fill', tooltipStyle.fontColor)
|
|
102
|
-
.attr('font-family', 'sans-serif')
|
|
103
|
-
.attr('font-size', tooltipStyle.fontSize + 2)
|
|
104
|
-
.attr('font-weight', tooltipStyle.fontWeight + 150)
|
|
105
|
-
.attr('fill-opacity', tooltipStyle.borderOpacity);
|
|
106
|
-
const headerRow = table.append('g').attr('font-weight', tooltipStyle.fontWeight + 550);
|
|
107
|
-
const hrLower = headerRow.append("text").text(() => options.headers.before);
|
|
108
|
-
const hrUpper = headerRow.append("text").text(() => options.headers.after);
|
|
109
|
-
const hrDelta = headerRow.append("text").text(() => options.headers.delta);
|
|
110
|
-
const trHeader = table.append("text").text(() => labels.x);
|
|
111
|
-
const trLower = table.append("text").text(() => formatters.x.value(lower.time));
|
|
112
|
-
const trUpper = table.append("text").text(() => formatters.x.value(upper.time));
|
|
113
|
-
const trDelta = table.append("text").text(() => formatters.x.change(lower.time, upper.time));
|
|
114
|
-
const vrHeader = table.append("text").text(() => labels.y);
|
|
115
|
-
const vrLower = table.append("text").text(() => formatters.y.value(lower.value));
|
|
116
|
-
const vrUpper = table.append("text").text(() => formatters.y.value(upper.value));
|
|
117
|
-
const vrDelta = table.append("text").text(() => formatters.y.change(lower.value, upper.value));
|
|
118
|
-
const textWidthOf = (elem) => { var _a, _b; return ((_b = (_a = elem.node()) === null || _a === void 0 ? void 0 : _a.getBBox()) === null || _b === void 0 ? void 0 : _b.width) || 0; };
|
|
119
|
-
const textHeightOf = (elem) => { var _a, _b; return ((_b = (_a = elem.node()) === null || _a === void 0 ? void 0 : _a.getBBox()) === null || _b === void 0 ? void 0 : _b.height) || 0; };
|
|
120
|
-
const spacesWidthFor = (spaces) => spaces * textWidthOf(hrLower) / 5;
|
|
121
|
-
// calculate the max width and height of the text
|
|
122
|
-
const tooltipWidth = Math.max(textWidthOf(header), spacesWidthFor(33));
|
|
123
|
-
const headerTextHeight = textHeightOf(header);
|
|
124
|
-
const headerRowHeight = textHeightOf(hrLower);
|
|
125
|
-
const timeRowHeight = textHeightOf(trHeader);
|
|
126
|
-
const valueRowHeight = textHeightOf(vrHeader);
|
|
127
|
-
const textHeight = headerTextHeight + headerRowHeight + timeRowHeight + valueRowHeight;
|
|
128
|
-
// set the header text location
|
|
129
|
-
const xCoord = tooltipX(x, tooltipWidth, plotDimensions, tooltipStyle, margin);
|
|
130
|
-
const yCoord = tooltipY(y, textHeight, plotDimensions, tooltipStyle, margin);
|
|
131
|
-
const xTooltip = xCoord + tooltipStyle.paddingLeft;
|
|
132
|
-
const yTooltip = yCoord + tooltipStyle.paddingTop;
|
|
133
|
-
header
|
|
134
|
-
.attr('x', () => xTooltip)
|
|
135
|
-
.attr('y', () => yTooltip - (headerRowHeight + timeRowHeight + valueRowHeight) + textHeight);
|
|
136
|
-
const hrRowY = yTooltip + headerTextHeight + headerRowHeight;
|
|
137
|
-
const hrLowerX = spacesWidthFor(14);
|
|
138
|
-
const hrUpperX = spacesWidthFor(24);
|
|
139
|
-
const hrDeltaX = spacesWidthFor(32);
|
|
140
|
-
hrLower.attr('x', () => xTooltip + hrLowerX - textWidthOf(hrLower)).attr('y', () => hrRowY);
|
|
141
|
-
hrUpper.attr('x', () => xTooltip + hrUpperX - textWidthOf(hrUpper)).attr('y', () => hrRowY);
|
|
142
|
-
hrDelta.attr('x', () => xTooltip + hrDeltaX - textWidthOf(hrDelta)).attr('y', () => hrRowY);
|
|
143
|
-
const trRowY = hrRowY + timeRowHeight;
|
|
144
|
-
trHeader.attr('x', () => xTooltip).attr('y', () => trRowY);
|
|
145
|
-
trLower.attr('x', () => xTooltip + hrLowerX - textWidthOf(trLower)).attr('y', () => trRowY);
|
|
146
|
-
trUpper.attr('x', () => xTooltip + hrUpperX - textWidthOf(trUpper)).attr('y', () => trRowY);
|
|
147
|
-
trDelta.attr('x', () => xTooltip + hrDeltaX - textWidthOf(trDelta)).attr('y', () => trRowY);
|
|
148
|
-
const vrRowY = trRowY + valueRowHeight;
|
|
149
|
-
vrHeader.attr('x', () => xTooltip).attr('y', () => vrRowY);
|
|
150
|
-
vrLower.attr('x', () => xTooltip + hrLowerX - textWidthOf(vrLower)).attr('y', () => vrRowY);
|
|
151
|
-
vrUpper.attr('x', () => xTooltip + hrUpperX - textWidthOf(vrUpper)).attr('y', () => vrRowY);
|
|
152
|
-
vrDelta.attr('x', () => xTooltip + hrDeltaX - textWidthOf(vrDelta)).attr('y', () => vrRowY);
|
|
153
|
-
return { x: xCoord, y: yCoord, contentWidth: tooltipWidth, contentHeight: textHeight };
|
|
169
|
+
function AutocorrelationChart(props) {
|
|
170
|
+
const { autocorrelation: { sparkline, maxLag }, color, fontSize } = props;
|
|
171
|
+
// where a lag, and a correlation, are within the plot area (as `sparklineFor` places them)
|
|
172
|
+
const innerWidth = SPARKLINE_WIDTH - 2 * SPARKLINE_PADDING;
|
|
173
|
+
const innerHeight = SPARKLINE_HEIGHT - 2 * SPARKLINE_PADDING;
|
|
174
|
+
const xOf = (lag) => SPARKLINE_PADDING + lag / maxLag * innerWidth;
|
|
175
|
+
const yOf = (correlation) => SPARKLINE_PADDING + (1 - correlation) / 2 * innerHeight;
|
|
176
|
+
// (the y-axis sits just left of lag 0, so it doesn't cover the line's start)
|
|
177
|
+
const yAxisX = SPARKLINE_PADDING - TICK_LENGTH;
|
|
178
|
+
const lagTicks = d3.ticks(0, maxLag, Math.min(LAG_TICK_COUNT, maxLag)).filter(Number.isInteger);
|
|
179
|
+
const axisStyle = { stroke: color, strokeOpacity: 0.6, strokeWidth: 1 };
|
|
180
|
+
const labelStyle = { fill: color, fillOpacity: 0.8, fontSize };
|
|
181
|
+
return (_jsx("svg", { width: AXES_MARGIN.left + SPARKLINE_WIDTH + AXES_MARGIN.right, height: AXES_MARGIN.top + SPARKLINE_HEIGHT + AXES_MARGIN.bottom, style: { display: 'block', marginTop: 2 }, "aria-hidden": "true", children: _jsxs("g", { transform: `translate(${AXES_MARGIN.left}, ${AXES_MARGIN.top})`, children: [_jsx("line", { x1: yAxisX, y1: yOf(1), x2: yAxisX, y2: yOf(-1), ...axisStyle }), [-1, 0, 1].map(correlation => (_jsxs("g", { children: [_jsx("line", { x1: yAxisX - TICK_LENGTH, y1: yOf(correlation), x2: yAxisX, y2: yOf(correlation), ...axisStyle }), _jsx("text", { x: yAxisX - TICK_LENGTH - 2, y: yOf(correlation), textAnchor: "end", dominantBaseline: "middle", ...labelStyle, children: correlation })] }, correlation))), _jsx("line", { x1: yAxisX, y1: yOf(0), x2: xOf(maxLag), y2: yOf(0), ...axisStyle, strokeOpacity: 0.35, strokeDasharray: "2 2" }), lagTicks.map(lag => (_jsxs("g", { children: [_jsx("line", { x1: xOf(lag), y1: yOf(0) - TICK_LENGTH / 2, x2: xOf(lag), y2: yOf(0) + TICK_LENGTH / 2, ...axisStyle }), _jsx("text", { x: xOf(lag), y: SPARKLINE_HEIGHT + AXES_MARGIN.bottom - 3, textAnchor: "middle", ...labelStyle, children: lag })] }, lag))), _jsx("text", { x: xOf(maxLag) + TICK_LENGTH, y: yOf(0), textAnchor: "start", dominantBaseline: "middle", ...labelStyle, children: "lag" }), _jsx("path", { d: sparkline.path, fill: "none", stroke: color, strokeWidth: 1.25, strokeLinejoin: "round", strokeLinecap: "round" })] }) }));
|
|
154
182
|
}
|
|
155
183
|
//# sourceMappingURL=ScatterPlotTooltipContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterPlotTooltipContent.js","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/ScatterPlotTooltipContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScatterPlotTooltipContent.js","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/ScatterPlotTooltipContent.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EACH,eAAe,EACf,cAAc,EAEd,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;AACpG,OAAO,EAAa,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAyE5D,wFAAwF;AACxF,MAAM,eAAe,GAAG,GAAG,CAAA;AAC3B,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAC3B,8DAA8D;AAC9D,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAC3B,+FAA+F;AAC/F,kFAAkF;AAClF,MAAM,WAAW,GAAG,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAC,CAAA;AAC7D,gCAAgC;AAChC,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,4CAA4C;AAC5C,MAAM,cAAc,GAAG,CAAC,CAAA;AAsBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAY;IAClD,MAAM,EACF,MAAM,EACN,MAAM,EACN,YAAY,GAAG,QAAQ,EACvB,WAAW,GAAG,OAAO,EACrB,WAAW,GAAG,OAAO,EACrB,WAAW,GAAG,GAAG,EACjB,eAAe,GAAG,U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,CAAC,CAAC,GAAG,WAAW,GAAG,CAAC,KACtC,SAAS,GACf,EACF,eACI,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,EACzD,UAAU,EAAC,QAAQ,KACf,UAAU,YAEb,GAAG,GACD,KAZH,GAAG,CAaP,CACP,CAAC,EAEF,eACI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EACvC,UAAU,EAAC,OAAO,EAAC,gBAAgB,EAAC,QAAQ,KACxC,UAAU,oBAGX,EACP,eACI,CAAC,EAAE,SAAS,CAAC,IAAI,EACjB,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,IAAI,EACjB,cAAc,EAAC,OAAO,EACtB,aAAa,EAAC,OAAO,GACvB,IACF,GACF,CACT,CAAA;AACL,CAAC"}
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
import { JSX } from "react";
|
|
2
|
-
import { TooltipStyle } from "./tooltipUtils";
|
|
3
|
-
import { BaseAxis, SeriesStyle } from "../axes/axes";
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import { type TooltipStyle } from "./tooltipUtils";
|
|
3
|
+
import type { BaseAxis, SeriesStyle } from "../axes/axes";
|
|
4
4
|
import { BaseAxisRange } from "../axes/BaseAxisRange";
|
|
5
|
+
/**
|
|
6
|
+
* The properties of the {@link Tooltip}
|
|
7
|
+
*/
|
|
5
8
|
export interface Props {
|
|
9
|
+
/** whether the tooltip is shown when the mouse is over one of the plot's elements */
|
|
6
10
|
visible: boolean;
|
|
11
|
+
/** the style of the tooltip (its box and text); its content can override parts of it */
|
|
7
12
|
style?: Partial<TooltipStyle>;
|
|
13
|
+
/** the tooltip's content (e.g. a `<ScatterPlotTooltipContent>`, or your own, built on `<TooltipContent>`) */
|
|
8
14
|
children: JSX.Element;
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* uses the {@link useTooltip}'s {@link UseTooltipValues.tooltipContentProvider} to render the actual
|
|
16
|
-
* content of the tooltip. The content provider is given the series' name on which the mouse-over
|
|
17
|
-
* event occurred, the plot time associated with mouse-over event, and the {@link TimeSeries}
|
|
18
|
-
* associated with the mouse-over event. The plot (for example {@link ScatterPlot}) is responsible
|
|
19
|
-
* for rendering the tooltip, and it registers this tooltip-content provider with the {@link useTooltip}
|
|
20
|
-
* hook.
|
|
21
|
-
*
|
|
22
|
-
* The {@link useChart} hook allows the plots and this tooltip to register methods needed its siblings.
|
|
23
|
-
*
|
|
24
|
-
* ## on mount
|
|
25
|
-
* 1. The plot (for example {@link ScatterPlot}) adds a d3 mouse-enter and mouse-leave event handlers
|
|
26
|
-
* to each series. The mouse-enter event handler performs a few tasks and then calls the
|
|
27
|
-
* mouse-over event handler registered by the {@link Tooltip} via the {@link useMouse} hook.
|
|
28
|
-
* 2. The plot (for example {@link ScatterPlot}) registers the tooltip-content provider with the {@link useTooltip}
|
|
29
|
-
* hook using the {@link UseTooltipValues.registerTooltipContentProvider} function.
|
|
30
|
-
* 3. {@link Tooltip} registers the handler for mouse-over events. The handler accepts the series
|
|
31
|
-
* name, plot time, and time-series associated with the mouse-over event, and returns the tooltip
|
|
32
|
-
* dimensions. In order to create/render the tooltip, it uses the {@link UseTooltipValues.tooltipContentProvider}
|
|
33
|
-
* function that was registered via the {@link useTooltip} hook.
|
|
17
|
+
* Shows a tooltip when the mouse is over one of the plot's elements (a series, a point, a spike, a
|
|
18
|
+
* bar, a band, and so on), while `visible` is `true`. What the tooltip shows is up to its content
|
|
19
|
+
* (its child -- for example, a `<ScatterPlotTooltipContent>`), which is built on
|
|
20
|
+
* {@link TooltipContent}.
|
|
34
21
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
22
|
+
* The plot hit-tests the mouse against what it drew, and calls the mouse-over handler this
|
|
23
|
+
* component registers (see `useMouse`), which hands what the plot knows about the element
|
|
24
|
+
* under the mouse to the content's tooltip-content provider (see `useTooltip`). The content
|
|
25
|
+
* shows itself, and hides itself again when the mouse leaves the element.
|
|
39
26
|
*
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
27
|
+
* The content gets this tooltip's style (its `style` over the default tooltip style) through
|
|
28
|
+
* {@link useTooltipStyle}, and can override parts of it.
|
|
29
|
+
* @param props Whether the tooltip is shown, its style, and its content
|
|
30
|
+
* @return The content, while the tooltip is shown
|
|
31
|
+
* @template D The type of the series' datum
|
|
32
|
+
* @template S The type of the series style
|
|
33
|
+
* @template TM The type of the tooltip metadata
|
|
34
|
+
* @template AR The type of the axis range
|
|
35
|
+
* @template A The type of the axis
|
|
42
36
|
*/
|
|
43
37
|
export declare function Tooltip<D, S extends SeriesStyle, TM, AR extends BaseAxisRange, A extends BaseAxis>(props: Props): JSX.Element;
|
|
38
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/app/charts/tooltips/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,GAAG,EAAqB,MAAM,OAAO,CAAC;AACnD,OAAO,EAAsB,KAAK,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAC,QAAQ,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAExD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB,qFAAqF;IACrF,OAAO,EAAE,OAAO,CAAA;IAChB,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IAC7B,6GAA6G;IAC7G,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EAAE,EAAE,EAAE,EAAE,SAAS,aAAa,EAAE,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAwC7H"}
|