@perses-dev/components 0.53.0-rc.0 → 0.53.0-rc.2
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.js +1 -1
- package/dist/AlignSelector/AlignSelector.js.map +1 -1
- package/dist/AlignSelector/index.js +1 -1
- package/dist/AlignSelector/index.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +1 -1
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.js +1 -1
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/index.js +1 -1
- package/dist/ContentWithLegend/index.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.js +1 -1
- package/dist/DensitySelector/DensitySelector.js.map +1 -1
- package/dist/DensitySelector/index.js +1 -1
- package/dist/DensitySelector/index.js.map +1 -1
- package/dist/Dialog/Dialog.js +1 -1
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js +1 -1
- package/dist/Dialog/index.js.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.js +1 -1
- package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
- package/dist/DragAndDrop/DragButton.js +1 -1
- package/dist/DragAndDrop/DragButton.js.map +1 -1
- package/dist/DragAndDrop/DropIndicator.js +1 -1
- package/dist/DragAndDrop/DropIndicator.js.map +1 -1
- package/dist/DragAndDrop/index.js +1 -1
- package/dist/DragAndDrop/index.js.map +1 -1
- package/dist/DragAndDrop/model.js +1 -1
- package/dist/DragAndDrop/model.js.map +1 -1
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/EChart/EChart.js +1 -1
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js +1 -1
- package/dist/EChart/index.js.map +1 -1
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FontSizeSelector/index.js +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormEditor/FormActions.js +1 -1
- package/dist/FormEditor/FormActions.js.map +1 -1
- package/dist/FormEditor/index.js +1 -1
- package/dist/FormEditor/index.js.map +1 -1
- package/dist/FormatControls/FormatControls.d.ts.map +1 -1
- package/dist/FormatControls/FormatControls.js +10 -23
- package/dist/FormatControls/FormatControls.js.map +1 -1
- package/dist/FormatControls/UnitSelector.d.ts +9 -0
- package/dist/FormatControls/UnitSelector.d.ts.map +1 -0
- package/dist/FormatControls/UnitSelector.js +47 -0
- package/dist/FormatControls/UnitSelector.js.map +1 -0
- package/dist/FormatControls/index.d.ts +1 -0
- package/dist/FormatControls/index.d.ts.map +1 -1
- package/dist/FormatControls/index.js +2 -1
- package/dist/FormatControls/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +1 -1
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.js +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.js +1 -1
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +1 -1
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.js +1 -1
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/Legend/legend-model.js +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LinksEditor/LinkEditorForm.js +1 -1
- package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
- package/dist/LinksEditor/LinksEditor.js +1 -1
- package/dist/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/LinksEditor/index.js +1 -1
- package/dist/LinksEditor/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.js +1 -1
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/ModeSelector/index.js +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +5 -2
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/Overlay/Overlay.js +1 -1
- package/dist/Overlay/Overlay.js.map +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Overlay/index.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RefreshIntervalPicker/index.js +1 -1
- package/dist/RefreshIntervalPicker/index.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +16 -3
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SettingsAutocomplete/index.js +1 -1
- package/dist/SettingsAutocomplete/index.js.map +1 -1
- package/dist/SortSelector/SortSelector.js +1 -1
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/SortSelectorButtons.js +1 -1
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
- package/dist/SortSelector/index.js +1 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/Table/InnerTable.js +1 -1
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +31 -7
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.js +1 -1
- package/dist/Table/TableBody.js.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 +27 -5
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.js +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableFoot.js +1 -1
- package/dist/Table/TableFoot.js.map +1 -1
- package/dist/Table/TableHead.js +1 -1
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.js +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.js +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +19 -3
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js +1 -1
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.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 +16 -6
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +4 -3
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/ThresholdsEditor/index.js +1 -1
- package/dist/ThresholdsEditor/index.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +2 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js +21 -33
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +6 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js +140 -19
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
- package/dist/TimeRangeSelector/index.js +1 -1
- package/dist/TimeRangeSelector/index.js.map +1 -1
- package/dist/TimeRangeSelector/utils.js +1 -1
- package/dist/TimeRangeSelector/utils.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +4 -0
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +3 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -3
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js +1 -1
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +3 -14
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +80 -58
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +1 -1
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/TimeZoneSelector.d.ts +16 -0
- package/dist/TimeZoneSelector.d.ts.map +1 -0
- package/dist/TimeZoneSelector.js +58 -0
- package/dist/TimeZoneSelector.js.map +1 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/ToolbarIconButton/index.js +1 -1
- package/dist/ToolbarIconButton/index.js.map +1 -1
- package/dist/TransformsEditor/TransformEditor.js +1 -1
- package/dist/TransformsEditor/TransformEditor.js.map +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.js +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
- package/dist/TransformsEditor/TransformsEditor.js +1 -1
- package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
- package/dist/TransformsEditor/index.js +1 -1
- package/dist/TransformsEditor/index.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js +1 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.js +1 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
- package/dist/ValueMappingEditor/index.js +1 -1
- package/dist/ValueMappingEditor/index.js.map +1 -1
- package/dist/YAxisLabel.js +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/AlignSelector/AlignSelector.js +1 -1
- package/dist/cjs/AlignSelector/index.js +1 -1
- package/dist/cjs/ColorPicker/ColorPicker.js +1 -1
- package/dist/cjs/ColorPicker/OptionsColorPicker.js +1 -1
- package/dist/cjs/ColorPicker/index.js +1 -1
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +1 -1
- package/dist/cjs/ContentWithLegend/index.js +1 -1
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +1 -1
- package/dist/cjs/DensitySelector/DensitySelector.js +1 -1
- package/dist/cjs/DensitySelector/index.js +1 -1
- package/dist/cjs/Dialog/Dialog.js +1 -1
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/Dialog/index.js +1 -1
- package/dist/cjs/DragAndDrop/DragAndDropList.js +1 -1
- package/dist/cjs/DragAndDrop/DragButton.js +1 -1
- package/dist/cjs/DragAndDrop/DropIndicator.js +1 -1
- package/dist/cjs/DragAndDrop/index.js +1 -1
- package/dist/cjs/DragAndDrop/model.js +1 -1
- package/dist/cjs/Drawer/Drawer.js +1 -1
- package/dist/cjs/Drawer/index.js +1 -1
- package/dist/cjs/EChart/EChart.js +1 -1
- package/dist/cjs/EChart/index.js +1 -1
- package/dist/cjs/ErrorAlert.js +1 -1
- package/dist/cjs/ErrorBoundary.js +1 -1
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +1 -1
- package/dist/cjs/FontSizeSelector/index.js +1 -1
- package/dist/cjs/FormEditor/FormActions.js +1 -1
- package/dist/cjs/FormEditor/index.js +1 -1
- package/dist/cjs/FormatControls/FormatControls.js +9 -22
- package/dist/cjs/FormatControls/UnitSelector.js +55 -0
- package/dist/cjs/FormatControls/index.js +2 -1
- package/dist/cjs/InfoTooltip/InfoTooltip.js +1 -1
- package/dist/cjs/InfoTooltip/index.js +1 -1
- package/dist/cjs/JSONEditor.js +1 -1
- package/dist/cjs/Legend/CompactLegend.js +1 -1
- package/dist/cjs/Legend/Legend.js +1 -1
- package/dist/cjs/Legend/LegendColorBadge.js +1 -1
- package/dist/cjs/Legend/ListLegend.js +1 -1
- package/dist/cjs/Legend/ListLegendItem.js +1 -1
- package/dist/cjs/Legend/TableLegend.js +1 -1
- package/dist/cjs/Legend/index.js +1 -1
- package/dist/cjs/Legend/legend-model.js +1 -1
- package/dist/cjs/LinksEditor/LinkEditorForm.js +1 -1
- package/dist/cjs/LinksEditor/LinksEditor.js +1 -1
- package/dist/cjs/LinksEditor/index.js +1 -1
- package/dist/cjs/ModeSelector/ModeSelector.js +1 -1
- package/dist/cjs/ModeSelector/index.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +5 -2
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/cjs/OptionsEditorLayout/index.js +1 -1
- package/dist/cjs/Overlay/Overlay.js +1 -1
- package/dist/cjs/Overlay/index.js +1 -1
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
- package/dist/cjs/RefreshIntervalPicker/index.js +1 -1
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +16 -3
- package/dist/cjs/SettingsAutocomplete/index.js +1 -1
- package/dist/cjs/SortSelector/SortSelector.js +1 -1
- package/dist/cjs/SortSelector/SortSelectorButtons.js +1 -1
- package/dist/cjs/SortSelector/index.js +1 -1
- package/dist/cjs/Table/InnerTable.js +1 -1
- package/dist/cjs/Table/Table.js +29 -5
- package/dist/cjs/Table/TableBody.js +1 -1
- package/dist/cjs/Table/TableCell.js +25 -3
- package/dist/cjs/Table/TableCheckbox.js +1 -1
- package/dist/cjs/Table/TableFoot.js +1 -1
- package/dist/cjs/Table/TableHead.js +1 -1
- package/dist/cjs/Table/TableHeaderCell.js +1 -1
- package/dist/cjs/Table/TableRow.js +1 -1
- package/dist/cjs/Table/VirtualizedTable.js +19 -3
- package/dist/cjs/Table/VirtualizedTableContainer.js +1 -1
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +1 -1
- package/dist/cjs/Table/index.js +1 -1
- package/dist/cjs/Table/model/table-model.js +4 -3
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +1 -1
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +1 -1
- package/dist/cjs/ThresholdsEditor/index.js +1 -1
- package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +20 -32
- package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +139 -18
- package/dist/cjs/TimeRangeSelector/index.js +1 -1
- package/dist/cjs/TimeRangeSelector/utils.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +3 -2
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +6 -3
- package/dist/cjs/TimeSeriesTooltip/index.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +80 -58
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/utils.js +1 -1
- package/dist/cjs/TimeZoneSelector.js +63 -0
- package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +1 -1
- package/dist/cjs/ToolbarIconButton/index.js +1 -1
- package/dist/cjs/TransformsEditor/TransformEditor.js +1 -1
- package/dist/cjs/TransformsEditor/TransformEditorContainer.js +1 -1
- package/dist/cjs/TransformsEditor/TransformsEditor.js +1 -1
- package/dist/cjs/TransformsEditor/index.js +1 -1
- package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +1 -1
- package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +1 -1
- package/dist/cjs/ValueMappingEditor/index.js +1 -1
- package/dist/cjs/YAxisLabel.js +1 -1
- package/dist/cjs/context/ChartsProvider.js +1 -1
- package/dist/cjs/context/ItemActionsProvider.js +111 -0
- package/dist/cjs/context/SelectionProvider.js +128 -0
- package/dist/cjs/context/SnackbarProvider.js +1 -1
- package/dist/cjs/context/TimeZoneProvider.js +1 -1
- package/dist/cjs/context/index.js +3 -1
- package/dist/cjs/controls/TextField.js +1 -1
- package/dist/cjs/controls/index.js +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/model/graph.js +1 -1
- package/dist/cjs/model/index.js +2 -1
- package/dist/cjs/model/theme.js +1 -1
- package/dist/cjs/model/timeOption.js +1 -1
- package/dist/cjs/model/timeZoneOption.js +34 -0
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test-utils/index.js +1 -1
- package/dist/cjs/test-utils/theme.js +1 -1
- package/dist/cjs/theme/component-overrides/alert.js +1 -1
- package/dist/cjs/theme/component-overrides/paper.js +1 -1
- package/dist/cjs/theme/index.js +1 -1
- package/dist/cjs/theme/palette/background.js +1 -1
- package/dist/cjs/theme/palette/colors/blue.js +1 -1
- package/dist/cjs/theme/palette/colors/common.js +1 -1
- package/dist/cjs/theme/palette/colors/green.js +1 -1
- package/dist/cjs/theme/palette/colors/grey.js +1 -1
- package/dist/cjs/theme/palette/colors/index.js +1 -1
- package/dist/cjs/theme/palette/colors/orange.js +1 -1
- package/dist/cjs/theme/palette/colors/purple.js +1 -1
- package/dist/cjs/theme/palette/colors/red.js +1 -1
- package/dist/cjs/theme/palette/colors/types.js +1 -1
- package/dist/cjs/theme/palette/error.js +1 -1
- package/dist/cjs/theme/palette/grey.js +1 -1
- package/dist/cjs/theme/palette/index.js +1 -1
- package/dist/cjs/theme/palette/palette-options.js +1 -1
- package/dist/cjs/theme/palette/primary.js +1 -1
- package/dist/cjs/theme/palette/secondary.js +1 -1
- package/dist/cjs/theme/palette/success.js +1 -1
- package/dist/cjs/theme/palette/text.js +1 -1
- package/dist/cjs/theme/palette/warning.js +1 -1
- package/dist/cjs/theme/theme.js +1 -1
- package/dist/cjs/theme/types/ThemeExtension.d.js +1 -1
- package/dist/cjs/theme/typography.js +1 -1
- package/dist/cjs/utils/axis.js +80 -5
- package/dist/cjs/utils/browser-storage.js +1 -1
- package/dist/cjs/utils/chart-actions.js +1 -1
- package/dist/cjs/utils/combine-sx.js +1 -1
- package/dist/cjs/utils/component-ids.js +1 -1
- package/dist/cjs/utils/data-field-interpolation.js +230 -0
- package/dist/cjs/utils/format.js +1 -1
- package/dist/cjs/utils/index.js +5 -2
- package/dist/cjs/utils/mathjs.js +1 -1
- package/dist/cjs/utils/memo.js +1 -1
- package/dist/cjs/utils/selection-interpolation.js +69 -0
- package/dist/cjs/utils/theme-gen.js +1 -1
- package/dist/cjs/utils/variable-interpolation.js +192 -0
- package/dist/context/ChartsProvider.js +1 -1
- package/dist/context/ChartsProvider.js.map +1 -1
- package/dist/context/ItemActionsProvider.d.ts +25 -0
- package/dist/context/ItemActionsProvider.d.ts.map +1 -0
- package/dist/context/ItemActionsProvider.js +95 -0
- package/dist/context/ItemActionsProvider.js.map +1 -0
- package/dist/context/SelectionProvider.d.ts +34 -0
- package/dist/context/SelectionProvider.d.ts.map +1 -0
- package/dist/context/SelectionProvider.js +120 -0
- package/dist/context/SelectionProvider.js.map +1 -0
- package/dist/context/SnackbarProvider.js +1 -1
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +3 -1
- package/dist/context/index.js.map +1 -1
- package/dist/controls/TextField.js +1 -1
- package/dist/controls/TextField.js.map +1 -1
- package/dist/controls/index.js +1 -1
- package/dist/controls/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/model/graph.js +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +2 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/theme.d.ts +1 -0
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/timeOption.js +1 -1
- package/dist/model/timeOption.js.map +1 -1
- package/dist/model/timeZoneOption.d.ts +10 -0
- package/dist/model/timeZoneOption.d.ts.map +1 -0
- package/dist/model/timeZoneOption.js +29 -0
- package/dist/model/timeZoneOption.js.map +1 -0
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.js +1 -1
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.js +1 -1
- 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.js +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.js +1 -1
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/blue.js +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/common.js +1 -1
- package/dist/theme/palette/colors/common.js.map +1 -1
- package/dist/theme/palette/colors/green.js +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.js +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js +1 -1
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.js +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.js +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.js +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/colors/types.js +1 -1
- package/dist/theme/palette/colors/types.js.map +1 -1
- package/dist/theme/palette/error.js +1 -1
- package/dist/theme/palette/error.js.map +1 -1
- package/dist/theme/palette/grey.js +1 -1
- package/dist/theme/palette/grey.js.map +1 -1
- package/dist/theme/palette/index.js +1 -1
- package/dist/theme/palette/index.js.map +1 -1
- package/dist/theme/palette/palette-options.js +1 -1
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.js +1 -1
- package/dist/theme/palette/primary.js.map +1 -1
- package/dist/theme/palette/secondary.js +1 -1
- package/dist/theme/palette/secondary.js.map +1 -1
- package/dist/theme/palette/success.js +1 -1
- package/dist/theme/palette/success.js.map +1 -1
- package/dist/theme/palette/text.js +1 -1
- package/dist/theme/palette/text.js.map +1 -1
- package/dist/theme/palette/warning.js +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.js +1 -1
- package/dist/theme/types/ThemeExtension.d.js.map +1 -1
- package/dist/theme/typography.js +1 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/axis.d.ts +18 -0
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js +79 -3
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/browser-storage.js +1 -1
- package/dist/utils/browser-storage.js.map +1 -1
- package/dist/utils/chart-actions.js +1 -1
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/combine-sx.js +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/data-field-interpolation.d.ts +84 -0
- package/dist/utils/data-field-interpolation.d.ts.map +1 -0
- package/dist/utils/data-field-interpolation.js +239 -0
- package/dist/utils/data-field-interpolation.js.map +1 -0
- package/dist/utils/format.js +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/memo.js +1 -1
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/selection-interpolation.d.ts +32 -0
- package/dist/utils/selection-interpolation.d.ts.map +1 -0
- package/dist/utils/selection-interpolation.js +77 -0
- package/dist/utils/selection-interpolation.js.map +1 -0
- package/dist/utils/theme-gen.js +1 -1
- package/dist/utils/theme-gen.js.map +1 -1
- package/dist/utils/variable-interpolation.d.ts +71 -0
- package/dist/utils/variable-interpolation.d.ts.map +1 -0
- package/dist/utils/variable-interpolation.js +176 -0
- package/dist/utils/variable-interpolation.js.map +1 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 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
|
|
@@ -23,9 +23,12 @@ Object.defineProperty(exports, "TimeRangeSelector", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _Calendar = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Calendar"));
|
|
26
|
+
const _Earth = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Earth"));
|
|
26
27
|
const _core = require("@perses-dev/core");
|
|
27
28
|
const _react = require("react");
|
|
28
29
|
const _context = require("../context");
|
|
30
|
+
const _timeZoneOption = require("../model/timeZoneOption");
|
|
31
|
+
const _SettingsAutocomplete = require("../SettingsAutocomplete");
|
|
29
32
|
const _DateTimeRangePicker = require("./DateTimeRangePicker");
|
|
30
33
|
const _utils = require("./utils");
|
|
31
34
|
function _interop_require_default(obj) {
|
|
@@ -33,33 +36,81 @@ function _interop_require_default(obj) {
|
|
|
33
36
|
default: obj
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
|
-
function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTimeRange = true }) {
|
|
37
|
-
const { timeZone } = (0, _context.useTimeZone)();
|
|
38
|
-
const
|
|
39
|
-
|
|
39
|
+
function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTimeRange = true, timeZone: timeZoneProp, timeZoneOptions, onTimeZoneChange }) {
|
|
40
|
+
const { timeZone: ctxTimeZone } = (0, _context.useTimeZone)();
|
|
41
|
+
const timeZone = timeZoneProp ?? ctxTimeZone;
|
|
42
|
+
const anchorEl = (0, _react.useRef)();
|
|
40
43
|
const [showCustomDateSelector, setShowCustomDateSelector] = (0, _react.useState)(false);
|
|
41
|
-
// Build the initial value of the absolute time range picker
|
|
42
44
|
const convertedTimeRange = (0, _react.useMemo)(()=>{
|
|
43
45
|
return (0, _core.isRelativeTimeRange)(value) ? (0, _core.toAbsoluteTimeRange)(value) : value;
|
|
44
46
|
}, [
|
|
45
47
|
value
|
|
46
48
|
]);
|
|
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
49
|
const lastOption = (0, _react.useMemo)(()=>(0, _utils.buildCustomTimeOption)((0, _core.isRelativeTimeRange)(value) ? undefined : value, timeZone), [
|
|
51
50
|
value,
|
|
52
51
|
timeZone
|
|
53
52
|
]);
|
|
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
53
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
54
|
+
const tzOptions = timeZoneOptions ?? (0, _timeZoneOption.getTimeZoneOptions)();
|
|
55
|
+
const [tzAnchorEl, setTzAnchorEl] = (0, _react.useState)(null);
|
|
56
|
+
const tzOpen = Boolean(tzAnchorEl);
|
|
57
|
+
const tzLabel = tzOptions.find((o)=>o.value === timeZone)?.display ?? timeZone;
|
|
58
|
+
const tzAutocompleteOptions = tzOptions.map((o)=>({
|
|
59
|
+
id: o.value,
|
|
60
|
+
label: o.display
|
|
61
|
+
}));
|
|
62
|
+
let tzAutocompleteValue = undefined;
|
|
63
|
+
{
|
|
64
|
+
const current = tzOptions.find((o)=>o.value === timeZone);
|
|
65
|
+
if (current) tzAutocompleteValue = {
|
|
66
|
+
id: current.value,
|
|
67
|
+
label: current.display
|
|
68
|
+
};
|
|
69
|
+
}
|
|
61
70
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
62
71
|
children: [
|
|
72
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
73
|
+
anchorEl: tzAnchorEl,
|
|
74
|
+
anchorOrigin: {
|
|
75
|
+
vertical: 'bottom',
|
|
76
|
+
horizontal: 'right'
|
|
77
|
+
},
|
|
78
|
+
transformOrigin: {
|
|
79
|
+
vertical: 'top',
|
|
80
|
+
horizontal: 'right'
|
|
81
|
+
},
|
|
82
|
+
open: tzOpen,
|
|
83
|
+
onClose: ()=>setTzAnchorEl(null),
|
|
84
|
+
sx: (theme)=>({
|
|
85
|
+
padding: theme.spacing(1)
|
|
86
|
+
}),
|
|
87
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
88
|
+
sx: {
|
|
89
|
+
p: 1,
|
|
90
|
+
minWidth: 260
|
|
91
|
+
},
|
|
92
|
+
onClick: (e)=>{
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
},
|
|
95
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
|
|
96
|
+
options: tzAutocompleteOptions,
|
|
97
|
+
value: tzAutocompleteValue,
|
|
98
|
+
onChange: (_e, option)=>{
|
|
99
|
+
if (option) {
|
|
100
|
+
const selected = tzOptions.find((o)=>o.value === option.id);
|
|
101
|
+
if (selected) onTimeZoneChange?.(selected);
|
|
102
|
+
}
|
|
103
|
+
setTzAnchorEl(null);
|
|
104
|
+
},
|
|
105
|
+
disableClearable: true,
|
|
106
|
+
renderInput: (params)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
107
|
+
...params,
|
|
108
|
+
placeholder: "Search timezones",
|
|
109
|
+
size: "small"
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
}),
|
|
63
114
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
|
|
64
115
|
anchorEl: anchorEl.current,
|
|
65
116
|
anchorOrigin: {
|
|
@@ -78,7 +129,8 @@ function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTim
|
|
|
78
129
|
setShowCustomDateSelector(false);
|
|
79
130
|
setOpen(false);
|
|
80
131
|
},
|
|
81
|
-
onCancel: ()=>setShowCustomDateSelector(false)
|
|
132
|
+
onCancel: ()=>setShowCustomDateSelector(false),
|
|
133
|
+
timeZone: timeZone
|
|
82
134
|
})
|
|
83
135
|
}),
|
|
84
136
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
@@ -92,12 +144,10 @@ function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTim
|
|
|
92
144
|
'aria-label': `Select time range. Currently set to ${value}`
|
|
93
145
|
},
|
|
94
146
|
sx: {
|
|
95
|
-
// `transform: none` prevents calendar icon from flipping over when menu is open
|
|
96
147
|
'.MuiSelect-icon': {
|
|
97
148
|
marginTop: '1px',
|
|
98
149
|
transform: 'none'
|
|
99
150
|
},
|
|
100
|
-
// paddingRight creates more space for the calendar icon (it's a bigger icon)
|
|
101
151
|
'.MuiSelect-select.MuiSelect-outlined.MuiInputBase-input': {
|
|
102
152
|
paddingRight: '36px'
|
|
103
153
|
},
|
|
@@ -107,6 +157,77 @@ function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTim
|
|
|
107
157
|
} : {}
|
|
108
158
|
},
|
|
109
159
|
children: [
|
|
160
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
161
|
+
disableRipple: true,
|
|
162
|
+
onClick: (e)=>{
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
e.stopPropagation();
|
|
165
|
+
},
|
|
166
|
+
sx: {
|
|
167
|
+
cursor: 'default',
|
|
168
|
+
'&:hover': {
|
|
169
|
+
backgroundColor: 'transparent'
|
|
170
|
+
},
|
|
171
|
+
py: 0.5,
|
|
172
|
+
px: 1
|
|
173
|
+
},
|
|
174
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
175
|
+
sx: {
|
|
176
|
+
display: 'flex',
|
|
177
|
+
alignItems: 'center',
|
|
178
|
+
width: '100%',
|
|
179
|
+
justifyContent: 'space-between'
|
|
180
|
+
},
|
|
181
|
+
children: [
|
|
182
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
183
|
+
sx: {
|
|
184
|
+
display: 'flex',
|
|
185
|
+
flexDirection: 'column',
|
|
186
|
+
alignItems: 'flex-start'
|
|
187
|
+
},
|
|
188
|
+
children: [
|
|
189
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
190
|
+
sx: {
|
|
191
|
+
typography: 'subtitle1'
|
|
192
|
+
},
|
|
193
|
+
children: "Time Range"
|
|
194
|
+
}),
|
|
195
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
196
|
+
sx: {
|
|
197
|
+
color: 'text.secondary',
|
|
198
|
+
typography: 'caption',
|
|
199
|
+
mt: 0.25
|
|
200
|
+
},
|
|
201
|
+
children: [
|
|
202
|
+
"Timezone: ",
|
|
203
|
+
tzLabel
|
|
204
|
+
]
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}),
|
|
208
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
209
|
+
sx: {
|
|
210
|
+
display: 'flex',
|
|
211
|
+
alignItems: 'center',
|
|
212
|
+
pr: 1,
|
|
213
|
+
ml: 1.5
|
|
214
|
+
},
|
|
215
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
216
|
+
size: "small",
|
|
217
|
+
"aria-label": "Select timezone",
|
|
218
|
+
onClick: (e)=>{
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
e.stopPropagation();
|
|
221
|
+
setTzAnchorEl(e.currentTarget);
|
|
222
|
+
},
|
|
223
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Earth.default, {
|
|
224
|
+
fontSize: "small"
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
})
|
|
230
|
+
}),
|
|
110
231
|
timeOptions.map((item, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
111
232
|
value: (0, _utils.formatTimeRange)(item.value, timeZone),
|
|
112
233
|
onClick: ()=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 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
|
|
@@ -34,7 +34,7 @@ function _interop_require_default(obj) {
|
|
|
34
34
|
default: obj
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartTooltip({ containerId, chartRef, data, seriesMapping, enablePinning = true, wrapLabels, format, onUnpinClick, pinnedPos }) {
|
|
37
|
+
const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartTooltip({ containerId, chartRef, data, seriesMapping, enablePinning = true, wrapLabels, format, seriesFormatMap, 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)();
|
|
@@ -56,6 +56,7 @@ const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartToolti
|
|
|
56
56
|
pinnedPos,
|
|
57
57
|
chart,
|
|
58
58
|
format,
|
|
59
|
+
seriesFormatMap,
|
|
59
60
|
showAllSeries
|
|
60
61
|
});
|
|
61
62
|
if (nearbySeries.length === 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 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
|
|
@@ -25,7 +25,7 @@ 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 _TimeZoneProvider = require("../context/TimeZoneProvider");
|
|
29
29
|
const _tooltipmodel = require("./tooltip-model");
|
|
30
30
|
function _interop_require_default(obj) {
|
|
31
31
|
return obj && obj.__esModule ? obj : {
|
|
@@ -33,12 +33,15 @@ function _interop_require_default(obj) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ nearbySeries, totalSeries, isTooltipPinned, showAllSeries, enablePinning = true, onShowAllClick, onUnpinClick }) {
|
|
36
|
+
const { formatWithUserTimeZone } = (0, _TimeZoneProvider.useTimeZone)();
|
|
36
37
|
const seriesTimeMs = nearbySeries[0]?.date ?? null;
|
|
37
38
|
if (seriesTimeMs === null) {
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
40
41
|
const formatTimeSeriesHeader = (timeMs)=>{
|
|
41
|
-
const
|
|
42
|
+
const date = new Date(timeMs);
|
|
43
|
+
const formattedDate = formatWithUserTimeZone(date, 'MMM dd, yyyy - ');
|
|
44
|
+
const formattedTime = formatWithUserTimeZone(date, 'HH:mm:ss');
|
|
42
45
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
43
46
|
children: [
|
|
44
47
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 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
|
|
@@ -44,9 +44,6 @@ _export(exports, {
|
|
|
44
44
|
},
|
|
45
45
|
get legacyCheckforNearbySeries () {
|
|
46
46
|
return legacyCheckforNearbySeries;
|
|
47
|
-
},
|
|
48
|
-
get legacyGetNearbySeriesData () {
|
|
49
|
-
return legacyGetNearbySeriesData;
|
|
50
47
|
}
|
|
51
48
|
});
|
|
52
49
|
const _core = require("@perses-dev/core");
|
|
@@ -56,7 +53,8 @@ const _tooltipmodel = require("./tooltip-model");
|
|
|
56
53
|
const INCREASE_NEARBY_SERIES_MULTIPLIER = 5.5; // adjusts how many series show in tooltip (higher == more series shown)
|
|
57
54
|
const DYNAMIC_NEARBY_SERIES_MULTIPLIER = 30; // used for adjustment after series number divisor
|
|
58
55
|
const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
59
|
-
function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format
|
|
56
|
+
function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format, seriesFormatMap, // in the case of multi-axis, we need the cursor Y position in pixel space
|
|
57
|
+
cursorPixelY) {
|
|
60
58
|
const currentNearbySeriesData = [];
|
|
61
59
|
const cursorX = pointInGrid[0] ?? null;
|
|
62
60
|
const cursorY = pointInGrid[1] ?? null;
|
|
@@ -76,6 +74,23 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
76
74
|
if (closestTimestamp === null) {
|
|
77
75
|
return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
78
76
|
}
|
|
77
|
+
// For multi-axis support: convert yBuffer to pixel space for consistent comparison
|
|
78
|
+
// This allows us to compare series on different Y axes fairly
|
|
79
|
+
let yBufferPixels = null;
|
|
80
|
+
if (cursorPixelY !== undefined) {
|
|
81
|
+
// Convert a point at cursorY and cursorY + yBuffer to pixels to get the buffer in pixel space
|
|
82
|
+
const cursorPoint = chart.convertToPixel('grid', [
|
|
83
|
+
0,
|
|
84
|
+
cursorY
|
|
85
|
+
]);
|
|
86
|
+
const bufferPoint = chart.convertToPixel('grid', [
|
|
87
|
+
0,
|
|
88
|
+
cursorY + yBuffer
|
|
89
|
+
]);
|
|
90
|
+
if (cursorPoint && bufferPoint && cursorPoint[1] !== undefined && bufferPoint[1] !== undefined) {
|
|
91
|
+
yBufferPixels = Math.abs(bufferPoint[1] - cursorPoint[1]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
79
94
|
// find the timestamp with data that is closest to cursorX
|
|
80
95
|
for(let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++){
|
|
81
96
|
const currentSeries = seriesMapping[seriesIdx];
|
|
@@ -86,7 +101,10 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
86
101
|
if (currentDatasetValues === undefined || !Array.isArray(currentDatasetValues)) break;
|
|
87
102
|
const lineSeries = currentSeries;
|
|
88
103
|
const currentSeriesName = lineSeries.name ? lineSeries.name.toString() : '';
|
|
104
|
+
const seriesId = lineSeries.id ? lineSeries.id.toString() : '';
|
|
89
105
|
const markerColor = lineSeries.color ?? '#000';
|
|
106
|
+
// Get the format for this series (from seriesFormatMap or fallback to default format)
|
|
107
|
+
const seriesFormat = seriesFormatMap?.get(seriesId) ?? format;
|
|
90
108
|
if (Array.isArray(data)) {
|
|
91
109
|
for(let datumIdx = 0; datumIdx < currentDatasetValues.length; datumIdx++){
|
|
92
110
|
const nearbyTimeSeries = currentDatasetValues[datumIdx];
|
|
@@ -96,15 +114,59 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
96
114
|
// TODO: ensure null values not displayed in tooltip
|
|
97
115
|
if (yValue !== undefined && yValue !== null) {
|
|
98
116
|
if (closestTimestamp === xValue) {
|
|
99
|
-
|
|
117
|
+
// Check if this series is nearby the cursor
|
|
118
|
+
let isNearby = false;
|
|
119
|
+
// For multi-axis: compare in pixel space
|
|
120
|
+
if (cursorPixelY !== undefined && yBufferPixels !== null) {
|
|
121
|
+
const dataPointPixel = chart.convertToPixel({
|
|
122
|
+
seriesIndex: seriesIdx
|
|
123
|
+
}, [
|
|
124
|
+
datumIdx,
|
|
125
|
+
yValue
|
|
126
|
+
]);
|
|
127
|
+
if (dataPointPixel && dataPointPixel[1] !== undefined) {
|
|
128
|
+
const pixelDistance = Math.abs(cursorPixelY - dataPointPixel[1]);
|
|
129
|
+
isNearby = pixelDistance <= yBufferPixels;
|
|
130
|
+
} else {
|
|
131
|
+
// Fallback to data-space comparison for primary axis
|
|
132
|
+
isNearby = cursorY <= yValue + yBuffer && cursorY >= yValue - yBuffer;
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
// Fallback to original data-space comparison
|
|
136
|
+
isNearby = cursorY <= yValue + yBuffer && cursorY >= yValue - yBuffer;
|
|
137
|
+
}
|
|
138
|
+
if (isNearby) {
|
|
100
139
|
// show fewer bold series in tooltip when many total series
|
|
101
140
|
const minPercentRange = totalSeries > SHOW_FEWER_SERIES_LIMIT ? 2 : 5;
|
|
102
141
|
const percentRangeToCheck = Math.max(minPercentRange, 100 / totalSeries);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
142
|
+
// For isClosestToCursor, also use pixel space for multi-axis
|
|
143
|
+
let isClosestToCursor = false;
|
|
144
|
+
if (cursorPixelY !== undefined) {
|
|
145
|
+
const dataPointPixel = chart.convertToPixel({
|
|
146
|
+
seriesIndex: seriesIdx
|
|
147
|
+
}, [
|
|
148
|
+
datumIdx,
|
|
149
|
+
yValue
|
|
150
|
+
]);
|
|
151
|
+
if (dataPointPixel && dataPointPixel[1] !== undefined) {
|
|
152
|
+
const pixelDistance = Math.abs(cursorPixelY - dataPointPixel[1]);
|
|
153
|
+
// Use percentage of buffer for "closest" determination
|
|
154
|
+
const tightBufferPixels = (yBufferPixels ?? 50) * (percentRangeToCheck / 100);
|
|
155
|
+
isClosestToCursor = pixelDistance <= Math.max(tightBufferPixels, 5);
|
|
156
|
+
} else {
|
|
157
|
+
isClosestToCursor = isWithinPercentageRange({
|
|
158
|
+
valueToCheck: cursorY,
|
|
159
|
+
baseValue: yValue,
|
|
160
|
+
percentage: percentRangeToCheck
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
isClosestToCursor = isWithinPercentageRange({
|
|
165
|
+
valueToCheck: cursorY,
|
|
166
|
+
baseValue: yValue,
|
|
167
|
+
percentage: percentRangeToCheck
|
|
168
|
+
});
|
|
169
|
+
}
|
|
108
170
|
if (isClosestToCursor) {
|
|
109
171
|
// shows as bold in tooltip, customize 'emphasis' options in getTimeSeries util
|
|
110
172
|
emphasizedSeriesIndexes.push(seriesIdx);
|
|
@@ -135,7 +197,7 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
|
|
|
135
197
|
seriesIndex: seriesIdx
|
|
136
198
|
});
|
|
137
199
|
}
|
|
138
|
-
const formattedY = (0, _core.formatValue)(yValue,
|
|
200
|
+
const formattedY = (0, _core.formatValue)(yValue, seriesFormat);
|
|
139
201
|
currentNearbySeriesData.push({
|
|
140
202
|
seriesIdx: seriesIdx,
|
|
141
203
|
datumIdx: datumIdx,
|
|
@@ -251,7 +313,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
|
251
313
|
}
|
|
252
314
|
return currentNearbySeriesData;
|
|
253
315
|
}
|
|
254
|
-
function getNearbySeriesData({ mousePos, pinnedPos, data, seriesMapping, chart, format, showAllSeries = false }) {
|
|
316
|
+
function getNearbySeriesData({ mousePos, pinnedPos, data, seriesMapping, chart, format, seriesFormatMap, showAllSeries = false }) {
|
|
255
317
|
if (chart === undefined || mousePos === null) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
256
318
|
// prevents multiple tooltips showing from adjacent charts unless tooltip is pinned
|
|
257
319
|
let cursorTargetMatchesChart = false;
|
|
@@ -275,7 +337,8 @@ function getNearbySeriesData({ mousePos, pinnedPos, data, seriesMapping, chart,
|
|
|
275
337
|
if (cursorTargetMatchesChart === false || data === null || chart['_model'] === undefined) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
276
338
|
// mousemove position undefined when not hovering over chart canvas
|
|
277
339
|
if (mousePos.plotCanvas.x === undefined || mousePos.plotCanvas.y === undefined) return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
278
|
-
const
|
|
340
|
+
const cursorPixelY = mousePos.plotCanvas.y;
|
|
341
|
+
const pointInGrid = (0, _utils.getPointInGrid)(mousePos.plotCanvas.x, cursorPixelY, chart);
|
|
279
342
|
if (pointInGrid !== null) {
|
|
280
343
|
const chartModel = chart['_model'];
|
|
281
344
|
const yAxisScale = chartModel.getComponent('yAxis').axis.scale;
|
|
@@ -298,54 +361,13 @@ function getNearbySeriesData({ mousePos, pinnedPos, data, seriesMapping, chart,
|
|
|
298
361
|
totalSeries,
|
|
299
362
|
showAllSeries
|
|
300
363
|
});
|
|
301
|
-
|
|
364
|
+
// Detect if chart has multiple Y-axes by checking if any series uses yAxisIndex > 0
|
|
365
|
+
const hasMultipleYAxes = seriesMapping.some((series)=>series.yAxisIndex !== undefined && series.yAxisIndex > 0);
|
|
366
|
+
return checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format, seriesFormatMap, hasMultipleYAxes ? cursorPixelY : undefined);
|
|
302
367
|
}
|
|
303
368
|
// no nearby series found
|
|
304
369
|
return _tooltipmodel.EMPTY_TOOLTIP_DATA;
|
|
305
370
|
}
|
|
306
|
-
function legacyGetNearbySeriesData({ mousePos, pinnedPos, chartData, chart, format, showAllSeries = false }) {
|
|
307
|
-
if (chart === undefined || mousePos === null) return [];
|
|
308
|
-
// prevents multiple tooltips showing from adjacent charts unless tooltip is pinned
|
|
309
|
-
let cursorTargetMatchesChart = false;
|
|
310
|
-
if (mousePos.target !== null) {
|
|
311
|
-
const currentParent = mousePos.target.parentElement;
|
|
312
|
-
if (currentParent !== null) {
|
|
313
|
-
const currentGrandparent = currentParent.parentElement;
|
|
314
|
-
if (currentGrandparent !== null) {
|
|
315
|
-
const chartDom = chart.getDom();
|
|
316
|
-
if (chartDom === currentGrandparent) {
|
|
317
|
-
cursorTargetMatchesChart = true;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
// allows moving cursor inside tooltip without it fading away
|
|
323
|
-
if (pinnedPos !== null) {
|
|
324
|
-
mousePos = pinnedPos;
|
|
325
|
-
cursorTargetMatchesChart = true;
|
|
326
|
-
}
|
|
327
|
-
if (cursorTargetMatchesChart === false) return [];
|
|
328
|
-
if (chart['_model'] === undefined) return [];
|
|
329
|
-
const chartModel = chart['_model'];
|
|
330
|
-
const yInterval = chartModel.getComponent('yAxis').axis.scale._interval;
|
|
331
|
-
const totalSeries = chartData.timeSeries.length;
|
|
332
|
-
const yBuffer = getYBuffer({
|
|
333
|
-
yInterval,
|
|
334
|
-
totalSeries,
|
|
335
|
-
showAllSeries
|
|
336
|
-
});
|
|
337
|
-
const pointInPixel = [
|
|
338
|
-
mousePos.plotCanvas.x ?? 0,
|
|
339
|
-
mousePos.plotCanvas.y ?? 0
|
|
340
|
-
];
|
|
341
|
-
if (chart.containPixel('grid', pointInPixel)) {
|
|
342
|
-
const pointInGrid = chart.convertFromPixel('grid', pointInPixel);
|
|
343
|
-
if (pointInGrid[0] !== undefined && pointInGrid[1] !== undefined) {
|
|
344
|
-
return legacyCheckforNearbySeries(chartData, pointInGrid, yBuffer, chart, format);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
return [];
|
|
348
|
-
}
|
|
349
371
|
function isWithinPercentageRange({ valueToCheck, baseValue, percentage }) {
|
|
350
372
|
const range = percentage / 100 * baseValue;
|
|
351
373
|
const lowerBound = baseValue - range;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright 2026 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, "TimeZoneSelector", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return TimeZoneSelector;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = require("react");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _timeZoneOption = require("./model/timeZoneOption");
|
|
27
|
+
function TimeZoneSelector({ value, onChange, timeZoneOptions, variant = 'standard', heightPx, ...selectProps }) {
|
|
28
|
+
const options = (0, _react.useMemo)(()=>timeZoneOptions ?? (0, _timeZoneOption.getTimeZoneOptions)(), [
|
|
29
|
+
timeZoneOptions
|
|
30
|
+
]);
|
|
31
|
+
const height = heightPx ? typeof heightPx === 'number' ? `${heightPx}px` : heightPx : undefined;
|
|
32
|
+
const handleChange = (selectedValue)=>{
|
|
33
|
+
const selectedOption = options.find((opt)=>opt.value === selectedValue);
|
|
34
|
+
if (selectedOption && onChange) {
|
|
35
|
+
onChange(selectedOption);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const sxStyles = (0, _react.useMemo)(()=>({
|
|
39
|
+
minWidth: variant === 'compact' ? '80px' : '150px',
|
|
40
|
+
...height && {
|
|
41
|
+
lineHeight: height,
|
|
42
|
+
paddingY: 0
|
|
43
|
+
},
|
|
44
|
+
...selectProps.sx
|
|
45
|
+
}), [
|
|
46
|
+
variant,
|
|
47
|
+
height,
|
|
48
|
+
selectProps.sx
|
|
49
|
+
]);
|
|
50
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Select, {
|
|
51
|
+
...selectProps,
|
|
52
|
+
value: value,
|
|
53
|
+
onChange: (event, _child)=>{
|
|
54
|
+
handleChange(event.target.value);
|
|
55
|
+
},
|
|
56
|
+
sx: sxStyles,
|
|
57
|
+
size: variant === 'compact' ? 'small' : 'medium',
|
|
58
|
+
children: options.map((option)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
59
|
+
value: option.value,
|
|
60
|
+
children: option.display
|
|
61
|
+
}, option.value))
|
|
62
|
+
});
|
|
63
|
+
}
|