@perses-dev/components 0.0.0-snapshot-panel-extra-content-2-2767e21 → 0.0.0-snapshot-scatter-chart-embed-8efdfab
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/dist/BarChart/BarChart.d.ts +2 -2
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +16 -10
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/BarChart/index.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/index.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +19 -19
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +6 -22
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
- package/dist/DateTimeRangePicker/index.js.map +1 -1
- package/dist/DateTimeRangePicker/utils.js.map +1 -1
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js.map +1 -1
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +3 -2
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/EChart/EChart.js +2 -2
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js.map +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormatControls/FormatControls.d.ts +9 -0
- package/dist/FormatControls/FormatControls.d.ts.map +1 -0
- package/dist/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +26 -26
- package/dist/FormatControls/FormatControls.js.map +1 -0
- package/dist/FormatControls/index.d.ts +2 -0
- package/dist/FormatControls/index.d.ts.map +1 -0
- package/dist/{UnitSelector → FormatControls}/index.js +1 -1
- package/dist/FormatControls/index.js.map +1 -0
- package/dist/GaugeChart/GaugeChart.d.ts +3 -3
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +12 -12
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/GaugeChart/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.d.ts +2 -1
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +9 -8
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.js +3 -3
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +2 -2
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +2 -2
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +20 -23
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +22 -6
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RefreshIntervalPicker/index.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +2 -2
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SettingsAutocomplete/index.js.map +1 -1
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +2 -2
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +8 -8
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +7 -7
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.js +2 -2
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.js +6 -6
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +20 -20
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.js +9 -9
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +2 -2
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +19 -18
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/ThresholdsEditor/index.js.map +1 -1
- package/dist/TimeChart/TimeChart.d.ts +3 -3
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +109 -66
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeChart/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +3 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +12 -10
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +2 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +3 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +7 -6
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -0
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +11 -11
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +7 -7
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +42 -43
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +13 -22
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +10 -10
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +5 -4
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/BarChart/BarChart.js +24 -16
- package/dist/cjs/BarChart/index.js +10 -8
- package/dist/cjs/ColorPicker/ColorPicker.js +15 -13
- package/dist/cjs/ColorPicker/index.js +10 -8
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +12 -10
- package/dist/cjs/ContentWithLegend/index.js +10 -8
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +27 -23
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +29 -43
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +12 -10
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +13 -11
- package/dist/cjs/DateTimeRangePicker/index.js +12 -10
- package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
- package/dist/cjs/Dialog/Dialog.js +15 -13
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +11 -9
- package/dist/cjs/Dialog/index.js +11 -9
- package/dist/cjs/Drawer/Drawer.js +7 -4
- package/dist/cjs/Drawer/index.js +10 -8
- package/dist/cjs/EChart/EChart.js +12 -10
- package/dist/cjs/EChart/index.js +10 -8
- package/dist/cjs/ErrorAlert.js +5 -3
- package/dist/cjs/ErrorBoundary.js +4 -2
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +8 -6
- package/dist/cjs/FontSizeSelector/index.js +10 -8
- package/dist/cjs/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +38 -36
- package/dist/cjs/{UnitSelector → FormatControls}/index.js +10 -8
- package/dist/cjs/GaugeChart/GaugeChart.js +22 -18
- package/dist/cjs/GaugeChart/index.js +10 -8
- package/dist/cjs/InfoTooltip/InfoTooltip.js +13 -11
- package/dist/cjs/InfoTooltip/index.js +10 -8
- package/dist/cjs/JSONEditor.js +19 -16
- package/dist/cjs/Legend/CompactLegend.js +9 -7
- package/dist/cjs/Legend/Legend.js +15 -13
- package/dist/cjs/Legend/LegendColorBadge.js +7 -5
- package/dist/cjs/Legend/ListLegend.js +10 -8
- package/dist/cjs/Legend/ListLegendItem.js +12 -10
- package/dist/cjs/Legend/TableLegend.js +7 -5
- package/dist/cjs/Legend/index.js +11 -9
- package/dist/cjs/Legend/legend-model.js +3 -1
- package/dist/cjs/LineChart/LineChart.js +29 -30
- package/dist/cjs/LineChart/index.js +10 -8
- package/dist/cjs/ModeSelector/ModeSelector.js +8 -6
- package/dist/cjs/ModeSelector/index.js +10 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +6 -4
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +16 -14
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +5 -3
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +11 -9
- package/dist/cjs/OptionsEditorLayout/index.js +13 -11
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +27 -9
- package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +12 -10
- package/dist/cjs/SettingsAutocomplete/index.js +10 -8
- package/dist/cjs/SortSelector/SortSelector.js +8 -6
- package/dist/cjs/SortSelector/index.js +10 -8
- package/dist/cjs/StatChart/StatChart.js +20 -18
- package/dist/cjs/StatChart/calculateFontSize.js +10 -8
- package/dist/cjs/StatChart/index.js +10 -8
- package/dist/cjs/Table/InnerTable.js +5 -3
- package/dist/cjs/Table/Table.js +15 -13
- package/dist/cjs/Table/TableBody.js +5 -3
- package/dist/cjs/Table/TableCell.js +10 -8
- package/dist/cjs/Table/TableCheckbox.js +5 -3
- package/dist/cjs/Table/TableHead.js +5 -3
- package/dist/cjs/Table/TableHeaderCell.js +8 -6
- package/dist/cjs/Table/TableRow.js +5 -3
- package/dist/cjs/Table/VirtualizedTable.js +32 -30
- package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +3 -1
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +23 -21
- package/dist/cjs/Table/index.js +14 -10
- package/dist/cjs/Table/model/table-model.js +15 -11
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +15 -13
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +14 -12
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +44 -41
- package/dist/cjs/ThresholdsEditor/index.js +10 -8
- package/dist/cjs/TimeChart/TimeChart.js +122 -77
- package/dist/cjs/TimeChart/index.js +10 -8
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +33 -29
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +17 -15
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +15 -13
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +5 -3
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +25 -22
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +7 -5
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +36 -34
- package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +68 -51
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +61 -24
- package/dist/cjs/TimeSeriesTooltip/utils.js +19 -14
- package/dist/cjs/YAxisLabel.js +6 -4
- package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +38 -11
- package/dist/cjs/context/SnackbarProvider.js +6 -2
- package/dist/cjs/context/TimeZoneProvider.js +13 -7
- package/dist/cjs/context/index.js +32 -0
- package/dist/cjs/index.js +41 -41
- package/dist/cjs/model/graph.js +9 -3
- package/dist/cjs/model/index.js +12 -10
- package/dist/cjs/test/index.js +10 -8
- package/dist/cjs/test/render.js +7 -5
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/theme.js +38 -19
- package/dist/cjs/theme/component-overrides/alert.js +3 -1
- package/dist/cjs/theme/component-overrides/paper.js +3 -1
- package/dist/cjs/theme/index.js +10 -8
- package/dist/cjs/theme/palette/background.js +6 -2
- package/dist/cjs/theme/palette/colors/blue.js +3 -1
- package/dist/cjs/theme/palette/colors/common.js +6 -2
- package/dist/cjs/theme/palette/colors/green.js +3 -1
- package/dist/cjs/theme/palette/colors/grey.js +3 -1
- package/dist/cjs/theme/palette/colors/index.js +17 -15
- package/dist/cjs/theme/palette/colors/orange.js +3 -1
- package/dist/cjs/theme/palette/colors/purple.js +3 -1
- package/dist/cjs/theme/palette/colors/red.js +3 -1
- package/dist/cjs/theme/palette/error.js +3 -1
- package/dist/cjs/theme/palette/grey.js +3 -1
- package/dist/cjs/theme/palette/index.js +10 -8
- package/dist/cjs/theme/palette/palette-options.js +3 -1
- package/dist/cjs/theme/palette/primary.js +3 -1
- package/dist/cjs/theme/palette/secondary.js +3 -1
- package/dist/cjs/theme/palette/success.js +3 -1
- package/dist/cjs/theme/palette/text.js +3 -1
- package/dist/cjs/theme/palette/warning.js +3 -1
- package/dist/cjs/theme/theme.js +5 -3
- package/dist/cjs/theme/typography.js +3 -1
- package/dist/cjs/utils/axis.js +11 -7
- package/dist/cjs/utils/chart-actions.js +68 -12
- package/dist/cjs/utils/combine-sx.js +3 -1
- package/dist/cjs/utils/component-ids.js +3 -1
- package/dist/cjs/utils/format.js +16 -8
- package/dist/cjs/utils/index.js +15 -13
- package/dist/cjs/utils/mathjs.js +3 -1
- package/dist/cjs/utils/theme-gen.js +16 -18
- package/dist/context/ChartsProvider.d.ts +19 -0
- package/dist/context/ChartsProvider.d.ts.map +1 -0
- package/dist/context/{ChartsThemeProvider.js → ChartsProvider.js} +24 -6
- package/dist/context/ChartsProvider.js.map +1 -0
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +17 -0
- package/dist/context/index.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.d.ts +2 -0
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +25 -16
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/theme/component-overrides/paper.js.map +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.d.ts.map +1 -1
- package/dist/theme/palette/background.js +3 -1
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/common.js.map +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/error.js.map +1 -1
- package/dist/theme/palette/grey.js.map +1 -1
- package/dist/theme/palette/index.js.map +1 -1
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.js.map +1 -1
- package/dist/theme/palette/secondary.js.map +1 -1
- package/dist/theme/palette/success.js.map +1 -1
- package/dist/theme/palette/text.js.map +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/axis.d.ts +4 -4
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js +4 -4
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/chart-actions.d.ts +6 -2
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +51 -7
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.d.ts +2 -7
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +11 -15
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +7 -6
- package/dist/UnitSelector/UnitSelector.d.ts +0 -9
- package/dist/UnitSelector/UnitSelector.d.ts.map +0 -1
- package/dist/UnitSelector/UnitSelector.js.map +0 -1
- package/dist/UnitSelector/index.d.ts +0 -2
- package/dist/UnitSelector/index.d.ts.map +0 -1
- package/dist/UnitSelector/index.js.map +0 -1
- package/dist/context/ChartsThemeProvider.d.ts +0 -10
- package/dist/context/ChartsThemeProvider.d.ts.map +0 -1
- package/dist/context/ChartsThemeProvider.js.map +0 -1
|
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "SeriesMarker", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return SeriesMarker;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
25
|
const _utils = require("../utils");
|
|
24
26
|
function SeriesMarker(props) {
|
|
25
27
|
const { markerColor , sx } = props;
|
|
26
|
-
return /*#__PURE__*/ (0,
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
27
29
|
sx: (0, _utils.combineSx)({
|
|
28
30
|
display: 'inline-block',
|
|
29
31
|
width: '11px',
|
|
@@ -16,34 +16,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "TimeChartTooltip", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeChartTooltip;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
+
const _useresizeobserver = /*#__PURE__*/ _interop_require_default(require("use-resize-observer"));
|
|
27
|
+
const _tooltipmodel = require("./tooltip-model");
|
|
26
28
|
const _utils = require("./utils");
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
function
|
|
29
|
+
const _nearbyseries = require("./nearby-series");
|
|
30
|
+
const _TooltipHeader = require("./TooltipHeader");
|
|
31
|
+
const _TooltipContent = require("./TooltipContent");
|
|
32
|
+
function _interop_require_default(obj) {
|
|
31
33
|
return obj && obj.__esModule ? obj : {
|
|
32
34
|
default: obj
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartTooltip({ containerId , chartRef , data , seriesMapping , wrapLabels ,
|
|
37
|
+
const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartTooltip({ containerId , chartRef , data , seriesMapping , enablePinning =true , wrapLabels , format , onUnpinClick , pinnedPos }) {
|
|
36
38
|
const [showAllSeries, setShowAllSeries] = (0, _react.useState)(false);
|
|
37
|
-
const transform = (0, _react.useRef)(
|
|
38
|
-
const mousePos = (0,
|
|
39
|
-
const { height , width , ref: tooltipRef } = (0,
|
|
40
|
-
const isTooltipPinned = pinnedPos !== null;
|
|
39
|
+
const transform = (0, _react.useRef)();
|
|
40
|
+
const mousePos = (0, _tooltipmodel.useMousePosition)();
|
|
41
|
+
const { height , width , ref: tooltipRef } = (0, _useresizeobserver.default)();
|
|
42
|
+
const isTooltipPinned = pinnedPos !== null && enablePinning;
|
|
41
43
|
if (mousePos === null || mousePos.target === null || data === null) return null;
|
|
42
44
|
// Ensure user is hovering over a chart before checking for nearby series.
|
|
43
45
|
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
44
46
|
const chart = chartRef.current;
|
|
45
|
-
var
|
|
46
|
-
const chartWidth = (
|
|
47
|
+
var _chart_getWidth;
|
|
48
|
+
const chartWidth = (_chart_getWidth = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && _chart_getWidth !== void 0 ? _chart_getWidth : _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
47
49
|
const containerElement = containerId ? document.querySelector(containerId) : undefined;
|
|
48
50
|
// if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
|
|
49
51
|
const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
|
|
@@ -51,39 +53,40 @@ const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartToolti
|
|
|
51
53
|
transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height !== null && height !== void 0 ? height : 0, width !== null && width !== void 0 ? width : 0, containerElement);
|
|
52
54
|
}
|
|
53
55
|
// Get series nearby the cursor and pass into tooltip content children.
|
|
54
|
-
const nearbySeries = (0,
|
|
56
|
+
const nearbySeries = (0, _nearbyseries.getNearbySeriesData)({
|
|
55
57
|
mousePos,
|
|
56
58
|
data,
|
|
57
59
|
seriesMapping,
|
|
58
60
|
pinnedPos,
|
|
59
61
|
chart,
|
|
60
|
-
|
|
62
|
+
format,
|
|
61
63
|
showAllSeries
|
|
62
64
|
});
|
|
63
65
|
if (nearbySeries.length === 0) {
|
|
64
66
|
return null;
|
|
65
67
|
}
|
|
66
68
|
const totalSeries = data.length;
|
|
67
|
-
return /*#__PURE__*/ (0,
|
|
69
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Portal, {
|
|
68
70
|
container: containerElement,
|
|
69
|
-
children: /*#__PURE__*/ (0,
|
|
71
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
70
72
|
ref: tooltipRef,
|
|
71
73
|
sx: (theme)=>(0, _utils.getTooltipStyles)(theme, pinnedPos, maxHeight),
|
|
72
74
|
style: {
|
|
73
75
|
transform: transform.current
|
|
74
76
|
},
|
|
75
|
-
children: /*#__PURE__*/ (0,
|
|
77
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
76
78
|
spacing: 0.5,
|
|
77
79
|
children: [
|
|
78
|
-
/*#__PURE__*/ (0,
|
|
80
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_TooltipHeader.TooltipHeader, {
|
|
79
81
|
nearbySeries: nearbySeries,
|
|
80
82
|
totalSeries: totalSeries,
|
|
83
|
+
enablePinning: enablePinning,
|
|
81
84
|
isTooltipPinned: isTooltipPinned,
|
|
82
85
|
showAllSeries: showAllSeries,
|
|
83
86
|
onShowAllClick: (checked)=>setShowAllSeries(checked),
|
|
84
87
|
onUnpinClick: onUnpinClick
|
|
85
88
|
}),
|
|
86
|
-
/*#__PURE__*/ (0,
|
|
89
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_TooltipContent.TooltipContent, {
|
|
87
90
|
series: nearbySeries,
|
|
88
91
|
wrapLabels: wrapLabels
|
|
89
92
|
})
|
|
@@ -16,12 +16,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "TooltipContent", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return TooltipContent;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
|
-
const
|
|
26
|
+
const _SeriesInfo = require("./SeriesInfo");
|
|
25
27
|
function TooltipContent(props) {
|
|
26
28
|
const { series , wrapLabels } = props;
|
|
27
29
|
const sortedFocusedSeries = (0, _react.useMemo)(()=>{
|
|
@@ -34,7 +36,7 @@ function TooltipContent(props) {
|
|
|
34
36
|
return null;
|
|
35
37
|
}
|
|
36
38
|
// TODO: use react-virtuoso to improve performance
|
|
37
|
-
return /*#__PURE__*/ (0,
|
|
39
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
38
40
|
sx: (theme)=>({
|
|
39
41
|
display: 'table',
|
|
40
42
|
padding: theme.spacing(0.5, 2)
|
|
@@ -42,7 +44,7 @@ function TooltipContent(props) {
|
|
|
42
44
|
children: sortedFocusedSeries.map(({ datumIdx , seriesIdx , seriesName , y , formattedY , markerColor , isClosestToCursor })=>{
|
|
43
45
|
if (datumIdx === null || seriesIdx === null) return null;
|
|
44
46
|
const key = seriesIdx.toString() + datumIdx.toString();
|
|
45
|
-
return /*#__PURE__*/ (0,
|
|
47
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_SeriesInfo.SeriesInfo, {
|
|
46
48
|
seriesName: seriesName,
|
|
47
49
|
y: y,
|
|
48
50
|
formattedY: formattedY,
|
|
@@ -16,43 +16,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "TooltipHeader", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return TooltipHeader;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
+
const _Pin = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Pin"));
|
|
26
|
+
const _PinOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOutline"));
|
|
25
27
|
const _react = require("react");
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
function
|
|
28
|
+
const _datefns = require("date-fns");
|
|
29
|
+
const _tooltipmodel = require("./tooltip-model");
|
|
30
|
+
function _interop_require_default(obj) {
|
|
29
31
|
return obj && obj.__esModule ? obj : {
|
|
30
32
|
default: obj
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
|
-
const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ nearbySeries , totalSeries , isTooltipPinned , showAllSeries , onShowAllClick , onUnpinClick }) {
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
const seriesTimeMs = (
|
|
35
|
+
const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ nearbySeries , totalSeries , isTooltipPinned , showAllSeries , enablePinning =true , onShowAllClick , onUnpinClick }) {
|
|
36
|
+
var _nearbySeries_;
|
|
37
|
+
var _nearbySeries__date;
|
|
38
|
+
const seriesTimeMs = (_nearbySeries__date = (_nearbySeries_ = nearbySeries[0]) === null || _nearbySeries_ === void 0 ? void 0 : _nearbySeries_.date) !== null && _nearbySeries__date !== void 0 ? _nearbySeries__date : null;
|
|
37
39
|
if (seriesTimeMs === null) {
|
|
38
40
|
return null;
|
|
39
41
|
}
|
|
40
42
|
const formatTimeSeriesHeader = (timeMs)=>{
|
|
41
43
|
const date = new Date(timeMs);
|
|
42
|
-
const formattedDate = (0,
|
|
43
|
-
const formattedTime = (0,
|
|
44
|
-
return /*#__PURE__*/ (0,
|
|
44
|
+
const formattedDate = (0, _datefns.format)(date, 'MMM dd, yyyy - ');
|
|
45
|
+
const formattedTime = (0, _datefns.format)(date, 'HH:mm:ss');
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
45
47
|
children: [
|
|
46
|
-
/*#__PURE__*/ (0,
|
|
48
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
47
49
|
variant: "caption",
|
|
48
50
|
sx: (theme)=>({
|
|
49
51
|
color: theme.palette.common.white
|
|
50
52
|
}),
|
|
51
53
|
children: formattedDate
|
|
52
54
|
}),
|
|
53
|
-
/*#__PURE__*/ (0,
|
|
55
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
54
56
|
variant: "caption",
|
|
55
|
-
children: /*#__PURE__*/ (0,
|
|
57
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
56
58
|
children: formattedTime
|
|
57
59
|
})
|
|
58
60
|
})
|
|
@@ -60,24 +62,24 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
60
62
|
});
|
|
61
63
|
};
|
|
62
64
|
// TODO: accurately calc whether more series are outside scrollable region using yBuffer, avg series name length, TOOLTIP_MAX_HEIGHT
|
|
63
|
-
const showAllSeriesToggle = totalSeries > 5;
|
|
64
|
-
const pinTooltipHelpText = isTooltipPinned ?
|
|
65
|
-
var
|
|
66
|
-
return /*#__PURE__*/ (0,
|
|
65
|
+
const showAllSeriesToggle = enablePinning && totalSeries > 5;
|
|
66
|
+
const pinTooltipHelpText = isTooltipPinned ? _tooltipmodel.UNPIN_TOOLTIP_HELP_TEXT : _tooltipmodel.PIN_TOOLTIP_HELP_TEXT;
|
|
67
|
+
var _theme_palette_designSystem_grey_;
|
|
68
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
67
69
|
sx: (theme)=>{
|
|
68
|
-
var
|
|
70
|
+
var _theme_palette_designSystem;
|
|
69
71
|
return {
|
|
70
72
|
width: '100%',
|
|
71
|
-
maxWidth:
|
|
73
|
+
maxWidth: _tooltipmodel.TOOLTIP_MAX_WIDTH,
|
|
72
74
|
padding: theme.spacing(1.5, 2, 0.5, 2),
|
|
73
|
-
backgroundColor: (
|
|
75
|
+
backgroundColor: (_theme_palette_designSystem_grey_ = (_theme_palette_designSystem = theme.palette.designSystem) === null || _theme_palette_designSystem === void 0 ? void 0 : _theme_palette_designSystem.grey[800]) !== null && _theme_palette_designSystem_grey_ !== void 0 ? _theme_palette_designSystem_grey_ : _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
|
|
74
76
|
position: 'sticky',
|
|
75
77
|
top: 0,
|
|
76
78
|
left: 0
|
|
77
79
|
};
|
|
78
80
|
},
|
|
79
81
|
children: [
|
|
80
|
-
/*#__PURE__*/ (0,
|
|
82
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
81
83
|
sx: {
|
|
82
84
|
width: '100%',
|
|
83
85
|
display: 'flex',
|
|
@@ -87,14 +89,14 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
87
89
|
},
|
|
88
90
|
children: [
|
|
89
91
|
formatTimeSeriesHeader(seriesTimeMs),
|
|
90
|
-
/*#__PURE__*/ (0,
|
|
92
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
91
93
|
direction: "row",
|
|
92
94
|
gap: 1,
|
|
93
95
|
sx: {
|
|
94
96
|
marginLeft: 'auto'
|
|
95
97
|
},
|
|
96
98
|
children: [
|
|
97
|
-
showAllSeriesToggle && /*#__PURE__*/ (0,
|
|
99
|
+
showAllSeriesToggle && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
98
100
|
direction: "row",
|
|
99
101
|
gap: 0.5,
|
|
100
102
|
alignItems: "center",
|
|
@@ -102,13 +104,13 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
102
104
|
textAlign: 'right'
|
|
103
105
|
},
|
|
104
106
|
children: [
|
|
105
|
-
/*#__PURE__*/ (0,
|
|
107
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
106
108
|
sx: {
|
|
107
109
|
fontSize: 11
|
|
108
110
|
},
|
|
109
111
|
children: "Show All"
|
|
110
112
|
}),
|
|
111
|
-
/*#__PURE__*/ (0,
|
|
113
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
112
114
|
checked: showAllSeries,
|
|
113
115
|
size: "small",
|
|
114
116
|
onChange: (_, checked)=>{
|
|
@@ -127,11 +129,11 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
127
129
|
})
|
|
128
130
|
]
|
|
129
131
|
}),
|
|
130
|
-
/*#__PURE__*/ (0,
|
|
132
|
+
enablePinning && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
131
133
|
direction: "row",
|
|
132
134
|
alignItems: "center",
|
|
133
135
|
children: [
|
|
134
|
-
/*#__PURE__*/ (0,
|
|
136
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
135
137
|
sx: {
|
|
136
138
|
marginRight: 0.5,
|
|
137
139
|
fontSize: 11,
|
|
@@ -139,7 +141,7 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
139
141
|
},
|
|
140
142
|
children: pinTooltipHelpText
|
|
141
143
|
}),
|
|
142
|
-
isTooltipPinned ? /*#__PURE__*/ (0,
|
|
144
|
+
isTooltipPinned ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_Pin.default, {
|
|
143
145
|
onClick: ()=>{
|
|
144
146
|
if (onUnpinClick !== undefined) {
|
|
145
147
|
onUnpinClick();
|
|
@@ -149,7 +151,7 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
149
151
|
fontSize: 16,
|
|
150
152
|
cursor: 'pointer'
|
|
151
153
|
}
|
|
152
|
-
}) : /*#__PURE__*/ (0,
|
|
154
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_PinOutline.default, {
|
|
153
155
|
sx: {
|
|
154
156
|
fontSize: 16
|
|
155
157
|
}
|
|
@@ -160,7 +162,7 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
160
162
|
})
|
|
161
163
|
]
|
|
162
164
|
}),
|
|
163
|
-
/*#__PURE__*/ (0,
|
|
165
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {
|
|
164
166
|
sx: (theme)=>({
|
|
165
167
|
width: '100%',
|
|
166
168
|
borderColor: theme.palette.grey['500']
|
|
@@ -14,24 +14,26 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function
|
|
17
|
+
_export_star(require("./LineChartTooltip"), exports);
|
|
18
|
+
_export_star(require("./SeriesInfo"), exports);
|
|
19
|
+
_export_star(require("./SeriesLabelsStack"), exports);
|
|
20
|
+
_export_star(require("./SeriesMarker"), exports);
|
|
21
|
+
_export_star(require("./TimeChartTooltip"), exports);
|
|
22
|
+
_export_star(require("./TooltipContent"), exports);
|
|
23
|
+
_export_star(require("./TooltipHeader"), exports);
|
|
24
|
+
_export_star(require("./nearby-series"), exports);
|
|
25
|
+
_export_star(require("./tooltip-model"), exports);
|
|
26
|
+
_export_star(require("./utils"), exports);
|
|
27
|
+
function _export_star(from, to) {
|
|
28
28
|
Object.keys(from).forEach(function(k) {
|
|
29
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
30
|
+
Object.defineProperty(to, k, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function() {
|
|
33
|
+
return from[k];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
35
37
|
});
|
|
36
38
|
return from;
|
|
37
39
|
}
|
|
@@ -21,28 +21,48 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
INCREASE_NEARBY_SERIES_MULTIPLIER: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
INCREASE_NEARBY_SERIES_MULTIPLIER: function() {
|
|
25
|
+
return INCREASE_NEARBY_SERIES_MULTIPLIER;
|
|
26
|
+
},
|
|
27
|
+
DYNAMIC_NEARBY_SERIES_MULTIPLIER: function() {
|
|
28
|
+
return DYNAMIC_NEARBY_SERIES_MULTIPLIER;
|
|
29
|
+
},
|
|
30
|
+
SHOW_FEWER_SERIES_LIMIT: function() {
|
|
31
|
+
return SHOW_FEWER_SERIES_LIMIT;
|
|
32
|
+
},
|
|
33
|
+
checkforNearbyTimeSeries: function() {
|
|
34
|
+
return checkforNearbyTimeSeries;
|
|
35
|
+
},
|
|
36
|
+
legacyCheckforNearbySeries: function() {
|
|
37
|
+
return legacyCheckforNearbySeries;
|
|
38
|
+
},
|
|
39
|
+
getNearbySeriesData: function() {
|
|
40
|
+
return getNearbySeriesData;
|
|
41
|
+
},
|
|
42
|
+
legacyGetNearbySeriesData: function() {
|
|
43
|
+
return legacyGetNearbySeriesData;
|
|
44
|
+
},
|
|
45
|
+
isWithinPercentageRange: function() {
|
|
46
|
+
return isWithinPercentageRange;
|
|
47
|
+
},
|
|
48
|
+
getYBuffer: function() {
|
|
49
|
+
return getYBuffer;
|
|
50
|
+
}
|
|
33
51
|
});
|
|
34
52
|
const _core = require("@perses-dev/core");
|
|
35
53
|
const _model = require("../model");
|
|
36
54
|
const _utils = require("../utils");
|
|
55
|
+
const _tooltipmodel = require("./tooltip-model");
|
|
37
56
|
const INCREASE_NEARBY_SERIES_MULTIPLIER = 5.5; // adjusts how many series show in tooltip (higher == more series shown)
|
|
38
57
|
const DYNAMIC_NEARBY_SERIES_MULTIPLIER = 30; // used for adjustment after series number divisor
|
|
39
58
|
const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
40
|
-
function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart,
|
|
59
|
+
function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format) {
|
|
60
|
+
var _data_;
|
|
41
61
|
const currentNearbySeriesData = [];
|
|
42
|
-
var
|
|
43
|
-
const cursorX = (
|
|
44
|
-
var
|
|
45
|
-
const cursorY = (
|
|
62
|
+
var _pointInGrid_;
|
|
63
|
+
const cursorX = (_pointInGrid_ = pointInGrid[0]) !== null && _pointInGrid_ !== void 0 ? _pointInGrid_ : null;
|
|
64
|
+
var _pointInGrid_1;
|
|
65
|
+
const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
|
|
46
66
|
if (cursorX === null || cursorY === null) return currentNearbySeriesData;
|
|
47
67
|
if (chart.dispatchAction === undefined) return currentNearbySeriesData;
|
|
48
68
|
if (!Array.isArray(data)) return currentNearbySeriesData;
|
|
@@ -53,8 +73,12 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
53
73
|
const duplicateDatapoints = [];
|
|
54
74
|
const totalSeries = data.length;
|
|
55
75
|
const yValueCounts = new Map();
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
// Only need to loop through first dataset source since getCommonTimeScale ensures xAxis timestamps are consistent
|
|
77
|
+
const firstTimeSeriesValues = (_data_ = data[0]) === null || _data_ === void 0 ? void 0 : _data_.values;
|
|
78
|
+
const closestTimestamp = (0, _utils.getClosestTimestamp)(firstTimeSeriesValues, cursorX);
|
|
79
|
+
if (closestTimestamp === null) {
|
|
80
|
+
return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
81
|
+
}
|
|
58
82
|
// find the timestamp with data that is closest to cursorX
|
|
59
83
|
for(let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++){
|
|
60
84
|
const currentSeries = seriesMapping[seriesIdx];
|
|
@@ -62,20 +86,11 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
62
86
|
const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;
|
|
63
87
|
if (currentDataset == null) break;
|
|
64
88
|
const currentDatasetValues = currentDataset.values;
|
|
65
|
-
// Determine closestTimestamp before checking whether it is equal to xValue. Consolidating
|
|
66
|
-
// with second currentDatasetValues loop below would result in duplicate nearby series
|
|
67
|
-
for (const [timestamp] of currentDatasetValues){
|
|
68
|
-
const distance = Math.abs(timestamp - cursorX);
|
|
69
|
-
if (distance < closestDistance) {
|
|
70
|
-
closestTimestamp = timestamp;
|
|
71
|
-
closestDistance = distance;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
89
|
if (currentDatasetValues === undefined || !Array.isArray(currentDatasetValues)) break;
|
|
75
90
|
const lineSeries = currentSeries;
|
|
76
91
|
const currentSeriesName = lineSeries.name ? lineSeries.name.toString() : '';
|
|
77
|
-
var
|
|
78
|
-
const markerColor = (
|
|
92
|
+
var _lineSeries_color;
|
|
93
|
+
const markerColor = (_lineSeries_color = lineSeries.color) !== null && _lineSeries_color !== void 0 ? _lineSeries_color : '#000';
|
|
79
94
|
if (Array.isArray(data)) {
|
|
80
95
|
for(let datumIdx = 0; datumIdx < currentDatasetValues.length; datumIdx++){
|
|
81
96
|
const nearbyTimeSeries = currentDatasetValues[datumIdx];
|
|
@@ -97,10 +112,10 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
97
112
|
if (isClosestToCursor) {
|
|
98
113
|
// shows as bold in tooltip, customize 'emphasis' options in getTimeSeries util
|
|
99
114
|
emphasizedSeriesIndexes.push(seriesIdx);
|
|
100
|
-
var
|
|
115
|
+
var _yValueCounts_get;
|
|
101
116
|
// Used to determine which datapoint to apply select styles to.
|
|
102
117
|
// Accounts for cases where lines may be rendered directly on top of eachother.
|
|
103
|
-
const duplicateValuesCount = (
|
|
118
|
+
const duplicateValuesCount = (_yValueCounts_get = yValueCounts.get(yValue)) !== null && _yValueCounts_get !== void 0 ? _yValueCounts_get : 0;
|
|
104
119
|
yValueCounts.set(yValue, duplicateValuesCount + 1);
|
|
105
120
|
if (duplicateValuesCount > 0) {
|
|
106
121
|
duplicateDatapoints.push({
|
|
@@ -125,7 +140,7 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
125
140
|
seriesIndex: seriesIdx
|
|
126
141
|
});
|
|
127
142
|
}
|
|
128
|
-
const formattedY = (0, _core.formatValue)(yValue,
|
|
143
|
+
const formattedY = (0, _core.formatValue)(yValue, format);
|
|
129
144
|
currentNearbySeriesData.push({
|
|
130
145
|
seriesIdx: seriesIdx,
|
|
131
146
|
datumIdx: datumIdx,
|
|
@@ -147,12 +162,12 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
147
162
|
(0, _utils.batchDispatchNearbySeriesActions)(chart, nearbySeriesIndexes, emphasizedSeriesIndexes, nonEmphasizedSeriesIndexes, emphasizedDatapoints, duplicateDatapoints);
|
|
148
163
|
return currentNearbySeriesData;
|
|
149
164
|
}
|
|
150
|
-
function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart,
|
|
165
|
+
function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
151
166
|
const currentNearbySeriesData = [];
|
|
152
|
-
var
|
|
153
|
-
const cursorX = (
|
|
154
|
-
var
|
|
155
|
-
const cursorY = (
|
|
167
|
+
var _pointInGrid_;
|
|
168
|
+
const cursorX = (_pointInGrid_ = pointInGrid[0]) !== null && _pointInGrid_ !== void 0 ? _pointInGrid_ : null;
|
|
169
|
+
var _pointInGrid_1;
|
|
170
|
+
const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
|
|
156
171
|
if (cursorX === null || cursorY === null) {
|
|
157
172
|
return currentNearbySeriesData;
|
|
158
173
|
}
|
|
@@ -166,12 +181,12 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, unit) {
|
|
|
166
181
|
if (currentSeries === undefined) break;
|
|
167
182
|
if (currentNearbySeriesData.length >= _model.OPTIMIZED_MODE_SERIES_LIMIT) break;
|
|
168
183
|
const currentSeriesName = currentSeries.name ? currentSeries.name.toString() : '';
|
|
169
|
-
var
|
|
170
|
-
const markerColor = (
|
|
184
|
+
var _currentSeries_color;
|
|
185
|
+
const markerColor = (_currentSeries_color = currentSeries.color) !== null && _currentSeries_color !== void 0 ? _currentSeries_color : '#000';
|
|
171
186
|
if (Array.isArray(currentSeries.data)) {
|
|
172
187
|
for(let datumIdx = 0; datumIdx < currentSeries.data.length; datumIdx++){
|
|
173
|
-
var
|
|
174
|
-
const xValue = (
|
|
188
|
+
var _data_xAxis_datumIdx;
|
|
189
|
+
const xValue = (_data_xAxis_datumIdx = data.xAxis[datumIdx]) !== null && _data_xAxis_datumIdx !== void 0 ? _data_xAxis_datumIdx : 0;
|
|
175
190
|
const yValue = currentSeries.data[datumIdx];
|
|
176
191
|
// ensure null values not displayed in tooltip
|
|
177
192
|
if (yValue !== undefined && yValue !== null && cursorX === datumIdx) {
|
|
@@ -198,7 +213,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, unit) {
|
|
|
198
213
|
}
|
|
199
214
|
// determine whether to convert timestamp to ms, see: https://stackoverflow.com/a/23982005/17575201
|
|
200
215
|
const xValueMilliSeconds = xValue > 99999999999 ? xValue : xValue * 1000;
|
|
201
|
-
const formattedY = (0, _core.formatValue)(yValue,
|
|
216
|
+
const formattedY = (0, _core.formatValue)(yValue, format);
|
|
202
217
|
currentNearbySeriesData.push({
|
|
203
218
|
seriesIdx: seriesIdx,
|
|
204
219
|
datumIdx: datumIdx,
|
|
@@ -245,8 +260,8 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, unit) {
|
|
|
245
260
|
}
|
|
246
261
|
return currentNearbySeriesData;
|
|
247
262
|
}
|
|
248
|
-
function getNearbySeriesData({ mousePos , pinnedPos , data , seriesMapping , chart ,
|
|
249
|
-
if (chart === undefined || mousePos === null) return
|
|
263
|
+
function getNearbySeriesData({ mousePos , pinnedPos , data , seriesMapping , chart , format , showAllSeries =false }) {
|
|
264
|
+
if (chart === undefined || mousePos === null) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
250
265
|
// prevents multiple tooltips showing from adjacent charts unless tooltip is pinned
|
|
251
266
|
let cursorTargetMatchesChart = false;
|
|
252
267
|
if (mousePos.target !== null) {
|
|
@@ -266,8 +281,9 @@ function getNearbySeriesData({ mousePos , pinnedPos , data , seriesMapping , cha
|
|
|
266
281
|
mousePos = pinnedPos;
|
|
267
282
|
cursorTargetMatchesChart = true;
|
|
268
283
|
}
|
|
269
|
-
if (cursorTargetMatchesChart === false) return
|
|
270
|
-
|
|
284
|
+
if (cursorTargetMatchesChart === false || data === null || chart['_model'] === undefined) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
285
|
+
// mousemove position undefined when not hovering over chart canvas
|
|
286
|
+
if (mousePos.plotCanvas.x === undefined || mousePos.plotCanvas.y === undefined) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
271
287
|
const pointInGrid = (0, _utils.getPointInGrid)(mousePos.plotCanvas.x, mousePos.plotCanvas.y, chart);
|
|
272
288
|
if (pointInGrid !== null) {
|
|
273
289
|
const chartModel = chart['_model'];
|
|
@@ -278,11 +294,12 @@ function getNearbySeriesData({ mousePos , pinnedPos , data , seriesMapping , cha
|
|
|
278
294
|
totalSeries,
|
|
279
295
|
showAllSeries
|
|
280
296
|
});
|
|
281
|
-
return checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart,
|
|
297
|
+
return checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format);
|
|
282
298
|
}
|
|
283
|
-
|
|
299
|
+
// no nearby series found
|
|
300
|
+
return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
284
301
|
}
|
|
285
|
-
function legacyGetNearbySeriesData({ mousePos , pinnedPos , chartData , chart ,
|
|
302
|
+
function legacyGetNearbySeriesData({ mousePos , pinnedPos , chartData , chart , format , showAllSeries =false }) {
|
|
286
303
|
if (chart === undefined || mousePos === null) return [];
|
|
287
304
|
// prevents multiple tooltips showing from adjacent charts unless tooltip is pinned
|
|
288
305
|
let cursorTargetMatchesChart = false;
|
|
@@ -313,15 +330,15 @@ function legacyGetNearbySeriesData({ mousePos , pinnedPos , chartData , chart ,
|
|
|
313
330
|
totalSeries,
|
|
314
331
|
showAllSeries
|
|
315
332
|
});
|
|
316
|
-
var
|
|
333
|
+
var _mousePos_plotCanvas_x, _mousePos_plotCanvas_y;
|
|
317
334
|
const pointInPixel = [
|
|
318
|
-
(
|
|
319
|
-
(
|
|
335
|
+
(_mousePos_plotCanvas_x = mousePos.plotCanvas.x) !== null && _mousePos_plotCanvas_x !== void 0 ? _mousePos_plotCanvas_x : 0,
|
|
336
|
+
(_mousePos_plotCanvas_y = mousePos.plotCanvas.y) !== null && _mousePos_plotCanvas_y !== void 0 ? _mousePos_plotCanvas_y : 0
|
|
320
337
|
];
|
|
321
338
|
if (chart.containPixel('grid', pointInPixel)) {
|
|
322
339
|
const pointInGrid = chart.convertFromPixel('grid', pointInPixel);
|
|
323
340
|
if (pointInGrid[0] !== undefined && pointInGrid[1] !== undefined) {
|
|
324
|
-
return legacyCheckforNearbySeries(chartData, pointInGrid, yBuffer, chart,
|
|
341
|
+
return legacyCheckforNearbySeries(chartData, pointInGrid, yBuffer, chart, format);
|
|
325
342
|
}
|
|
326
343
|
}
|
|
327
344
|
return [];
|