@perses-dev/components 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-explorer-plugin-c4a7621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlignSelector/AlignSelector.d.ts +9 -0
- package/dist/AlignSelector/AlignSelector.d.ts.map +1 -0
- package/dist/AlignSelector/AlignSelector.js +42 -0
- package/dist/AlignSelector/AlignSelector.js.map +1 -0
- package/dist/AlignSelector/index.d.ts +2 -0
- package/dist/AlignSelector/index.d.ts.map +1 -0
- package/dist/AlignSelector/index.js +15 -0
- package/dist/AlignSelector/index.js.map +1 -0
- package/dist/BarChart/BarChart.d.ts +2 -1
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +11 -6
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.d.ts +3 -1
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +28 -13
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.d.ts +9 -0
- package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -0
- package/dist/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +16 -13
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -0
- package/dist/ColorPicker/index.d.ts +1 -0
- package/dist/ColorPicker/index.d.ts.map +1 -1
- package/dist/ColorPicker/index.js +1 -0
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.d.ts +2 -1
- package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +8 -5
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +2 -3
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.d.ts +8 -0
- package/dist/DensitySelector/DensitySelector.d.ts.map +1 -0
- package/dist/DensitySelector/DensitySelector.js +46 -0
- package/dist/DensitySelector/DensitySelector.js.map +1 -0
- package/dist/DensitySelector/index.d.ts +2 -0
- package/dist/DensitySelector/index.d.ts.map +1 -0
- package/dist/DensitySelector/index.js +15 -0
- package/dist/DensitySelector/index.js.map +1 -0
- package/dist/Dialog/Dialog.d.ts +9 -14
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +7 -3
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +2 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.d.ts +24 -0
- package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -0
- package/dist/DragAndDrop/DragAndDropList.js +153 -0
- package/dist/DragAndDrop/DragAndDropList.js.map +1 -0
- package/dist/DragAndDrop/DragButton.d.ts +13 -0
- package/dist/DragAndDrop/DragButton.d.ts.map +1 -0
- package/dist/DragAndDrop/DragButton.js +97 -0
- package/dist/DragAndDrop/DragButton.js.map +1 -0
- package/dist/DragAndDrop/DropIndicator.d.ts +3 -0
- package/dist/DragAndDrop/DropIndicator.d.ts.map +1 -0
- package/dist/DragAndDrop/DropIndicator.js +44 -0
- package/dist/DragAndDrop/DropIndicator.js.map +1 -0
- package/dist/DragAndDrop/index.d.ts +4 -0
- package/dist/DragAndDrop/index.d.ts.map +1 -0
- package/dist/DragAndDrop/index.js +17 -0
- package/dist/DragAndDrop/index.js.map +1 -0
- package/dist/DragAndDrop/model.d.ts +11 -0
- package/dist/DragAndDrop/model.d.ts.map +1 -0
- package/dist/DragAndDrop/model.js +17 -0
- package/dist/DragAndDrop/model.js.map +1 -0
- package/dist/Drawer/Drawer.d.ts +2 -1
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/EChart/EChart.d.ts +2 -2
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +5 -6
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/ErrorAlert.d.ts +2 -1
- package/dist/ErrorAlert.d.ts.map +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.d.ts +2 -1
- package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FormEditor/FormActions.d.ts +16 -0
- package/dist/FormEditor/FormActions.d.ts.map +1 -0
- package/dist/FormEditor/FormActions.js +75 -0
- package/dist/FormEditor/FormActions.js.map +1 -0
- package/dist/FormEditor/index.d.ts +2 -0
- package/dist/FormEditor/index.d.ts.map +1 -0
- package/dist/FormEditor/index.js +15 -0
- package/dist/FormEditor/index.js.map +1 -0
- package/dist/FormatControls/FormatControls.d.ts +2 -1
- package/dist/FormatControls/FormatControls.d.ts.map +1 -1
- package/dist/FormatControls/FormatControls.js +2 -2
- package/dist/FormatControls/FormatControls.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.d.ts +2 -1
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +4 -7
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.d.ts +3 -3
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +3 -4
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/JSONEditor.d.ts +2 -1
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.d.ts +2 -1
- package/dist/Legend/CompactLegend.d.ts.map +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts +2 -1
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +8 -4
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.d.ts +2 -2
- package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
- package/dist/Legend/LegendColorBadge.js +2 -2
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.d.ts +2 -1
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +5 -5
- package/dist/Legend/ListLegendItem.d.ts.map +1 -1
- package/dist/Legend/ListLegendItem.js +8 -12
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts +2 -1
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +1 -0
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/legend-model.d.ts.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +1 -1
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +6 -11
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LinksEditor/LinksEditor.d.ts +8 -0
- package/dist/LinksEditor/LinksEditor.d.ts.map +1 -0
- package/dist/LinksEditor/LinksEditor.js +161 -0
- package/dist/LinksEditor/LinksEditor.js.map +1 -0
- package/dist/LinksEditor/index.d.ts +2 -0
- package/dist/LinksEditor/index.d.ts.map +1 -0
- package/dist/LinksEditor/index.js +15 -0
- package/dist/LinksEditor/index.js.map +1 -0
- package/dist/ModeSelector/ModeSelector.d.ts +2 -1
- package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/Overlay/Overlay.d.ts +16 -0
- package/dist/Overlay/Overlay.d.ts.map +1 -0
- package/dist/Overlay/Overlay.js +52 -0
- package/dist/Overlay/Overlay.js.map +1 -0
- package/dist/Overlay/index.d.ts +2 -0
- package/dist/Overlay/index.d.ts.map +1 -0
- package/dist/Overlay/index.js +15 -0
- package/dist/Overlay/index.js.map +1 -0
- package/dist/PieChart/PieChart.d.ts +14 -0
- package/dist/PieChart/PieChart.d.ts.map +1 -0
- package/dist/PieChart/PieChart.js +92 -0
- package/dist/PieChart/PieChart.js.map +1 -0
- package/dist/PieChart/index.d.ts +2 -0
- package/dist/PieChart/index.d.ts.map +1 -0
- package/dist/PieChart/index.js +15 -0
- package/dist/PieChart/index.js.map +1 -0
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +2 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +2 -2
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +6 -5
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SortSelector/SortSelector.d.ts +2 -1
- package/dist/SortSelector/SortSelector.d.ts.map +1 -1
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/SortSelectorButtons.d.ts +9 -0
- package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -0
- package/dist/SortSelector/SortSelectorButtons.js +42 -0
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -0
- package/dist/SortSelector/index.d.ts +1 -0
- package/dist/SortSelector/index.d.ts.map +1 -1
- package/dist/SortSelector/index.js +2 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +6 -5
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +10 -16
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.d.ts.map +1 -1
- package/dist/StatChart/calculateFontSize.js +2 -4
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/utils/formatStatChartValue.d.ts +3 -0
- package/dist/StatChart/utils/formatStatChartValue.d.ts.map +1 -0
- package/dist/StatChart/utils/formatStatChartValue.js +26 -0
- package/dist/StatChart/utils/formatStatChartValue.js.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +27 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.js +132 -0
- package/dist/StatusHistoryChart/StatusHistoryChart.js.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +13 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +1 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.js +47 -0
- package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +1 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts +2 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts.map +1 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.js +41 -0
- package/dist/StatusHistoryChart/get-formatted-axis-label.js.map +1 -0
- package/dist/StatusHistoryChart/index.d.ts +3 -0
- package/dist/StatusHistoryChart/index.d.ts.map +1 -0
- package/dist/StatusHistoryChart/index.js +16 -0
- package/dist/StatusHistoryChart/index.js.map +1 -0
- package/dist/StatusHistoryChart/utils/get-color.d.ts +6 -0
- package/dist/StatusHistoryChart/utils/get-color.d.ts.map +1 -0
- package/dist/StatusHistoryChart/utils/get-color.js +100 -0
- package/dist/StatusHistoryChart/utils/get-color.js.map +1 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts +3 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts.map +1 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.js +27 -0
- package/dist/StatusHistoryChart/utils/get-tooltip-position.js.map +1 -0
- package/dist/Table/InnerTable.d.ts.map +1 -1
- package/dist/Table/InnerTable.js +2 -1
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +2 -1
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +10 -8
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableCell.d.ts +4 -2
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +28 -6
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.d.ts +2 -1
- package/dist/Table/TableCheckbox.d.ts.map +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHeaderCell.d.ts +3 -2
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +5 -4
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +17 -14
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts +2 -2
- 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 +10 -12
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.d.ts +1 -2
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +22 -2
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +27 -21
- 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 +2 -2
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +2 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +18 -26
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +5 -8
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +19 -0
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +43 -28
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +36 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.js +119 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.d.ts +1 -2
- package/dist/TimeRangeSelector/index.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
- package/dist/TimeRangeSelector/index.js.map +1 -0
- package/dist/TimeRangeSelector/utils.d.ts +25 -0
- package/dist/TimeRangeSelector/utils.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/utils.js +23 -2
- package/dist/TimeRangeSelector/utils.js.map +1 -0
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +6 -11
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +2 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +2 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +2 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +2 -3
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts +2 -1
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -14
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +15 -25
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +8 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +13 -2
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -21
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +2 -4
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/TransformsEditor/TransformEditor.d.ts +9 -0
- package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -0
- package/dist/TransformsEditor/TransformEditor.js +289 -0
- package/dist/TransformsEditor/TransformEditor.js.map +1 -0
- package/dist/TransformsEditor/TransformEditorContainer.d.ts +10 -0
- package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -0
- package/dist/TransformsEditor/TransformEditorContainer.js +118 -0
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -0
- package/dist/TransformsEditor/TransformsEditor.d.ts +9 -0
- package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -0
- package/dist/TransformsEditor/TransformsEditor.js +90 -0
- package/dist/TransformsEditor/TransformsEditor.js.map +1 -0
- package/dist/TransformsEditor/index.d.ts +2 -0
- package/dist/TransformsEditor/index.d.ts.map +1 -0
- package/dist/TransformsEditor/index.js +15 -0
- package/dist/TransformsEditor/index.js.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.d.ts +10 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.js +374 -0
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +8 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.js +118 -0
- package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -0
- package/dist/ValueMappingEditor/index.d.ts +2 -0
- package/dist/ValueMappingEditor/index.d.ts.map +1 -0
- package/dist/ValueMappingEditor/index.js +15 -0
- package/dist/ValueMappingEditor/index.js.map +1 -0
- package/dist/YAxisLabel.d.ts +2 -1
- package/dist/YAxisLabel.d.ts.map +1 -1
- package/dist/YAxisLabel.js +4 -2
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/AlignSelector/AlignSelector.js +50 -0
- package/dist/cjs/AlignSelector/index.js +30 -0
- package/dist/cjs/BarChart/BarChart.js +12 -7
- package/dist/cjs/ColorPicker/ColorPicker.js +28 -54
- package/dist/cjs/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +18 -15
- package/dist/cjs/ColorPicker/index.js +1 -0
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +8 -10
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +2 -3
- package/dist/cjs/DensitySelector/DensitySelector.js +54 -0
- package/dist/cjs/DensitySelector/index.js +30 -0
- package/dist/cjs/Dialog/Dialog.js +7 -3
- package/dist/cjs/DragAndDrop/DragAndDropList.js +159 -0
- package/dist/cjs/DragAndDrop/DragButton.js +121 -0
- package/dist/cjs/DragAndDrop/DropIndicator.js +52 -0
- package/dist/cjs/DragAndDrop/index.js +32 -0
- package/dist/cjs/DragAndDrop/model.js +25 -0
- package/dist/cjs/Drawer/Drawer.js +1 -1
- package/dist/cjs/EChart/EChart.js +5 -47
- package/dist/cjs/FormEditor/FormActions.js +83 -0
- package/dist/cjs/FormEditor/index.js +30 -0
- package/dist/cjs/FormatControls/FormatControls.js +2 -2
- package/dist/cjs/GaugeChart/GaugeChart.js +5 -8
- package/dist/cjs/InfoTooltip/InfoTooltip.js +3 -9
- package/dist/cjs/Legend/Legend.js +8 -4
- package/dist/cjs/Legend/LegendColorBadge.js +2 -7
- package/dist/cjs/Legend/ListLegendItem.js +6 -50
- package/dist/cjs/Legend/TableLegend.js +1 -0
- package/dist/cjs/LineChart/LineChart.js +8 -13
- package/dist/cjs/LinksEditor/LinksEditor.js +174 -0
- package/dist/cjs/LinksEditor/index.js +30 -0
- package/dist/cjs/Overlay/Overlay.js +71 -0
- package/dist/cjs/Overlay/index.js +30 -0
- package/dist/cjs/PieChart/PieChart.js +100 -0
- package/dist/cjs/PieChart/index.js +30 -0
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +6 -5
- package/dist/cjs/SortSelector/SortSelectorButtons.js +50 -0
- package/dist/cjs/SortSelector/index.js +2 -1
- package/dist/cjs/StatChart/StatChart.js +13 -19
- package/dist/cjs/StatChart/calculateFontSize.js +2 -4
- package/dist/cjs/StatChart/utils/formatStatChartValue.js +34 -0
- package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +140 -0
- package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +55 -0
- package/dist/cjs/StatusHistoryChart/get-formatted-axis-label.js +48 -0
- package/dist/cjs/StatusHistoryChart/index.js +31 -0
- package/dist/cjs/StatusHistoryChart/utils/get-color.js +125 -0
- package/dist/cjs/StatusHistoryChart/utils/get-tooltip-position.js +35 -0
- package/dist/cjs/Table/InnerTable.js +2 -1
- package/dist/cjs/Table/Table.js +9 -7
- package/dist/cjs/Table/TableCell.js +28 -6
- package/dist/cjs/Table/VirtualizedTable.js +17 -14
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
- package/dist/cjs/Table/index.js +1 -7
- package/dist/cjs/Table/model/table-model.js +30 -21
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +2 -2
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +18 -26
- package/dist/cjs/TimeChart/TimeChart.js +5 -8
- package/dist/cjs/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +37 -30
- package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +127 -0
- package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
- package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/utils.js +24 -1
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +6 -11
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -2
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +2 -3
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +6 -14
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +15 -25
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +22 -2
- package/dist/cjs/TimeSeriesTooltip/utils.js +2 -4
- package/dist/cjs/TransformsEditor/TransformEditor.js +297 -0
- package/dist/cjs/TransformsEditor/TransformEditorContainer.js +131 -0
- package/dist/cjs/TransformsEditor/TransformsEditor.js +103 -0
- package/dist/cjs/TransformsEditor/index.js +30 -0
- package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +387 -0
- package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +131 -0
- package/dist/cjs/ValueMappingEditor/index.js +30 -0
- package/dist/cjs/YAxisLabel.js +4 -2
- package/dist/cjs/context/TimeZoneProvider.js +1 -1
- package/dist/cjs/controls/TextField.js +54 -0
- package/dist/cjs/controls/index.js +30 -0
- package/dist/cjs/index.js +12 -1
- package/dist/cjs/model/timeOption.js +19 -1
- package/dist/cjs/theme/index.js +1 -0
- package/dist/cjs/theme/palette/background.js +2 -0
- package/dist/cjs/theme/theme.js +6 -6
- package/dist/cjs/utils/chart-actions.js +2 -3
- package/dist/cjs/utils/format.js +19 -1
- package/dist/cjs/utils/theme-gen.js +5 -7
- package/dist/context/ChartsProvider.d.ts +2 -2
- package/dist/context/ChartsProvider.d.ts.map +1 -1
- package/dist/context/ChartsProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.d.ts +4 -4
- package/dist/context/TimeZoneProvider.d.ts.map +1 -1
- package/dist/context/TimeZoneProvider.js +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/controls/TextField.d.ts +9 -0
- package/dist/controls/TextField.d.ts.map +1 -0
- package/dist/controls/TextField.js +41 -0
- package/dist/controls/TextField.js.map +1 -0
- package/dist/controls/index.d.ts +2 -0
- package/dist/controls/index.d.ts.map +1 -0
- package/dist/controls/index.js +15 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/model/timeOption.d.ts +2 -1
- package/dist/model/timeOption.d.ts.map +1 -1
- package/dist/model/timeOption.js +13 -2
- package/dist/model/timeOption.js.map +1 -1
- package/dist/test/render.d.ts +3 -3
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.d.ts.map +1 -1
- package/dist/theme/palette/background.js +2 -0
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/theme.d.ts +2 -2
- 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/utils/axis.d.ts +1 -7
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +2 -3
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/component-ids.d.ts.map +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.d.ts +10 -4
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +16 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/theme-gen.js +5 -7
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +12 -8
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +0 -9
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +0 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -11
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -80
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +0 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +0 -13
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +0 -67
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +0 -1
- package/dist/DateTimeRangePicker/index.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/index.js.map +0 -1
- package/dist/DateTimeRangePicker/utils.d.ts +0 -7
- package/dist/DateTimeRangePicker/utils.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/utils.js.map +0 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +0 -3
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +0 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +0 -1
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +0 -88
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +0 -80
|
@@ -29,8 +29,7 @@ export const LineChartTooltip = /*#__PURE__*/ memo(function LineChartTooltip({ c
|
|
|
29
29
|
// Ensure user is hovering over a chart before checking for nearby series.
|
|
30
30
|
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
31
31
|
const chart = chartRef.current;
|
|
32
|
-
|
|
33
|
-
const chartWidth = (_chart_getWidth = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && _chart_getWidth !== void 0 ? _chart_getWidth : FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
32
|
+
const chartWidth = chart?.getWidth() ?? FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
34
33
|
// Get series nearby the cursor and pass into tooltip content children.
|
|
35
34
|
const nearbySeries = legacyGetNearbySeriesData({
|
|
36
35
|
mousePos,
|
|
@@ -48,24 +47,21 @@ export const LineChartTooltip = /*#__PURE__*/ memo(function LineChartTooltip({ c
|
|
|
48
47
|
// if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
|
|
49
48
|
const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
|
|
50
49
|
if (!isTooltipPinned) {
|
|
51
|
-
transform.current = assembleTransform(mousePos, chartWidth, pinnedPos, height
|
|
50
|
+
transform.current = assembleTransform(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);
|
|
52
51
|
}
|
|
53
52
|
return /*#__PURE__*/ _jsx(Portal, {
|
|
54
53
|
container: containerElement,
|
|
55
54
|
children: /*#__PURE__*/ _jsx(Box, {
|
|
56
55
|
ref: tooltipRef,
|
|
57
|
-
sx: (theme)=>{
|
|
58
|
-
var _theme_palette_designSystem;
|
|
59
|
-
var _theme_palette_designSystem_grey_;
|
|
60
|
-
return {
|
|
56
|
+
sx: (theme)=>({
|
|
61
57
|
minWidth: TOOLTIP_MIN_WIDTH,
|
|
62
58
|
maxWidth: TOOLTIP_MAX_WIDTH,
|
|
63
|
-
maxHeight: maxHeight
|
|
59
|
+
maxHeight: maxHeight ?? TOOLTIP_MAX_HEIGHT,
|
|
64
60
|
padding: 0,
|
|
65
61
|
position: 'absolute',
|
|
66
62
|
top: 0,
|
|
67
63
|
left: 0,
|
|
68
|
-
backgroundColor:
|
|
64
|
+
backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,
|
|
69
65
|
borderRadius: '6px',
|
|
70
66
|
color: '#fff',
|
|
71
67
|
fontSize: '11px',
|
|
@@ -78,8 +74,7 @@ export const LineChartTooltip = /*#__PURE__*/ memo(function LineChartTooltip({ c
|
|
|
78
74
|
'&:hover': {
|
|
79
75
|
overflowY: 'auto'
|
|
80
76
|
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
77
|
+
}),
|
|
83
78
|
style: {
|
|
84
79
|
transform: transform.current,
|
|
85
80
|
display: transform.current ? 'block' : 'none'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/LineChartTooltip.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, Portal, Stack } from '@mui/material';\nimport { FormatOptions } from '@perses-dev/core';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { memo, useRef, useState } from 'react';\nimport useResizeObserver from 'use-resize-observer';\nimport { EChartsDataFormat } from '../model';\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipHeader } from './TooltipHeader';\nimport { legacyGetNearbySeriesData } from './nearby-series';\nimport {\n CursorCoordinates,\n FALLBACK_CHART_WIDTH,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MIN_WIDTH,\n useMousePosition,\n} from './tooltip-model';\nimport { assembleTransform } from './utils';\n\nexport interface TimeSeriesTooltipProps {\n chartRef:
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/LineChartTooltip.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, Portal, Stack } from '@mui/material';\nimport { FormatOptions } from '@perses-dev/core';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { memo, MutableRefObject, ReactElement, useRef, useState } from 'react';\nimport useResizeObserver from 'use-resize-observer';\nimport { EChartsDataFormat } from '../model';\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipHeader } from './TooltipHeader';\nimport { legacyGetNearbySeriesData } from './nearby-series';\nimport {\n CursorCoordinates,\n FALLBACK_CHART_WIDTH,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MIN_WIDTH,\n useMousePosition,\n} from './tooltip-model';\nimport { assembleTransform } from './utils';\n\nexport interface TimeSeriesTooltipProps {\n chartRef: MutableRefObject<EChartsInstance | undefined>;\n chartData: EChartsDataFormat;\n enablePinning?: boolean;\n wrapLabels?: boolean;\n format?: FormatOptions;\n onUnpinClick?: () => void;\n pinnedPos: CursorCoordinates | null;\n /**\n * The id of the container that will have the chart tooltip appended to it.\n * By default, the chart tooltip is attached to document.body.\n */\n containerId?: string;\n}\n\nexport const LineChartTooltip = memo(function LineChartTooltip({\n chartRef,\n chartData,\n enablePinning = true,\n wrapLabels,\n format,\n onUnpinClick,\n pinnedPos,\n containerId,\n}: TimeSeriesTooltipProps): ReactElement | null {\n const [showAllSeries, setShowAllSeries] = useState(false);\n const mousePos = useMousePosition();\n const { height, width, ref: tooltipRef } = useResizeObserver();\n const transform = useRef<string | undefined>();\n\n const isTooltipPinned = pinnedPos !== null && enablePinning;\n\n if (mousePos === null || mousePos.target === null) return null;\n\n // Ensure user is hovering over a chart before checking for nearby series.\n if (pinnedPos === null && (mousePos.target as HTMLElement).tagName !== 'CANVAS') return null;\n\n const chart = chartRef.current;\n const chartWidth = chart?.getWidth() ?? FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.\n\n // Get series nearby the cursor and pass into tooltip content children.\n const nearbySeries = legacyGetNearbySeriesData({\n mousePos,\n chartData,\n pinnedPos,\n chart,\n format,\n showAllSeries,\n });\n if (nearbySeries.length === 0) {\n return null;\n }\n\n const totalSeries = chartData.timeSeries.length;\n\n const containerElement = containerId ? document.querySelector(containerId) : undefined;\n // if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off\n const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;\n if (!isTooltipPinned) {\n transform.current = assembleTransform(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);\n }\n\n return (\n <Portal container={containerElement}>\n <Box\n ref={tooltipRef}\n sx={(theme) => ({\n minWidth: TOOLTIP_MIN_WIDTH,\n maxWidth: TOOLTIP_MAX_WIDTH,\n maxHeight: maxHeight ?? TOOLTIP_MAX_HEIGHT,\n padding: 0,\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n borderRadius: '6px',\n color: '#fff',\n fontSize: '11px',\n visibility: 'visible',\n opacity: 1,\n transition: 'all 0.1s ease-out',\n // Ensure pinned tooltip shows behind edit panel drawer and sticky header\n zIndex: pinnedPos !== null ? 'auto' : theme.zIndex.tooltip,\n overflow: 'hidden',\n '&:hover': {\n overflowY: 'auto',\n },\n })}\n style={{\n transform: transform.current,\n display: transform.current ? 'block' : 'none',\n }}\n >\n <Stack spacing={0.5}>\n <TooltipHeader\n nearbySeries={nearbySeries}\n totalSeries={totalSeries}\n enablePinning={enablePinning}\n isTooltipPinned={isTooltipPinned}\n showAllSeries={showAllSeries}\n onShowAllClick={(checked) => setShowAllSeries(checked)}\n onUnpinClick={onUnpinClick}\n />\n <TooltipContent series={nearbySeries} wrapLabels={wrapLabels} />\n </Stack>\n </Box>\n </Portal>\n );\n});\n"],"names":["Box","Portal","Stack","memo","useRef","useState","useResizeObserver","TooltipContent","TooltipHeader","legacyGetNearbySeriesData","FALLBACK_CHART_WIDTH","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_MAX_HEIGHT","TOOLTIP_MAX_WIDTH","TOOLTIP_MIN_WIDTH","useMousePosition","assembleTransform","LineChartTooltip","chartRef","chartData","enablePinning","wrapLabels","format","onUnpinClick","pinnedPos","containerId","showAllSeries","setShowAllSeries","mousePos","height","width","ref","tooltipRef","transform","isTooltipPinned","target","tagName","chart","current","chartWidth","getWidth","nearbySeries","length","totalSeries","timeSeries","containerElement","document","querySelector","undefined","maxHeight","getBoundingClientRect","container","sx","theme","minWidth","maxWidth","padding","position","top","left","backgroundColor","palette","designSystem","grey","borderRadius","color","fontSize","visibility","opacity","transition","zIndex","tooltip","overflow","overflowY","style","display","spacing","onShowAllClick","checked","series"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,gBAAgB;AAGnD,SAASC,I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AYJ,mBAAmBA,iBAAiBK,qBAAqB,GAAGrB,MAAM,GAAGmB;IACvF,IAAI,CAACd,iBAAiB;QACpBD,UAAUK,OAAO,GAAGtB,kBAAkBY,UAAUW,YAAYf,WAAWK,UAAU,GAAGC,SAAS,GAAGe;IAClG;IAEA,qBACE,KAAC5C;QAAOkD,WAAWN;kBACjB,cAAA,KAAC7C;YACC+B,KAAKC;YACLoB,IAAI,CAACC,QAAW,CAAA;oBACdC,UAAUxC;oBACVyC,UAAU1C;oBACVoC,WAAWA,aAAarC;oBACxB4C,SAAS;oBACTC,UAAU;oBACVC,KAAK;oBACLC,MAAM;oBACNC,iBAAiBP,MAAMQ,OAAO,CAACC,YAAY,EAAEC,IAAI,CAAC,IAAI,IAAIpD;oBAC1DqD,cAAc;oBACdC,OAAO;oBACPC,UAAU;oBACVC,YAAY;oBACZC,SAAS;oBACTC,YAAY;oBACZ,yEAAyE;oBACzEC,QAAQ9C,cAAc,OAAO,SAAS6B,MAAMiB,MAAM,CAACC,OAAO;oBAC1DC,UAAU;oBACV,WAAW;wBACTC,WAAW;oBACb;gBACF,CAAA;YACAC,OAAO;gBACLzC,WAAWA,UAAUK,OAAO;gBAC5BqC,SAAS1C,UAAUK,OAAO,GAAG,UAAU;YACzC;sBAEA,cAAA,MAACpC;gBAAM0E,SAAS;;kCACd,KAACpE;wBACCiC,cAAcA;wBACdE,aAAaA;wBACbvB,eAAeA;wBACfc,iBAAiBA;wBACjBR,eAAeA;wBACfmD,gBAAgB,CAACC,UAAYnD,iBAAiBmD;wBAC9CvD,cAAcA;;kCAEhB,KAAChB;wBAAewE,QAAQtC;wBAAcpB,YAAYA;;;;;;AAK5D,GAAG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
export interface SeriesInfoProps {
|
|
2
3
|
seriesName: string;
|
|
3
4
|
y: number;
|
|
@@ -7,5 +8,5 @@ export interface SeriesInfoProps {
|
|
|
7
8
|
emphasizeText?: boolean;
|
|
8
9
|
wrapLabels?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare function SeriesInfo(props: SeriesInfoProps):
|
|
11
|
+
export declare function SeriesInfo(props: SeriesInfoProps): ReactElement;
|
|
11
12
|
//# sourceMappingURL=SeriesInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeriesInfo.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesInfo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SeriesInfo.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesInfo.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAKrC,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CA0E/D"}
|
|
@@ -21,8 +21,7 @@ export function SeriesInfo(props) {
|
|
|
21
21
|
// ex with metric name: node_load15{env="demo",job="node"}
|
|
22
22
|
// ex without metric name: {env="demo",job="node"}
|
|
23
23
|
const splitName = seriesName.split('{');
|
|
24
|
-
|
|
25
|
-
const seriesLabels = (_splitName_ = splitName[1]) !== null && _splitName_ !== void 0 ? _splitName_ : seriesName;
|
|
24
|
+
const seriesLabels = splitName[1] ?? seriesName;
|
|
26
25
|
// remove curly braces that wrap labels
|
|
27
26
|
const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');
|
|
28
27
|
// determine whether to show labels on separate lines
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesInfo.tsx"],"sourcesContent":["// Copyright 2023 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 { Box } from '@mui/material';\nimport { SeriesMarker } from './SeriesMarker';\nimport { SeriesLabelsStack } from './SeriesLabelsStack';\nimport { TOOLTIP_LABELS_MAX_WIDTH, EMPHASIZED_SERIES_DESCRIPTION, NEARBY_SERIES_DESCRIPTION } from './tooltip-model';\n\nexport interface SeriesInfoProps {\n seriesName: string;\n y: number;\n formattedY: string;\n markerColor: string;\n totalSeries: number;\n emphasizeText?: boolean;\n wrapLabels?: boolean;\n}\n\nexport function SeriesInfo(props: SeriesInfoProps) {\n const { seriesName, formattedY, markerColor, totalSeries, emphasizeText = false, wrapLabels = true } = props;\n\n // metric __name__ comes before opening curly brace, ignore if not populated\n // ex with metric name: node_load15{env=\"demo\",job=\"node\"}\n // ex without metric name: {env=\"demo\",job=\"node\"}\n const splitName = seriesName.split('{');\n const seriesLabels = splitName[1] ?? seriesName;\n\n // remove curly braces that wrap labels\n const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');\n\n // determine whether to show labels on separate lines\n const splitLabels = formattedSeriesLabels.split(',');\n if (totalSeries === 1 && splitLabels.length > 1) {\n const metricName = splitName[0] ? `${splitName[0]}:` : 'value:';\n return (\n <SeriesLabelsStack\n formattedY={formattedY}\n metricName={metricName}\n metricLabels={splitLabels}\n markerColor={markerColor}\n />\n );\n }\n\n // add space after commas so wrapLabels works\n const formattedSeriesInfo = seriesName.replace(/[,]/g, ', ');\n\n return (\n <Box\n sx={{\n display: 'table-row',\n paddingTop: 0.5,\n }}\n >\n <Box\n sx={{\n display: 'table-cell',\n maxWidth: '520px',\n }}\n >\n <SeriesMarker markerColor={markerColor} sx={{ marginTop: 0.5 }} />\n <Box\n component=\"span\"\n sx={(theme) => ({\n display: 'inline-block',\n width: 'calc(100% - 20px)',\n minWidth: 150,\n maxWidth: TOOLTIP_LABELS_MAX_WIDTH,\n overflow: 'hidden',\n color: theme.palette.common.white,\n fontWeight: emphasizeText ? theme.typography.fontWeightBold : theme.typography.fontWeightRegular,\n textOverflow: 'ellipsis',\n whiteSpace: wrapLabels ? 'normal' : 'nowrap',\n })}\n aria-label={emphasizeText ? EMPHASIZED_SERIES_DESCRIPTION : NEARBY_SERIES_DESCRIPTION}\n >\n {formattedSeriesInfo}\n </Box>\n </Box>\n <Box\n sx={(theme) => ({\n display: 'table-cell',\n paddingLeft: 1.5,\n textAlign: 'right',\n verticalAlign: 'top',\n fontWeight: emphasizeText ? theme.typography.fontWeightBold : theme.typography.fontWeightRegular,\n })}\n >\n {formattedY}\n </Box>\n </Box>\n );\n}\n"],"names":["Box","SeriesMarker","SeriesLabelsStack","TOOLTIP_LABELS_MAX_WIDTH","EMPHASIZED_SERIES_DESCRIPTION","NEARBY_SERIES_DESCRIPTION","SeriesInfo","props","seriesName","formattedY","markerColor","totalSeries","emphasizeText","wrapLabels","splitName","split","seriesLabels","formattedSeriesLabels","replace","splitLabels","length","metricName","metricLabels","formattedSeriesInfo","sx","display","paddingTop","maxWidth","marginTop","component","theme","width","minWidth","overflow","color","palette","common","white","fontWeight","typography","fontWeightBold","fontWeightRegular","textOverflow","whiteSpace","aria-label","paddingLeft","textAlign","verticalAlign"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesInfo.tsx"],"sourcesContent":["// Copyright 2023 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 { Box } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { SeriesMarker } from './SeriesMarker';\nimport { SeriesLabelsStack } from './SeriesLabelsStack';\nimport { TOOLTIP_LABELS_MAX_WIDTH, EMPHASIZED_SERIES_DESCRIPTION, NEARBY_SERIES_DESCRIPTION } from './tooltip-model';\n\nexport interface SeriesInfoProps {\n seriesName: string;\n y: number;\n formattedY: string;\n markerColor: string;\n totalSeries: number;\n emphasizeText?: boolean;\n wrapLabels?: boolean;\n}\n\nexport function SeriesInfo(props: SeriesInfoProps): ReactElement {\n const { seriesName, formattedY, markerColor, totalSeries, emphasizeText = false, wrapLabels = true } = props;\n\n // metric __name__ comes before opening curly brace, ignore if not populated\n // ex with metric name: node_load15{env=\"demo\",job=\"node\"}\n // ex without metric name: {env=\"demo\",job=\"node\"}\n const splitName = seriesName.split('{');\n const seriesLabels = splitName[1] ?? seriesName;\n\n // remove curly braces that wrap labels\n const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');\n\n // determine whether to show labels on separate lines\n const splitLabels = formattedSeriesLabels.split(',');\n if (totalSeries === 1 && splitLabels.length > 1) {\n const metricName = splitName[0] ? `${splitName[0]}:` : 'value:';\n return (\n <SeriesLabelsStack\n formattedY={formattedY}\n metricName={metricName}\n metricLabels={splitLabels}\n markerColor={markerColor}\n />\n );\n }\n\n // add space after commas so wrapLabels works\n const formattedSeriesInfo = seriesName.replace(/[,]/g, ', ');\n\n return (\n <Box\n sx={{\n display: 'table-row',\n paddingTop: 0.5,\n }}\n >\n <Box\n sx={{\n display: 'table-cell',\n maxWidth: '520px',\n }}\n >\n <SeriesMarker markerColor={markerColor} sx={{ marginTop: 0.5 }} />\n <Box\n component=\"span\"\n sx={(theme) => ({\n display: 'inline-block',\n width: 'calc(100% - 20px)',\n minWidth: 150,\n maxWidth: TOOLTIP_LABELS_MAX_WIDTH,\n overflow: 'hidden',\n color: theme.palette.common.white,\n fontWeight: emphasizeText ? theme.typography.fontWeightBold : theme.typography.fontWeightRegular,\n textOverflow: 'ellipsis',\n whiteSpace: wrapLabels ? 'normal' : 'nowrap',\n })}\n aria-label={emphasizeText ? EMPHASIZED_SERIES_DESCRIPTION : NEARBY_SERIES_DESCRIPTION}\n >\n {formattedSeriesInfo}\n </Box>\n </Box>\n <Box\n sx={(theme) => ({\n display: 'table-cell',\n paddingLeft: 1.5,\n textAlign: 'right',\n verticalAlign: 'top',\n fontWeight: emphasizeText ? theme.typography.fontWeightBold : theme.typography.fontWeightRegular,\n })}\n >\n {formattedY}\n </Box>\n </Box>\n );\n}\n"],"names":["Box","SeriesMarker","SeriesLabelsStack","TOOLTIP_LABELS_MAX_WIDTH","EMPHASIZED_SERIES_DESCRIPTION","NEARBY_SERIES_DESCRIPTION","SeriesInfo","props","seriesName","formattedY","markerColor","totalSeries","emphasizeText","wrapLabels","splitName","split","seriesLabels","formattedSeriesLabels","replace","splitLabels","length","metricName","metricLabels","formattedSeriesInfo","sx","display","paddingTop","maxWidth","marginTop","component","theme","width","minWidth","overflow","color","palette","common","white","fontWeight","typography","fontWeightBold","fontWeightRegular","textOverflow","whiteSpace","aria-label","paddingLeft","textAlign","verticalAlign"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,Q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,CAACC,KAAK;gCACjCC,YAAY1B,gBAAgBkB,MAAMS,UAAU,CAACC,cAAc,GAAGV,MAAMS,UAAU,CAACE,iBAAiB;gCAChGC,cAAc;gCACdC,YAAY9B,aAAa,WAAW;4BACtC,CAAA;wBACA+B,cAAYhC,gBAAgBR,gCAAgCC;kCAE3DkB;;;;0BAGL,KAACvB;gBACCwB,IAAI,CAACM,QAAW,CAAA;wBACdL,SAAS;wBACToB,aAAa;wBACbC,WAAW;wBACXC,eAAe;wBACfT,YAAY1B,gBAAgBkB,MAAMS,UAAU,CAACC,cAAc,GAAGV,MAAMS,UAAU,CAACE,iBAAiB;oBAClG,CAAA;0BAEChC;;;;AAIT"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
export interface SeriesLabelsStackProps {
|
|
2
3
|
formattedY: string;
|
|
3
4
|
metricName: string;
|
|
4
5
|
metricLabels: string[];
|
|
5
6
|
markerColor: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function SeriesLabelsStack(props: SeriesLabelsStackProps):
|
|
8
|
+
export declare function SeriesLabelsStack(props: SeriesLabelsStackProps): ReactElement;
|
|
8
9
|
//# sourceMappingURL=SeriesLabelsStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeriesLabelsStack.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesLabelsStack.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SeriesLabelsStack.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesLabelsStack.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAiE7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesLabelsStack.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, Divider, Stack, Typography } from '@mui/material';\nimport { SeriesMarker } from './SeriesMarker';\n\nexport interface SeriesLabelsStackProps {\n formattedY: string;\n metricName: string;\n metricLabels: string[];\n markerColor: string;\n}\n\nexport function SeriesLabelsStack(props: SeriesLabelsStackProps) {\n const { formattedY, markerColor, metricName, metricLabels } = props;\n return (\n <Stack spacing={0.5}>\n <Box\n sx={(theme) => ({\n display: 'flex',\n height: '16px',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'left',\n color: theme.palette.common.white,\n fontSize: '11px',\n })}\n >\n <SeriesMarker markerColor={markerColor} sx={{ marginTop: 0.25 }} />\n <Box component=\"span\">\n {metricName}\n <Box\n component=\"span\"\n sx={(theme) => ({\n color: theme.palette.common.white,\n fontWeight: 700,\n paddingLeft: '2px',\n })}\n >\n {formattedY}\n </Box>\n </Box>\n </Box>\n <Divider\n sx={(theme) => ({\n borderColor: theme.palette.grey['500'],\n })}\n />\n <Box\n sx={(theme) => ({\n color: theme.palette.common.white,\n })}\n >\n {metricLabels.map((label) => {\n // show labels on separate lines when many labels and only one focused series\n if (label) {\n const [name, value] = label.split('=');\n const formattedName = value !== undefined ? `${name}: ` : name;\n const formattedValue = value !== undefined ? value.replace(/(^\"|\"$)/g, '') : value;\n return (\n <Box key={label} sx={{ display: 'flex', gap: '4px' }}>\n <Typography sx={{ fontSize: '11px' }}>{formattedName}</Typography>\n <Typography\n sx={(theme) => ({\n color: theme.palette.common.white,\n fontWeight: 700,\n fontSize: '11px',\n })}\n >\n {formattedValue}\n </Typography>\n </Box>\n );\n }\n })}\n </Box>\n </Stack>\n );\n}\n"],"names":["Box","Divider","Stack","Typography","SeriesMarker","SeriesLabelsStack","props","formattedY","markerColor","metricName","metricLabels","spacing","sx","theme","display","height","flexDirection","alignItems","justifyContent","color","palette","common","white","fontSize","marginTop","component","fontWeight","paddingLeft","borderColor","grey","map","label","name","value","split","formattedName","undefined","formattedValue","replace","gap"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,OAAO,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesLabelsStack.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, Divider, Stack, Typography } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { SeriesMarker } from './SeriesMarker';\n\nexport interface SeriesLabelsStackProps {\n formattedY: string;\n metricName: string;\n metricLabels: string[];\n markerColor: string;\n}\n\nexport function SeriesLabelsStack(props: SeriesLabelsStackProps): ReactElement {\n const { formattedY, markerColor, metricName, metricLabels } = props;\n return (\n <Stack spacing={0.5}>\n <Box\n sx={(theme) => ({\n display: 'flex',\n height: '16px',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'left',\n color: theme.palette.common.white,\n fontSize: '11px',\n })}\n >\n <SeriesMarker markerColor={markerColor} sx={{ marginTop: 0.25 }} />\n <Box component=\"span\">\n {metricName}\n <Box\n component=\"span\"\n sx={(theme) => ({\n color: theme.palette.common.white,\n fontWeight: 700,\n paddingLeft: '2px',\n })}\n >\n {formattedY}\n </Box>\n </Box>\n </Box>\n <Divider\n sx={(theme) => ({\n borderColor: theme.palette.grey['500'],\n })}\n />\n <Box\n sx={(theme) => ({\n color: theme.palette.common.white,\n })}\n >\n {metricLabels.map((label) => {\n // show labels on separate lines when many labels and only one focused series\n if (label) {\n const [name, value] = label.split('=');\n const formattedName = value !== undefined ? `${name}: ` : name;\n const formattedValue = value !== undefined ? value.replace(/(^\"|\"$)/g, '') : value;\n return (\n <Box key={label} sx={{ display: 'flex', gap: '4px' }}>\n <Typography sx={{ fontSize: '11px' }}>{formattedName}</Typography>\n <Typography\n sx={(theme) => ({\n color: theme.palette.common.white,\n fontWeight: 700,\n fontSize: '11px',\n })}\n >\n {formattedValue}\n </Typography>\n </Box>\n );\n }\n })}\n </Box>\n </Stack>\n );\n}\n"],"names":["Box","Divider","Stack","Typography","SeriesMarker","SeriesLabelsStack","props","formattedY","markerColor","metricName","metricLabels","spacing","sx","theme","display","height","flexDirection","alignItems","justifyContent","color","palette","common","white","fontSize","marginTop","component","fontWeight","paddingLeft","borderColor","grey","map","label","name","value","split","formattedName","undefined","formattedValue","replace","gap"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,OAAO,EAAEC,KAAK,E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AAQyB,KAAK;4BAAM;;8CACjD,KAACpC;oCAAWS,IAAI;wCAAEW,UAAU;oCAAO;8CAAIY;;8CACvC,KAAChC;oCACCS,IAAI,CAACC,QAAW,CAAA;4CACdM,OAAON,MAAMO,OAAO,CAACC,MAAM,CAACC,KAAK;4CACjCI,YAAY;4CACZH,UAAU;wCACZ,CAAA;8CAECc;;;2BATKN;oBAad;gBACF;;;;AAIR"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BoxProps } from '@mui/material';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
2
3
|
interface SeriesMarkerProps extends BoxProps<'div'> {
|
|
3
4
|
markerColor: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function SeriesMarker(props: SeriesMarkerProps):
|
|
6
|
+
export declare function SeriesMarker(props: SeriesMarkerProps): ReactElement;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=SeriesMarker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeriesMarker.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesMarker.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SeriesMarker.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/SeriesMarker.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,UAAU,iBAAkB,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAkBnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesMarker.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, BoxProps } from '@mui/material';\nimport { combineSx } from '../utils';\n\ninterface SeriesMarkerProps extends BoxProps<'div'> {\n markerColor: string;\n}\n\nexport function SeriesMarker(props: SeriesMarkerProps) {\n const { markerColor, sx } = props;\n return (\n <Box\n sx={combineSx(\n {\n display: 'inline-block',\n width: '11px',\n height: '11px',\n borderRadius: '2px',\n marginRight: 1,\n verticalAlign: 'top',\n },\n sx\n )}\n style={{ backgroundColor: markerColor }}\n ></Box>\n );\n}\n"],"names":["Box","combineSx","SeriesMarker","props","markerColor","sx","display","width","height","borderRadius","marginRight","verticalAlign","style","backgroundColor"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/SeriesMarker.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, BoxProps } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { combineSx } from '../utils';\n\ninterface SeriesMarkerProps extends BoxProps<'div'> {\n markerColor: string;\n}\n\nexport function SeriesMarker(props: SeriesMarkerProps): ReactElement {\n const { markerColor, sx } = props;\n return (\n <Box\n sx={combineSx(\n {\n display: 'inline-block',\n width: '11px',\n height: '11px',\n borderRadius: '2px',\n marginRight: 1,\n verticalAlign: 'top',\n },\n sx\n )}\n style={{ backgroundColor: markerColor }}\n ></Box>\n );\n}\n"],"names":["Box","combineSx","SeriesMarker","props","markerColor","sx","display","width","height","borderRadius","marginRight","verticalAlign","style","backgroundColor"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAE9C,SAASC,SAAS,QAAQ,WAAW;AAMrC,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAM,EAAEC,WAAW,EAAEC,EAAE,EAAE,GAAGF;IAC5B,qBACE,KAACH;QACCK,IAAIJ,UACF;YACEK,SAAS;YACTC,OAAO;YACPC,QAAQ;YACRC,cAAc;YACdC,aAAa;YACbC,eAAe;QACjB,GACAN;QAEFO,OAAO;YAAEC,iBAAiBT;QAAY;;AAG5C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
2
|
import { ECharts as EChartsInstance } from 'echarts/core';
|
|
3
3
|
import { FormatOptions, TimeSeries } from '@perses-dev/core';
|
|
4
4
|
import { TimeChartSeriesMapping } from '../model';
|
|
5
5
|
import { CursorCoordinates } from './tooltip-model';
|
|
6
6
|
export interface TimeChartTooltipProps {
|
|
7
|
-
chartRef:
|
|
7
|
+
chartRef: MutableRefObject<EChartsInstance | undefined>;
|
|
8
8
|
data: TimeSeries[];
|
|
9
9
|
seriesMapping: TimeChartSeriesMapping;
|
|
10
10
|
enablePinning?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeChartTooltip.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TimeChartTooltip.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TimeChartTooltip.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TimeChartTooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAQ,gBAAgB,EAAoB,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAA0C,MAAM,iBAAiB,CAAC;AAM5F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,gBAAgB,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACxD,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,aAAa,EAAE,sBAAsB,CAAC;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,6DA2E3B,CAAC"}
|
|
@@ -29,13 +29,12 @@ export const TimeChartTooltip = /*#__PURE__*/ memo(function TimeChartTooltip({ c
|
|
|
29
29
|
// Ensure user is hovering over a chart before checking for nearby series.
|
|
30
30
|
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
31
31
|
const chart = chartRef.current;
|
|
32
|
-
|
|
33
|
-
const chartWidth = (_chart_getWidth = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && _chart_getWidth !== void 0 ? _chart_getWidth : FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
32
|
+
const chartWidth = chart?.getWidth() ?? FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
34
33
|
const containerElement = containerId ? document.querySelector(containerId) : undefined;
|
|
35
34
|
// if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
|
|
36
35
|
const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
|
|
37
36
|
if (!isTooltipPinned) {
|
|
38
|
-
transform.current = assembleTransform(mousePos, chartWidth, pinnedPos, height
|
|
37
|
+
transform.current = assembleTransform(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);
|
|
39
38
|
}
|
|
40
39
|
// Get series nearby the cursor and pass into tooltip content children.
|
|
41
40
|
const nearbySeries = getNearbySeriesData({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/TimeChartTooltip.tsx"],"sourcesContent":["// Copyright 2023 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 { memo, useRef, useState } from 'react';\nimport { Box, Portal, Stack } from '@mui/material';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { FormatOptions, TimeSeries } from '@perses-dev/core';\nimport useResizeObserver from 'use-resize-observer';\nimport { TimeChartSeriesMapping } from '../model';\nimport { CursorCoordinates, FALLBACK_CHART_WIDTH, useMousePosition } from './tooltip-model';\nimport { assembleTransform, getTooltipStyles } from './utils';\nimport { getNearbySeriesData } from './nearby-series';\nimport { TooltipHeader } from './TooltipHeader';\nimport { TooltipContent } from './TooltipContent';\n\nexport interface TimeChartTooltipProps {\n chartRef:
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/TimeChartTooltip.tsx"],"sourcesContent":["// Copyright 2023 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 { memo, MutableRefObject, useRef, useState } from 'react';\nimport { Box, Portal, Stack } from '@mui/material';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { FormatOptions, TimeSeries } from '@perses-dev/core';\nimport useResizeObserver from 'use-resize-observer';\nimport { TimeChartSeriesMapping } from '../model';\nimport { CursorCoordinates, FALLBACK_CHART_WIDTH, useMousePosition } from './tooltip-model';\nimport { assembleTransform, getTooltipStyles } from './utils';\nimport { getNearbySeriesData } from './nearby-series';\nimport { TooltipHeader } from './TooltipHeader';\nimport { TooltipContent } from './TooltipContent';\n\nexport interface TimeChartTooltipProps {\n chartRef: MutableRefObject<EChartsInstance | undefined>;\n data: TimeSeries[];\n seriesMapping: TimeChartSeriesMapping;\n enablePinning?: boolean;\n pinnedPos: CursorCoordinates | null;\n /**\n * The id of the container that will have the chart tooltip appended to it.\n * By default, the chart tooltip is attached to document.body.\n */\n containerId?: string;\n onUnpinClick?: () => void;\n format?: FormatOptions;\n wrapLabels?: boolean;\n}\n\nexport const TimeChartTooltip = memo(function TimeChartTooltip({\n containerId,\n chartRef,\n data,\n seriesMapping,\n enablePinning = true,\n wrapLabels,\n format,\n onUnpinClick,\n pinnedPos,\n}: TimeChartTooltipProps) {\n const [showAllSeries, setShowAllSeries] = useState(false);\n const transform = useRef<string | undefined>();\n\n const mousePos = useMousePosition();\n const { height, width, ref: tooltipRef } = useResizeObserver();\n\n const isTooltipPinned = pinnedPos !== null && enablePinning;\n\n if (mousePos === null || mousePos.target === null || data === null) return null;\n\n // Ensure user is hovering over a chart before checking for nearby series.\n if (pinnedPos === null && (mousePos.target as HTMLElement).tagName !== 'CANVAS') return null;\n\n const chart = chartRef.current;\n const chartWidth = chart?.getWidth() ?? FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.\n\n const containerElement = containerId ? document.querySelector(containerId) : undefined;\n // if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off\n const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;\n\n if (!isTooltipPinned) {\n transform.current = assembleTransform(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);\n }\n\n // Get series nearby the cursor and pass into tooltip content children.\n const nearbySeries = getNearbySeriesData({\n mousePos,\n data,\n seriesMapping,\n pinnedPos,\n chart,\n format,\n showAllSeries,\n });\n if (nearbySeries.length === 0) {\n return null;\n }\n\n const totalSeries = data.length;\n\n return (\n <Portal container={containerElement}>\n <Box\n ref={tooltipRef}\n sx={(theme) => getTooltipStyles(theme, pinnedPos, maxHeight)}\n style={{\n transform: transform.current,\n }}\n >\n <Stack spacing={0.5}>\n <TooltipHeader\n nearbySeries={nearbySeries}\n totalSeries={totalSeries}\n enablePinning={enablePinning}\n isTooltipPinned={isTooltipPinned}\n showAllSeries={showAllSeries}\n onShowAllClick={(checked) => setShowAllSeries(checked)}\n onUnpinClick={onUnpinClick}\n />\n <TooltipContent series={nearbySeries} wrapLabels={wrapLabels} />\n </Stack>\n </Box>\n </Portal>\n );\n});\n"],"names":["memo","useRef","useState","Box","Portal","Stack","useResizeObserver","FALLBACK_CHART_WIDTH","useMousePosition","assembleTransform","getTooltipStyles","getNearbySeriesData","TooltipHeader","TooltipContent","TimeChartTooltip","containerId","chartRef","data","seriesMapping","enablePinning","wrapLabels","format","onUnpinClick","pinnedPos","showAllSeries","setShowAllSeries","transform","mousePos","height","width","ref","tooltipRef","isTooltipPinned","target","tagName","chart","current","chartWidth","getWidth","containerElement","document","querySelector","undefined","maxHeight","getBoundingClientRect","nearbySeries","length","totalSeries","container","sx","theme","style","spacing","onShowAllClick","checked","series"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,IAAI,EAAoBC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AACjE,SAASC,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,gBAAgB;AAGnD,OAAOC,uBAAuB,sBAAsB;AAEpD,SAA4BC,oBAAoB,EAAEC,gBAAgB,QAAQ,kBAAkB;AAC5F,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,UAAU;AAC9D,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,cAAc,QAAQ,mBAAmB;AAkBlD,OAAO,MAAMC,iCAAmBd,KAAK,SAASc,iBAAiB,EAC7DC,WAAW,EACXC,QAAQ,EACRC,IAAI,EACJC,aAAa,EACbC,gBAAgB,IAAI,EACpBC,UAAU,EACVC,MAAM,EACNC,YAAY,EACZC,SAAS,EACa;IACtB,MAAM,CAACC,eAAeC,iBAAiB,GAAGvB,SAAS;IACnD,MAAMwB,YAAYzB;IAElB,MAAM0B,WAAWnB;IACjB,MAAM,EAAEoB,MAAM,EAAEC,KAAK,EAAEC,KAAKC,UAAU,EAAE,GAAGzB;IAE3C,MAAM0B,kBAAkBT,cAAc,QAAQJ;IAE9C,IAAIQ,aAAa,QAAQA,SAASM,MAAM,KAAK,QAAQhB,SAAS,MAAM,OAAO;IAE3E,0EAA0E;IAC1E,IAAIM,cAAc,QAAQ,AAACI,SAASM,MAAM,CAAiBC,OAAO,KAAK,UAAU,OAAO;IAExF,MAAMC,QAAQnB,SAASoB,OAAO;IAC9B,MAAMC,aAAaF,OAAOG,cAAc/B,sBAAsB,+CAA+C;IAE7G,MAAMgC,mBAAmBxB,cAAcyB,SAASC,aAAa,CAAC1B,eAAe2B;IAC7E,uHAAuH;IACvH,MAAMC,YAAYJ,mBAAmBA,iBAAiBK,qBAAqB,GAAGhB,MAAM,GAAGc;IAEvF,IAAI,CAACV,iBAAiB;QACpBN,UAAUU,OAAO,GAAG3B,kBAAkBkB,UAAUU,YAAYd,WAAWK,UAAU,GAAGC,SAAS,GAAGU;IAClG;IAEA,uEAAuE;IACvE,MAAMM,eAAelC,oBAAoB;QACvCgB;QACAV;QACAC;QACAK;QACAY;QACAd;QACAG;IACF;IACA,IAAIqB,aAAaC,MAAM,KAAK,GAAG;QAC7B,OAAO;IACT;IAEA,MAAMC,cAAc9B,KAAK6B,MAAM;IAE/B,qBACE,KAAC1C;QAAO4C,WAAWT;kBACjB,cAAA,KAACpC;YACC2B,KAAKC;YACLkB,IAAI,CAACC,QAAUxC,iBAAiBwC,OAAO3B,WAAWoB;YAClDQ,OAAO;gBACLzB,WAAWA,UAAUU,OAAO;YAC9B;sBAEA,cAAA,MAAC/B;gBAAM+C,SAAS;;kCACd,KAACxC;wBACCiC,cAAcA;wBACdE,aAAaA;wBACb5B,eAAeA;wBACfa,iBAAiBA;wBACjBR,eAAeA;wBACf6B,gBAAgB,CAACC,UAAY7B,iBAAiB6B;wBAC9ChC,cAAcA;;kCAEhB,KAACT;wBAAe0C,QAAQV;wBAAczB,YAAYA;;;;;;AAK5D,GAAG"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
import { NearbySeriesArray } from './nearby-series';
|
|
2
3
|
export interface TooltipContentProps {
|
|
3
4
|
series: NearbySeriesArray | null;
|
|
4
5
|
wrapLabels?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function TooltipContent(props: TooltipContentProps):
|
|
7
|
+
export declare function TooltipContent(props: TooltipContentProps): ReactElement | null;
|
|
7
8
|
//# sourceMappingURL=TooltipContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TooltipContent.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAsC9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"sourcesContent":["// Copyright 2023 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 { useMemo } from 'react';\nimport { Box } from '@mui/material';\nimport { NearbySeriesArray } from './nearby-series';\nimport { SeriesInfo } from './SeriesInfo';\n\nexport interface TooltipContentProps {\n series: NearbySeriesArray | null;\n wrapLabels?: boolean;\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const { series, wrapLabels } = props;\n\n const sortedFocusedSeries = useMemo(() => {\n if (series === null) return null;\n return series.sort((a, b) => (a.y > b.y ? -1 : 1));\n }, [series]);\n\n if (series === null || sortedFocusedSeries === null) {\n return null;\n }\n // TODO: use react-virtuoso to improve performance\n return (\n <Box\n sx={(theme) => ({\n display: 'table',\n padding: theme.spacing(0.5, 2),\n })}\n >\n {sortedFocusedSeries.map(({ datumIdx, seriesIdx, seriesName, y, formattedY, markerColor, isClosestToCursor }) => {\n if (datumIdx === null || seriesIdx === null) return null;\n const key = seriesIdx.toString() + datumIdx.toString();\n\n return (\n <SeriesInfo\n key={key}\n seriesName={seriesName}\n y={y}\n formattedY={formattedY}\n markerColor={markerColor}\n totalSeries={sortedFocusedSeries.length}\n wrapLabels={wrapLabels}\n emphasizeText={isClosestToCursor}\n />\n );\n })}\n </Box>\n );\n}\n"],"names":["useMemo","Box","SeriesInfo","TooltipContent","props","series","wrapLabels","sortedFocusedSeries","sort","a","b","y","sx","theme","display","padding","spacing","map","datumIdx","seriesIdx","seriesName","formattedY","markerColor","isClosestToCursor","key","toString","totalSeries","length","emphasizeText"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"sourcesContent":["// Copyright 2023 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 { ReactElement, useMemo } from 'react';\nimport { Box } from '@mui/material';\nimport { NearbySeriesArray } from './nearby-series';\nimport { SeriesInfo } from './SeriesInfo';\n\nexport interface TooltipContentProps {\n series: NearbySeriesArray | null;\n wrapLabels?: boolean;\n}\n\nexport function TooltipContent(props: TooltipContentProps): ReactElement | null {\n const { series, wrapLabels } = props;\n\n const sortedFocusedSeries = useMemo(() => {\n if (series === null) return null;\n return series.sort((a, b) => (a.y > b.y ? -1 : 1));\n }, [series]);\n\n if (series === null || sortedFocusedSeries === null) {\n return null;\n }\n // TODO: use react-virtuoso to improve performance\n return (\n <Box\n sx={(theme) => ({\n display: 'table',\n padding: theme.spacing(0.5, 2),\n })}\n >\n {sortedFocusedSeries.map(({ datumIdx, seriesIdx, seriesName, y, formattedY, markerColor, isClosestToCursor }) => {\n if (datumIdx === null || seriesIdx === null) return null;\n const key = seriesIdx.toString() + datumIdx.toString();\n\n return (\n <SeriesInfo\n key={key}\n seriesName={seriesName}\n y={y}\n formattedY={formattedY}\n markerColor={markerColor}\n totalSeries={sortedFocusedSeries.length}\n wrapLabels={wrapLabels}\n emphasizeText={isClosestToCursor}\n />\n );\n })}\n </Box>\n );\n}\n"],"names":["useMemo","Box","SeriesInfo","TooltipContent","props","series","wrapLabels","sortedFocusedSeries","sort","a","b","y","sx","theme","display","padding","spacing","map","datumIdx","seriesIdx","seriesName","formattedY","markerColor","isClosestToCursor","key","toString","totalSeries","length","emphasizeText"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,GAAG,QAAQ,gBAAgB;AAEpC,SAASC,UAAU,QAAQ,eAAe;AAO1C,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM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,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"TooltipHeader.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TooltipHeader.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAQpD,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,iBAAiB,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,0DAyHxB,CAAC"}
|
|
@@ -15,19 +15,15 @@ import { Box, Divider, Typography, Stack, Switch } from '@mui/material';
|
|
|
15
15
|
import Pin from 'mdi-material-ui/Pin';
|
|
16
16
|
import PinOutline from 'mdi-material-ui/PinOutline';
|
|
17
17
|
import { memo } from 'react';
|
|
18
|
-
import {
|
|
18
|
+
import { getDateAndTime } from '../utils';
|
|
19
19
|
import { TOOLTIP_BG_COLOR_FALLBACK, TOOLTIP_MAX_WIDTH, PIN_TOOLTIP_HELP_TEXT, UNPIN_TOOLTIP_HELP_TEXT } from './tooltip-model';
|
|
20
20
|
export const TooltipHeader = /*#__PURE__*/ memo(function TooltipHeader({ nearbySeries, totalSeries, isTooltipPinned, showAllSeries, enablePinning = true, onShowAllClick, onUnpinClick }) {
|
|
21
|
-
|
|
22
|
-
var _nearbySeries__date;
|
|
23
|
-
const seriesTimeMs = (_nearbySeries__date = (_nearbySeries_ = nearbySeries[0]) === null || _nearbySeries_ === void 0 ? void 0 : _nearbySeries_.date) !== null && _nearbySeries__date !== void 0 ? _nearbySeries__date : null;
|
|
21
|
+
const seriesTimeMs = nearbySeries[0]?.date ?? null;
|
|
24
22
|
if (seriesTimeMs === null) {
|
|
25
23
|
return null;
|
|
26
24
|
}
|
|
27
25
|
const formatTimeSeriesHeader = (timeMs)=>{
|
|
28
|
-
const
|
|
29
|
-
const formattedDate = format(date, 'MMM dd, yyyy - ');
|
|
30
|
-
const formattedTime = format(date, 'HH:mm:ss');
|
|
26
|
+
const { formattedTime, formattedDate } = getDateAndTime(timeMs);
|
|
31
27
|
return /*#__PURE__*/ _jsxs(Box, {
|
|
32
28
|
children: [
|
|
33
29
|
/*#__PURE__*/ _jsx(Typography, {
|
|
@@ -50,19 +46,15 @@ export const TooltipHeader = /*#__PURE__*/ memo(function TooltipHeader({ nearbyS
|
|
|
50
46
|
const showAllSeriesToggle = enablePinning && totalSeries > 5;
|
|
51
47
|
const pinTooltipHelpText = isTooltipPinned ? UNPIN_TOOLTIP_HELP_TEXT : PIN_TOOLTIP_HELP_TEXT;
|
|
52
48
|
return /*#__PURE__*/ _jsxs(Box, {
|
|
53
|
-
sx: (theme)=>{
|
|
54
|
-
var _theme_palette_designSystem;
|
|
55
|
-
var _theme_palette_designSystem_grey_;
|
|
56
|
-
return {
|
|
49
|
+
sx: (theme)=>({
|
|
57
50
|
width: '100%',
|
|
58
51
|
maxWidth: TOOLTIP_MAX_WIDTH,
|
|
59
52
|
padding: theme.spacing(1.5, 2, 0.5, 2),
|
|
60
|
-
backgroundColor:
|
|
53
|
+
backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,
|
|
61
54
|
position: 'sticky',
|
|
62
55
|
top: 0,
|
|
63
56
|
left: 0
|
|
64
|
-
}
|
|
65
|
-
},
|
|
57
|
+
}),
|
|
66
58
|
children: [
|
|
67
59
|
/*#__PURE__*/ _jsxs(Box, {
|
|
68
60
|
sx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipHeader.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, Divider, Typography, Stack, Switch } from '@mui/material';\nimport Pin from 'mdi-material-ui/Pin';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport { memo } from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipHeader.tsx"],"sourcesContent":["// Copyright 2023 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 { Box, Divider, Typography, Stack, Switch } from '@mui/material';\nimport Pin from 'mdi-material-ui/Pin';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport { memo, ReactElement } from 'react';\nimport { getDateAndTime } from '../utils';\nimport { NearbySeriesArray } from './nearby-series';\nimport {\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_MAX_WIDTH,\n PIN_TOOLTIP_HELP_TEXT,\n UNPIN_TOOLTIP_HELP_TEXT,\n} from './tooltip-model';\n\nexport interface TooltipHeaderProps {\n nearbySeries: NearbySeriesArray;\n totalSeries: number;\n isTooltipPinned: boolean;\n showAllSeries: boolean;\n enablePinning?: boolean;\n onShowAllClick?: (checked: boolean) => void;\n onUnpinClick?: () => void;\n}\n\nexport const TooltipHeader = memo(function TooltipHeader({\n nearbySeries,\n totalSeries,\n isTooltipPinned,\n showAllSeries,\n enablePinning = true,\n onShowAllClick,\n onUnpinClick,\n}: TooltipHeaderProps) {\n const seriesTimeMs = nearbySeries[0]?.date ?? null;\n if (seriesTimeMs === null) {\n return null;\n }\n\n const formatTimeSeriesHeader = (timeMs: number): ReactElement => {\n const { formattedTime, formattedDate } = getDateAndTime(timeMs);\n return (\n <Box>\n <Typography\n variant=\"caption\"\n sx={(theme) => ({\n color: theme.palette.common.white,\n })}\n >\n {formattedDate}\n </Typography>\n <Typography variant=\"caption\">\n <strong>{formattedTime}</strong>\n </Typography>\n </Box>\n );\n };\n\n // TODO: accurately calc whether more series are outside scrollable region using yBuffer, avg series name length, TOOLTIP_MAX_HEIGHT\n const showAllSeriesToggle = enablePinning && totalSeries > 5;\n\n const pinTooltipHelpText = isTooltipPinned ? UNPIN_TOOLTIP_HELP_TEXT : PIN_TOOLTIP_HELP_TEXT;\n\n return (\n <Box\n sx={(theme) => ({\n width: '100%',\n maxWidth: TOOLTIP_MAX_WIDTH,\n padding: theme.spacing(1.5, 2, 0.5, 2),\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n position: 'sticky',\n top: 0,\n left: 0,\n })}\n >\n <Box\n sx={{\n width: '100%',\n display: 'flex',\n justifyContent: 'start',\n alignItems: 'center',\n paddingBottom: 0.5,\n }}\n >\n {formatTimeSeriesHeader(seriesTimeMs)}\n <Stack direction=\"row\" gap={1} sx={{ marginLeft: 'auto' }}>\n {showAllSeriesToggle && (\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\" sx={{ textAlign: 'right' }}>\n <Typography sx={{ fontSize: 11 }}>Show All</Typography>\n <Switch\n checked={showAllSeries}\n size=\"small\"\n onChange={(_, checked) => {\n if (onShowAllClick !== undefined) {\n return onShowAllClick(checked);\n }\n }}\n sx={(theme) => ({\n '& .MuiSwitch-switchBase': {\n color: theme.palette.common.white,\n },\n '& .MuiSwitch-track': {\n backgroundColor: theme.palette.common.white,\n },\n })}\n />\n </Stack>\n )}\n {enablePinning && (\n <Stack direction=\"row\" alignItems=\"center\">\n <Typography\n sx={{\n marginRight: 0.5,\n fontSize: 11,\n verticalAlign: 'middle',\n }}\n >\n {pinTooltipHelpText}\n </Typography>\n {isTooltipPinned ? (\n <Pin\n onClick={() => {\n if (onUnpinClick !== undefined) {\n onUnpinClick();\n }\n }}\n sx={{\n fontSize: 16,\n cursor: 'pointer',\n }}\n />\n ) : (\n <PinOutline sx={{ fontSize: 16 }} />\n )}\n </Stack>\n )}\n </Stack>\n </Box>\n <Divider\n sx={(theme) => ({\n width: '100%',\n borderColor: theme.palette.grey['500'],\n })}\n />\n </Box>\n );\n});\n"],"names":["Box","Divider","Typography","Stack","Switch","Pin","PinOutline","memo","getDateAndTime","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_MAX_WIDTH","PIN_TOOLTIP_HELP_TEXT","UNPIN_TOOLTIP_HELP_TEXT","TooltipHeader","nearbySeries","totalSeries","isTooltipPinned","showAllSeries","enablePinning","onShowAllClick","onUnpinClick","seriesTimeMs","date","formatTimeSeriesHeader","timeMs","formattedTime","formattedDate","variant","sx","theme","color","palette","common","white","strong","showAllSeriesToggle","pinTooltipHelpText","width","maxWidth","padding","spacing","backgroundColor","designSystem","grey","position","top","left","display","justifyContent","alignItems","paddingBottom","direction","gap","marginLeft","textAlign","fontSize","checked","size","onChange","_","undefined","marginRight","verticalAlign","onClick","cursor","borderColor"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAEC,MAAM,QAAQ,gBAAgB;AACxE,OAAOC,SAAS,sBAAsB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ACxB,MAAClB;wBAAMgD,WAAU;wBAAMC,KAAK;wBAAGxB,IAAI;4BAAEyB,YAAY;wBAAO;;4BACrDlB,qCACC,MAAChC;gCAAMgD,WAAU;gCAAMC,KAAK;gCAAKH,YAAW;gCAASrB,IAAI;oCAAE0B,WAAW;gCAAQ;;kDAC5E,KAACpD;wCAAW0B,IAAI;4CAAE2B,UAAU;wCAAG;kDAAG;;kDAClC,KAACnD;wCACCoD,SAASvC;wCACTwC,MAAK;wCACLC,UAAU,CAACC,GAAGH;4CACZ,IAAIrC,mBAAmByC,WAAW;gDAChC,OAAOzC,eAAeqC;4CACxB;wCACF;wCACA5B,IAAI,CAACC,QAAW,CAAA;gDACd,2BAA2B;oDACzBC,OAAOD,MAAME,OAAO,CAACC,MAAM,CAACC,KAAK;gDACnC;gDACA,sBAAsB;oDACpBQ,iBAAiBZ,MAAME,OAAO,CAACC,MAAM,CAACC,KAAK;gDAC7C;4CACF,CAAA;;;;4BAILf,+BACC,MAACf;gCAAMgD,WAAU;gCAAMF,YAAW;;kDAChC,KAAC/C;wCACC0B,IAAI;4CACFiC,aAAa;4CACbN,UAAU;4CACVO,eAAe;wCACjB;kDAEC1B;;oCAEFpB,gCACC,KAACX;wCACC0D,SAAS;4CACP,IAAI3C,iBAAiBwC,WAAW;gDAC9BxC;4CACF;wCACF;wCACAQ,IAAI;4CACF2B,UAAU;4CACVS,QAAQ;wCACV;uDAGF,KAAC1D;wCAAWsB,IAAI;4CAAE2B,UAAU;wCAAG;;;;;;;;0BAMzC,KAACtD;gBACC2B,IAAI,CAACC,QAAW,CAAA;wBACdQ,OAAO;wBACP4B,aAAapC,MAAME,OAAO,CAACY,IAAI,CAAC,MAAM;oBACxC,CAAA;;;;AAIR,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nearby-series.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/nearby-series.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,eAA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AY,EACZ,SAAS,EACT,UAAU,GACX,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAKV;AAKD,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,WAAW,EACX,aAAqB,GACtB,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,MAAM,CAgBT"}
|
|
@@ -22,12 +22,9 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
22
22
|
* Returns formatted series data for the points that are close to the user's cursor.
|
|
23
23
|
* Adjust xBuffer and yBuffer to increase or decrease number of series shown.
|
|
24
24
|
*/ export function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format) {
|
|
25
|
-
var _data_;
|
|
26
25
|
const currentNearbySeriesData = [];
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
var _pointInGrid_1;
|
|
30
|
-
const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
|
|
26
|
+
const cursorX = pointInGrid[0] ?? null;
|
|
27
|
+
const cursorY = pointInGrid[1] ?? null;
|
|
31
28
|
if (cursorX === null || cursorY === null) return currentNearbySeriesData;
|
|
32
29
|
if (chart.dispatchAction === undefined) return currentNearbySeriesData;
|
|
33
30
|
if (!Array.isArray(data)) return currentNearbySeriesData;
|
|
@@ -39,7 +36,7 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
39
36
|
const totalSeries = data.length;
|
|
40
37
|
const yValueCounts = new Map();
|
|
41
38
|
// Only need to loop through first dataset source since getCommonTimeScale ensures xAxis timestamps are consistent
|
|
42
|
-
const firstTimeSeriesValues =
|
|
39
|
+
const firstTimeSeriesValues = data[0]?.values;
|
|
43
40
|
const closestTimestamp = getClosestTimestamp(firstTimeSeriesValues, cursorX);
|
|
44
41
|
if (closestTimestamp === null) {
|
|
45
42
|
return EMPTY_TOOLTIP_DATA;
|
|
@@ -47,15 +44,14 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
47
44
|
// find the timestamp with data that is closest to cursorX
|
|
48
45
|
for(let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++){
|
|
49
46
|
const currentSeries = seriesMapping[seriesIdx];
|
|
50
|
-
if (currentSeries
|
|
47
|
+
if (!currentSeries) break;
|
|
51
48
|
const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;
|
|
52
|
-
if (currentDataset
|
|
49
|
+
if (!currentDataset) break;
|
|
53
50
|
const currentDatasetValues = currentDataset.values;
|
|
54
51
|
if (currentDatasetValues === undefined || !Array.isArray(currentDatasetValues)) break;
|
|
55
52
|
const lineSeries = currentSeries;
|
|
56
53
|
const currentSeriesName = lineSeries.name ? lineSeries.name.toString() : '';
|
|
57
|
-
|
|
58
|
-
const markerColor = (_lineSeries_color = lineSeries.color) !== null && _lineSeries_color !== void 0 ? _lineSeries_color : '#000';
|
|
54
|
+
const markerColor = lineSeries.color ?? '#000';
|
|
59
55
|
if (Array.isArray(data)) {
|
|
60
56
|
for(let datumIdx = 0; datumIdx < currentDatasetValues.length; datumIdx++){
|
|
61
57
|
const nearbyTimeSeries = currentDatasetValues[datumIdx];
|
|
@@ -77,10 +73,9 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
77
73
|
if (isClosestToCursor) {
|
|
78
74
|
// shows as bold in tooltip, customize 'emphasis' options in getTimeSeries util
|
|
79
75
|
emphasizedSeriesIndexes.push(seriesIdx);
|
|
80
|
-
var _yValueCounts_get;
|
|
81
76
|
// Used to determine which datapoint to apply select styles to.
|
|
82
77
|
// Accounts for cases where lines may be rendered directly on top of eachother.
|
|
83
|
-
const duplicateValuesCount =
|
|
78
|
+
const duplicateValuesCount = yValueCounts.get(yValue) ?? 0;
|
|
84
79
|
yValueCounts.set(yValue, duplicateValuesCount + 1);
|
|
85
80
|
if (duplicateValuesCount > 0) {
|
|
86
81
|
duplicateDatapoints.push({
|
|
@@ -132,10 +127,8 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
132
127
|
* Adjust yBuffer to increase or decrease number of series shown
|
|
133
128
|
*/ export function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
|
|
134
129
|
const currentNearbySeriesData = [];
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
var _pointInGrid_1;
|
|
138
|
-
const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
|
|
130
|
+
const cursorX = pointInGrid[0] ?? null;
|
|
131
|
+
const cursorY = pointInGrid[1] ?? null;
|
|
139
132
|
if (cursorX === null || cursorY === null) {
|
|
140
133
|
return currentNearbySeriesData;
|
|
141
134
|
}
|
|
@@ -149,12 +142,10 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
149
142
|
if (currentSeries === undefined) break;
|
|
150
143
|
if (currentNearbySeriesData.length >= OPTIMIZED_MODE_SERIES_LIMIT) break;
|
|
151
144
|
const currentSeriesName = currentSeries.name ? currentSeries.name.toString() : '';
|
|
152
|
-
|
|
153
|
-
const markerColor = (_currentSeries_color = currentSeries.color) !== null && _currentSeries_color !== void 0 ? _currentSeries_color : '#000';
|
|
145
|
+
const markerColor = currentSeries.color ?? '#000';
|
|
154
146
|
if (Array.isArray(currentSeries.data)) {
|
|
155
147
|
for(let datumIdx = 0; datumIdx < currentSeries.data.length; datumIdx++){
|
|
156
|
-
|
|
157
|
-
const xValue = (_data_xAxis_datumIdx = data.xAxis[datumIdx]) !== null && _data_xAxis_datumIdx !== void 0 ? _data_xAxis_datumIdx : 0;
|
|
148
|
+
const xValue = data.xAxis[datumIdx] ?? 0;
|
|
158
149
|
const yValue = currentSeries.data[datumIdx];
|
|
159
150
|
// ensure null values not displayed in tooltip
|
|
160
151
|
if (yValue !== undefined && yValue !== null && cursorX === datumIdx) {
|
|
@@ -172,7 +163,7 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
172
163
|
} else {
|
|
173
164
|
nonEmphasizedSeriesIndexes.push(seriesIdx);
|
|
174
165
|
// ensure series not close to cursor are not highlighted
|
|
175
|
-
if (
|
|
166
|
+
if (chart?.dispatchAction !== undefined) {
|
|
176
167
|
chart.dispatchAction({
|
|
177
168
|
type: 'downplay',
|
|
178
169
|
seriesIndex: seriesIdx
|
|
@@ -200,7 +191,7 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
200
191
|
}
|
|
201
192
|
}
|
|
202
193
|
}
|
|
203
|
-
if (
|
|
194
|
+
if (chart?.dispatchAction !== undefined) {
|
|
204
195
|
// Clears emphasis state of all lines that are not emphasized.
|
|
205
196
|
// Emphasized is a subset of just the nearby series that are closest to cursor.
|
|
206
197
|
chart.dispatchAction({
|
|
@@ -304,10 +295,9 @@ export const SHOW_FEWER_SERIES_LIMIT = 5;
|
|
|
304
295
|
totalSeries,
|
|
305
296
|
showAllSeries
|
|
306
297
|
});
|
|
307
|
-
var _mousePos_plotCanvas_x, _mousePos_plotCanvas_y;
|
|
308
298
|
const pointInPixel = [
|
|
309
|
-
|
|
310
|
-
|
|
299
|
+
mousePos.plotCanvas.x ?? 0,
|
|
300
|
+
mousePos.plotCanvas.y ?? 0
|
|
311
301
|
];
|
|
312
302
|
if (chart.containPixel('grid', pointInPixel)) {
|
|
313
303
|
const pointInGrid = chart.convertFromPixel('grid', pointInPixel);
|