@perses-dev/components 0.55.0-beta.3 → 0.55.0-beta.6
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 +2 -2
- package/dist/AlignSelector/AlignSelector.d.ts.map +1 -1
- package/dist/AlignSelector/AlignSelector.js +2 -2
- 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.d.ts +1 -1
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +5 -5
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.d.ts +1 -1
- package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.js +5 -5
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js +2 -2
- 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 +4 -4
- 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.d.ts +3 -3
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +2 -2
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.d.ts +1 -1
- package/dist/DensitySelector/DensitySelector.d.ts.map +1 -1
- package/dist/DensitySelector/DensitySelector.js +2 -2
- 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.d.ts +4 -3
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +2 -2
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js +2 -2
- package/dist/Dialog/index.js.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.d.ts +1 -1
- package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.js +8 -8
- package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
- package/dist/DragAndDrop/DragButton.d.ts +1 -1
- package/dist/DragAndDrop/DragButton.d.ts.map +1 -1
- package/dist/DragAndDrop/DragButton.js +4 -4
- package/dist/DragAndDrop/DragButton.js.map +1 -1
- package/dist/DragAndDrop/DropIndicator.d.ts +1 -1
- package/dist/DragAndDrop/DropIndicator.d.ts.map +1 -1
- package/dist/DragAndDrop/DropIndicator.js +1 -1
- package/dist/DragAndDrop/DropIndicator.js.map +1 -1
- package/dist/DragAndDrop/index.js +3 -3
- package/dist/DragAndDrop/index.js.map +1 -1
- package/dist/DragAndDrop/model.d.ts +1 -1
- package/dist/DragAndDrop/model.d.ts.map +1 -1
- package/dist/DragAndDrop/model.js.map +1 -1
- package/dist/Drawer/Drawer.d.ts +2 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +3 -3
- 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.d.ts +4 -4
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +9 -9
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js +2 -2
- package/dist/EChart/index.js.map +1 -1
- package/dist/EChart/timezone-formatter.js +1 -1
- package/dist/ErrorAlert.d.ts +1 -1
- package/dist/ErrorAlert.d.ts.map +1 -1
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.d.ts +1 -1
- 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/FontSizeSelector/index.js +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormEditor/FormActions.d.ts +3 -3
- package/dist/FormEditor/FormActions.d.ts.map +1 -1
- package/dist/FormEditor/FormActions.js +2 -2
- 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 +2 -2
- package/dist/FormatControls/FormatControls.d.ts.map +1 -1
- package/dist/FormatControls/FormatControls.js +6 -6
- package/dist/FormatControls/FormatControls.js.map +1 -1
- package/dist/FormatControls/UnitSelector.d.ts +2 -2
- package/dist/FormatControls/UnitSelector.d.ts.map +1 -1
- package/dist/FormatControls/UnitSelector.js +35 -6
- package/dist/FormatControls/UnitSelector.js.map +1 -1
- package/dist/FormatControls/index.js +2 -2
- package/dist/FormatControls/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.d.ts +1 -1
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +2 -2
- 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.d.ts +2 -2
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +5 -5
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.d.ts +3 -3
- package/dist/Legend/CompactLegend.d.ts.map +1 -1
- package/dist/Legend/CompactLegend.js +3 -3
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts +4 -4
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +6 -6
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.d.ts +1 -1
- package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
- package/dist/Legend/LegendColorBadge.js +4 -4
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.d.ts +3 -3
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js +3 -3
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +3 -3
- package/dist/Legend/ListLegendItem.d.ts.map +1 -1
- package/dist/Legend/ListLegendItem.js +5 -5
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts +3 -3
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +3 -3
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js +2 -2
- package/dist/Legend/index.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/LinksEditor/LinkEditorForm.d.ts +1 -1
- package/dist/LinksEditor/LinkEditorForm.d.ts.map +1 -1
- package/dist/LinksEditor/LinkEditorForm.js +2 -2
- package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
- package/dist/LinksEditor/index.js +1 -1
- package/dist/LinksEditor/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.d.ts +1 -1
- 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/ModeSelector/index.js +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +1 -1
- 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 +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +6 -6
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +1 -1
- 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 +2 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js +4 -4
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/Overlay/Overlay.d.ts +2 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +2 -2
- 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.d.ts +3 -3
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +2 -2
- 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/RepeatGrid/RepeatGrid.d.ts +2 -2
- package/dist/RepeatGrid/RepeatGrid.d.ts.map +1 -1
- package/dist/RepeatGrid/RepeatGrid.js +3 -3
- package/dist/RepeatGrid/RepeatGrid.js.map +1 -1
- package/dist/RepeatGrid/index.js +1 -1
- package/dist/RepeatGrid/index.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 +2 -2
- 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.d.ts +1 -1
- 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 +3 -3
- package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -1
- package/dist/SortSelector/SortSelectorButtons.js +2 -2
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
- package/dist/SortSelector/index.js +2 -2
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/Table/InnerTable.d.ts +2 -2
- package/dist/Table/InnerTable.d.ts.map +1 -1
- package/dist/Table/InnerTable.js +3 -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 +7 -7
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.d.ts +1 -1
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js +3 -3
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.d.ts +3 -3
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +5 -5
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.d.ts +3 -3
- package/dist/Table/TableCheckbox.d.ts.map +1 -1
- package/dist/Table/TableCheckbox.js +2 -2
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableFoot.d.ts +1 -1
- package/dist/Table/TableFoot.d.ts.map +1 -1
- package/dist/Table/TableFoot.js +3 -3
- package/dist/Table/TableFoot.js.map +1 -1
- package/dist/Table/TableHead.d.ts +1 -1
- package/dist/Table/TableHead.d.ts.map +1 -1
- package/dist/Table/TableHead.js +3 -3
- package/dist/Table/TableHead.js.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 +2 -2
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.d.ts +2 -2
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +3 -3
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/TableToolbar.d.ts +2 -2
- package/dist/Table/TableToolbar.d.ts.map +1 -1
- package/dist/Table/TableToolbar.js +8 -8
- package/dist/Table/TableToolbar.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +4 -4
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +14 -14
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.d.ts +1 -1
- package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js +4 -4
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useFuzzySearch.d.ts +3 -3
- package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
- package/dist/Table/hooks/useFuzzySearch.js +3 -3
- package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts.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.d.ts +3 -3
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.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 +2 -2
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +5 -5
- package/dist/Table/model/table-model.d.ts.map +1 -1
- 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 +4 -4
- 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 +10 -10
- 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 -2
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js +8 -8
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +4 -4
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js +11 -11
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
- package/dist/TimeRangeSelector/index.js +2 -2
- package/dist/TimeRangeSelector/index.js.map +1 -1
- package/dist/TimeRangeSelector/utils.d.ts +1 -1
- package/dist/TimeRangeSelector/utils.d.ts.map +1 -1
- package/dist/TimeRangeSelector/utils.js +3 -3
- package/dist/TimeRangeSelector/utils.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +4 -4
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +2 -2
- 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 +3 -3
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +5 -5
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +8 -8
- 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 +3 -3
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -6
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js +10 -10
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +5 -5
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +4 -4
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +4 -4
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +1 -1
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/TimeZoneSelector.d.ts +3 -3
- package/dist/TimeZoneSelector.d.ts.map +1 -1
- package/dist/TimeZoneSelector.js +4 -4
- package/dist/TimeZoneSelector.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.js +3 -3
- 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.d.ts +3 -3
- package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -1
- package/dist/TransformsEditor/TransformEditor.js +3 -3
- package/dist/TransformsEditor/TransformEditor.js.map +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.d.ts +2 -2
- package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.js +8 -8
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
- package/dist/TransformsEditor/TransformsEditor.d.ts +3 -3
- package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -1
- package/dist/TransformsEditor/TransformsEditor.js +5 -5
- 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.d.ts +3 -3
- package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js +5 -5
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +2 -2
- package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.js +4 -4
- 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.d.ts +1 -1
- package/dist/YAxisLabel.d.ts.map +1 -1
- package/dist/YAxisLabel.js +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/context/ChartsProvider.d.ts +4 -3
- package/dist/context/ChartsProvider.d.ts.map +1 -1
- package/dist/context/ChartsProvider.js +2 -2
- package/dist/context/ChartsProvider.js.map +1 -1
- package/dist/context/ItemActionsProvider.d.ts +1 -1
- package/dist/context/ItemActionsProvider.d.ts.map +1 -1
- package/dist/context/ItemActionsProvider.js +2 -2
- package/dist/context/ItemActionsProvider.js.map +1 -1
- package/dist/context/SelectionProvider.d.ts +1 -1
- package/dist/context/SelectionProvider.d.ts.map +1 -1
- package/dist/context/SelectionProvider.js +2 -2
- package/dist/context/SelectionProvider.js.map +1 -1
- package/dist/context/SnackbarProvider.d.ts +2 -1
- package/dist/context/SnackbarProvider.d.ts.map +1 -1
- package/dist/context/SnackbarProvider.js +3 -3
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.d.ts +2 -1
- package/dist/context/TimeZoneProvider.d.ts.map +1 -1
- package/dist/context/TimeZoneProvider.js +3 -3
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/context/index.js +5 -5
- package/dist/context/index.js.map +1 -1
- package/dist/controls/TextField.d.ts +1 -1
- package/dist/controls/TextField.d.ts.map +1 -1
- package/dist/controls/TextField.js +4 -4
- 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.js +39 -39
- package/dist/index.js.map +1 -1
- package/dist/model/action.d.ts +1 -1
- package/dist/model/action.d.ts.map +1 -1
- package/dist/model/action.js.map +1 -1
- package/dist/model/bits.d.ts +1 -1
- package/dist/model/bits.d.ts.map +1 -1
- package/dist/model/bits.js +4 -4
- package/dist/model/bits.js.map +1 -1
- package/dist/model/bytes.d.ts +1 -1
- package/dist/model/bytes.d.ts.map +1 -1
- package/dist/model/bytes.js +4 -4
- package/dist/model/bytes.js.map +1 -1
- package/dist/model/currency.d.ts +1 -1
- package/dist/model/currency.d.ts.map +1 -1
- package/dist/model/currency.js +4 -4
- package/dist/model/currency.js.map +1 -1
- package/dist/model/date.d.ts +1 -1
- package/dist/model/date.d.ts.map +1 -1
- package/dist/model/date.js.map +1 -1
- package/dist/model/decimal.d.ts +1 -1
- package/dist/model/decimal.d.ts.map +1 -1
- package/dist/model/decimal.js +3 -3
- package/dist/model/decimal.js.map +1 -1
- package/dist/model/graph.d.ts +3 -3
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.js +21 -21
- package/dist/model/index.js.map +1 -1
- package/dist/model/percent.d.ts +1 -1
- package/dist/model/percent.d.ts.map +1 -1
- package/dist/model/percent.js +3 -3
- package/dist/model/percent.js.map +1 -1
- package/dist/model/temperature.d.ts +1 -1
- package/dist/model/temperature.d.ts.map +1 -1
- package/dist/model/temperature.js +3 -3
- package/dist/model/temperature.js.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/throughput.d.ts +1 -1
- package/dist/model/throughput.d.ts.map +1 -1
- package/dist/model/throughput.js +5 -5
- package/dist/model/throughput.js.map +1 -1
- package/dist/model/time.d.ts +1 -1
- package/dist/model/time.d.ts.map +1 -1
- package/dist/model/time.js +3 -3
- package/dist/model/time.js.map +1 -1
- package/dist/model/timeOption.d.ts +1 -1
- package/dist/model/timeOption.d.ts.map +1 -1
- package/dist/model/timeOption.js +2 -2
- package/dist/model/timeOption.js.map +1 -1
- package/dist/model/types.d.ts +3 -3
- package/dist/model/types.d.ts.map +1 -1
- package/dist/model/types.js.map +1 -1
- package/dist/model/units.d.ts +10 -10
- package/dist/model/units.d.ts.map +1 -1
- package/dist/model/units.js +9 -9
- package/dist/model/units.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +2 -2
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.d.ts +2 -2
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +2 -2
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.d.ts +1 -1
- package/dist/theme/component-overrides/alert.d.ts.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.d.ts +1 -1
- package/dist/theme/component-overrides/paper.d.ts.map +1 -1
- package/dist/theme/component-overrides/paper.js.map +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -2
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.d.ts +1 -1
- package/dist/theme/palette/background.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/colors/blue.d.ts.map +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/green.d.ts +1 -1
- package/dist/theme/palette/colors/green.d.ts.map +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.d.ts +1 -1
- package/dist/theme/palette/colors/grey.d.ts.map +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js +8 -8
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.d.ts +1 -1
- package/dist/theme/palette/colors/orange.d.ts.map +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.d.ts +1 -1
- package/dist/theme/palette/colors/purple.d.ts.map +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.d.ts +1 -1
- package/dist/theme/palette/colors/red.d.ts.map +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/error.d.ts +1 -1
- package/dist/theme/palette/error.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/grey.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/palette-options.d.ts.map +1 -1
- package/dist/theme/palette/palette-options.js +10 -10
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.d.ts +1 -1
- package/dist/theme/palette/primary.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/secondary.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/success.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/text.d.ts.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.d.ts +1 -1
- package/dist/theme/palette/warning.d.ts.map +1 -1
- package/dist/theme/palette/warning.js +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.d.ts +2 -1
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +5 -5
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.js +2 -1
- package/dist/theme/types/ThemeExtension.d.js.map +1 -1
- package/dist/theme/typography.d.ts +1 -1
- package/dist/theme/typography.d.ts.map +1 -1
- package/dist/theme/typography.js +6 -6
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/axis.d.ts +1 -1
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js +2 -2
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/browser-storage.js +1 -1
- package/dist/utils/chart-actions.d.ts +3 -3
- package/dist/utils/chart-actions.d.ts.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.d.ts +1 -1
- package/dist/utils/combine-sx.d.ts.map +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js +1 -1
- package/dist/utils/data-field-interpolation.js +1 -1
- package/dist/utils/data-field-interpolation.js.map +1 -1
- package/dist/utils/format.js +2 -2
- package/dist/utils/index.js +19 -19
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/memo.d.ts +1 -1
- package/dist/utils/memo.d.ts.map +1 -1
- package/dist/utils/memo.js +2 -2
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/request-interpolation.d.ts +2 -2
- package/dist/utils/request-interpolation.d.ts.map +1 -1
- package/dist/utils/request-interpolation.js +2 -2
- package/dist/utils/request-interpolation.js.map +1 -1
- package/dist/utils/selection-interpolation.d.ts +2 -2
- package/dist/utils/selection-interpolation.d.ts.map +1 -1
- package/dist/utils/selection-interpolation.js +2 -2
- package/dist/utils/selection-interpolation.js.map +1 -1
- package/dist/utils/text.d.ts +1 -1
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/theme-gen.d.ts +2 -2
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +1 -1
- package/dist/utils/theme-gen.js.map +1 -1
- package/dist/utils/time-series-data.d.ts +1 -1
- package/dist/utils/time-series-data.d.ts.map +1 -1
- package/dist/utils/time-series-data.js +1 -1
- package/dist/utils/time-series-data.js.map +1 -1
- package/dist/utils/trace-data.d.ts +2 -2
- package/dist/utils/trace-data.d.ts.map +1 -1
- package/dist/utils/trace-data.js.map +1 -1
- package/dist/utils/transform-data.d.ts +1 -1
- package/dist/utils/transform-data.d.ts.map +1 -1
- package/dist/utils/transform-data.js.map +1 -1
- package/dist/utils/value-mapping.d.ts +1 -1
- package/dist/utils/value-mapping.d.ts.map +1 -1
- package/dist/utils/value-mapping.js +1 -1
- package/dist/utils/value-mapping.js.map +1 -1
- package/dist/utils/variable-interpolation.d.ts +9 -1
- package/dist/utils/variable-interpolation.d.ts.map +1 -1
- package/dist/utils/variable-interpolation.js +12 -0
- package/dist/utils/variable-interpolation.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/AlignSelector/AlignSelector.js +0 -50
- package/dist/cjs/AlignSelector/index.js +0 -30
- package/dist/cjs/ColorPicker/ColorPicker.js +0 -106
- package/dist/cjs/ColorPicker/OptionsColorPicker.js +0 -92
- package/dist/cjs/ColorPicker/index.js +0 -31
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +0 -71
- package/dist/cjs/ContentWithLegend/index.js +0 -30
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +0 -122
- package/dist/cjs/DensitySelector/DensitySelector.js +0 -54
- package/dist/cjs/DensitySelector/index.js +0 -30
- package/dist/cjs/Dialog/Dialog.js +0 -102
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +0 -55
- package/dist/cjs/Dialog/index.js +0 -31
- package/dist/cjs/DragAndDrop/DragAndDropList.js +0 -159
- package/dist/cjs/DragAndDrop/DragButton.js +0 -123
- package/dist/cjs/DragAndDrop/DropIndicator.js +0 -52
- package/dist/cjs/DragAndDrop/index.js +0 -32
- package/dist/cjs/DragAndDrop/model.js +0 -25
- package/dist/cjs/Drawer/Drawer.js +0 -44
- package/dist/cjs/Drawer/index.js +0 -30
- package/dist/cjs/EChart/EChart.js +0 -203
- package/dist/cjs/EChart/index.js +0 -31
- package/dist/cjs/EChart/timezone-formatter.js +0 -49
- package/dist/cjs/ErrorAlert.js +0 -31
- package/dist/cjs/ErrorBoundary.js +0 -24
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +0 -132
- package/dist/cjs/FontSizeSelector/index.js +0 -30
- package/dist/cjs/FormEditor/FormActions.js +0 -83
- package/dist/cjs/FormEditor/index.js +0 -30
- package/dist/cjs/FormatControls/FormatControls.js +0 -119
- package/dist/cjs/FormatControls/UnitSelector.js +0 -55
- package/dist/cjs/FormatControls/index.js +0 -31
- package/dist/cjs/InfoTooltip/InfoTooltip.js +0 -86
- package/dist/cjs/InfoTooltip/index.js +0 -30
- package/dist/cjs/JSONEditor.js +0 -69
- package/dist/cjs/Legend/CompactLegend.js +0 -56
- package/dist/cjs/Legend/Legend.js +0 -131
- package/dist/cjs/Legend/LegendColorBadge.js +0 -39
- package/dist/cjs/Legend/ListLegend.js +0 -55
- package/dist/cjs/Legend/ListLegendItem.js +0 -85
- package/dist/cjs/Legend/TableLegend.js +0 -98
- package/dist/cjs/Legend/index.js +0 -31
- package/dist/cjs/Legend/legend-model.js +0 -27
- package/dist/cjs/LinksEditor/LinkEditorForm.js +0 -95
- package/dist/cjs/LinksEditor/index.js +0 -30
- package/dist/cjs/ModeSelector/ModeSelector.js +0 -51
- package/dist/cjs/ModeSelector/index.js +0 -30
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +0 -34
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +0 -95
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +0 -31
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +0 -59
- package/dist/cjs/OptionsEditorLayout/index.js +0 -33
- package/dist/cjs/Overlay/Overlay.js +0 -71
- package/dist/cjs/Overlay/index.js +0 -30
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +0 -68
- package/dist/cjs/RefreshIntervalPicker/index.js +0 -30
- package/dist/cjs/RepeatGrid/RepeatGrid.js +0 -76
- package/dist/cjs/RepeatGrid/index.js +0 -30
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +0 -82
- package/dist/cjs/SettingsAutocomplete/index.js +0 -30
- package/dist/cjs/SortSelector/SortSelector.js +0 -50
- package/dist/cjs/SortSelector/SortSelectorButtons.js +0 -50
- package/dist/cjs/SortSelector/index.js +0 -31
- package/dist/cjs/Table/InnerTable.js +0 -47
- package/dist/cjs/Table/Table.js +0 -222
- package/dist/cjs/Table/TableBody.js +0 -31
- package/dist/cjs/Table/TableCell.js +0 -153
- package/dist/cjs/Table/TableCheckbox.js +0 -57
- package/dist/cjs/Table/TableFoot.js +0 -31
- package/dist/cjs/Table/TableHead.js +0 -31
- package/dist/cjs/Table/TableHeaderCell.js +0 -93
- package/dist/cjs/Table/TableRow.js +0 -37
- package/dist/cjs/Table/TableToolbar.js +0 -151
- package/dist/cjs/Table/VirtualizedTable.js +0 -284
- package/dist/cjs/Table/VirtualizedTableContainer.js +0 -36
- package/dist/cjs/Table/hooks/useFuzzySearch.js +0 -67
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +0 -108
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +0 -89
- package/dist/cjs/Table/index.js +0 -31
- package/dist/cjs/Table/model/table-model.js +0 -138
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +0 -80
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +0 -282
- package/dist/cjs/ThresholdsEditor/index.js +0 -30
- package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +0 -204
- package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +0 -271
- package/dist/cjs/TimeRangeSelector/index.js +0 -31
- package/dist/cjs/TimeRangeSelector/utils.js +0 -72
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +0 -98
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +0 -107
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +0 -41
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +0 -113
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +0 -58
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +0 -168
- package/dist/cjs/TimeSeriesTooltip/index.js +0 -39
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +0 -454
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +0 -148
- package/dist/cjs/TimeSeriesTooltip/types.js +0 -16
- package/dist/cjs/TimeSeriesTooltip/utils.js +0 -199
- package/dist/cjs/TimeZoneSelector.js +0 -66
- package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/TransformsEditor/TransformEditor.js +0 -297
- package/dist/cjs/TransformsEditor/TransformEditorContainer.js +0 -131
- package/dist/cjs/TransformsEditor/TransformsEditor.js +0 -103
- package/dist/cjs/TransformsEditor/index.js +0 -30
- package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +0 -387
- package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +0 -131
- package/dist/cjs/ValueMappingEditor/index.js +0 -30
- package/dist/cjs/YAxisLabel.js +0 -50
- package/dist/cjs/context/ChartsProvider.js +0 -114
- package/dist/cjs/context/ItemActionsProvider.js +0 -111
- package/dist/cjs/context/SelectionProvider.js +0 -128
- package/dist/cjs/context/SnackbarProvider.js +0 -126
- package/dist/cjs/context/TimeZoneProvider.js +0 -98
- package/dist/cjs/context/index.js +0 -34
- package/dist/cjs/controls/TextField.js +0 -54
- package/dist/cjs/controls/index.js +0 -30
- package/dist/cjs/index.js +0 -68
- package/dist/cjs/model/action.js +0 -43
- package/dist/cjs/model/bits.js +0 -113
- package/dist/cjs/model/bytes.js +0 -115
- package/dist/cjs/model/constants.js +0 -23
- package/dist/cjs/model/currency.js +0 -126
- package/dist/cjs/model/date.js +0 -297
- package/dist/cjs/model/decimal.js +0 -72
- package/dist/cjs/model/formatterCache.js +0 -120
- package/dist/cjs/model/graph.js +0 -59
- package/dist/cjs/model/index.js +0 -50
- package/dist/cjs/model/legend.js +0 -101
- package/dist/cjs/model/percent.js +0 -82
- package/dist/cjs/model/temperature.js +0 -72
- package/dist/cjs/model/theme.js +0 -16
- package/dist/cjs/model/thresholds.js +0 -16
- package/dist/cjs/model/throughput.js +0 -161
- package/dist/cjs/model/time.js +0 -178
- package/dist/cjs/model/timeOption.js +0 -34
- package/dist/cjs/model/timeZoneOption.js +0 -34
- package/dist/cjs/model/transforms.js +0 -29
- package/dist/cjs/model/types.js +0 -16
- package/dist/cjs/model/units.js +0 -186
- package/dist/cjs/model/utils.js +0 -48
- package/dist/cjs/model/value-mapping.js +0 -16
- package/dist/cjs/test/index.js +0 -30
- package/dist/cjs/test/render.js +0 -38
- package/dist/cjs/test/setup-tests.js +0 -26
- package/dist/cjs/test-utils/index.js +0 -30
- package/dist/cjs/test-utils/theme.js +0 -61
- package/dist/cjs/theme/component-overrides/alert.js +0 -104
- package/dist/cjs/theme/component-overrides/paper.js +0 -29
- package/dist/cjs/theme/index.js +0 -31
- package/dist/cjs/theme/palette/background.js +0 -46
- package/dist/cjs/theme/palette/colors/blue.js +0 -37
- package/dist/cjs/theme/palette/colors/common.js +0 -32
- package/dist/cjs/theme/palette/colors/green.js +0 -37
- package/dist/cjs/theme/palette/colors/grey.js +0 -37
- package/dist/cjs/theme/palette/colors/index.js +0 -37
- package/dist/cjs/theme/palette/colors/orange.js +0 -37
- package/dist/cjs/theme/palette/colors/purple.js +0 -37
- package/dist/cjs/theme/palette/colors/red.js +0 -37
- package/dist/cjs/theme/palette/colors/types.js +0 -16
- package/dist/cjs/theme/palette/error.js +0 -34
- package/dist/cjs/theme/palette/grey.js +0 -50
- package/dist/cjs/theme/palette/index.js +0 -30
- package/dist/cjs/theme/palette/palette-options.js +0 -61
- package/dist/cjs/theme/palette/primary.js +0 -34
- package/dist/cjs/theme/palette/secondary.js +0 -34
- package/dist/cjs/theme/palette/success.js +0 -34
- package/dist/cjs/theme/palette/text.js +0 -44
- package/dist/cjs/theme/palette/warning.js +0 -34
- package/dist/cjs/theme/theme.js +0 -90
- package/dist/cjs/theme/types/ThemeExtension.d.js +0 -17
- package/dist/cjs/theme/typography.js +0 -99
- package/dist/cjs/utils/axis.js +0 -122
- package/dist/cjs/utils/browser-storage.js +0 -62
- package/dist/cjs/utils/chart-actions.js +0 -180
- package/dist/cjs/utils/combine-sx.js +0 -31
- package/dist/cjs/utils/component-ids.js +0 -33
- package/dist/cjs/utils/data-field-interpolation.js +0 -230
- package/dist/cjs/utils/format.js +0 -132
- package/dist/cjs/utils/index.js +0 -48
- package/dist/cjs/utils/mathjs.js +0 -38
- package/dist/cjs/utils/memo.js +0 -64
- package/dist/cjs/utils/regexp.js +0 -54
- package/dist/cjs/utils/request-interpolation.js +0 -99
- package/dist/cjs/utils/selection-interpolation.js +0 -69
- package/dist/cjs/utils/text.js +0 -52
- package/dist/cjs/utils/theme-gen.js +0 -274
- package/dist/cjs/utils/time-series-data.js +0 -141
- package/dist/cjs/utils/trace-data.js +0 -25
- package/dist/cjs/utils/transform-data.js +0 -157
- package/dist/cjs/utils/types.js +0 -16
- package/dist/cjs/utils/value-mapping.js +0 -105
- package/dist/cjs/utils/variable-interpolation.js +0 -198
|
@@ -4,7 +4,7 @@ import '@fontsource/inter/500.css';
|
|
|
4
4
|
import '@fontsource/inter/600.css';
|
|
5
5
|
import '@fontsource/inter/700.css';
|
|
6
6
|
import '@fontsource/inter/900.css';
|
|
7
|
-
import { ThemeOptions } from '@mui/material';
|
|
7
|
+
import type { ThemeOptions } from '@mui/material';
|
|
8
8
|
/**
|
|
9
9
|
* Theme typography options that are the same across both the dark and light themes.
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQlD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,YAAY,CAsEjD,CAAC"}
|
package/dist/theme/typography.js
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
13
|
+
import "@fontsource/inter/300.css";
|
|
14
|
+
import "@fontsource/inter/400.css";
|
|
15
|
+
import "@fontsource/inter/500.css";
|
|
16
|
+
import "@fontsource/inter/600.css";
|
|
17
|
+
import "@fontsource/inter/700.css";
|
|
18
|
+
import "@fontsource/inter/900.css";
|
|
19
19
|
// Font weights need to correspond with the imports at the top of the file
|
|
20
20
|
const fontWeightLight = 300;
|
|
21
21
|
const fontWeightRegular = 400;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/theme/typography.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@fontsource/inter/300.css';\nimport '@fontsource/inter/400.css';\nimport '@fontsource/inter/500.css';\nimport '@fontsource/inter/600.css';\nimport '@fontsource/inter/700.css';\nimport '@fontsource/inter/900.css';\nimport { ThemeOptions } from '@mui/material';\n\n// Font weights need to correspond with the imports at the top of the file\nconst fontWeightLight = 300;\nconst fontWeightRegular = 400;\nconst fontWeightMedium = 600;\nconst fontWeightBold = 700;\n\n/**\n * Theme typography options that are the same across both the dark and light themes.\n */\nexport const typography: ThemeOptions['typography'] = {\n fontFamily:\n 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n\n h1: {\n fontSize: '1.5rem', // 24px\n fontWeight: fontWeightMedium,\n lineHeight: '32px',\n },\n h2: {\n fontSize: '1.25rem', // 20px\n fontWeight: fontWeightMedium,\n lineHeight: '28px',\n },\n h3: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightMedium,\n lineHeight: '24px',\n },\n h4: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n },\n h5: undefined,\n h6: undefined,\n\n body1: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightRegular,\n lineHeight: '20px',\n },\n body2: {\n fontSize: '0.75rem', // 12px\n fontWeight: fontWeightRegular,\n lineHeight: '18px',\n },\n subtitle1: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightRegular,\n lineHeight: '24px',\n letterSpacing: '0.02rem',\n },\n subtitle2: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n letterSpacing: '0.03rem',\n textTransform: 'uppercase',\n },\n\n button: {\n // 14px\n fontSize: '0.875rem',\n fontWeight: fontWeightMedium,\n // 20 px\n lineHeight: '1.25rem',\n textTransform: 'none',\n letterSpacing: '0.03rem',\n },\n caption: {\n fontSize: '0.6875rem', // 11px\n fontWeight: fontWeightRegular,\n lineHeight: '16px',\n },\n};\n"],"names":["fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","typography","fontFamily","h1","fontSize","fontWeight","lineHeight","h2","h3","h4","h5","undefined","h6","body1","body2","subtitle1","letterSpacing","subtitle2","textTransform","button","caption"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AAGnC,0EAA0E;AAC1E,MAAMA,kBAAkB;AACxB,MAAMC,oBAAoB;AAC1B,MAAMC,mBAAmB;AACzB,MAAMC,iBAAiB;AAEvB;;CAEC,GACD,OAAO,MAAMC,aAAyC;IACpDC,YACE;IAEFL;IACAC;IACAC;IACAC;IAEAG,IAAI;QACFC,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAC,IAAI;QACFH,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAE,IAAI;QACFJ,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAG,IAAI;QACFL,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAI,IAAIC;IACJC,IAAID;IAEJE,OAAO;QACLT,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAQ,OAAO;QACLV,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAS,WAAW;QACTX,UAAU;QACVC,YAAYP;QACZQ,YAAY;QACZU,eAAe;IACjB;IACAC,WAAW;QACTb,UAAU;QACVC,YAAYN;QACZO,YAAY;QACZU,eAAe;QACfE,eAAe;IACjB;IAEAC,QAAQ;QACN,OAAO;QACPf,UAAU;QACVC,YAAYN;QACZ,QAAQ;QACRO,YAAY;QACZY,eAAe;QACfF,eAAe;IACjB;IACAI,SAAS;QACPhB,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../src/theme/typography.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@fontsource/inter/300.css';\nimport '@fontsource/inter/400.css';\nimport '@fontsource/inter/500.css';\nimport '@fontsource/inter/600.css';\nimport '@fontsource/inter/700.css';\nimport '@fontsource/inter/900.css';\nimport type { ThemeOptions } from '@mui/material';\n\n// Font weights need to correspond with the imports at the top of the file\nconst fontWeightLight = 300;\nconst fontWeightRegular = 400;\nconst fontWeightMedium = 600;\nconst fontWeightBold = 700;\n\n/**\n * Theme typography options that are the same across both the dark and light themes.\n */\nexport const typography: ThemeOptions['typography'] = {\n fontFamily:\n 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n\n h1: {\n fontSize: '1.5rem', // 24px\n fontWeight: fontWeightMedium,\n lineHeight: '32px',\n },\n h2: {\n fontSize: '1.25rem', // 20px\n fontWeight: fontWeightMedium,\n lineHeight: '28px',\n },\n h3: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightMedium,\n lineHeight: '24px',\n },\n h4: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n },\n h5: undefined,\n h6: undefined,\n\n body1: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightRegular,\n lineHeight: '20px',\n },\n body2: {\n fontSize: '0.75rem', // 12px\n fontWeight: fontWeightRegular,\n lineHeight: '18px',\n },\n subtitle1: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightRegular,\n lineHeight: '24px',\n letterSpacing: '0.02rem',\n },\n subtitle2: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n letterSpacing: '0.03rem',\n textTransform: 'uppercase',\n },\n\n button: {\n // 14px\n fontSize: '0.875rem',\n fontWeight: fontWeightMedium,\n // 20 px\n lineHeight: '1.25rem',\n textTransform: 'none',\n letterSpacing: '0.03rem',\n },\n caption: {\n fontSize: '0.6875rem', // 11px\n fontWeight: fontWeightRegular,\n lineHeight: '16px',\n },\n};\n"],"names":["fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","typography","fontFamily","h1","fontSize","fontWeight","lineHeight","h2","h3","h4","h5","undefined","h6","body1","body2","subtitle1","letterSpacing","subtitle2","textTransform","button","caption"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AAGnC,0EAA0E;AAC1E,MAAMA,kBAAkB;AACxB,MAAMC,oBAAoB;AAC1B,MAAMC,mBAAmB;AACzB,MAAMC,iBAAiB;AAEvB;;CAEC,GACD,OAAO,MAAMC,aAAyC;IACpDC,YACE;IAEFL;IACAC;IACAC;IACAC;IAEAG,IAAI;QACFC,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAC,IAAI;QACFH,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAE,IAAI;QACFJ,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAG,IAAI;QACFL,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAI,IAAIC;IACJC,IAAID;IAEJE,OAAO;QACLT,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAQ,OAAO;QACLV,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAS,WAAW;QACTX,UAAU;QACVC,YAAYP;QACZQ,YAAY;QACZU,eAAe;IACjB;IACAC,WAAW;QACTb,UAAU;QACVC,YAAYN;QACZO,YAAY;QACZU,eAAe;QACfE,eAAe;IACjB;IAEAC,QAAQ;QACN,OAAO;QACPf,UAAU;QACVC,YAAYN;QACZ,QAAQ;QACRO,YAAY;QACZY,eAAe;QACfF,eAAe;IACjB;IACAI,SAAS;QACPhB,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;AACF,EAAE"}
|
package/dist/utils/axis.d.ts
CHANGED
package/dist/utils/axis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/utils/axis.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG1E,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/utils/axis.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA0BD,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,EAAE,CAWpH;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,UAAU,EAAE,aAAa,GAAG,SAAS,EACrC,iBAAiB,EAAE,aAAa,EAAE,EAClC,SAAS,CAAC,EAAE,MAAM,EAAE,GACnB,oBAAoB,EAAE,CAkDxB"}
|
package/dist/utils/axis.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import merge from
|
|
14
|
-
import { formatValue } from
|
|
13
|
+
import merge from "lodash/merge";
|
|
14
|
+
import { formatValue } from "../model/index.js";
|
|
15
15
|
// Character width multipliers (approximate for typical UI fonts)
|
|
16
16
|
const CHAR_WIDTH_BASE = 6;
|
|
17
17
|
const AXIS_LABEL_PADDING = 10; // Extra padding to avoid label clipping
|
package/dist/utils/axis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/axis.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { XAXisComponentOption, YAXisComponentOption } from 'echarts';\nimport merge from 'lodash/merge';\n\nimport { FormatOptions
|
|
1
|
+
{"version":3,"sources":["../../src/utils/axis.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { XAXisComponentOption, YAXisComponentOption } from 'echarts';\nimport merge from 'lodash/merge';\n\nimport type { FormatOptions } from '../model';\nimport { formatValue } from '../model';\n\nexport interface YAxisConfig {\n format?: FormatOptions;\n position?: 'left' | 'right';\n show?: boolean;\n min?: number;\n max?: number;\n}\n\n// Character width multipliers (approximate for typical UI fonts)\nconst CHAR_WIDTH_BASE = 6;\nconst AXIS_LABEL_PADDING = 10; // Extra padding to avoid label clipping\n\n/**\n * Estimate the pixel width needed for an axis label using Canvas API.\n */\nfunction estimateLabelWidth(format: FormatOptions | undefined, maxValue: number): number {\n const formattedLabel = formatValue(maxValue, format);\n // Create a canvas element (reuse if possible for performance)\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n // Fallback to estimation if canvas not available\n return formattedLabel.length * CHAR_WIDTH_BASE;\n }\n context.font = '12px sans-serif';\n const metrics = context.measureText(formattedLabel);\n return metrics.width;\n}\n\n/*\n * Populate yAxis or xAxis properties, returns an Array since multiple axes are supported\n */\nexport function getFormattedAxis(axis?: YAXisComponentOption | XAXisComponentOption, unit?: FormatOptions): unknown[] {\n const AXIS_DEFAULT = {\n type: 'value',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, unit);\n },\n },\n };\n return [merge(AXIS_DEFAULT, axis)];\n}\n\n/**\n * Create multiple Y axes configurations for ECharts\n * The first axis (index 0) is always on the left side (default axis from panel settings)\n * Additional axes are placed on the right side\n *\n * @param baseAxis - Base axis configuration from panel settings\n * @param baseFormat - Format for the base/default Y axis\n * @param additionalFormats - Array of formats for additional right-side Y axes\n * @param maxValues - Optional array of max values for each additional format (used to compute dynamic label widths)\n */\nexport function getFormattedMultipleYAxes(\n baseAxis: YAXisComponentOption | undefined,\n baseFormat: FormatOptions | undefined,\n additionalFormats: FormatOptions[],\n maxValues?: number[],\n): YAXisComponentOption[] {\n const axes: YAXisComponentOption[] = [];\n\n // Base/default Y axis (left side)\n const baseAxisConfig: YAXisComponentOption = merge(\n {\n type: 'value',\n position: 'left',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, baseFormat);\n },\n // Let ECharts handle width automatically\n overflow: 'truncate',\n },\n },\n baseAxis,\n );\n axes.push(baseAxisConfig);\n\n // Calculate cumulative offsets based on actual formatted label widths\n let cumulativeOffset = 0;\n\n // Additional Y axes (right side) for each unique format\n additionalFormats.forEach((format, index) => {\n const rightAxisConfig: YAXisComponentOption = {\n type: 'value',\n position: 'right',\n // Dynamic offset based on cumulative width of preceding axis labels\n offset: cumulativeOffset,\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, format);\n },\n },\n splitLine: {\n show: false, // Hide grid lines for right-side axes to reduce visual noise\n },\n show: baseAxis?.show,\n };\n axes.push(rightAxisConfig);\n // For subsequent axes, add the width of the previous axis's labels\n if (maxValues) {\n cumulativeOffset += estimateLabelWidth(format, maxValues[index] ?? 1000) + AXIS_LABEL_PADDING;\n }\n });\n\n return axes;\n}\n"],"names":["merge","formatValue","CHAR_WIDTH_BASE","AXIS_LABEL_PADDING","estimateLabelWidth","format","maxValue","formattedLabel","canvas","document","createElement","context","getContext","length","font","metrics","measureText","width","getFormattedAxis","axis","unit","AXIS_DEFAULT","type","boundaryGap","axisLabel","formatter","value","getFormattedMultipleYAxes","baseAxis","baseFormat","additionalFormats","maxValues","axes","baseAxisConfig","position","overflow","push","cumulativeOffset","forEach","index","rightAxisConfig","offset","splitLine","show"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAOA,WAAW,eAAe;AAGjC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oEAAoE;YACpEO,QAAQJ;YACRd,aAAa;gBAAC;gBAAG;aAAM;YACvBC,WAAW;gBACTC,WAAW,CAACC;oBACV,OAAOzB,YAAYyB,OAAOrB;gBAC5B;YACF;YACAqC,WAAW;gBACTC,MAAM;YACR;YACAA,MAAMf,UAAUe;QAClB;QACAX,KAAKI,IAAI,CAACI;QACV,mEAAmE;QACnE,IAAIT,WAAW;YACbM,oBAAoBjC,mBAAmBC,QAAQ0B,SAAS,CAACQ,MAAM,IAAI,QAAQpC;QAC7E;IACF;IAEA,OAAO6B;AACT"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { useState, useCallback } from
|
|
13
|
+
import { useState, useCallback } from "react";
|
|
14
14
|
/**
|
|
15
15
|
* Just like useState but gets/sets the value in the browser's local storage.
|
|
16
16
|
* 'key' should be a constant string. 'initialValue' is returned when local
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';
|
|
2
|
-
import { ECharts as EChartsInstance } from 'echarts/core';
|
|
3
|
-
import { DatapointInfo, TimeChartSeriesMapping } from '../model';
|
|
1
|
+
import type { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';
|
|
2
|
+
import type { ECharts as EChartsInstance } from 'echarts/core';
|
|
3
|
+
import type { DatapointInfo, TimeChartSeriesMapping } from '../model';
|
|
4
4
|
export interface ZoomEventData {
|
|
5
5
|
start: number;
|
|
6
6
|
end: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-actions.d.ts","sourceRoot":"","sources":["../../src/utils/chart-actions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"chart-actions.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IAAI,CAapG"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { PINNED_CROSSHAIR_SERIES_NAME } from
|
|
13
|
+
import { PINNED_CROSSHAIR_SERIES_NAME } from "../model/index.js";
|
|
14
14
|
/**
|
|
15
15
|
* Enable dataZoom without requring user to click toolbox icon.
|
|
16
16
|
* https://stackoverflow.com/questions/57183297/is-there-a-way-to-use-zoom-of-type-select-without-showing-the-toolbar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/chart-actions.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport { ECharts as EChartsInstance } from 'echarts/core';\n\nimport { DatapointInfo, PINNED_CROSSHAIR_SERIES_NAME, TimeChartSeriesMapping } from '../model';\n\nexport interface ZoomEventData {\n start: number;\n end: number;\n}\n\n/**\n * Enable dataZoom without requring user to click toolbox icon.\n * https://stackoverflow.com/questions/57183297/is-there-a-way-to-use-zoom-of-type-select-without-showing-the-toolbar\n */\nexport function enableDataZoom(chart: EChartsInstance): void {\n const chartModel = chart['_model'];\n if (chartModel === undefined) return;\n if (chartModel.option.toolbox !== undefined && chartModel.option.toolbox.length > 0) {\n // check if hidden data zoom icon is unselected (if selected it would be 'emphasis' instead of 'normal')\n if (chartModel.option.toolbox[0].feature.dataZoom.iconStatus.zoom === 'normal') {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: true,\n });\n }\n }\n}\n\n/**\n * Restore chart to original state before zoom or other actions were dispatched\n */\nexport function restoreChart(chart: EChartsInstance): void {\n // TODO: support incremental unzoom instead of restore to original state\n chart.dispatchAction({\n type: 'restore', // https://echarts.apache.org/en/api.html#events.restore\n });\n}\n\n/*\n * Clear all highlighted series when cursor exits canvas\n * https://echarts.apache.org/en/api.html#action.downplay\n */\nexport function clearHighlightedSeries(chart: EChartsInstance): void {\n if (chart.dispatchAction !== undefined) {\n // Clear any selected data points\n chart.dispatchAction({\n type: 'unselect',\n });\n\n // Clear any highlighted series\n chart.dispatchAction({\n type: 'downplay',\n });\n }\n}\n\n/*\n * Convert a point from pixel coordinate to logical coordinate.\n * Used to determine if cursor is over chart canvas and closest datapoint.\n * https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel\n */\nexport function getPointInGrid(cursorCoordX: number, cursorCoordY: number, chart?: EChartsInstance): number[] | null {\n if (chart === undefined) {\n return null;\n }\n\n const pointInPixel = [cursorCoordX, cursorCoordY];\n if (!chart.containPixel('grid', pointInPixel)) {\n return null;\n }\n\n const pointInGrid: number[] = chart.convertFromPixel('grid', pointInPixel);\n return pointInGrid;\n}\n\n/*\n * TimeSeriesChart tooltip is built custom to support finding nearby series instead of single or all series.\n * This means ECharts actions need to be dispatched manually for series highlighting, datapoint select state, etc.\n * More info: https://echarts.apache.org/en/api.html#action\n */\nexport function batchDispatchNearbySeriesActions(\n chart: EChartsInstance,\n nearbySeriesIndexes: number[],\n emphasizedSeriesIndexes: number[],\n nonEmphasizedSeriesIndexes: number[],\n emphasizedDatapoints: DatapointInfo[],\n duplicateDatapoints: DatapointInfo[],\n): void {\n // Accounts for multiple series that are rendered direct on top of eachother.\n // Only applies select state to the datapoint that is visible to avoid color mismatch.\n const lastEmphasizedDatapoint =\n duplicateDatapoints.length > 0\n ? duplicateDatapoints[duplicateDatapoints.length - 1]\n : emphasizedDatapoints[emphasizedDatapoints.length - 1];\n if (lastEmphasizedDatapoint !== undefined) {\n // Corresponds to select options inside getTimeSeries util.\n // https://echarts.apache.org/en/option.html#series-line.select.itemStyle\n chart.dispatchAction({\n type: 'select',\n seriesIndex: lastEmphasizedDatapoint.seriesIndex,\n dataIndex: lastEmphasizedDatapoint.dataIndex,\n // Shared crosshair should not emphasize datapoints on adjacent charts.\n escapeConnect: true, // TODO: try to remove escapeConnect and match by seriesName for cross panel correlation\n });\n }\n\n // Blanket downplay clears axis-triggered emphasis (enlarged \"big point\" markers) before\n // re-applying emphasis to only the winner series.\n // https://echarts.apache.org/en/api.html#action.downplay\n chart.dispatchAction({\n type: 'downplay',\n });\n\n // Clears emphasis state of all lines that are not emphasized.\n // Emphasized is a subset of just the nearby series that are closest to cursor.\n if (nonEmphasizedSeriesIndexes.length > 0) {\n chart.dispatchAction({\n type: 'downplay',\n seriesIndex: nonEmphasizedSeriesIndexes,\n });\n }\n\n // https://echarts.apache.org/en/api.html#action.highlight\n if (emphasizedSeriesIndexes.length > 0) {\n // Fadeout opacity of all series not closest to cursor.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: emphasizedSeriesIndexes,\n notBlur: false, // ensure blur IS triggered, this is default but setting so it is explicit\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n } else {\n // When no emphasized series with bold text, notBlur allows opacity fadeout to not trigger.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: nearbySeriesIndexes,\n notBlur: true, // do not trigger blur state when cursor is not immediately close to any series\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n\n // Clears selected datapoints since no bold series in tooltip, restore does not impact highlighting\n chart.dispatchAction({\n type: 'toggleSelect', // https://echarts.apache.org/en/api.html#action.toggleSelect\n });\n }\n}\n\n/*\n * Determine whether a markLine was pushed into the final series, which means crosshair was already pinned onClick\n */\nexport function checkCrosshairPinnedStatus(seriesMapping: TimeChartSeriesMapping): boolean {\n const isCrosshairPinned = seriesMapping[seriesMapping.length - 1]?.name === PINNED_CROSSHAIR_SERIES_NAME;\n return isCrosshairPinned;\n}\n\n/*\n * Find closest timestamp to logical x coordinate returned from echartsInstance.convertFromPixel\n * Used to find nearby series in time series tooltip.\n */\nexport function getClosestTimestamp(timeSeriesValues?: TimeSeriesValueTuple[], cursorX?: number): number | null {\n if (timeSeriesValues === undefined || cursorX === undefined) {\n return null;\n }\n\n let currentClosestTimestamp: number | null = null;\n let currentClosestDistance = Infinity;\n\n for (const [timestamp] of timeSeriesValues) {\n const distance = Math.abs(timestamp - cursorX);\n if (distance < currentClosestDistance) {\n currentClosestTimestamp = timestamp;\n currentClosestDistance = distance;\n }\n }\n return currentClosestTimestamp;\n}\n\n/*\n * Find closest timestamp in full dataset, used to snap crosshair into place onClick when tooltip is pinned.\n */\nexport function getClosestTimestampInFullDataset(data: TimeSeries[], cursorX?: number): number | null {\n if (cursorX === undefined) {\n return null;\n }\n const totalSeries = data.length;\n let closestTimestamp = null;\n for (let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++) {\n const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;\n if (!currentDataset) break;\n const currentValues: TimeSeriesValueTuple[] = currentDataset.values;\n closestTimestamp = getClosestTimestamp(currentValues, cursorX);\n }\n return closestTimestamp;\n}\n"],"names":["PINNED_CROSSHAIR_SERIES_NAME","enableDataZoom","chart","chartModel","undefined","option","toolbox","length","feature","dataZoom","iconStatus","zoom","dispatchAction","type","key","dataZoomSelectActive","restoreChart","clearHighlightedSeries","getPointInGrid","cursorCoordX","cursorCoordY","pointInPixel","containPixel","pointInGrid","convertFromPixel","batchDispatchNearbySeriesActions","nearbySeriesIndexes","emphasizedSeriesIndexes","nonEmphasizedSeriesIndexes","emphasizedDatapoints","duplicateDatapoints","lastEmphasizedDatapoint","seriesIndex","dataIndex","escapeConnect","notBlur","checkCrosshairPinnedStatus","seriesMapping","isCrosshairPinned","name","getClosestTimestamp","timeSeriesValues","cursorX","currentClosestTimestamp","currentClosestDistance","Infinity","timestamp","distance","Math","abs","getClosestTimestampInFullDataset","data","totalSeries","closestTimestamp","seriesIdx","currentDataset","currentValues","values"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAKjC,SAAwBA,4BAA4B,QAAgC,WAAW;AAO/F;;;CAGC,GACD,OAAO,SAASC,eAAeC,KAAsB;IACnD,MAAMC,aAAaD,KAAK,CAAC,SAAS;IAClC,IAAIC,eAAeC,WAAW;IAC9B,IAAID,WAAWE,MAAM,CAACC,OAAO,KAAKF,aAAaD,WAAWE,MAAM,CAACC,OAAO,CAACC,MAAM,GAAG,GAAG;QACnF,wGAAwG;QACxG,IAAIJ,WAAWE,MAAM,CAACC,OAAO,CAAC,EAAE,CAACE,OAAO,CAACC,QAAQ,CAACC,UAAU,CAACC,IAAI,KAAK,UAAU;YAC9ET,MAAMU,cAAc,CAAC;gBACnBC,MAAM;gBACNC,KAAK;gBACLC,sBAAsB;YACxB;QACF;IACF;AACF;AAEA;;CAEC,GACD,OAAO,SAASC,aAAad,KAAsB;IACjD,wEAAwE;IACxEA,MAAMU,cAAc,CAAC;QACnBC,MAAM;IACR;AACF;AAEA;;;CAGC,GACD,OAAO,SAASI,uBAAuBf,KAAsB;IAC3D,IAAIA,MAAMU,cAAc,KAAKR,WAAW;QACtC,iCAAiC;QACjCF,MAAMU,cAAc,CAAC;YACnBC,MAAM;QACR;QAEA,+BAA+B;QAC/BX,MAAMU,cAAc,CAAC;YACnBC,MAAM;QACR;IACF;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASK,eAAeC,YAAoB,EAAEC,YAAoB,EAAElB,KAAuB;IAChG,IAAIA,UAAUE,WAAW;QACvB,OAAO;IACT;IAEA,MAAMiB,eAAe;QAACF;QAAcC;K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,GACD,OAAO,SAASuB,2BAA2BC,aAAqC;IAC9E,MAAMC,oBAAoBD,aAAa,CAACA,cAAc9B,MAAM,GAAG,EAAE,EAAEgC,SAASvC;IAC5E,OAAOsC;AACT;AAEA;;;CAGC,GACD,OAAO,SAASE,oBAAoBC,gBAAyC,EAAEC,OAAgB;IAC7F,IAAID,qBAAqBrC,aAAasC,YAAYtC,WAAW;QAC3D,OAAO;IACT;IAEA,IAAIuC,0BAAyC;IAC7C,IAAIC,yBAAyBC;IAE7B,KAAK,MAAM,CAACC,UAAU,IAAIL,iBAAkB;QAC1C,MAAMM,WAAWC,KAAKC,GAAG,CAACH,YAAYJ;QACtC,IAAIK,WAAWH,wBAAwB;YACrCD,0BAA0BG;YAC1BF,yBAAyBG;QAC3B;IACF;IACA,OAAOJ;AACT;AAEA;;CAEC,GACD,OAAO,SAASO,iCAAiCC,IAAkB,EAAET,OAAgB;IACnF,IAAIA,YAAYtC,WAAW;QACzB,OAAO;IACT;IACA,MAAMgD,cAAcD,KAAK5C,MAAM;IAC/B,IAAI8C,mBAAmB;IACvB,IAAK,IAAIC,YAAY,GAAGA,YAAYF,aAAaE,YAAa;QAC5D,MAAMC,iBAAiBH,cAAc,IAAID,IAAI,CAACG,UAAU,GAAG;QAC3D,IAAI,CAACC,gBAAgB;QACrB,MAAMC,gBAAwCD,eAAeE,MAAM;QACnEJ,mBAAmBb,oBAAoBgB,eAAed;IACxD;IACA,OAAOW;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/chart-actions.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport type { ECharts as EChartsInstance } from 'echarts/core';\n\nimport type { DatapointInfo, TimeChartSeriesMapping } from '../model';\nimport { PINNED_CROSSHAIR_SERIES_NAME } from '../model';\n\nexport interface ZoomEventData {\n start: number;\n end: number;\n}\n\n/**\n * Enable dataZoom without requring user to click toolbox icon.\n * https://stackoverflow.com/questions/57183297/is-there-a-way-to-use-zoom-of-type-select-without-showing-the-toolbar\n */\nexport function enableDataZoom(chart: EChartsInstance): void {\n const chartModel = chart['_model'];\n if (chartModel === undefined) return;\n if (chartModel.option.toolbox !== undefined && chartModel.option.toolbox.length > 0) {\n // check if hidden data zoom icon is unselected (if selected it would be 'emphasis' instead of 'normal')\n if (chartModel.option.toolbox[0].feature.dataZoom.iconStatus.zoom === 'normal') {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: true,\n });\n }\n }\n}\n\n/**\n * Restore chart to original state before zoom or other actions were dispatched\n */\nexport function restoreChart(chart: EChartsInstance): void {\n // TODO: support incremental unzoom instead of restore to original state\n chart.dispatchAction({\n type: 'restore', // https://echarts.apache.org/en/api.html#events.restore\n });\n}\n\n/*\n * Clear all highlighted series when cursor exits canvas\n * https://echarts.apache.org/en/api.html#action.downplay\n */\nexport function clearHighlightedSeries(chart: EChartsInstance): void {\n if (chart.dispatchAction !== undefined) {\n // Clear any selected data points\n chart.dispatchAction({\n type: 'unselect',\n });\n\n // Clear any highlighted series\n chart.dispatchAction({\n type: 'downplay',\n });\n }\n}\n\n/*\n * Convert a point from pixel coordinate to logical coordinate.\n * Used to determine if cursor is over chart canvas and closest datapoint.\n * https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel\n */\nexport function getPointInGrid(cursorCoordX: number, cursorCoordY: number, chart?: EChartsInstance): number[] | null {\n if (chart === undefined) {\n return null;\n }\n\n const pointInPixel = [cursorCoordX, cursorCoordY];\n if (!chart.containPixel('grid', pointInPixel)) {\n return null;\n }\n\n const pointInGrid: number[] = chart.convertFromPixel('grid', pointInPixel);\n return pointInGrid;\n}\n\n/*\n * TimeSeriesChart tooltip is built custom to support finding nearby series instead of single or all series.\n * This means ECharts actions need to be dispatched manually for series highlighting, datapoint select state, etc.\n * More info: https://echarts.apache.org/en/api.html#action\n */\nexport function batchDispatchNearbySeriesActions(\n chart: EChartsInstance,\n nearbySeriesIndexes: number[],\n emphasizedSeriesIndexes: number[],\n nonEmphasizedSeriesIndexes: number[],\n emphasizedDatapoints: DatapointInfo[],\n duplicateDatapoints: DatapointInfo[],\n): void {\n // Accounts for multiple series that are rendered direct on top of eachother.\n // Only applies select state to the datapoint that is visible to avoid color mismatch.\n const lastEmphasizedDatapoint =\n duplicateDatapoints.length > 0\n ? duplicateDatapoints[duplicateDatapoints.length - 1]\n : emphasizedDatapoints[emphasizedDatapoints.length - 1];\n if (lastEmphasizedDatapoint !== undefined) {\n // Corresponds to select options inside getTimeSeries util.\n // https://echarts.apache.org/en/option.html#series-line.select.itemStyle\n chart.dispatchAction({\n type: 'select',\n seriesIndex: lastEmphasizedDatapoint.seriesIndex,\n dataIndex: lastEmphasizedDatapoint.dataIndex,\n // Shared crosshair should not emphasize datapoints on adjacent charts.\n escapeConnect: true, // TODO: try to remove escapeConnect and match by seriesName for cross panel correlation\n });\n }\n\n // Blanket downplay clears axis-triggered emphasis (enlarged \"big point\" markers) before\n // re-applying emphasis to only the winner series.\n // https://echarts.apache.org/en/api.html#action.downplay\n chart.dispatchAction({\n type: 'downplay',\n });\n\n // Clears emphasis state of all lines that are not emphasized.\n // Emphasized is a subset of just the nearby series that are closest to cursor.\n if (nonEmphasizedSeriesIndexes.length > 0) {\n chart.dispatchAction({\n type: 'downplay',\n seriesIndex: nonEmphasizedSeriesIndexes,\n });\n }\n\n // https://echarts.apache.org/en/api.html#action.highlight\n if (emphasizedSeriesIndexes.length > 0) {\n // Fadeout opacity of all series not closest to cursor.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: emphasizedSeriesIndexes,\n notBlur: false, // ensure blur IS triggered, this is default but setting so it is explicit\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n } else {\n // When no emphasized series with bold text, notBlur allows opacity fadeout to not trigger.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: nearbySeriesIndexes,\n notBlur: true, // do not trigger blur state when cursor is not immediately close to any series\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n\n // Clears selected datapoints since no bold series in tooltip, restore does not impact highlighting\n chart.dispatchAction({\n type: 'toggleSelect', // https://echarts.apache.org/en/api.html#action.toggleSelect\n });\n }\n}\n\n/*\n * Determine whether a markLine was pushed into the final series, which means crosshair was already pinned onClick\n */\nexport function checkCrosshairPinnedStatus(seriesMapping: TimeChartSeriesMapping): boolean {\n const isCrosshairPinned = seriesMapping[seriesMapping.length - 1]?.name === PINNED_CROSSHAIR_SERIES_NAME;\n return isCrosshairPinned;\n}\n\n/*\n * Find closest timestamp to logical x coordinate returned from echartsInstance.convertFromPixel\n * Used to find nearby series in time series tooltip.\n */\nexport function getClosestTimestamp(timeSeriesValues?: TimeSeriesValueTuple[], cursorX?: number): number | null {\n if (timeSeriesValues === undefined || cursorX === undefined) {\n return null;\n }\n\n let currentClosestTimestamp: number | null = null;\n let currentClosestDistance = Infinity;\n\n for (const [timestamp] of timeSeriesValues) {\n const distance = Math.abs(timestamp - cursorX);\n if (distance < currentClosestDistance) {\n currentClosestTimestamp = timestamp;\n currentClosestDistance = distance;\n }\n }\n return currentClosestTimestamp;\n}\n\n/*\n * Find closest timestamp in full dataset, used to snap crosshair into place onClick when tooltip is pinned.\n */\nexport function getClosestTimestampInFullDataset(data: TimeSeries[], cursorX?: number): number | null {\n if (cursorX === undefined) {\n return null;\n }\n const totalSeries = data.length;\n let closestTimestamp = null;\n for (let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++) {\n const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;\n if (!currentDataset) break;\n const currentValues: TimeSeriesValueTuple[] = currentDataset.values;\n closestTimestamp = getClosestTimestamp(currentValues, cursorX);\n }\n return closestTimestamp;\n}\n"],"names":["PINNED_CROSSHAIR_SERIES_NAME","enableDataZoom","chart","chartModel","undefined","option","toolbox","length","feature","dataZoom","iconStatus","zoom","dispatchAction","type","key","dataZoomSelectActive","restoreChart","clearHighlightedSeries","getPointInGrid","cursorCoordX","cursorCoordY","pointInPixel","containPixel","pointInGrid","convertFromPixel","batchDispatchNearbySeriesActions","nearbySeriesIndexes","emphasizedSeriesIndexes","nonEmphasizedSeriesIndexes","emphasizedDatapoints","duplicateDatapoints","lastEmphasizedDatapoint","seriesIndex","dataIndex","escapeConnect","notBlur","checkCrosshairPinnedStatus","seriesMapping","isCrosshairPinned","name","getClosestTimestamp","timeSeriesValues","cursorX","currentClosestTimestamp","currentClosestDistance","Infinity","timestamp","distance","Math","abs","getClosestTimestampInFullDataset","data","totalSeries","closestTimestamp","seriesIdx","currentDataset","currentValues","values"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAMjC,SAASA,4BAA4B,QAAQ,oBAAW;AAOxD;;;CAGC,GACD,OAAO,SAASC,eAAeC,KAAsB;IACnD,MAAMC,aAAaD,KAAK,CAAC,SAAS;IAClC,IAAIC,eAAeC,WAAW;IAC9B,IAAID,WAAWE,MAAM,CAACC,OAAO,KAAKF,aAAaD,WAAWE,MAAM,CAACC,OAAO,CAACC,MAAM,GAAG,GAAG;QACnF,wGAAwG;QACxG,IAAIJ,WAAWE,MAAM,CAACC,OAAO,CAAC,EAAE,CAACE,OAAO,CAACC,QAAQ,CAACC,UAAU,CAACC,IAAI,KAAK,UAAU;YAC9ET,MAAMU,cAAc,CAAC;gBACnBC,MAAM;gBACNC,KAAK;gBACLC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MAAMC,iBAAiBH,cAAc,IAAID,IAAI,CAACG,UAAU,GAAG;QAC3D,IAAI,CAACC,gBAAgB;QACrB,MAAMC,gBAAwCD,eAAeE,MAAM;QACnEJ,mBAAmBb,oBAAoBgB,eAAed;IACxD;IACA,OAAOW;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SxProps, Theme } from '@mui/material';
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
2
|
/**
|
|
3
3
|
* Combines sx props from multiple sources. Useful when creating a component and
|
|
4
4
|
* you want consumers to be able to provide SxProps that should be combined with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combine-sx.d.ts","sourceRoot":"","sources":["../../src/utils/combine-sx.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"combine-sx.d.ts","sourceRoot":"","sources":["../../src/utils/combine-sx.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAMvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/combine-sx.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { SxProps, Theme } from '@mui/material';\n\n/**\n * Combines sx props from multiple sources. Useful when creating a component and\n * you want consumers to be able to provide SxProps that should be combined with\n * some built-in styles.\n */\nexport function combineSx(...sxProps: Array<SxProps<Theme> | undefined>): SxProps<Theme> {\n return sxProps.flatMap((sx) => {\n if (sx === undefined) return [];\n if (Array.isArray(sx)) return sx;\n return [sx];\n });\n}\n"],"names":["combineSx","sxProps","flatMap","sx","undefined","Array","isArray"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC;;;;CAIC,GACD,OAAO,SAASA,UAAU,GAAGC,OAA0C;IACrE,OAAOA,QAAQC,OAAO,CAAC,CAACC;QACtB,IAAIA,OAAOC,WAAW,OAAO,EAAE;QAC/B,IAAIC,MAAMC,OAAO,CAACH,KAAK,OAAOA;QAC9B,OAAO;YAACA;SAAG;IACb;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/combine-sx.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { SxProps, Theme } from '@mui/material';\n\n/**\n * Combines sx props from multiple sources. Useful when creating a component and\n * you want consumers to be able to provide SxProps that should be combined with\n * some built-in styles.\n */\nexport function combineSx(...sxProps: Array<SxProps<Theme> | undefined>): SxProps<Theme> {\n return sxProps.flatMap((sx) => {\n if (sx === undefined) return [];\n if (Array.isArray(sx)) return sx;\n return [sx];\n });\n}\n"],"names":["combineSx","sxProps","flatMap","sx","undefined","Array","isArray"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC;;;;CAIC,GACD,OAAO,SAASA,UAAU,GAAGC,OAA0C;IACrE,OAAOA,QAAQC,OAAO,CAAC,CAACC;QACtB,IAAIA,OAAOC,WAAW,OAAO,EAAE;QAC/B,IAAIC,MAAMC,OAAO,CAACH,KAAK,OAAOA;QAC9B,OAAO;YAACA;SAAG;IACb;AACF"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { useRef } from
|
|
13
|
+
import { useRef } from "react";
|
|
14
14
|
/**
|
|
15
15
|
* Generates a unique (stable) ID for a component. Should be replaced with React.useId once we support only React 18.
|
|
16
16
|
*/ export function useId(prefix) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { interpolate, InterpolationFormat } from
|
|
13
|
+
import { interpolate, InterpolationFormat } from "./variable-interpolation.js";
|
|
14
14
|
// Regex patterns for data field interpolation
|
|
15
15
|
// Matches: ${__data.fields["fieldName"]} or ${__data.fields['fieldName']} or ${__data.fields.fieldName} with optional format ${__data.fields["fieldName"]:format}
|
|
16
16
|
const SINGLE_FIELD_REGEX = /\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/data-field-interpolation.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { interpolate, InterpolationFormat } from './variable-interpolation';\n\n/**\n * Data item with its fields (used for selection/row data)\n */\nexport type DataItem = Record<string, unknown>;\n\n/**\n * Result of interpolation with data fields\n */\nexport interface InterpolationResult {\n text: string;\n errors?: string[];\n}\n\n/**\n * Options for data field replacement\n */\nexport interface ReplaceDataFieldsOptions {\n /**\n * Whether to URL encode values. Defaults to true.\n */\n urlEncode?: boolean;\n /**\n * Current index (0-based) for ${__data.index} replacement.\n */\n index?: number;\n /**\n * Total count for ${__data.count} replacement.\n */\n count?: number;\n}\n\n// Regex patterns for data field interpolation\n// Matches: ${__data.fields[\"fieldName\"]} or ${__data.fields['fieldName']} or ${__data.fields.fieldName} with optional format ${__data.fields[\"fieldName\"]:format}\nconst SINGLE_FIELD_REGEX =\n /\\$\\{__data\\.fields(?:\\[(?:\"|')([^\"']+)(?:\"|')\\]|\\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\\}/g;\n\n// Matches: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']} for indexed access\nconst INDEXED_FIELD_REGEX = /\\$\\{__data\\[(\\d+)\\]\\.fields\\[(?:\"|')([^\"']+)(?:\"|')\\]\\}/g;\n\n// Matches: ${__data.index}\nconst DATA_INDEX_REGEX = /\\$\\{__data\\.index\\}/g;\n\n// Matches: ${__data.count}\nconst DATA_COUNT_REGEX = /\\$\\{__data\\.count\\}/g;\n\n// Matches: ${__data} or ${__data:format} or '${__data:format}' or \"${__data:format}\"\nconst FULL_DATA_REGEX = /(\"|')?\\$\\{__data(?::([a-z]+))?\\}(\"|')?/g;\n\n/**\n * Get field value from a data item, converting to string.\n * Supports nested field access using dot notation in field names (e.g., \"foo.bar\" accesses item.foo.bar).\n * For backward compatibility, first checks if the exact key exists before attempting nested access.\n */\nfunction getFieldValue(item: DataItem, fieldName: string): string {\n // First, try direct property access (for backward compatibility with literal dot keys)\n if (Object.prototype.hasOwnProperty.call(item, fieldName)) {\n const value = item[fieldName];\n if (value === undefined || value === null) {\n return '';\n }\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return String(value);\n }\n\n // If not found and contains dots, try nested access\n if (fieldName.includes('.')) {\n const parts = fieldName.split('.');\n let current: unknown = item;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return '';\n }\n if (typeof current !== 'object') {\n return '';\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n if (current === undefined || current === null) {\n return '';\n }\n if (typeof current === 'object') {\n return JSON.stringify(current);\n }\n return String(current);\n }\n\n // Field not found\n return '';\n}\n\n/**\n * Parse format string to InterpolationFormat enum\n */\nexport function parseFormat(format: string | undefined): InterpolationFormat | undefined {\n if (!format) return undefined;\n const lowerFormat = format.toLowerCase();\n return Object.values(InterpolationFormat).find((f) => f === lowerFormat);\n}\n\n/**\n * Replace data field placeholders in a template string with values from a single data item.\n *\n * Supports:\n * - ${__data.fields[\"fieldName\"]} - field value from the item (URL encoded by default)\n * - ${__data.fields[\"fieldName\"]:format} - field value with format specifier\n * - ${__data.index} - current index (0-based) if provided in options\n * - ${__data.count} - total count if provided in options\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param item - The data item containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFields(\n template: string,\n item: DataItem,\n options: ReplaceDataFieldsOptions = {},\n): InterpolationResult {\n const { urlEncode = true, index, count } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace ${__data.index} if provided\n if (index !== undefined) {\n result = result.replaceAll(DATA_INDEX_REGEX, String(index));\n }\n\n // Replace ${__data.count} if provided\n if (count !== undefined) {\n result = result.replaceAll(DATA_COUNT_REGEX, String(count));\n }\n\n // Replace full data placeholder with optional format: ${__data} or ${__data:format}\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, _leadingQuote: string | undefined, format: string | undefined, _trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n let interpolationResult: string = '';\n\n if (interpolationFormat === InterpolationFormat.JSON) {\n interpolationResult = JSON.stringify(item);\n } else {\n interpolationResult = interpolate(\n Object.values(item).map((v) => JSON.stringify(v)),\n '',\n interpolationFormat,\n );\n }\n\n return interpolationResult;\n },\n );\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace __data.fields[\"fieldName\"] or __data.fields.fieldName patterns\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const value = getFieldValue(item, fieldName);\n if (value === '' && item[fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data`);\n }\n const interpolationFormat = parseFormat(format);\n if (interpolationFormat) {\n return interpolate([value], fieldName, interpolationFormat);\n }\n\n if (urlEncode) {\n // override: disable urlEncode for RAW format\n if (interpolationFormat === InterpolationFormat.RAW) {\n return value;\n }\n\n // avoid double encoding for queryparam and percentencode formats\n if (\n interpolationFormat !== InterpolationFormat.QUERYPARAM &&\n interpolationFormat !== InterpolationFormat.PERCENTENCODE\n ) {\n return encodeURIComponent(value);\n }\n }\n\n return value;\n },\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Replace data field placeholders in a template string with values from multiple data items (batch mode).\n *\n * Supports:\n * - ${__data[0].fields[\"fieldName\"]} - field value from specific item by index\n * - ${__data.fields[\"fieldName\"]} - aggregated field values (defaults to CSV format)\n * - ${__data.fields[\"fieldName\"]:csv} - aggregated field values with format specifier\n * - ${__data.count} - total number of items\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param items - Array of data items containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFieldsBatch(\n template: string,\n items: DataItem[],\n options: ReplaceDataFieldsOptions = {},\n): InterpolationResult {\n const { urlEncode = true } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace __data.count with items length\n result = result.replaceAll(DATA_COUNT_REGEX, String(items.length));\n\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace full data placeholder with optional format\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, leadingQuote: string | undefined, format: string | undefined, trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n\n const interpolationResult = interpolate(\n Object.values(items).map((e) => JSON.stringify(e)),\n '',\n interpolationFormat,\n );\n\n if (!leadingQuote || !trailingQuote) {\n // preserve quotes as they were not surrounding the full_data pattern\n return `${leadingQuote ?? ''}${interpolationResult}${trailingQuote ?? ''}`;\n }\n\n return interpolationResult;\n },\n );\n\n // Replace indexed access: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']}\n result = result.replaceAll(INDEXED_FIELD_REGEX, (match, indexStr: string, fieldName: string) => {\n const idx = parseInt(indexStr, 10);\n if (idx < 0 || idx >= items.length) {\n errors.push(`Index ${idx} out of bounds (0-${items.length - 1})`);\n return match;\n }\n const value = getFieldValue(items[idx]!, fieldName);\n if (value === '' && items[idx]![fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data at index ${idx}`);\n }\n return urlEncode ? encodeURIComponent(value) : value;\n });\n\n // Replace aggregated access with format: ${__data.fields[\"fieldName\"]:csv} or ${__data.fields.fieldName:csv}\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const values = items.map((item) => getFieldValue(item, fieldName));\n const interpolationFormat = parseFormat(format) || InterpolationFormat.CSV;\n return interpolate(values, fieldName, interpolationFormat);\n },\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Check if a template contains batch-only patterns (indexed access or format specifiers)\n */\nexport function hasBatchPatterns(template: string): boolean {\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return (\n INDEXED_FIELD_REGEX.test(template) ||\n /\\$\\{__data\\.fields(?:\\[[\"'][^\"']+[\"']\\]|\\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\\}/.test(template)\n );\n}\n\n/**\n * Check if a template contains indexed access patterns\n */\nexport function hasIndexedPatterns(template: string): boolean {\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Check if a template contains data field patterns\n */\nexport function hasDataFieldPatterns(template: string): boolean {\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return SINGLE_FIELD_REGEX.test(template) || INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Extract all field names referenced in a template\n */\nexport function extractFieldNames(template: string): string[] {\n const fields = new Set<string>();\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n\n let match;\n while ((match = SINGLE_FIELD_REGEX.exec(template)) !== null) {\n // Group 1 is bracket notation, group 2 is dot notation\n fields.add(match[1] ?? match[2]!);\n }\n while ((match = INDEXED_FIELD_REGEX.exec(template)) !== null) {\n fields.add(match[2]!);\n }\n\n return Array.from(fields);\n}\n"],"names":["interpolate","InterpolationFormat","SINGLE_FIELD_REGEX","INDEXED_FIELD_REGEX","DATA_INDEX_REGEX","DATA_COUNT_REGEX","FULL_DATA_REGEX","getFieldValue","item","fieldName","Object","prototype","hasOwnProperty","call","value","undefined","JSON","stringify","String","includes","parts","split","current","part","parseFormat","format","lowerFormat","toLowerCase","values","find","f","replaceDataFields","template","options","urlEncode","index","count","result","errors","replaceAll","_match","_leadingQuote","_trailingQuote","interpolationFormat","RAW","interpolationResult","map","v","lastIndex","bracketField","dotField","push","QUERYPARAM","PERCENTENCODE","encodeURIComponent","text","length","replaceDataFieldsBatch","items","leadingQuote","trailingQuote","e","match","indexStr","idx","parseInt","CSV","hasBatchPatterns","test","hasIndexedPatterns","hasDataFieldPatterns","extractFieldNames","fields","Set","exec","add","Array","from"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,2BAA2B;AAiC5E,8CAA8C;AAC9C,kKAAkK;AAClK,MAAMC,qBACJ;AAEF,mGAAmG;AACnG,MAAMC,sBAAsB;AAE5B,2BAA2B;AAC3B,MAAMC,mBAAmB;AAEzB,2BAA2B;AAC3B,MAAMC,mBAAmB;AAEzB,qFAAqF;AACrF,MAAMC,kBAAkB;AAExB;;;;CAIC,GACD,SAASC,cAAcC,IAAc,EAAEC,SAAiB;IACtD,uFAAuF;IACvF,IAAIC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAMC,YAAY;QACzD,MAAMK,QAAQN,IAAI,CAACC,UAAU;QAC7B,IAAIK,UAAUC,aAAaD,UAAU,MAAM;YACzC,OAAO;QACT;QACA,IAAI,OAAOA,UAAU,UAAU;YAC7B,OAAOE,KAAKC,SAAS,CAACH;QACxB;QACA,OAAOI,OAAOJ;IAChB;IAEA,oDAAoD;IACpD,IAAIL,UAAUU,QA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AAK,CAAC,EAAE;IACrB;IAEA,OAAOc,MAAMC,IAAI,CAACL;AACpB"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/data-field-interpolation.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { interpolate, InterpolationFormat } from './variable-interpolation';\n\n/**\n * Data item with its fields (used for selection/row data)\n */\nexport type DataItem = Record<string, unknown>;\n\n/**\n * Result of interpolation with data fields\n */\nexport interface InterpolationResult {\n text: string;\n errors?: string[];\n}\n\n/**\n * Options for data field replacement\n */\nexport interface ReplaceDataFieldsOptions {\n /**\n * Whether to URL encode values. Defaults to true.\n */\n urlEncode?: boolean;\n /**\n * Current index (0-based) for ${__data.index} replacement.\n */\n index?: number;\n /**\n * Total count for ${__data.count} replacement.\n */\n count?: number;\n}\n\n// Regex patterns for data field interpolation\n// Matches: ${__data.fields[\"fieldName\"]} or ${__data.fields['fieldName']} or ${__data.fields.fieldName} with optional format ${__data.fields[\"fieldName\"]:format}\nconst SINGLE_FIELD_REGEX =\n /\\$\\{__data\\.fields(?:\\[(?:\"|')([^\"']+)(?:\"|')\\]|\\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\\}/g;\n\n// Matches: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']} for indexed access\nconst INDEXED_FIELD_REGEX = /\\$\\{__data\\[(\\d+)\\]\\.fields\\[(?:\"|')([^\"']+)(?:\"|')\\]\\}/g;\n\n// Matches: ${__data.index}\nconst DATA_INDEX_REGEX = /\\$\\{__data\\.index\\}/g;\n\n// Matches: ${__data.count}\nconst DATA_COUNT_REGEX = /\\$\\{__data\\.count\\}/g;\n\n// Matches: ${__data} or ${__data:format} or '${__data:format}' or \"${__data:format}\"\nconst FULL_DATA_REGEX = /(\"|')?\\$\\{__data(?::([a-z]+))?\\}(\"|')?/g;\n\n/**\n * Get field value from a data item, converting to string.\n * Supports nested field access using dot notation in field names (e.g., \"foo.bar\" accesses item.foo.bar).\n * For backward compatibility, first checks if the exact key exists before attempting nested access.\n */\nfunction getFieldValue(item: DataItem, fieldName: string): string {\n // First, try direct property access (for backward compatibility with literal dot keys)\n if (Object.prototype.hasOwnProperty.call(item, fieldName)) {\n const value = item[fieldName];\n if (value === undefined || value === null) {\n return '';\n }\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return String(value);\n }\n\n // If not found and contains dots, try nested access\n if (fieldName.includes('.')) {\n const parts = fieldName.split('.');\n let current: unknown = item;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return '';\n }\n if (typeof current !== 'object') {\n return '';\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n if (current === undefined || current === null) {\n return '';\n }\n if (typeof current === 'object') {\n return JSON.stringify(current);\n }\n return String(current);\n }\n\n // Field not found\n return '';\n}\n\n/**\n * Parse format string to InterpolationFormat enum\n */\nexport function parseFormat(format: string | undefined): InterpolationFormat | undefined {\n if (!format) return undefined;\n const lowerFormat = format.toLowerCase();\n return Object.values(InterpolationFormat).find((f) => f === lowerFormat);\n}\n\n/**\n * Replace data field placeholders in a template string with values from a single data item.\n *\n * Supports:\n * - ${__data.fields[\"fieldName\"]} - field value from the item (URL encoded by default)\n * - ${__data.fields[\"fieldName\"]:format} - field value with format specifier\n * - ${__data.index} - current index (0-based) if provided in options\n * - ${__data.count} - total count if provided in options\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param item - The data item containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFields(\n template: string,\n item: DataItem,\n options: ReplaceDataFieldsOptions = {},\n): InterpolationResult {\n const { urlEncode = true, index, count } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace ${__data.index} if provided\n if (index !== undefined) {\n result = result.replaceAll(DATA_INDEX_REGEX, String(index));\n }\n\n // Replace ${__data.count} if provided\n if (count !== undefined) {\n result = result.replaceAll(DATA_COUNT_REGEX, String(count));\n }\n\n // Replace full data placeholder with optional format: ${__data} or ${__data:format}\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, _leadingQuote: string | undefined, format: string | undefined, _trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n let interpolationResult: string = '';\n\n if (interpolationFormat === InterpolationFormat.JSON) {\n interpolationResult = JSON.stringify(item);\n } else {\n interpolationResult = interpolate(\n Object.values(item).map((v) => JSON.stringify(v)),\n '',\n interpolationFormat,\n );\n }\n\n return interpolationResult;\n },\n );\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace __data.fields[\"fieldName\"] or __data.fields.fieldName patterns\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const value = getFieldValue(item, fieldName);\n if (value === '' && item[fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data`);\n }\n const interpolationFormat = parseFormat(format);\n if (interpolationFormat) {\n return interpolate([value], fieldName, interpolationFormat);\n }\n\n if (urlEncode) {\n // override: disable urlEncode for RAW format\n if (interpolationFormat === InterpolationFormat.RAW) {\n return value;\n }\n\n // avoid double encoding for queryparam and percentencode formats\n if (\n interpolationFormat !== InterpolationFormat.QUERYPARAM &&\n interpolationFormat !== InterpolationFormat.PERCENTENCODE\n ) {\n return encodeURIComponent(value);\n }\n }\n\n return value;\n },\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Replace data field placeholders in a template string with values from multiple data items (batch mode).\n *\n * Supports:\n * - ${__data[0].fields[\"fieldName\"]} - field value from specific item by index\n * - ${__data.fields[\"fieldName\"]} - aggregated field values (defaults to CSV format)\n * - ${__data.fields[\"fieldName\"]:csv} - aggregated field values with format specifier\n * - ${__data.count} - total number of items\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param items - Array of data items containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFieldsBatch(\n template: string,\n items: DataItem[],\n options: ReplaceDataFieldsOptions = {},\n): InterpolationResult {\n const { urlEncode = true } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace __data.count with items length\n result = result.replaceAll(DATA_COUNT_REGEX, String(items.length));\n\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace full data placeholder with optional format\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, leadingQuote: string | undefined, format: string | undefined, trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n\n const interpolationResult = interpolate(\n Object.values(items).map((e) => JSON.stringify(e)),\n '',\n interpolationFormat,\n );\n\n if (!leadingQuote || !trailingQuote) {\n // preserve quotes as they were not surrounding the full_data pattern\n return `${leadingQuote ?? ''}${interpolationResult}${trailingQuote ?? ''}`;\n }\n\n return interpolationResult;\n },\n );\n\n // Replace indexed access: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']}\n result = result.replaceAll(INDEXED_FIELD_REGEX, (match, indexStr: string, fieldName: string) => {\n const idx = parseInt(indexStr, 10);\n if (idx < 0 || idx >= items.length) {\n errors.push(`Index ${idx} out of bounds (0-${items.length - 1})`);\n return match;\n }\n const value = getFieldValue(items[idx]!, fieldName);\n if (value === '' && items[idx]![fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data at index ${idx}`);\n }\n return urlEncode ? encodeURIComponent(value) : value;\n });\n\n // Replace aggregated access with format: ${__data.fields[\"fieldName\"]:csv} or ${__data.fields.fieldName:csv}\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const values = items.map((item) => getFieldValue(item, fieldName));\n const interpolationFormat = parseFormat(format) || InterpolationFormat.CSV;\n return interpolate(values, fieldName, interpolationFormat);\n },\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Check if a template contains batch-only patterns (indexed access or format specifiers)\n */\nexport function hasBatchPatterns(template: string): boolean {\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return (\n INDEXED_FIELD_REGEX.test(template) ||\n /\\$\\{__data\\.fields(?:\\[[\"'][^\"']+[\"']\\]|\\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\\}/.test(template)\n );\n}\n\n/**\n * Check if a template contains indexed access patterns\n */\nexport function hasIndexedPatterns(template: string): boolean {\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Check if a template contains data field patterns\n */\nexport function hasDataFieldPatterns(template: string): boolean {\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return SINGLE_FIELD_REGEX.test(template) || INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Extract all field names referenced in a template\n */\nexport function extractFieldNames(template: string): string[] {\n const fields = new Set<string>();\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n\n let match;\n while ((match = SINGLE_FIELD_REGEX.exec(template)) !== null) {\n // Group 1 is bracket notation, group 2 is dot notation\n fields.add(match[1] ?? match[2]!);\n }\n while ((match = INDEXED_FIELD_REGEX.exec(template)) !== null) {\n fields.add(match[2]!);\n }\n\n return Array.from(fields);\n}\n"],"names":["interpolate","InterpolationFormat","SINGLE_FIELD_REGEX","INDEXED_FIELD_REGEX","DATA_INDEX_REGEX","DATA_COUNT_REGEX","FULL_DATA_REGEX","getFieldValue","item","fieldName","Object","prototype","hasOwnProperty","call","value","undefined","JSON","stringify","String","includes","parts","split","current","part","parseFormat","format","lowerFormat","toLowerCase","values","find","f","replaceDataFields","template","options","urlEncode","index","count","result","errors","replaceAll","_match","_leadingQuote","_trailingQuote","interpolationFormat","RAW","interpolationResult","map","v","lastIndex","bracketField","dotField","push","QUERYPARAM","PERCENTENCODE","encodeURIComponent","text","length","replaceDataFieldsBatch","items","leadingQuote","trailingQuote","e","match","indexStr","idx","parseInt","CSV","hasBatchPatterns","test","hasIndexedPatterns","hasDataFieldPatterns","extractFieldNames","fields","Set","exec","add","Array","from"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,8BAA2B;AAiC5E,8CAA8C;AAC9C,kKAAkK;AAClK,MAAMC,qBACJ;AAEF,mGAAmG;AACnG,MAAMC,sBAAsB;AAE5B,2BAA2B;AAC3B,MAAMC,mBAAmB;AAEzB,2BAA2B;AAC3B,MAAMC,mBAAmB;AAEzB,qFAAqF;AACrF,MAAMC,kBAAkB;AAExB;;;;CAIC,GACD,SAASC,cAAcC,IAAc,EAAEC,SAAiB;IACtD,uFAAuF;IACvF,IAAIC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAMC,YAAY;QACzD,MAAMK,QAAQN,IAAI,CAACC,UAAU;QAC7B,IAAIK,UAAUC,aAAaD,UAAU,MAAM;YACzC,OAAO;QACT;QACA,IAAI,OAAOA,UAAU,UAAU;YAC7B,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AACA,CAAAA,QAAQ3D,oBAAoBuE,IAAI,CAAC1C,SAAQ,MAAO,KAAM;QAC5DwC,OAAOG,GAAG,CAACb,KAAK,CAAC,EAAE;IACrB;IAEA,OAAOc,MAAMC,IAAI,CAACL;AACpB"}
|
package/dist/utils/format.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { tz } from
|
|
14
|
-
import { format } from
|
|
13
|
+
import { tz } from "@date-fns/tz";
|
|
14
|
+
import { format } from "date-fns";
|
|
15
15
|
export function dateFormatOptionsWithTimeZone(dateFormatOptions, timeZone) {
|
|
16
16
|
/*
|
|
17
17
|
* if timeZone is provided, and is not local|browser,
|
package/dist/utils/index.js
CHANGED
|
@@ -10,24 +10,24 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
13
|
+
export * from "./axis.js";
|
|
14
|
+
export * from "./browser-storage.js";
|
|
15
|
+
export * from "./chart-actions.js";
|
|
16
|
+
export * from "./combine-sx.js";
|
|
17
|
+
export * from "./component-ids.js";
|
|
18
|
+
export * from "./data-field-interpolation.js";
|
|
19
|
+
export * from "./format.js";
|
|
20
|
+
export * from "./memo.js";
|
|
21
|
+
export * from "./request-interpolation.js";
|
|
22
|
+
export * from "./selection-interpolation.js";
|
|
23
|
+
export * from "./theme-gen.js";
|
|
24
|
+
export * from "./variable-interpolation.js";
|
|
25
|
+
export * from "./value-mapping.js";
|
|
26
|
+
export * from "./regexp.js";
|
|
27
|
+
export * from "./transform-data.js";
|
|
28
|
+
export * from "./time-series-data.js";
|
|
29
|
+
export * from "./trace-data.js";
|
|
30
|
+
export * from "./types.js";
|
|
31
|
+
export * from "./text.js";
|
|
32
32
|
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './axis';\nexport * from './browser-storage';\nexport * from './chart-actions';\nexport * from './combine-sx';\nexport * from './component-ids';\nexport * from './data-field-interpolation';\nexport * from './format';\nexport * from './memo';\nexport * from './request-interpolation';\nexport * from './selection-interpolation';\nexport * from './theme-gen';\nexport * from './variable-interpolation';\nexport * from './value-mapping';\nexport * from './regexp';\nexport * from './transform-data';\nexport * from './time-series-data';\nexport * from './trace-data';\nexport * from './types';\nexport * from './text';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './axis';\nexport * from './browser-storage';\nexport * from './chart-actions';\nexport * from './combine-sx';\nexport * from './component-ids';\nexport * from './data-field-interpolation';\nexport * from './format';\nexport * from './memo';\nexport * from './request-interpolation';\nexport * from './selection-interpolation';\nexport * from './theme-gen';\nexport * from './variable-interpolation';\nexport * from './value-mapping';\nexport * from './regexp';\nexport * from './transform-data';\nexport * from './time-series-data';\nexport * from './trace-data';\nexport * from './types';\nexport * from './text';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,YAAS;AACvB,cAAc,uBAAoB;AAClC,cAAc,qBAAkB;AAChC,cAAc,kBAAe;AAC7B,cAAc,qBAAkB;AAChC,cAAc,gCAA6B;AAC3C,cAAc,cAAW;AACzB,cAAc,YAAS;AACvB,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,iBAAc;AAC5B,cAAc,8BAA2B;AACzC,cAAc,qBAAkB;AAChC,cAAc,cAAW;AACzB,cAAc,sBAAmB;AACjC,cAAc,wBAAqB;AACnC,cAAc,kBAAe;AAC7B,cAAc,aAAU;AACxB,cAAc,YAAS"}
|
package/dist/utils/mathjs.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { roundDependencies, gcdDependencies, create } from
|
|
13
|
+
import { roundDependencies, gcdDependencies, create } from "mathjs";
|
|
14
14
|
// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
|
|
15
15
|
const { round } = create({
|
|
16
16
|
roundDependencies
|
package/dist/utils/memo.d.ts
CHANGED
package/dist/utils/memo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/utils/memo.ts"],"names":[],"mappings":"AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/utils/memo.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,GAAG,CAAC,CAgBxE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,GAAG,CAAC,CAMxE"}
|
package/dist/utils/memo.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import isEqual from
|
|
14
|
-
import { useRef } from
|
|
13
|
+
import isEqual from "lodash/isEqual";
|
|
14
|
+
import { useRef } from "react";
|
|
15
15
|
/**
|
|
16
16
|
* Like React's useMemo, but guarantees the value will only be recalulated if
|
|
17
17
|
* a dependency changes. Uses strict equality (===) for comparison. (React's
|
package/dist/utils/memo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/memo.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport isEqual from 'lodash/isEqual';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/memo.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport isEqual from 'lodash/isEqual';\nimport type { DependencyList } from 'react';\nimport { useRef } from 'react';\n\ntype MemoRef<T> = {\n value: T;\n deps: DependencyList;\n};\n\n/**\n * Like React's useMemo, but guarantees the value will only be recalulated if\n * a dependency changes. Uses strict equality (===) for comparison. (React's\n * useMemo does not offer this guarantee, it's only a performance optimization).\n */\nexport function useMemoized<T>(factory: () => T, deps: DependencyList): T {\n const ref = useRef<MemoRef<T>>();\n\n let areEqual = true;\n for (let i = 0; i < deps.length; i++) {\n if (ref.current?.deps[i] !== deps[i]) {\n areEqual = false;\n break;\n }\n }\n\n if (ref.current === undefined || areEqual === false) {\n ref.current = { value: factory(), deps: deps };\n }\n\n return ref.current.value;\n}\n\n/**\n * Like React's useMemo, except it does a deep equality comparison with lodash's\n * isEqual on the dependency list.\n */\nexport function useDeepMemo<T>(factory: () => T, deps: DependencyList): T {\n const ref = useRef<MemoRef<T>>();\n if (ref.current === undefined || isEqual(deps, ref.current.deps) === false) {\n ref.current = { value: factory(), deps };\n }\n return ref.current.value;\n}\n"],"names":["isEqual","useRef","useMemoized","factory","deps","ref","areEqual","i","length","current","undefined","value","useDeepMemo"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,aAAa,iBAAiB;AAErC,SAASC,MAAM,QAAQ,QAAQ;AAO/B;;;;CAIC,GACD,OAAO,SAASC,YAAeC,OAAgB,EAAEC,IAAoB;IACnE,MAAMC,MAAMJ;IAEZ,IAAIK,WAAW;IACf,IAAK,IAAIC,IAAI,GAAGA,IAAIH,KAAKI,MAAM,EAAED,IAAK;QACpC,IAAIF,IAAII,OAAO,EAAEL,IAAI,CAACG,EAAE,KAAKH,IAAI,CAACG,EAAE,EAAE;YACpCD,WAAW;YACX;QACF;IACF;IAEA,IAAID,IAAII,OAAO,KAAKC,aAAaJ,aAAa,OAAO;QACnDD,IAAII,OAAO,GAAG;YAAEE,OAAOR;YAAWC,MAAMA;QAAK;IAC/C;IAEA,OAAOC,IAAII,OAAO,CAACE,KAAK;AAC1B;AAEA;;;CAGC,GACD,OAAO,SAASC,YAAeT,OAAgB,EAAEC,IAAoB;IACnE,MAAMC,MAAMJ;IACZ,IAAII,IAAII,OAAO,KAAKC,aAAaV,QAAQI,MAAMC,IAAII,OAAO,CAACL,IAAI,MAAM,OAAO;QAC1EC,IAAII,OAAO,GAAG;YAAEE,OAAOR;YAAWC;QAAK;IACzC;IACA,OAAOC,IAAII,OAAO,CAACE,KAAK;AAC1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestHeaders } from '@perses-dev/client';
|
|
2
|
-
import { VariableStateMap } from './variable-interpolation';
|
|
1
|
+
import type { RequestHeaders } from '@perses-dev/client';
|
|
2
|
+
import type { VariableStateMap } from './variable-interpolation';
|
|
3
3
|
export type QueryParamValues = Record<string, string | string[]>;
|
|
4
4
|
export declare function interpolateHeaders(headers: Record<string, string>, variableState: VariableStateMap): RequestHeaders;
|
|
5
5
|
export declare function interpolateQueryParams(queryParams: QueryParamValues, variableState: VariableStateMap): QueryParamValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-interpolation.d.ts","sourceRoot":"","sources":["../../src/utils/request-interpolation.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"request-interpolation.d.ts","sourceRoot":"","sources":["../../src/utils/request-interpolation.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AA4DjE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,gBAAgB,GAAG,cAAc,CAMnH;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,gBAAgB,EAC7B,aAAa,EAAE,gBAAgB,GAC9B,gBAAgB,CAUlB"}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { createRegexFromString } from
|
|
14
|
-
import { replaceVariables, parseVariablesAndFormat, InterpolationFormat } from
|
|
13
|
+
import { createRegexFromString } from "./regexp.js";
|
|
14
|
+
import { replaceVariables, parseVariablesAndFormat, InterpolationFormat } from "./variable-interpolation.js";
|
|
15
15
|
function expandQueryParamValue(value, variableState) {
|
|
16
16
|
// If value is an array, process each element
|
|
17
17
|
if (Array.isArray(value)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/request-interpolation.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { RequestHeaders } from '@perses-dev/client';\n\nimport { createRegexFromString } from './regexp';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/request-interpolation.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { RequestHeaders } from '@perses-dev/client';\n\nimport { createRegexFromString } from './regexp';\nimport type { VariableStateMap } from './variable-interpolation';\nimport { replaceVariables, parseVariablesAndFormat, InterpolationFormat } from './variable-interpolation';\n\nexport type QueryParamValues = Record<string, string | string[]>;\n\nfunction expandQueryParamValue(value: string | string[], variableState: VariableStateMap): string | string[] {\n // If value is an array, process each element\n if (Array.isArray(value)) {\n return value.map((v) => expandQueryParamValue(v, variableState) as string);\n }\n\n // Now we know value is a string, so we can safely use string methods\n const valueString = value as string;\n const variablesMap = parseVariablesAndFormat(valueString);\n\n // Find the first multi-value variable that should expand to repeated keys\n for (const [varName, format] of variablesMap) {\n const varState = variableState[varName];\n if (!varState) continue;\n\n const options = varState.options ?? [];\n const allOptionValues = options.map((o) => o.value);\n\n const isArray = Array.isArray(varState.value);\n const isCustomAllValue = varState.customAllValue !== undefined;\n\n let expandValues: string[] | undefined;\n if (isArray) {\n expandValues = varState.value as string[];\n } else if (isCustomAllValue) {\n try {\n const regex = createRegexFromString(varState.customAllValue as string);\n const matched = options.filter((o) => regex.test(o.value)).map((o) => o.value);\n expandValues = matched.length > 0 ? matched : allOptionValues;\n } catch {\n expandValues = allOptionValues;\n }\n }\n if (!expandValues) continue;\n\n // If format is queryparam or not specified (default for query params), expand to array\n if (!format || format === InterpolationFormat.QUERYPARAM) {\n // Build syntax patterns for this variable reference\n const simpleSyntax = '$' + varName;\n const bracketSyntax = format ? '${' + varName + ':' + format + '}' : '${' + varName + '}';\n\n return expandValues.map((singleValue) => {\n let text = valueString;\n // Replace the variable reference with the raw value directly.\n // We cannot use replaceVariables here because it would apply QUERYPARAM format\n // to the single value, producing \"varName=val\" instead of just \"val\".\n text = text.replaceAll(bracketSyntax, singleValue);\n text = text.replaceAll(simpleSyntax, singleValue);\n // Replace any remaining variables (other than the expanded one) using standard interpolation\n return replaceVariables(text, variableState);\n });\n }\n }\n\n // No multi-value expansion needed — use standard interpolation\n return replaceVariables(valueString, variableState);\n}\n\nexport function interpolateHeaders(headers: Record<string, string>, variableState: VariableStateMap): RequestHeaders {\n const result: RequestHeaders = {};\n for (const [key, value] of Object.entries(headers)) {\n result[key] = replaceVariables(value, variableState);\n }\n return result;\n}\n\nexport function interpolateQueryParams(\n queryParams: QueryParamValues,\n variableState: VariableStateMap,\n): QueryParamValues {\n const result: QueryParamValues = {};\n for (const [key, value] of Object.entries(queryParams)) {\n if (Array.isArray(value)) {\n result[key] = value.map((v) => replaceVariables(v, variableState));\n } else {\n result[key] = expandQueryParamValue(value, variableState);\n }\n }\n return result;\n}\n"],"names":["createRegexFromString","replaceVariables","parseVariablesAndFormat","InterpolationFormat","expandQueryParamValue","value","variableState","Array","isArray","map","v","valueString","variablesMap","varName","format","varState","options","allOptionValues","o","isCustomAllValue","customAllValue","undefined","expandValues","regex","matched","filter","test","length","QUERYPARAM","simpleSyntax","bracketSyntax","singleValue","text","replaceAll","interpolateHeaders","headers","result","key","Object","entries","interpolateQueryParams","queryParams"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,qBAAqB,QAAQ,cAAW;AAEjD,SAASC,gBAAgB,EAAEC,uBAAuB,EAAEC,mBAAmB,QAAQ,8BAA2B;AAI1G,SAASC,sBAAsBC,KAAwB,EAAEC,aAA+B;IACtF,6CAA6C;IAC7C,IAAIC,MAAMC,OAAO,CAACH,QAAQ;QACxB,OAAOA,MAAMI,GAAG,CAAC,CAACC,IAAMN,sBAAsBM,GAAGJ;IACnD;IAEA,qEAAqE;IACrE,MAAMK,cAAcN;IACpB,MAAMO,eAAeV,wBAAwBS;IAE7C,0EAA0E;IAC1E,KAAK,MAAM,CAACE,SAASC,OAAO,IAAIF,aAAc;QAC5C,MAAMG,WAAWT,aAAa,CAACO,QAAQ;QACvC,IAAI,CAACE,UAAU;QAEf,MAAMC,UAAUD,SAASC,OAAO,IAAI,EAAE;QACtC,MAAMC,kBAAkBD,QAAQP,GAAG,CAAC,CAACS,IAAMA,EAAEb,KAAK;QAElD,MAAMG,UAAUD,MAAMC,OAAO,CAACO,SAASV,KAAK;QAC5C,MAAMc,mBAAmBJ,SAASK,cAAc,KAAKC;QAErD,IAAIC;QACJ,IAAId,SAAS;YACXc,eAAeP,SAASV,KAAK;QAC/B,OAAO,IAAIc,kBAAkB;YAC3B,IAAI;gBACF,MAAMI,QAAQvB,sBAAsBe,SAASK,cAAc;gBAC3D,MAAMI,UAAUR,QAAQS,MAAM,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,OAAO;YACL8B,MAAM,CAACC,IAAI,GAAGjC,sBAAsBC,OAAOC;QAC7C;IACF;IACA,OAAO8B;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataItem, InterpolationResult } from './data-field-interpolation';
|
|
2
|
-
import { VariableStateMap } from './variable-interpolation';
|
|
1
|
+
import type { DataItem, InterpolationResult } from './data-field-interpolation';
|
|
2
|
+
import type { VariableStateMap } from './variable-interpolation';
|
|
3
3
|
export type SelectionItem = DataItem;
|
|
4
4
|
/**
|
|
5
5
|
* Interpolate selection data into a template string for individual mode.
|