@perses-dev/components 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
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/AlignSelector/AlignSelector.d.ts +9 -0
- package/dist/AlignSelector/AlignSelector.d.ts.map +1 -0
- package/dist/AlignSelector/AlignSelector.js +42 -0
- package/dist/AlignSelector/AlignSelector.js.map +1 -0
- package/dist/AlignSelector/index.d.ts +2 -0
- package/dist/AlignSelector/index.d.ts.map +1 -0
- package/dist/AlignSelector/index.js +15 -0
- package/dist/AlignSelector/index.js.map +1 -0
- package/dist/BarChart/BarChart.d.ts +2 -2
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +13 -8
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +28 -13
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.d.ts +9 -0
- package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -0
- package/dist/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +18 -15
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -0
- package/dist/ColorPicker/index.d.ts +1 -0
- package/dist/ColorPicker/index.d.ts.map +1 -1
- package/dist/ColorPicker/index.js +1 -0
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.d.ts +2 -2
- package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +10 -7
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +2 -2
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +4 -5
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.d.ts +8 -0
- package/dist/DensitySelector/DensitySelector.d.ts.map +1 -0
- package/dist/DensitySelector/DensitySelector.js +46 -0
- package/dist/DensitySelector/DensitySelector.js.map +1 -0
- package/dist/DensitySelector/index.d.ts +2 -0
- package/dist/DensitySelector/index.d.ts.map +1 -0
- package/dist/DensitySelector/index.js +15 -0
- package/dist/DensitySelector/index.js.map +1 -0
- package/dist/Dialog/Dialog.d.ts +10 -15
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +11 -7
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +2 -2
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.d.ts +24 -0
- package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -0
- package/dist/DragAndDrop/DragAndDropList.js +153 -0
- package/dist/DragAndDrop/DragAndDropList.js.map +1 -0
- package/dist/DragAndDrop/DragButton.d.ts +13 -0
- package/dist/DragAndDrop/DragButton.d.ts.map +1 -0
- package/dist/DragAndDrop/DragButton.js +97 -0
- package/dist/DragAndDrop/DragButton.js.map +1 -0
- package/dist/DragAndDrop/DropIndicator.d.ts +3 -0
- package/dist/DragAndDrop/DropIndicator.d.ts.map +1 -0
- package/dist/DragAndDrop/DropIndicator.js +44 -0
- package/dist/DragAndDrop/DropIndicator.js.map +1 -0
- package/dist/DragAndDrop/index.d.ts +4 -0
- package/dist/DragAndDrop/index.d.ts.map +1 -0
- package/dist/DragAndDrop/index.js +17 -0
- package/dist/DragAndDrop/index.js.map +1 -0
- package/dist/DragAndDrop/model.d.ts +11 -0
- package/dist/DragAndDrop/model.d.ts.map +1 -0
- package/dist/DragAndDrop/model.js +17 -0
- package/dist/DragAndDrop/model.js.map +1 -0
- package/dist/Drawer/Drawer.d.ts +2 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +2 -2
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/EChart/EChart.d.ts +8 -8
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +5 -6
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/ErrorAlert.d.ts +2 -2
- package/dist/ErrorAlert.d.ts.map +1 -1
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.d.ts +3 -3
- package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js +2 -2
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FormEditor/FormActions.d.ts +16 -0
- package/dist/FormEditor/FormActions.d.ts.map +1 -0
- package/dist/FormEditor/FormActions.js +75 -0
- package/dist/FormEditor/FormActions.js.map +1 -0
- package/dist/FormEditor/index.d.ts +2 -0
- package/dist/FormEditor/index.d.ts.map +1 -0
- package/dist/FormEditor/index.js +15 -0
- package/dist/FormEditor/index.js.map +1 -0
- package/dist/FormatControls/FormatControls.d.ts +2 -2
- package/dist/FormatControls/FormatControls.d.ts.map +1 -1
- package/dist/FormatControls/FormatControls.js +3 -3
- package/dist/FormatControls/FormatControls.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.d.ts +4 -4
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +5 -8
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.d.ts +4 -4
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +7 -8
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/JSONEditor.d.ts +3 -3
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.d.ts +2 -2
- package/dist/Legend/CompactLegend.d.ts.map +1 -1
- package/dist/Legend/CompactLegend.js +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts +2 -2
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +9 -5
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.d.ts +2 -2
- package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
- package/dist/Legend/LegendColorBadge.js +2 -2
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.d.ts +2 -2
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +6 -6
- package/dist/Legend/ListLegendItem.d.ts.map +1 -1
- package/dist/Legend/ListLegendItem.js +11 -19
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts +2 -2
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +3 -2
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/legend-model.d.ts +2 -2
- package/dist/Legend/legend-model.d.ts.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +1 -1
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +12 -17
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LinksEditor/LinksEditor.d.ts +8 -0
- package/dist/LinksEditor/LinksEditor.d.ts.map +1 -0
- package/dist/LinksEditor/LinksEditor.js +161 -0
- package/dist/LinksEditor/LinksEditor.js.map +1 -0
- package/dist/LinksEditor/index.d.ts +2 -0
- package/dist/LinksEditor/index.d.ts.map +1 -0
- package/dist/LinksEditor/index.js +15 -0
- package/dist/LinksEditor/index.js.map +1 -0
- package/dist/ModeSelector/ModeSelector.d.ts +3 -3
- package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
- package/dist/ModeSelector/ModeSelector.js +2 -2
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +3 -3
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +3 -3
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +3 -3
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +3 -3
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/Overlay/Overlay.d.ts +16 -0
- package/dist/Overlay/Overlay.d.ts.map +1 -0
- package/dist/Overlay/Overlay.js +52 -0
- package/dist/Overlay/Overlay.js.map +1 -0
- package/dist/Overlay/index.d.ts +2 -0
- package/dist/Overlay/index.d.ts.map +1 -0
- package/dist/Overlay/index.js +15 -0
- package/dist/Overlay/index.js.map +1 -0
- package/dist/PieChart/PieChart.d.ts +14 -0
- package/dist/PieChart/PieChart.d.ts.map +1 -0
- package/dist/PieChart/PieChart.js +92 -0
- package/dist/PieChart/PieChart.js.map +1 -0
- package/dist/PieChart/index.d.ts +2 -0
- package/dist/PieChart/index.d.ts.map +1 -0
- package/dist/PieChart/index.js +15 -0
- package/dist/PieChart/index.js.map +1 -0
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +2 -2
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +2 -2
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +8 -7
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SortSelector/SortSelector.d.ts +3 -3
- package/dist/SortSelector/SortSelector.d.ts.map +1 -1
- package/dist/SortSelector/SortSelector.js +2 -2
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/SortSelectorButtons.d.ts +9 -0
- package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -0
- package/dist/SortSelector/SortSelectorButtons.js +42 -0
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -0
- package/dist/SortSelector/index.d.ts +1 -0
- package/dist/SortSelector/index.d.ts.map +1 -1
- package/dist/SortSelector/index.js +2 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +6 -6
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +12 -18
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.d.ts.map +1 -1
- package/dist/StatChart/calculateFontSize.js +4 -6
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/utils/formatStatChartValue.d.ts +3 -0
- package/dist/StatChart/utils/formatStatChartValue.d.ts.map +1 -0
- package/dist/StatChart/utils/formatStatChartValue.js +26 -0
- package/dist/StatChart/utils/formatStatChartValue.js.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +27 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.js +132 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.js.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +13 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.js +47 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +1 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts +2 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts.map +1 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.js +41 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.js.map +1 -0
- package/dist/StatusHistoryChart/index.d.ts +3 -0
- package/dist/StatusHistoryChart/index.d.ts.map +1 -0
- package/dist/StatusHistoryChart/index.js +16 -0
- package/dist/StatusHistoryChart/index.js.map +1 -0
- package/dist/StatusHistoryChart/utils/get-color.d.ts +6 -0
- package/dist/StatusHistoryChart/utils/get-color.d.ts.map +1 -0
- package/dist/StatusHistoryChart/utils/get-color.js +100 -0
- package/dist/StatusHistoryChart/utils/get-color.js.map +1 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts +3 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts.map +1 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.js +27 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.js.map +1 -0
- package/dist/Table/InnerTable.d.ts +2 -2
- package/dist/Table/InnerTable.d.ts.map +1 -1
- package/dist/Table/InnerTable.js +4 -3
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +2 -2
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +12 -10
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.d.ts +2 -2
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableCell.d.ts +4 -2
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +29 -7
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.d.ts +2 -2
- package/dist/Table/TableCheckbox.d.ts.map +1 -1
- package/dist/Table/TableCheckbox.js +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHead.d.ts +2 -2
- package/dist/Table/TableHead.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.d.ts +3 -3
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.d.ts +1 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +5 -4
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +18 -15
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.d.ts +2 -2
- package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts +3 -3
- package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +2 -2
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +10 -12
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +8 -14
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.d.ts +1 -2
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +27 -7
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +29 -23
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.d.ts +2 -2
- package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +3 -3
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +2 -2
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +20 -27
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +12 -15
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +19 -0
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +44 -29
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +36 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.js +119 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.d.ts +1 -2
- package/dist/TimeRangeSelector/index.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
- package/dist/TimeRangeSelector/index.js.map +1 -0
- package/dist/TimeRangeSelector/utils.d.ts +25 -0
- package/dist/TimeRangeSelector/utils.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/utils.js +23 -2
- package/dist/TimeRangeSelector/utils.js.map +1 -0
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +8 -13
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +2 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +2 -3
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +2 -2
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +2 -2
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +4 -5
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts +2 -2
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +2 -2
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +7 -15
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +19 -29
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +10 -3
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +13 -2
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -21
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +2 -4
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js +32 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
- package/dist/ToolbarIconButton/index.d.ts +2 -0
- package/dist/ToolbarIconButton/index.d.ts.map +1 -0
- package/dist/ToolbarIconButton/index.js +15 -0
- package/dist/ToolbarIconButton/index.js.map +1 -0
- package/dist/TransformsEditor/TransformEditor.d.ts +9 -0
- package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -0
- package/dist/TransformsEditor/TransformEditor.js +289 -0
- package/dist/TransformsEditor/TransformEditor.js.map +1 -0
- package/dist/TransformsEditor/TransformEditorContainer.d.ts +10 -0
- package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -0
- package/dist/TransformsEditor/TransformEditorContainer.js +118 -0
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -0
- package/dist/TransformsEditor/TransformsEditor.d.ts +9 -0
- package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -0
- package/dist/TransformsEditor/TransformsEditor.js +90 -0
- package/dist/TransformsEditor/TransformsEditor.js.map +1 -0
- package/dist/TransformsEditor/index.d.ts +2 -0
- package/dist/TransformsEditor/index.d.ts.map +1 -0
- package/dist/TransformsEditor/index.js +15 -0
- package/dist/TransformsEditor/index.js.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.d.ts +10 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.js +374 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +8 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.js +118 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -0
- package/dist/ValueMappingEditor/index.d.ts +2 -0
- package/dist/ValueMappingEditor/index.d.ts.map +1 -0
- package/dist/ValueMappingEditor/index.js +15 -0
- package/dist/ValueMappingEditor/index.js.map +1 -0
- package/dist/YAxisLabel.d.ts +2 -2
- package/dist/YAxisLabel.d.ts.map +1 -1
- package/dist/YAxisLabel.js +5 -3
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/AlignSelector/AlignSelector.js +50 -0
- package/dist/cjs/AlignSelector/index.js +30 -0
- package/dist/cjs/BarChart/BarChart.js +14 -9
- package/dist/cjs/ColorPicker/ColorPicker.js +28 -52
- package/dist/cjs/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +19 -16
- package/dist/cjs/ColorPicker/index.js +1 -0
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +10 -12
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +4 -5
- package/dist/cjs/DensitySelector/DensitySelector.js +54 -0
- package/dist/cjs/DensitySelector/index.js +30 -0
- package/dist/cjs/Dialog/Dialog.js +11 -7
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/DragAndDrop/DragAndDropList.js +159 -0
- package/dist/cjs/DragAndDrop/DragButton.js +121 -0
- package/dist/cjs/DragAndDrop/DropIndicator.js +52 -0
- package/dist/cjs/DragAndDrop/index.js +32 -0
- package/dist/cjs/DragAndDrop/model.js +25 -0
- package/dist/cjs/Drawer/Drawer.js +2 -2
- package/dist/cjs/EChart/EChart.js +5 -45
- package/dist/cjs/ErrorAlert.js +1 -1
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +2 -2
- package/dist/cjs/FormEditor/FormActions.js +83 -0
- package/dist/cjs/FormEditor/index.js +30 -0
- package/dist/cjs/FormatControls/FormatControls.js +3 -3
- package/dist/cjs/GaugeChart/GaugeChart.js +6 -9
- package/dist/cjs/InfoTooltip/InfoTooltip.js +7 -13
- package/dist/cjs/Legend/CompactLegend.js +1 -1
- package/dist/cjs/Legend/Legend.js +9 -5
- package/dist/cjs/Legend/LegendColorBadge.js +2 -7
- package/dist/cjs/Legend/ListLegend.js +1 -1
- package/dist/cjs/Legend/ListLegendItem.js +9 -55
- package/dist/cjs/Legend/TableLegend.js +3 -2
- package/dist/cjs/LineChart/LineChart.js +13 -18
- package/dist/cjs/LinksEditor/LinksEditor.js +174 -0
- package/dist/cjs/LinksEditor/index.js +30 -0
- package/dist/cjs/ModeSelector/ModeSelector.js +2 -2
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/cjs/Overlay/Overlay.js +71 -0
- package/dist/cjs/Overlay/index.js +30 -0
- package/dist/cjs/PieChart/PieChart.js +100 -0
- package/dist/cjs/PieChart/index.js +30 -0
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +8 -7
- package/dist/cjs/SortSelector/SortSelector.js +2 -2
- package/dist/cjs/SortSelector/SortSelectorButtons.js +50 -0
- package/dist/cjs/SortSelector/index.js +2 -1
- package/dist/cjs/StatChart/StatChart.js +15 -21
- package/dist/cjs/StatChart/calculateFontSize.js +4 -6
- package/dist/cjs/StatChart/utils/formatStatChartValue.js +34 -0
- package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +140 -0
- package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +55 -0
- package/dist/cjs/StatusHistoryChart/get-formatted-axis-label.js +48 -0
- package/dist/cjs/StatusHistoryChart/index.js +31 -0
- package/dist/cjs/StatusHistoryChart/utils/get-color.js +125 -0
- package/dist/cjs/StatusHistoryChart/utils/get-tooltip-position.js +35 -0
- package/dist/cjs/Table/InnerTable.js +4 -3
- package/dist/cjs/Table/Table.js +11 -9
- package/dist/cjs/Table/TableCell.js +29 -7
- package/dist/cjs/Table/TableCheckbox.js +1 -1
- package/dist/cjs/Table/TableHeaderCell.js +1 -1
- package/dist/cjs/Table/VirtualizedTable.js +18 -15
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +2 -2
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +8 -14
- package/dist/cjs/Table/index.js +1 -7
- package/dist/cjs/Table/model/table-model.js +32 -23
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +3 -3
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +23 -28
- package/dist/cjs/TimeChart/TimeChart.js +12 -15
- package/dist/cjs/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +37 -30
- package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +127 -0
- package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
- package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/utils.js +26 -3
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +8 -13
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +2 -3
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +4 -5
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +2 -2
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +7 -15
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +29 -39
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +49 -29
- package/dist/cjs/TimeSeriesTooltip/utils.js +2 -4
- package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +40 -0
- package/dist/cjs/ToolbarIconButton/index.js +30 -0
- package/dist/cjs/TransformsEditor/TransformEditor.js +297 -0
- package/dist/cjs/TransformsEditor/TransformEditorContainer.js +131 -0
- package/dist/cjs/TransformsEditor/TransformsEditor.js +103 -0
- package/dist/cjs/TransformsEditor/index.js +30 -0
- package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +387 -0
- package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +131 -0
- package/dist/cjs/ValueMappingEditor/index.js +30 -0
- package/dist/cjs/YAxisLabel.js +5 -3
- package/dist/cjs/context/ChartsProvider.js +4 -2
- package/dist/cjs/context/SnackbarProvider.js +1 -1
- package/dist/cjs/context/TimeZoneProvider.js +5 -3
- package/dist/cjs/controls/TextField.js +54 -0
- package/dist/cjs/controls/index.js +30 -0
- package/dist/cjs/index.js +13 -1
- package/dist/cjs/model/graph.js +3 -3
- package/dist/cjs/model/timeOption.js +19 -1
- package/dist/cjs/test-utils/theme.js +3 -3
- package/dist/cjs/theme/component-overrides/alert.js +4 -4
- package/dist/cjs/theme/component-overrides/paper.js +1 -1
- package/dist/cjs/theme/index.js +1 -0
- package/dist/cjs/theme/palette/background.js +2 -0
- package/dist/cjs/theme/palette/colors/common.js +3 -3
- package/dist/cjs/theme/theme.js +7 -7
- package/dist/cjs/utils/axis.js +3 -3
- package/dist/cjs/utils/chart-actions.js +14 -15
- package/dist/cjs/utils/format.js +21 -3
- package/dist/cjs/utils/mathjs.js +1 -1
- package/dist/cjs/utils/theme-gen.js +5 -7
- package/dist/context/ChartsProvider.d.ts +2 -2
- package/dist/context/ChartsProvider.d.ts.map +1 -1
- package/dist/context/ChartsProvider.js +1 -1
- package/dist/context/ChartsProvider.js.map +1 -1
- package/dist/context/SnackbarProvider.d.ts +2 -2
- package/dist/context/SnackbarProvider.d.ts.map +1 -1
- package/dist/context/SnackbarProvider.js +1 -1
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.d.ts +4 -4
- package/dist/context/TimeZoneProvider.d.ts.map +1 -1
- package/dist/context/TimeZoneProvider.js +2 -2
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/controls/TextField.d.ts +9 -0
- package/dist/controls/TextField.d.ts.map +1 -0
- package/dist/controls/TextField.js +41 -0
- package/dist/controls/TextField.js.map +1 -0
- package/dist/controls/index.d.ts +2 -0
- package/dist/controls/index.d.ts.map +1 -0
- package/dist/controls/index.js +15 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +8 -8
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/theme.d.ts +1 -1
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/timeOption.d.ts +2 -1
- package/dist/model/timeOption.d.ts.map +1 -1
- package/dist/model/timeOption.js +13 -2
- package/dist/model/timeOption.js.map +1 -1
- package/dist/test/render.d.ts +3 -3
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/theme/component-overrides/alert.js +4 -4
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/theme/component-overrides/paper.js +1 -1
- package/dist/theme/component-overrides/paper.js.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.d.ts.map +1 -1
- package/dist/theme/palette/background.js +2 -0
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/types.d.ts +1 -1
- package/dist/theme/palette/colors/types.d.ts.map +1 -1
- package/dist/theme/palette/colors/types.js.map +1 -1
- package/dist/theme/theme.d.ts +2 -2
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +6 -6
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.js.map +1 -1
- package/dist/utils/axis.d.ts +1 -7
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +2 -3
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.d.ts.map +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.d.ts +10 -4
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +16 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.d.ts +1 -1
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +5 -7
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +13 -9
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +0 -10
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +0 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -12
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -80
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +0 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +0 -14
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +0 -67
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +0 -1
- package/dist/DateTimeRangePicker/index.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/index.js.map +0 -1
- package/dist/DateTimeRangePicker/utils.d.ts +0 -7
- package/dist/DateTimeRangePicker/utils.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/utils.js.map +0 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +0 -4
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +0 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +0 -1
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +0 -88
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +0 -80
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "TimeRangeSelector", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeRangeSelector;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _Calendar = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Calendar"));
|
|
26
|
+
const _core = require("@perses-dev/core");
|
|
27
|
+
const _react = require("react");
|
|
28
|
+
const _context = require("../context");
|
|
29
|
+
const _DateTimeRangePicker = require("./DateTimeRangePicker");
|
|
30
|
+
const _utils = require("./utils");
|
|
31
|
+
function _interop_require_default(obj) {
|
|
32
|
+
return obj && obj.__esModule ? obj : {
|
|
33
|
+
default: obj
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTimeRange = true }) {
|
|
37
|
+
const { timeZone } = (0, _context.useTimeZone)();
|
|
38
|
+
const anchorEl = (0, _react.useRef)(); // Used to position the absolute time range picker
|
|
39
|
+
// Control the open state of the absolute time range picker
|
|
40
|
+
const [showCustomDateSelector, setShowCustomDateSelector] = (0, _react.useState)(false);
|
|
41
|
+
// Build the initial value of the absolute time range picker
|
|
42
|
+
const convertedTimeRange = (0, _react.useMemo)(()=>{
|
|
43
|
+
return (0, _core.isRelativeTimeRange)(value) ? (0, _core.toAbsoluteTimeRange)(value) : value;
|
|
44
|
+
}, [
|
|
45
|
+
value
|
|
46
|
+
]);
|
|
47
|
+
// Last option is the absolute time range option (custom)
|
|
48
|
+
// If the value is an absolute time range, we display this time range
|
|
49
|
+
// If the value is a relative time range, we make a default CustomTimeOption built from undefined value
|
|
50
|
+
const lastOption = (0, _react.useMemo)(()=>(0, _utils.buildCustomTimeOption)((0, _core.isRelativeTimeRange)(value) ? undefined : value, timeZone), [
|
|
51
|
+
value,
|
|
52
|
+
timeZone
|
|
53
|
+
]);
|
|
54
|
+
// Control the open state of the select component to prevent the menu from closing when the custom date picker is
|
|
55
|
+
// opened.
|
|
56
|
+
//
|
|
57
|
+
// Note that the value state of the select is here for display only. The real value (the one from props) is managed
|
|
58
|
+
// by click events on each menu item.
|
|
59
|
+
// This is a trick to get around the limitation of select with menu item that doesn't support objects as value...
|
|
60
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
61
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
64
|
+
anchorEl: anchorEl.current,
|
|
65
|
+
anchorOrigin: {
|
|
66
|
+
vertical: 'bottom',
|
|
67
|
+
horizontal: 'center'
|
|
68
|
+
},
|
|
69
|
+
open: showCustomDateSelector,
|
|
70
|
+
onClose: ()=>setShowCustomDateSelector(false),
|
|
71
|
+
sx: (theme)=>({
|
|
72
|
+
padding: theme.spacing(2)
|
|
73
|
+
}),
|
|
74
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DateTimeRangePicker.DateTimeRangePicker, {
|
|
75
|
+
initialTimeRange: convertedTimeRange,
|
|
76
|
+
onChange: (value)=>{
|
|
77
|
+
onChange(value);
|
|
78
|
+
setShowCustomDateSelector(false);
|
|
79
|
+
setOpen(false);
|
|
80
|
+
},
|
|
81
|
+
onCancel: ()=>setShowCustomDateSelector(false)
|
|
82
|
+
})
|
|
83
|
+
}),
|
|
84
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
85
|
+
ref: anchorEl,
|
|
86
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Select, {
|
|
87
|
+
open: open,
|
|
88
|
+
value: (0, _utils.formatTimeRange)(value, timeZone),
|
|
89
|
+
onClick: ()=>setOpen(!open),
|
|
90
|
+
IconComponent: _Calendar.default,
|
|
91
|
+
inputProps: {
|
|
92
|
+
'aria-label': `Select time range. Currently set to ${value}`
|
|
93
|
+
},
|
|
94
|
+
sx: {
|
|
95
|
+
// `transform: none` prevents calendar icon from flipping over when menu is open
|
|
96
|
+
'.MuiSelect-icon': {
|
|
97
|
+
marginTop: '1px',
|
|
98
|
+
transform: 'none'
|
|
99
|
+
},
|
|
100
|
+
// paddingRight creates more space for the calendar icon (it's a bigger icon)
|
|
101
|
+
'.MuiSelect-select.MuiSelect-outlined.MuiInputBase-input': {
|
|
102
|
+
paddingRight: '36px'
|
|
103
|
+
},
|
|
104
|
+
'.MuiSelect-select': height ? {
|
|
105
|
+
lineHeight: height,
|
|
106
|
+
paddingY: 0
|
|
107
|
+
} : {}
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
timeOptions.map((item, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
111
|
+
value: (0, _utils.formatTimeRange)(item.value, timeZone),
|
|
112
|
+
onClick: ()=>{
|
|
113
|
+
onChange(item.value);
|
|
114
|
+
},
|
|
115
|
+
children: item.display
|
|
116
|
+
}, idx)),
|
|
117
|
+
showCustomTimeRange && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
118
|
+
value: (0, _utils.formatTimeRange)(lastOption.value, timeZone),
|
|
119
|
+
onClick: ()=>setShowCustomDateSelector(true),
|
|
120
|
+
children: lastOption.display
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
_export_star(require("./DateTimeRangePicker"), exports);
|
|
18
17
|
_export_star(require("./TimeRangeSelector"), exports);
|
|
19
|
-
_export_star(require("./
|
|
18
|
+
_export_star(require("./DateTimeRangePicker"), exports);
|
|
20
19
|
function _export_star(from, to) {
|
|
21
20
|
Object.keys(from).forEach(function(k) {
|
|
22
21
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -21,15 +21,32 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
DATE_TIME_FORMAT: function() {
|
|
25
|
+
return DATE_TIME_FORMAT;
|
|
26
|
+
},
|
|
27
|
+
buildCustomTimeOption: function() {
|
|
28
|
+
return buildCustomTimeOption;
|
|
26
29
|
},
|
|
27
30
|
formatAbsoluteRange: function() {
|
|
28
31
|
return formatAbsoluteRange;
|
|
32
|
+
},
|
|
33
|
+
formatTimeRange: function() {
|
|
34
|
+
return formatTimeRange;
|
|
35
|
+
},
|
|
36
|
+
validateDateRange: function() {
|
|
37
|
+
return validateDateRange;
|
|
29
38
|
}
|
|
30
39
|
});
|
|
31
40
|
const _datefns = require("date-fns");
|
|
41
|
+
const _core = require("@perses-dev/core");
|
|
32
42
|
const _utils = require("../utils");
|
|
43
|
+
const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
|
|
44
|
+
function buildCustomTimeOption(value, timeZone) {
|
|
45
|
+
return {
|
|
46
|
+
value,
|
|
47
|
+
display: formatTimeRange(value, timeZone)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
33
50
|
function validateDateRange(startDate, endDate) {
|
|
34
51
|
// TODO: display error as helperText
|
|
35
52
|
if (!(0, _datefns.isValid)(startDate) || !(0, _datefns.isValid)(endDate)) {
|
|
@@ -47,3 +64,9 @@ function formatAbsoluteRange(timeRange, dateFormat, timeZone) {
|
|
|
47
64
|
const formattedEnd = (0, _utils.formatWithTimeZone)(timeRange.end, dateFormat, timeZone);
|
|
48
65
|
return `${formattedStart} - ${formattedEnd}`;
|
|
49
66
|
}
|
|
67
|
+
function formatTimeRange(value, timeZone) {
|
|
68
|
+
if (!value) {
|
|
69
|
+
return 'Custom Time Range';
|
|
70
|
+
}
|
|
71
|
+
return !(0, _core.isRelativeTimeRange)(value) ? formatAbsoluteRange(value, DATE_TIME_FORMAT, timeZone) : value.pastDuration;
|
|
72
|
+
}
|
|
@@ -34,18 +34,17 @@ function _interop_require_default(obj) {
|
|
|
34
34
|
default: obj
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartTooltip({ chartRef
|
|
37
|
+
const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartTooltip({ chartRef, chartData, enablePinning = true, wrapLabels, format, onUnpinClick, pinnedPos, containerId }) {
|
|
38
38
|
const [showAllSeries, setShowAllSeries] = (0, _react.useState)(false);
|
|
39
39
|
const mousePos = (0, _tooltipmodel.useMousePosition)();
|
|
40
|
-
const { height
|
|
40
|
+
const { height, width, ref: tooltipRef } = (0, _useresizeobserver.default)();
|
|
41
41
|
const transform = (0, _react.useRef)();
|
|
42
42
|
const isTooltipPinned = pinnedPos !== null && enablePinning;
|
|
43
43
|
if (mousePos === null || mousePos.target === null) return null;
|
|
44
44
|
// Ensure user is hovering over a chart before checking for nearby series.
|
|
45
45
|
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
46
46
|
const chart = chartRef.current;
|
|
47
|
-
|
|
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
|
+
const chartWidth = chart?.getWidth() ?? _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
49
48
|
// Get series nearby the cursor and pass into tooltip content children.
|
|
50
49
|
const nearbySeries = (0, _nearbyseries.legacyGetNearbySeriesData)({
|
|
51
50
|
mousePos,
|
|
@@ -63,24 +62,21 @@ const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartToolti
|
|
|
63
62
|
// if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
|
|
64
63
|
const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
|
|
65
64
|
if (!isTooltipPinned) {
|
|
66
|
-
transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height
|
|
65
|
+
transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);
|
|
67
66
|
}
|
|
68
|
-
var _theme_palette_designSystem_grey_;
|
|
69
67
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Portal, {
|
|
70
68
|
container: containerElement,
|
|
71
69
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
72
70
|
ref: tooltipRef,
|
|
73
|
-
sx: (theme)=>{
|
|
74
|
-
var _theme_palette_designSystem;
|
|
75
|
-
return {
|
|
71
|
+
sx: (theme)=>({
|
|
76
72
|
minWidth: _tooltipmodel.TOOLTIP_MIN_WIDTH,
|
|
77
73
|
maxWidth: _tooltipmodel.TOOLTIP_MAX_WIDTH,
|
|
78
|
-
maxHeight: maxHeight
|
|
74
|
+
maxHeight: maxHeight ?? _tooltipmodel.TOOLTIP_MAX_HEIGHT,
|
|
79
75
|
padding: 0,
|
|
80
76
|
position: 'absolute',
|
|
81
77
|
top: 0,
|
|
82
78
|
left: 0,
|
|
83
|
-
backgroundColor:
|
|
79
|
+
backgroundColor: theme.palette.designSystem?.grey[800] ?? _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
|
|
84
80
|
borderRadius: '6px',
|
|
85
81
|
color: '#fff',
|
|
86
82
|
fontSize: '11px',
|
|
@@ -93,8 +89,7 @@ const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartToolti
|
|
|
93
89
|
'&:hover': {
|
|
94
90
|
overflowY: 'auto'
|
|
95
91
|
}
|
|
96
|
-
}
|
|
97
|
-
},
|
|
92
|
+
}),
|
|
98
93
|
style: {
|
|
99
94
|
transform: transform.current,
|
|
100
95
|
display: transform.current ? 'block' : 'none'
|
|
@@ -26,13 +26,12 @@ const _SeriesMarker = require("./SeriesMarker");
|
|
|
26
26
|
const _SeriesLabelsStack = require("./SeriesLabelsStack");
|
|
27
27
|
const _tooltipmodel = require("./tooltip-model");
|
|
28
28
|
function SeriesInfo(props) {
|
|
29
|
-
const { seriesName
|
|
29
|
+
const { seriesName, formattedY, markerColor, totalSeries, emphasizeText = false, wrapLabels = true } = props;
|
|
30
30
|
// metric __name__ comes before opening curly brace, ignore if not populated
|
|
31
31
|
// ex with metric name: node_load15{env="demo",job="node"}
|
|
32
32
|
// ex without metric name: {env="demo",job="node"}
|
|
33
33
|
const splitName = seriesName.split('{');
|
|
34
|
-
|
|
35
|
-
const seriesLabels = (_splitName_ = splitName[1]) !== null && _splitName_ !== void 0 ? _splitName_ : seriesName;
|
|
34
|
+
const seriesLabels = splitName[1] ?? seriesName;
|
|
36
35
|
// remove curly braces that wrap labels
|
|
37
36
|
const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');
|
|
38
37
|
// determine whether to show labels on separate lines
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _SeriesMarker = require("./SeriesMarker");
|
|
26
26
|
function SeriesLabelsStack(props) {
|
|
27
|
-
const { formattedY
|
|
27
|
+
const { formattedY, markerColor, metricName, metricLabels } = props;
|
|
28
28
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
29
29
|
spacing: 0.5,
|
|
30
30
|
children: [
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _utils = require("../utils");
|
|
26
26
|
function SeriesMarker(props) {
|
|
27
|
-
const { markerColor
|
|
27
|
+
const { markerColor, sx } = props;
|
|
28
28
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
29
29
|
sx: (0, _utils.combineSx)({
|
|
30
30
|
display: 'inline-block',
|
|
@@ -34,23 +34,22 @@ function _interop_require_default(obj) {
|
|
|
34
34
|
default: obj
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartTooltip({ containerId
|
|
37
|
+
const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartTooltip({ containerId, chartRef, data, seriesMapping, enablePinning = true, wrapLabels, format, onUnpinClick, pinnedPos }) {
|
|
38
38
|
const [showAllSeries, setShowAllSeries] = (0, _react.useState)(false);
|
|
39
39
|
const transform = (0, _react.useRef)();
|
|
40
40
|
const mousePos = (0, _tooltipmodel.useMousePosition)();
|
|
41
|
-
const { height
|
|
41
|
+
const { height, width, ref: tooltipRef } = (0, _useresizeobserver.default)();
|
|
42
42
|
const isTooltipPinned = pinnedPos !== null && enablePinning;
|
|
43
43
|
if (mousePos === null || mousePos.target === null || data === null) return null;
|
|
44
44
|
// Ensure user is hovering over a chart before checking for nearby series.
|
|
45
45
|
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
46
46
|
const chart = chartRef.current;
|
|
47
|
-
|
|
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
|
+
const chartWidth = chart?.getWidth() ?? _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
49
48
|
const containerElement = containerId ? document.querySelector(containerId) : undefined;
|
|
50
49
|
// if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
|
|
51
50
|
const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
|
|
52
51
|
if (!isTooltipPinned) {
|
|
53
|
-
transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height
|
|
52
|
+
transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);
|
|
54
53
|
}
|
|
55
54
|
// Get series nearby the cursor and pass into tooltip content children.
|
|
56
55
|
const nearbySeries = (0, _nearbyseries.getNearbySeriesData)({
|
|
@@ -25,7 +25,7 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _SeriesInfo = require("./SeriesInfo");
|
|
27
27
|
function TooltipContent(props) {
|
|
28
|
-
const { series
|
|
28
|
+
const { series, wrapLabels } = props;
|
|
29
29
|
const sortedFocusedSeries = (0, _react.useMemo)(()=>{
|
|
30
30
|
if (series === null) return null;
|
|
31
31
|
return series.sort((a, b)=>a.y > b.y ? -1 : 1);
|
|
@@ -41,7 +41,7 @@ function TooltipContent(props) {
|
|
|
41
41
|
display: 'table',
|
|
42
42
|
padding: theme.spacing(0.5, 2)
|
|
43
43
|
}),
|
|
44
|
-
children: sortedFocusedSeries.map(({ datumIdx
|
|
44
|
+
children: sortedFocusedSeries.map(({ datumIdx, seriesIdx, seriesName, y, formattedY, markerColor, isClosestToCursor })=>{
|
|
45
45
|
if (datumIdx === null || seriesIdx === null) return null;
|
|
46
46
|
const key = seriesIdx.toString() + datumIdx.toString();
|
|
47
47
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_SeriesInfo.SeriesInfo, {
|
|
@@ -25,24 +25,20 @@ const _material = require("@mui/material");
|
|
|
25
25
|
const _Pin = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Pin"));
|
|
26
26
|
const _PinOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PinOutline"));
|
|
27
27
|
const _react = require("react");
|
|
28
|
-
const
|
|
28
|
+
const _utils = require("../utils");
|
|
29
29
|
const _tooltipmodel = require("./tooltip-model");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
32
32
|
default: obj
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ nearbySeries
|
|
36
|
-
|
|
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;
|
|
35
|
+
const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ nearbySeries, totalSeries, isTooltipPinned, showAllSeries, enablePinning = true, onShowAllClick, onUnpinClick }) {
|
|
36
|
+
const seriesTimeMs = nearbySeries[0]?.date ?? null;
|
|
39
37
|
if (seriesTimeMs === null) {
|
|
40
38
|
return null;
|
|
41
39
|
}
|
|
42
40
|
const formatTimeSeriesHeader = (timeMs)=>{
|
|
43
|
-
const
|
|
44
|
-
const formattedDate = (0, _datefns.format)(date, 'MMM dd, yyyy - ');
|
|
45
|
-
const formattedTime = (0, _datefns.format)(date, 'HH:mm:ss');
|
|
41
|
+
const { formattedTime, formattedDate } = (0, _utils.getDateAndTime)(timeMs);
|
|
46
42
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
47
43
|
children: [
|
|
48
44
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
@@ -64,20 +60,16 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
|
|
|
64
60
|
// TODO: accurately calc whether more series are outside scrollable region using yBuffer, avg series name length, TOOLTIP_MAX_HEIGHT
|
|
65
61
|
const showAllSeriesToggle = enablePinning && totalSeries > 5;
|
|
66
62
|
const pinTooltipHelpText = isTooltipPinned ? _tooltipmodel.UNPIN_TOOLTIP_HELP_TEXT : _tooltipmodel.PIN_TOOLTIP_HELP_TEXT;
|
|
67
|
-
var _theme_palette_designSystem_grey_;
|
|
68
63
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
69
|
-
sx: (theme)=>{
|
|
70
|
-
var _theme_palette_designSystem;
|
|
71
|
-
return {
|
|
64
|
+
sx: (theme)=>({
|
|
72
65
|
width: '100%',
|
|
73
66
|
maxWidth: _tooltipmodel.TOOLTIP_MAX_WIDTH,
|
|
74
67
|
padding: theme.spacing(1.5, 2, 0.5, 2),
|
|
75
|
-
backgroundColor:
|
|
68
|
+
backgroundColor: theme.palette.designSystem?.grey[800] ?? _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
|
|
76
69
|
position: 'sticky',
|
|
77
70
|
top: 0,
|
|
78
71
|
left: 0
|
|
79
|
-
}
|
|
80
|
-
},
|
|
72
|
+
}),
|
|
81
73
|
children: [
|
|
82
74
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
83
75
|
sx: {
|
|
@@ -21,32 +21,32 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
INCREASE_NEARBY_SERIES_MULTIPLIER: function() {
|
|
25
|
-
return INCREASE_NEARBY_SERIES_MULTIPLIER;
|
|
26
|
-
},
|
|
27
24
|
DYNAMIC_NEARBY_SERIES_MULTIPLIER: function() {
|
|
28
25
|
return DYNAMIC_NEARBY_SERIES_MULTIPLIER;
|
|
29
26
|
},
|
|
27
|
+
INCREASE_NEARBY_SERIES_MULTIPLIER: function() {
|
|
28
|
+
return INCREASE_NEARBY_SERIES_MULTIPLIER;
|
|
29
|
+
},
|
|
30
30
|
SHOW_FEWER_SERIES_LIMIT: function() {
|
|
31
31
|
return SHOW_FEWER_SERIES_LIMIT;
|
|
32
32
|
},
|
|
33
33
|
checkforNearbyTimeSeries: function() {
|
|
34
34
|
return checkforNearbyTimeSeries;
|
|
35
35
|
},
|
|
36
|
-
legacyCheckforNearbySeries: function() {
|
|
37
|
-
return legacyCheckforNearbySeries;
|
|
38
|
-
},
|
|
39
36
|
getNearbySeriesData: function() {
|
|
40
37
|
return getNearbySeriesData;
|
|
41
38
|
},
|
|
42
|
-
|
|
43
|
-
return
|
|
39
|
+
getYBuffer: function() {
|
|
40
|
+
return getYBuffer;
|
|
44
41
|
},
|
|
45
42
|
isWithinPercentageRange: function() {
|
|
46
43
|
return isWithinPercentageRange;
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
45
|
+
legacyCheckforNearbySeries: function() {
|
|
46
|
+
return legacyCheckforNearbySeries;
|
|
47
|
+
},
|
|
48
|
+
legacyGetNearbySeriesData: function() {
|
|
49
|
+
return legacyGetNearbySeriesData;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
const _core = require("@perses-dev/core");
|
|
@@ -57,12 +57,9 @@ const INCREASE_NEARBY_SERIES_MULTIPLIER = 5.5; // adjusts how many series show i
|
|
|
57
57
|
const DYNAMIC_NEARBY_SERIES_MULTIPLIER = 30; // used for adjustment after series number divisor
|
|
58
58
|
const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
59
59
|
function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format) {
|
|
60
|
-
var _data_;
|
|
61
60
|
const currentNearbySeriesData = [];
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
var _pointInGrid_1;
|
|
65
|
-
const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
|
|
61
|
+
const cursorX = pointInGrid[0] ?? null;
|
|
62
|
+
const cursorY = pointInGrid[1] ?? null;
|
|
66
63
|
if (cursorX === null || cursorY === null) return currentNearbySeriesData;
|
|
67
64
|
if (chart.dispatchAction === undefined) return currentNearbySeriesData;
|
|
68
65
|
if (!Array.isArray(data)) return currentNearbySeriesData;
|
|
@@ -74,7 +71,7 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
74
71
|
const totalSeries = data.length;
|
|
75
72
|
const yValueCounts = new Map();
|
|
76
73
|
// Only need to loop through first dataset source since getCommonTimeScale ensures xAxis timestamps are consistent
|
|
77
|
-
const firstTimeSeriesValues =
|
|
74
|
+
const firstTimeSeriesValues = data[0]?.values;
|
|
78
75
|
const closestTimestamp = (0, _utils.getClosestTimestamp)(firstTimeSeriesValues, cursorX);
|
|
79
76
|
if (closestTimestamp === null) {
|
|
80
77
|
return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
@@ -82,15 +79,14 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
82
79
|
// find the timestamp with data that is closest to cursorX
|
|
83
80
|
for(let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++){
|
|
84
81
|
const currentSeries = seriesMapping[seriesIdx];
|
|
85
|
-
if (currentSeries
|
|
82
|
+
if (!currentSeries) break;
|
|
86
83
|
const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;
|
|
87
|
-
if (currentDataset
|
|
84
|
+
if (!currentDataset) break;
|
|
88
85
|
const currentDatasetValues = currentDataset.values;
|
|
89
86
|
if (currentDatasetValues === undefined || !Array.isArray(currentDatasetValues)) break;
|
|
90
87
|
const lineSeries = currentSeries;
|
|
91
88
|
const currentSeriesName = lineSeries.name ? lineSeries.name.toString() : '';
|
|
92
|
-
|
|
93
|
-
const markerColor = (_lineSeries_color = lineSeries.color) !== null && _lineSeries_color !== void 0 ? _lineSeries_color : '#000';
|
|
89
|
+
const markerColor = lineSeries.color ?? '#000';
|
|
94
90
|
if (Array.isArray(data)) {
|
|
95
91
|
for(let datumIdx = 0; datumIdx < currentDatasetValues.length; datumIdx++){
|
|
96
92
|
const nearbyTimeSeries = currentDatasetValues[datumIdx];
|
|
@@ -112,10 +108,9 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
112
108
|
if (isClosestToCursor) {
|
|
113
109
|
// shows as bold in tooltip, customize 'emphasis' options in getTimeSeries util
|
|
114
110
|
emphasizedSeriesIndexes.push(seriesIdx);
|
|
115
|
-
var _yValueCounts_get;
|
|
116
111
|
// Used to determine which datapoint to apply select styles to.
|
|
117
112
|
// Accounts for cases where lines may be rendered directly on top of eachother.
|
|
118
|
-
const duplicateValuesCount =
|
|
113
|
+
const duplicateValuesCount = yValueCounts.get(yValue) ?? 0;
|
|
119
114
|
yValueCounts.set(yValue, duplicateValuesCount + 1);
|
|
120
115
|
if (duplicateValuesCount > 0) {
|
|
121
116
|
duplicateDatapoints.push({
|
|
@@ -164,10 +159,8 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
164
159
|
}
|
|
165
160
|
function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
166
161
|
const currentNearbySeriesData = [];
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
var _pointInGrid_1;
|
|
170
|
-
const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
|
|
162
|
+
const cursorX = pointInGrid[0] ?? null;
|
|
163
|
+
const cursorY = pointInGrid[1] ?? null;
|
|
171
164
|
if (cursorX === null || cursorY === null) {
|
|
172
165
|
return currentNearbySeriesData;
|
|
173
166
|
}
|
|
@@ -181,12 +174,10 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
|
181
174
|
if (currentSeries === undefined) break;
|
|
182
175
|
if (currentNearbySeriesData.length >= _model.OPTIMIZED_MODE_SERIES_LIMIT) break;
|
|
183
176
|
const currentSeriesName = currentSeries.name ? currentSeries.name.toString() : '';
|
|
184
|
-
|
|
185
|
-
const markerColor = (_currentSeries_color = currentSeries.color) !== null && _currentSeries_color !== void 0 ? _currentSeries_color : '#000';
|
|
177
|
+
const markerColor = currentSeries.color ?? '#000';
|
|
186
178
|
if (Array.isArray(currentSeries.data)) {
|
|
187
179
|
for(let datumIdx = 0; datumIdx < currentSeries.data.length; datumIdx++){
|
|
188
|
-
|
|
189
|
-
const xValue = (_data_xAxis_datumIdx = data.xAxis[datumIdx]) !== null && _data_xAxis_datumIdx !== void 0 ? _data_xAxis_datumIdx : 0;
|
|
180
|
+
const xValue = data.xAxis[datumIdx] ?? 0;
|
|
190
181
|
const yValue = currentSeries.data[datumIdx];
|
|
191
182
|
// ensure null values not displayed in tooltip
|
|
192
183
|
if (yValue !== undefined && yValue !== null && cursorX === datumIdx) {
|
|
@@ -204,7 +195,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
|
204
195
|
} else {
|
|
205
196
|
nonEmphasizedSeriesIndexes.push(seriesIdx);
|
|
206
197
|
// ensure series not close to cursor are not highlighted
|
|
207
|
-
if (
|
|
198
|
+
if (chart?.dispatchAction !== undefined) {
|
|
208
199
|
chart.dispatchAction({
|
|
209
200
|
type: 'downplay',
|
|
210
201
|
seriesIndex: seriesIdx
|
|
@@ -232,7 +223,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
|
232
223
|
}
|
|
233
224
|
}
|
|
234
225
|
}
|
|
235
|
-
if (
|
|
226
|
+
if (chart?.dispatchAction !== undefined) {
|
|
236
227
|
// Clears emphasis state of all lines that are not emphasized.
|
|
237
228
|
// Emphasized is a subset of just the nearby series that are closest to cursor.
|
|
238
229
|
chart.dispatchAction({
|
|
@@ -260,7 +251,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
|
260
251
|
}
|
|
261
252
|
return currentNearbySeriesData;
|
|
262
253
|
}
|
|
263
|
-
function getNearbySeriesData({ mousePos
|
|
254
|
+
function getNearbySeriesData({ mousePos, pinnedPos, data, seriesMapping, chart, format, showAllSeries = false }) {
|
|
264
255
|
if (chart === undefined || mousePos === null) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
265
256
|
// prevents multiple tooltips showing from adjacent charts unless tooltip is pinned
|
|
266
257
|
let cursorTargetMatchesChart = false;
|
|
@@ -299,7 +290,7 @@ function getNearbySeriesData({ mousePos , pinnedPos , data , seriesMapping , cha
|
|
|
299
290
|
// no nearby series found
|
|
300
291
|
return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
301
292
|
}
|
|
302
|
-
function legacyGetNearbySeriesData({ mousePos
|
|
293
|
+
function legacyGetNearbySeriesData({ mousePos, pinnedPos, chartData, chart, format, showAllSeries = false }) {
|
|
303
294
|
if (chart === undefined || mousePos === null) return [];
|
|
304
295
|
// prevents multiple tooltips showing from adjacent charts unless tooltip is pinned
|
|
305
296
|
let cursorTargetMatchesChart = false;
|
|
@@ -330,10 +321,9 @@ function legacyGetNearbySeriesData({ mousePos , pinnedPos , chartData , chart ,
|
|
|
330
321
|
totalSeries,
|
|
331
322
|
showAllSeries
|
|
332
323
|
});
|
|
333
|
-
var _mousePos_plotCanvas_x, _mousePos_plotCanvas_y;
|
|
334
324
|
const pointInPixel = [
|
|
335
|
-
|
|
336
|
-
|
|
325
|
+
mousePos.plotCanvas.x ?? 0,
|
|
326
|
+
mousePos.plotCanvas.y ?? 0
|
|
337
327
|
];
|
|
338
328
|
if (chart.containPixel('grid', pointInPixel)) {
|
|
339
329
|
const pointInGrid = chart.convertFromPixel('grid', pointInPixel);
|
|
@@ -343,13 +333,13 @@ function legacyGetNearbySeriesData({ mousePos , pinnedPos , chartData , chart ,
|
|
|
343
333
|
}
|
|
344
334
|
return [];
|
|
345
335
|
}
|
|
346
|
-
function isWithinPercentageRange({ valueToCheck
|
|
336
|
+
function isWithinPercentageRange({ valueToCheck, baseValue, percentage }) {
|
|
347
337
|
const range = percentage / 100 * baseValue;
|
|
348
338
|
const lowerBound = baseValue - range;
|
|
349
339
|
const upperBound = baseValue + range;
|
|
350
340
|
return valueToCheck >= lowerBound && valueToCheck <= upperBound;
|
|
351
341
|
}
|
|
352
|
-
function getYBuffer({ yInterval
|
|
342
|
+
function getYBuffer({ yInterval, totalSeries, showAllSeries = false }) {
|
|
353
343
|
if (showAllSeries) {
|
|
354
344
|
return yInterval * 10; // roughly correlates with grid so entire canvas is searched
|
|
355
345
|
}
|