@perses-dev/components 0.0.0-snapshot-embed-import-errors-8906900 → 0.0.0-snapshot-test-internal-dep-dd238ac
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/README.md +2 -3
- package/dist/ColorPicker/ColorPicker.d.ts +12 -0
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -0
- package/dist/ColorPicker/ColorPicker.js +78 -0
- package/dist/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/ColorPicker/index.d.ts +2 -0
- package/dist/ColorPicker/index.d.ts.map +1 -0
- package/dist/{Tooltip → ColorPicker}/index.js +2 -3
- package/dist/ColorPicker/index.js.map +1 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +2 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +88 -51
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +3 -2
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +4 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
- package/dist/DateTimeRangePicker/index.js +1 -1
- package/dist/DateTimeRangePicker/index.js.map +1 -1
- package/dist/DateTimeRangePicker/utils.js +1 -1
- package/dist/DateTimeRangePicker/utils.js.map +1 -1
- package/dist/Dialog/Dialog.d.ts +24 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -0
- package/dist/Dialog/Dialog.js +74 -0
- package/dist/Dialog/Dialog.js.map +1 -0
- package/dist/Dialog/index.d.ts +2 -0
- package/dist/Dialog/index.d.ts.map +1 -0
- package/dist/Dialog/index.js +15 -0
- package/dist/{Tooltip → Dialog}/index.js.map +1 -1
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/{EChart.d.ts → EChart/EChart.d.ts} +3 -3
- package/dist/EChart/EChart.d.ts.map +1 -0
- package/dist/{EChart.js → EChart/EChart.js} +2 -3
- package/dist/EChart/EChart.js.map +1 -0
- package/dist/EChart/index.d.ts +2 -0
- package/dist/EChart/index.d.ts.map +1 -0
- package/dist/EChart/index.js +15 -0
- package/dist/EChart/index.js.map +1 -0
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.d.ts +1 -2
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +3 -2
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/GaugeChart/index.js +1 -1
- package/dist/GaugeChart/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.d.ts +1 -6
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +2 -9
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.js +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +13 -5
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +1 -1
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/index.js +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.js +13 -18
- package/dist/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/LegendOptionsEditor/index.js +1 -1
- package/dist/LegendOptionsEditor/index.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +4 -2
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +4 -4
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/LineChart/utils.js +2 -2
- package/dist/LineChart/utils.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +3 -2
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +18 -6
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +1 -3
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +23 -16
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/index.js +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +4 -0
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -0
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +76 -0
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -0
- package/dist/ThresholdsEditor/ThresholdInput.d.ts +13 -0
- package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -0
- package/dist/ThresholdsEditor/ThresholdInput.js +61 -0
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +10 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.js +215 -0
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -0
- package/dist/ThresholdsEditor/index.d.ts +2 -0
- package/dist/ThresholdsEditor/index.d.ts.map +1 -0
- package/dist/ThresholdsEditor/index.js +15 -0
- package/dist/ThresholdsEditor/index.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/SeriesInfo.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.js +89 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +9 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +99 -0
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/SeriesMarker.d.ts +2 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/SeriesMarker.js +7 -7
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -0
- package/dist/{Tooltip/Tooltip.d.ts → TimeSeriesTooltip/TimeSeriesTooltip.d.ts} +4 -4
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts.map +1 -0
- package/dist/{Tooltip/Tooltip.js → TimeSeriesTooltip/TimeSeriesTooltip.js} +3 -4
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/TooltipContent.d.ts +1 -2
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/TooltipContent.js +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -0
- package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.js +6 -6
- package/dist/TimeSeriesTooltip/focused-series.js.map +1 -0
- package/dist/TimeSeriesTooltip/index.d.ts +9 -0
- package/dist/TimeSeriesTooltip/index.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/index.js +22 -0
- package/dist/TimeSeriesTooltip/index.js.map +1 -0
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.js +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -0
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/utils.js +1 -1
- package/dist/TimeSeriesTooltip/utils.js.map +1 -0
- package/dist/UnitSelector/UnitSelector.js +1 -1
- package/dist/UnitSelector/UnitSelector.js.map +1 -1
- package/dist/UnitSelector/index.js +1 -1
- package/dist/UnitSelector/index.js.map +1 -1
- package/dist/YAxisLabel.js +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/ColorPicker/ColorPicker.js +128 -0
- package/dist/cjs/{Tooltip → ColorPicker}/index.js +2 -3
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +87 -50
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +3 -2
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +4 -1
- package/dist/cjs/DateTimeRangePicker/index.js +1 -1
- package/dist/cjs/DateTimeRangePicker/utils.js +1 -1
- package/dist/cjs/Dialog/Dialog.js +85 -0
- package/dist/cjs/Dialog/index.js +28 -0
- package/dist/cjs/Drawer/Drawer.js +1 -1
- package/dist/cjs/Drawer/index.js +1 -1
- package/dist/cjs/{EChart.js → EChart/EChart.js} +5 -11
- package/dist/cjs/EChart/index.js +28 -0
- package/dist/cjs/ErrorAlert.js +1 -1
- package/dist/cjs/ErrorBoundary.js +1 -1
- package/dist/cjs/GaugeChart/GaugeChart.js +3 -2
- package/dist/cjs/GaugeChart/index.js +1 -1
- package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -18
- package/dist/cjs/InfoTooltip/index.js +1 -1
- package/dist/cjs/JSONEditor.js +1 -1
- package/dist/cjs/Legend/CompactLegend.js +1 -1
- package/dist/cjs/Legend/Legend.js +13 -5
- package/dist/cjs/Legend/LegendColorBadge.js +1 -1
- package/dist/cjs/Legend/ListLegend.js +1 -1
- package/dist/cjs/Legend/ListLegendItem.js +1 -1
- package/dist/cjs/Legend/index.js +1 -1
- package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.js +13 -18
- package/dist/cjs/LegendOptionsEditor/index.js +1 -1
- package/dist/cjs/LineChart/LineChart.js +43 -4
- package/dist/cjs/LineChart/index.js +1 -1
- package/dist/cjs/LineChart/utils.js +3 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +2 -2
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +23 -6
- package/dist/cjs/OptionsEditorLayout/index.js +1 -1
- package/dist/cjs/StatChart/StatChart.js +24 -60
- package/dist/cjs/StatChart/index.js +1 -1
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +87 -0
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +72 -0
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +265 -0
- package/dist/cjs/ThresholdsEditor/index.js +28 -0
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +95 -0
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +105 -0
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/SeriesMarker.js +7 -7
- package/dist/cjs/{Tooltip/Tooltip.js → TimeSeriesTooltip/TimeSeriesTooltip.js} +4 -4
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/TooltipContent.js +1 -1
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/focused-series.js +6 -6
- package/dist/cjs/TimeSeriesTooltip/index.js +35 -0
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/tooltip-model.js +1 -1
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/utils.js +1 -1
- package/dist/cjs/UnitSelector/UnitSelector.js +1 -1
- package/dist/cjs/UnitSelector/index.js +1 -1
- package/dist/cjs/YAxisLabel.js +1 -1
- package/dist/cjs/context/ChartsThemeProvider.js +1 -1
- package/dist/cjs/context/TimeZoneProvider.js +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/model/graph.js +4 -15
- package/dist/cjs/model/index.js +2 -1
- package/dist/cjs/model/legend.js +67 -0
- package/dist/cjs/model/theme.js +1 -1
- package/dist/cjs/model/units/bytes.js +1 -1
- package/dist/cjs/model/units/constants.js +1 -1
- package/dist/cjs/model/units/decimal.js +5 -2
- package/dist/cjs/model/units/index.js +1 -1
- package/dist/cjs/model/units/percent.js +1 -1
- package/dist/cjs/model/units/time.js +1 -1
- package/dist/cjs/model/units/types.js +1 -1
- package/dist/cjs/model/units/units.js +1 -1
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test-utils/index.js +1 -1
- package/dist/cjs/test-utils/theme.js +14 -1
- package/dist/cjs/theme/index.js +1 -1
- package/dist/cjs/theme/palette/background.js +1 -1
- package/dist/cjs/theme/palette/colors/blue.js +1 -1
- package/dist/cjs/theme/palette/colors/common.js +1 -1
- package/dist/cjs/theme/palette/colors/green.js +1 -1
- package/dist/cjs/theme/palette/colors/grey.js +1 -1
- package/dist/cjs/theme/palette/colors/index.js +1 -1
- package/dist/cjs/theme/palette/colors/orange.js +1 -1
- package/dist/cjs/theme/palette/colors/purple.js +1 -1
- package/dist/cjs/theme/palette/colors/red.js +1 -1
- package/dist/cjs/theme/palette/colors/types.js +1 -1
- package/dist/cjs/theme/palette/error.js +1 -1
- package/dist/cjs/theme/palette/grey.js +1 -1
- package/dist/cjs/theme/palette/index.js +1 -1
- package/dist/cjs/theme/palette/palette-options.js +1 -1
- package/dist/cjs/theme/palette/primary.js +1 -1
- package/dist/cjs/theme/palette/secondary.js +1 -1
- package/dist/cjs/theme/palette/success.js +1 -1
- package/dist/cjs/theme/palette/text.js +1 -1
- package/dist/cjs/theme/palette/warning.js +1 -1
- package/dist/cjs/theme/theme.js +17 -1
- package/dist/cjs/theme/types/ThemeExtension.d.js +1 -1
- package/dist/cjs/theme/typography.js +5 -1
- package/dist/cjs/utils/combine-sx.js +1 -1
- package/dist/cjs/utils/component-ids.js +1 -1
- package/dist/cjs/utils/format.js +1 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/mathjs.js +1 -1
- package/dist/cjs/utils/theme-gen.js +16 -8
- package/dist/context/ChartsThemeProvider.js +1 -1
- package/dist/context/ChartsThemeProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +3 -18
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/graph.js +1 -5
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +2 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/legend.d.ts +22 -0
- package/dist/model/legend.d.ts.map +1 -0
- package/dist/model/legend.js +51 -0
- package/dist/model/legend.js.map +1 -0
- package/dist/model/theme.d.ts +16 -0
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/units/bytes.d.ts +1 -1
- package/dist/model/units/bytes.d.ts.map +1 -1
- package/dist/model/units/bytes.js +1 -1
- package/dist/model/units/bytes.js.map +1 -1
- package/dist/model/units/constants.js +1 -1
- package/dist/model/units/constants.js.map +1 -1
- package/dist/model/units/decimal.d.ts +1 -1
- package/dist/model/units/decimal.d.ts.map +1 -1
- package/dist/model/units/decimal.js +5 -2
- package/dist/model/units/decimal.js.map +1 -1
- package/dist/model/units/index.js +1 -1
- package/dist/model/units/index.js.map +1 -1
- package/dist/model/units/percent.d.ts +1 -1
- package/dist/model/units/percent.d.ts.map +1 -1
- package/dist/model/units/percent.js +1 -1
- package/dist/model/units/percent.js.map +1 -1
- package/dist/model/units/time.d.ts +1 -1
- package/dist/model/units/time.d.ts.map +1 -1
- package/dist/model/units/time.js +1 -1
- package/dist/model/units/time.js.map +1 -1
- package/dist/model/units/types.d.ts +1 -1
- package/dist/model/units/types.d.ts.map +1 -1
- package/dist/model/units/types.js +1 -1
- package/dist/model/units/types.js.map +1 -1
- package/dist/model/units/units.js +1 -1
- package/dist/model/units/units.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +14 -1
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.js +1 -1
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/blue.js +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/common.js +1 -1
- package/dist/theme/palette/colors/common.js.map +1 -1
- package/dist/theme/palette/colors/green.js +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.js +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js +1 -1
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.js +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.js +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.js +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/colors/types.js +1 -1
- package/dist/theme/palette/colors/types.js.map +1 -1
- package/dist/theme/palette/error.js +1 -1
- package/dist/theme/palette/error.js.map +1 -1
- package/dist/theme/palette/grey.js +1 -1
- package/dist/theme/palette/grey.js.map +1 -1
- package/dist/theme/palette/index.js +1 -1
- package/dist/theme/palette/index.js.map +1 -1
- package/dist/theme/palette/palette-options.js +1 -1
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.js +1 -1
- package/dist/theme/palette/primary.js.map +1 -1
- package/dist/theme/palette/secondary.js +1 -1
- package/dist/theme/palette/secondary.js.map +1 -1
- package/dist/theme/palette/success.js +1 -1
- package/dist/theme/palette/success.js.map +1 -1
- package/dist/theme/palette/text.js +1 -1
- package/dist/theme/palette/text.js.map +1 -1
- package/dist/theme/palette/warning.js +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +18 -2
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.js +1 -1
- package/dist/theme/types/ThemeExtension.d.js.map +1 -1
- package/dist/theme/typography.d.ts +4 -0
- package/dist/theme/typography.d.ts.map +1 -1
- package/dist/theme/typography.js +5 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/combine-sx.js +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +15 -2
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +10 -4
- package/dist/EChart.d.ts.map +0 -1
- package/dist/EChart.js.map +0 -1
- package/dist/InfoTooltip/InfoTooltip.test.d.ts +0 -2
- package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +0 -1
- package/dist/InfoTooltip/InfoTooltip.test.js +0 -36
- package/dist/InfoTooltip/InfoTooltip.test.js.map +0 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts +0 -2
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts.map +0 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -41
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js.map +0 -1
- package/dist/StatChart/StatChart.test.d.ts +0 -2
- package/dist/StatChart/StatChart.test.d.ts.map +0 -1
- package/dist/StatChart/StatChart.test.js +0 -94
- package/dist/StatChart/StatChart.test.js.map +0 -1
- package/dist/Tooltip/SeriesInfo.d.ts.map +0 -1
- package/dist/Tooltip/SeriesInfo.js +0 -143
- package/dist/Tooltip/SeriesInfo.js.map +0 -1
- package/dist/Tooltip/SeriesMarker.d.ts.map +0 -1
- package/dist/Tooltip/SeriesMarker.js.map +0 -1
- package/dist/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/Tooltip/Tooltip.js.map +0 -1
- package/dist/Tooltip/TooltipContent.d.ts.map +0 -1
- package/dist/Tooltip/TooltipContent.js.map +0 -1
- package/dist/Tooltip/focused-series.d.ts.map +0 -1
- package/dist/Tooltip/focused-series.js.map +0 -1
- package/dist/Tooltip/focused-series.test.d.ts +0 -2
- package/dist/Tooltip/focused-series.test.d.ts.map +0 -1
- package/dist/Tooltip/focused-series.test.js +0 -93
- package/dist/Tooltip/focused-series.test.js.map +0 -1
- package/dist/Tooltip/index.d.ts +0 -3
- package/dist/Tooltip/index.d.ts.map +0 -1
- package/dist/Tooltip/tooltip-model.d.ts.map +0 -1
- package/dist/Tooltip/tooltip-model.js.map +0 -1
- package/dist/Tooltip/utils.d.ts.map +0 -1
- package/dist/Tooltip/utils.js.map +0 -1
- package/dist/UnitSelector/UnitSelector.test.d.ts +0 -2
- package/dist/UnitSelector/UnitSelector.test.d.ts.map +0 -1
- package/dist/UnitSelector/UnitSelector.test.js +0 -204
- package/dist/UnitSelector/UnitSelector.test.js.map +0 -1
- package/dist/cjs/InfoTooltip/InfoTooltip.test.js +0 -43
- package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -48
- package/dist/cjs/StatChart/StatChart.test.js +0 -96
- package/dist/cjs/Tooltip/SeriesInfo.js +0 -149
- package/dist/cjs/Tooltip/focused-series.test.js +0 -95
- package/dist/cjs/UnitSelector/UnitSelector.test.js +0 -211
- package/dist/cjs/model/units/units.test.js +0 -153
- package/dist/cjs/utils/format.test.js +0 -47
- package/dist/cjs/utils/theme-gen.test.js +0 -197
- package/dist/model/units/units.test.d.ts +0 -2
- package/dist/model/units/units.test.d.ts.map +0 -1
- package/dist/model/units/units.test.js +0 -151
- package/dist/model/units/units.test.js.map +0 -1
- package/dist/utils/format.test.d.ts +0 -2
- package/dist/utils/format.test.d.ts.map +0 -1
- package/dist/utils/format.test.js +0 -45
- package/dist/utils/format.test.js.map +0 -1
- package/dist/utils/theme-gen.test.d.ts +0 -2
- package/dist/utils/theme-gen.test.d.ts.map +0 -1
- package/dist/utils/theme-gen.test.js +0 -195
- package/dist/utils/theme-gen.test.js.map +0 -1
- /package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.d.ts +0 -0
- /package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.d.ts +0 -0
- /package/dist/{Tooltip → TimeSeriesTooltip}/utils.d.ts +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "ThresholdsEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>ThresholdsEditor
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
23
|
+
const _immer = /*#__PURE__*/ _interopRequireDefault(require("immer"));
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _plus = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Plus"));
|
|
26
|
+
const _system = require("@mui/system");
|
|
27
|
+
const _infoTooltip = require("../InfoTooltip");
|
|
28
|
+
const _chartsThemeProvider = require("../context/ChartsThemeProvider");
|
|
29
|
+
const _optionsEditorLayout = require("../OptionsEditorLayout");
|
|
30
|
+
const _thresholdColorPicker = require("./ThresholdColorPicker");
|
|
31
|
+
const _thresholdInput = require("./ThresholdInput");
|
|
32
|
+
function _interopRequireDefault(obj) {
|
|
33
|
+
return obj && obj.__esModule ? obj : {
|
|
34
|
+
default: obj
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
38
|
+
if (typeof WeakMap !== "function") return null;
|
|
39
|
+
var cacheBabelInterop = new WeakMap();
|
|
40
|
+
var cacheNodeInterop = new WeakMap();
|
|
41
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
42
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
43
|
+
})(nodeInterop);
|
|
44
|
+
}
|
|
45
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
46
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
47
|
+
return obj;
|
|
48
|
+
}
|
|
49
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
50
|
+
return {
|
|
51
|
+
default: obj
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
55
|
+
if (cache && cache.has(obj)) {
|
|
56
|
+
return cache.get(obj);
|
|
57
|
+
}
|
|
58
|
+
var newObj = {};
|
|
59
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
60
|
+
for(var key in obj){
|
|
61
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
62
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
63
|
+
if (desc && (desc.get || desc.set)) {
|
|
64
|
+
Object.defineProperty(newObj, key, desc);
|
|
65
|
+
} else {
|
|
66
|
+
newObj[key] = obj[key];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
newObj.default = obj;
|
|
71
|
+
if (cache) {
|
|
72
|
+
cache.set(obj, newObj);
|
|
73
|
+
}
|
|
74
|
+
return newObj;
|
|
75
|
+
}
|
|
76
|
+
const DEFAULT_STEP = 10;
|
|
77
|
+
function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercentMode }) {
|
|
78
|
+
const { thresholds: { defaultColor , palette } , } = (0, _chartsThemeProvider.useChartsTheme)();
|
|
79
|
+
var ref;
|
|
80
|
+
const defaultThresholdColor = (ref = thresholds === null || thresholds === void 0 ? void 0 : thresholds.default_color) !== null && ref !== void 0 ? ref : defaultColor;
|
|
81
|
+
const [steps, setSteps] = (0, _react.useState)(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
|
|
82
|
+
(0, _react.useEffect)(()=>{
|
|
83
|
+
setSteps(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
|
|
84
|
+
}, [
|
|
85
|
+
thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps
|
|
86
|
+
]);
|
|
87
|
+
// every time a new threshold is added, we want to focus the recently added input
|
|
88
|
+
const recentlyAddedInputRef = (0, _react.useRef)(null);
|
|
89
|
+
const focusRef = (0, _react.useRef)(false);
|
|
90
|
+
(0, _react.useEffect)(()=>{
|
|
91
|
+
var ref;
|
|
92
|
+
if (!recentlyAddedInputRef.current || !focusRef.current) return;
|
|
93
|
+
(ref = recentlyAddedInputRef.current) === null || ref === void 0 ? void 0 : ref.focus();
|
|
94
|
+
focusRef.current = false;
|
|
95
|
+
}, [
|
|
96
|
+
steps === null || steps === void 0 ? void 0 : steps.length
|
|
97
|
+
]);
|
|
98
|
+
const handleThresholdValueChange = (e, i)=>{
|
|
99
|
+
setSteps((0, _immer.default)(steps, (draft)=>{
|
|
100
|
+
const step = draft === null || draft === void 0 ? void 0 : draft[i];
|
|
101
|
+
if (step) {
|
|
102
|
+
step.value = Number(e.target.value);
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
const handleThresholdColorChange = (color, i)=>{
|
|
107
|
+
if (thresholds !== undefined) {
|
|
108
|
+
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
109
|
+
if (draft.steps !== undefined) {
|
|
110
|
+
const step = draft.steps[i];
|
|
111
|
+
if (step) {
|
|
112
|
+
step.color = color;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const handleDefaultColorChange = (color)=>{
|
|
119
|
+
if (thresholds !== undefined) {
|
|
120
|
+
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
121
|
+
draft.default_color = color;
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
// sort thresholds in ascending order every time an input blurs
|
|
126
|
+
const handleThresholdBlur = ()=>{
|
|
127
|
+
if (steps !== undefined) {
|
|
128
|
+
const sortedSteps = [
|
|
129
|
+
...steps
|
|
130
|
+
];
|
|
131
|
+
sortedSteps.sort((a, b)=>a.value - b.value);
|
|
132
|
+
if (thresholds !== undefined) {
|
|
133
|
+
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
134
|
+
draft.steps = sortedSteps;
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const deleteThreshold = (i)=>{
|
|
140
|
+
if (thresholds !== undefined) {
|
|
141
|
+
const updatedThresholds = (0, _immer.default)(thresholds, (draft)=>{
|
|
142
|
+
if (draft.steps) {
|
|
143
|
+
draft.steps.splice(i, 1);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
onChange(updatedThresholds);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
const addThresholdInput = ()=>{
|
|
150
|
+
focusRef.current = true;
|
|
151
|
+
if (thresholds === undefined) {
|
|
152
|
+
onChange({
|
|
153
|
+
steps: [
|
|
154
|
+
{
|
|
155
|
+
value: DEFAULT_STEP
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
} else {
|
|
160
|
+
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
161
|
+
const steps = draft.steps;
|
|
162
|
+
if (steps === null || steps === void 0 ? void 0 : steps.length) {
|
|
163
|
+
const lastStep = steps[steps.length - 1];
|
|
164
|
+
var _length;
|
|
165
|
+
const color = (_length = palette[steps.length]) !== null && _length !== void 0 ? _length : getRandomColor(); // we will assign color from the palette first, then generate random color
|
|
166
|
+
var ref;
|
|
167
|
+
steps.push({
|
|
168
|
+
color,
|
|
169
|
+
value: ((ref = lastStep === null || lastStep === void 0 ? void 0 : lastStep.value) !== null && ref !== void 0 ? ref : 0) + DEFAULT_STEP
|
|
170
|
+
}); // set new threshold value to last step value + 10
|
|
171
|
+
} else if (steps) {
|
|
172
|
+
steps.push({
|
|
173
|
+
value: DEFAULT_STEP
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const handleModeChange = (event, value)=>{
|
|
180
|
+
const mode = value === 'Percent' ? 'Percent' : undefined;
|
|
181
|
+
if (thresholds !== undefined) {
|
|
182
|
+
onChange((0, _immer.default)(thresholds, (draft)=>{
|
|
183
|
+
draft.mode = mode;
|
|
184
|
+
}));
|
|
185
|
+
} else {
|
|
186
|
+
onChange({
|
|
187
|
+
mode
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
var ref1, _color, ref2;
|
|
192
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_optionsEditorLayout.OptionsEditorGroup, {
|
|
193
|
+
title: "Thresholds",
|
|
194
|
+
icon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
195
|
+
size: "small",
|
|
196
|
+
"aria-label": "add threshold",
|
|
197
|
+
onClick: addThresholdInput,
|
|
198
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plus.default, {})
|
|
199
|
+
}),
|
|
200
|
+
children: [
|
|
201
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.ToggleButtonGroup, {
|
|
202
|
+
exclusive: true,
|
|
203
|
+
disabled: disablePercentMode,
|
|
204
|
+
value: (ref1 = thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode) !== null && ref1 !== void 0 ? ref1 : 'Absolute',
|
|
205
|
+
onChange: handleModeChange,
|
|
206
|
+
sx: {
|
|
207
|
+
height: '36px',
|
|
208
|
+
marginLeft: 'auto'
|
|
209
|
+
},
|
|
210
|
+
children: [
|
|
211
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ToggleButton, {
|
|
212
|
+
"aria-label": "absolute",
|
|
213
|
+
value: "Absolute",
|
|
214
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
|
|
215
|
+
description: "Absolute",
|
|
216
|
+
children: "#"
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ToggleButton, {
|
|
220
|
+
"aria-label": "percent",
|
|
221
|
+
value: "Percent",
|
|
222
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
|
|
223
|
+
description: "Percentage means thresholds relative to min & max",
|
|
224
|
+
children: "%"
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
}),
|
|
229
|
+
steps && steps.map((step, i)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_thresholdInput.ThresholdInput, {
|
|
230
|
+
inputRef: i === steps.length - 1 ? recentlyAddedInputRef : undefined,
|
|
231
|
+
label: `T${i + 1}`,
|
|
232
|
+
color: (ref2 = (_color = step.color) !== null && _color !== void 0 ? _color : palette[i]) !== null && ref2 !== void 0 ? ref2 : defaultThresholdColor,
|
|
233
|
+
value: step.value,
|
|
234
|
+
onColorChange: (color)=>handleThresholdColorChange(color, i),
|
|
235
|
+
onChange: (e)=>{
|
|
236
|
+
handleThresholdValueChange(e, i);
|
|
237
|
+
},
|
|
238
|
+
onDelete: ()=>{
|
|
239
|
+
deleteThreshold(i);
|
|
240
|
+
},
|
|
241
|
+
onBlur: handleThresholdBlur
|
|
242
|
+
}, i)).reverse(),
|
|
243
|
+
!hideDefault && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_system.Stack, {
|
|
244
|
+
flex: 1,
|
|
245
|
+
direction: "row",
|
|
246
|
+
alignItems: "center",
|
|
247
|
+
spacing: 1,
|
|
248
|
+
children: [
|
|
249
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_thresholdColorPicker.ThresholdColorPicker, {
|
|
250
|
+
label: "default",
|
|
251
|
+
color: defaultThresholdColor,
|
|
252
|
+
onColorChange: handleDefaultColorChange
|
|
253
|
+
}),
|
|
254
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
255
|
+
children: "Default"
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
// https://www.paulirish.com/2009/random-hex-color-code-snippets/
|
|
263
|
+
const getRandomColor = ()=>{
|
|
264
|
+
return '#' + Math.floor(Math.random() * 16777216).toString(16).padStart(6, '0');
|
|
265
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./ThresholdsEditor"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "SeriesInfo", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>SeriesInfo
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
const _seriesMarker = require("./SeriesMarker");
|
|
24
|
+
const _seriesLabelsStack = require("./SeriesLabelsStack");
|
|
25
|
+
const _tooltipModel = require("./tooltip-model");
|
|
26
|
+
function SeriesInfo(props) {
|
|
27
|
+
const { seriesName , formattedY , markerColor , totalSeries , wrapLabels } = props;
|
|
28
|
+
// metric __name__ comes before opening curly brace, ignore if not populated
|
|
29
|
+
// ex with metric name: node_load15{env="demo",job="node"}
|
|
30
|
+
// ex without metric name: {env="demo",job="node"}
|
|
31
|
+
const splitName = seriesName.split('{');
|
|
32
|
+
var ref;
|
|
33
|
+
const seriesLabels = (ref = splitName[1]) !== null && ref !== void 0 ? ref : seriesName;
|
|
34
|
+
// remove curly braces that wrap labels
|
|
35
|
+
const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');
|
|
36
|
+
// determine whether to show labels on separate lines
|
|
37
|
+
const splitLabels = formattedSeriesLabels.split(',');
|
|
38
|
+
if (totalSeries === 1 && splitLabels.length > 1) {
|
|
39
|
+
const metricName = splitName[0] ? `${splitName[0]}:` : 'value:';
|
|
40
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_seriesLabelsStack.SeriesLabelsStack, {
|
|
41
|
+
formattedY: formattedY,
|
|
42
|
+
metricName: metricName,
|
|
43
|
+
metricLabels: splitLabels,
|
|
44
|
+
markerColor: markerColor
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// add space after commas when more than one focused series
|
|
48
|
+
const inlineSeriesLabels = formattedSeriesLabels.replace(/[,]/g, ', ');
|
|
49
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
50
|
+
sx: {
|
|
51
|
+
display: 'table-row',
|
|
52
|
+
paddingTop: 0.5
|
|
53
|
+
},
|
|
54
|
+
children: [
|
|
55
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
56
|
+
sx: {
|
|
57
|
+
display: 'table-cell',
|
|
58
|
+
maxWidth: '520px'
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_seriesMarker.SeriesMarker, {
|
|
62
|
+
markerColor: markerColor,
|
|
63
|
+
sx: {
|
|
64
|
+
marginTop: 0.5
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
68
|
+
component: "span",
|
|
69
|
+
sx: (theme)=>({
|
|
70
|
+
display: 'inline-block',
|
|
71
|
+
width: 'calc(100% - 20px)',
|
|
72
|
+
minWidth: 150,
|
|
73
|
+
maxWidth: _tooltipModel.TOOLTIP_LABELS_MAX_WIDTH,
|
|
74
|
+
overflow: 'hidden',
|
|
75
|
+
color: theme.palette.common.white,
|
|
76
|
+
textOverflow: 'ellipsis',
|
|
77
|
+
whiteSpace: wrapLabels ? 'normal' : 'nowrap'
|
|
78
|
+
}),
|
|
79
|
+
children: inlineSeriesLabels
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
84
|
+
sx: {
|
|
85
|
+
display: 'table-cell',
|
|
86
|
+
paddingLeft: 1.5,
|
|
87
|
+
textAlign: 'right',
|
|
88
|
+
verticalAlign: 'top',
|
|
89
|
+
fontWeight: '700'
|
|
90
|
+
},
|
|
91
|
+
children: formattedY
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "SeriesLabelsStack", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>SeriesLabelsStack
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
const _seriesMarker = require("./SeriesMarker");
|
|
24
|
+
function SeriesLabelsStack(props) {
|
|
25
|
+
const { formattedY , markerColor , metricName , metricLabels } = props;
|
|
26
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
27
|
+
spacing: 0.5,
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
30
|
+
sx: (theme)=>({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
height: '16px',
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'left',
|
|
36
|
+
color: theme.palette.common.white,
|
|
37
|
+
fontSize: '11px'
|
|
38
|
+
}),
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_seriesMarker.SeriesMarker, {
|
|
41
|
+
markerColor: markerColor,
|
|
42
|
+
sx: {
|
|
43
|
+
marginTop: 0.25
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
47
|
+
component: "span",
|
|
48
|
+
children: [
|
|
49
|
+
metricName,
|
|
50
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
51
|
+
component: "span",
|
|
52
|
+
sx: (theme)=>({
|
|
53
|
+
color: theme.palette.common.white,
|
|
54
|
+
fontWeight: 700,
|
|
55
|
+
paddingLeft: '2px'
|
|
56
|
+
}),
|
|
57
|
+
children: formattedY
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Divider, {
|
|
64
|
+
sx: (theme)=>({
|
|
65
|
+
borderColor: theme.palette.grey['500']
|
|
66
|
+
})
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
69
|
+
sx: (theme)=>({
|
|
70
|
+
color: theme.palette.common.white
|
|
71
|
+
}),
|
|
72
|
+
children: metricLabels.map((label)=>{
|
|
73
|
+
// show labels on separate lines when many labels and only one focused series
|
|
74
|
+
if (label) {
|
|
75
|
+
const [name, value] = label.split('=');
|
|
76
|
+
const formattedName = value !== undefined ? `${name}: ` : name;
|
|
77
|
+
const formattedValue = value !== undefined ? value.replace(/(^"|"$)/g, '') : value;
|
|
78
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
79
|
+
sx: {
|
|
80
|
+
display: 'flex',
|
|
81
|
+
gap: '4px'
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
85
|
+
sx: {
|
|
86
|
+
fontSize: '11px'
|
|
87
|
+
},
|
|
88
|
+
children: formattedName
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
91
|
+
sx: (theme)=>({
|
|
92
|
+
color: theme.palette.common.white,
|
|
93
|
+
fontWeight: 700,
|
|
94
|
+
fontSize: '11px'
|
|
95
|
+
}),
|
|
96
|
+
children: formattedValue
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
}, label);
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -20,18 +20,18 @@ Object.defineProperty(exports, "SeriesMarker", {
|
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
22
|
const _material = require("@mui/material");
|
|
23
|
+
const _utils = require("../utils");
|
|
23
24
|
function SeriesMarker(props) {
|
|
24
|
-
const { markerColor } = props;
|
|
25
|
+
const { markerColor , sx } = props;
|
|
25
26
|
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
26
|
-
sx: {
|
|
27
|
+
sx: (0, _utils.combineSx)({
|
|
27
28
|
display: 'inline-block',
|
|
28
|
-
width: '
|
|
29
|
+
width: '11px',
|
|
30
|
+
height: '11px',
|
|
29
31
|
borderRadius: '2px',
|
|
30
|
-
height: '12px',
|
|
31
|
-
marginTop: 0.25,
|
|
32
32
|
marginRight: 1,
|
|
33
33
|
verticalAlign: 'top'
|
|
34
|
-
},
|
|
34
|
+
}, sx),
|
|
35
35
|
style: {
|
|
36
36
|
backgroundColor: markerColor
|
|
37
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "TimeSeriesTooltip", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()=>
|
|
19
|
+
get: ()=>TimeSeriesTooltip
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
22
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
@@ -64,7 +64,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
64
64
|
}
|
|
65
65
|
return newObj;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const TimeSeriesTooltip = /*#__PURE__*/ _react.default.memo(function TimeSeriesTooltip({ chartRef , chartData , wrapLabels , pinTooltip , unit }) {
|
|
68
68
|
const [pinnedPos, setPinnedPos] = (0, _react.useState)(null);
|
|
69
69
|
const mousePos = (0, _tooltipModel.useMousePosition)();
|
|
70
70
|
if (mousePos === null || mousePos.target === null) return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -47,9 +47,9 @@ function getNearbySeries(data, pointInGrid, yBuffer, unit) {
|
|
|
47
47
|
for(let datumIdx = 0; datumIdx < currentSeries.data.length; datumIdx++){
|
|
48
48
|
var _datumIdx;
|
|
49
49
|
const xValue = (_datumIdx = data.xAxis[datumIdx]) !== null && _datumIdx !== void 0 ? _datumIdx : 0;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (focusedX === datumIdx) {
|
|
50
|
+
const yValue = currentSeries.data[datumIdx];
|
|
51
|
+
// ensure null values not displayed in tooltip
|
|
52
|
+
if (yValue !== undefined && yValue !== null && focusedX === datumIdx) {
|
|
53
53
|
if (yValue !== '-' && focusedY <= yValue + yBuffer && focusedY >= yValue - yBuffer) {
|
|
54
54
|
// determine whether to convert timestamp to ms, see: https://stackoverflow.com/a/23982005/17575201
|
|
55
55
|
const xValueMilliSeconds = xValue > 99999999999 ? xValue : xValue * 1000;
|
|
@@ -99,9 +99,9 @@ function getFocusedSeriesData(mousePos, chartData, pinnedPos, chart, unit) {
|
|
|
99
99
|
if (chart['_model'] === undefined) return [];
|
|
100
100
|
const chartModel = chart['_model'];
|
|
101
101
|
const yAxisInterval = chartModel.getComponent('yAxis').axis.scale._interval;
|
|
102
|
+
// tooltip trigger area gets smaller with more series, increase yAxisInterval multiplier to expand nearby series range
|
|
102
103
|
const seriesNum = chartData.timeSeries.length;
|
|
103
|
-
|
|
104
|
-
const yBuffer = seriesNum > _tooltipModel.TOOLTIP_MAX_ITEMS ? yAxisInterval * 0.5 : yAxisInterval * 2;
|
|
104
|
+
const yBuffer = seriesNum > _tooltipModel.TOOLTIP_MAX_ITEMS ? yAxisInterval * 0.5 : yAxisInterval * 5;
|
|
105
105
|
var _x, _y;
|
|
106
106
|
const pointInPixel = [
|
|
107
107
|
(_x = mousePos.plotCanvas.x) !== null && _x !== void 0 ? _x : 0,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./TimeSeriesTooltip"), exports);
|
|
18
|
+
_exportStar(require("./SeriesInfo"), exports);
|
|
19
|
+
_exportStar(require("./SeriesLabelsStack"), exports);
|
|
20
|
+
_exportStar(require("./SeriesMarker"), exports);
|
|
21
|
+
_exportStar(require("./TooltipContent"), exports);
|
|
22
|
+
_exportStar(require("./focused-series"), exports);
|
|
23
|
+
_exportStar(require("./tooltip-model"), exports);
|
|
24
|
+
_exportStar(require("./utils"), exports);
|
|
25
|
+
function _exportStar(from, to) {
|
|
26
|
+
Object.keys(from).forEach(function(k) {
|
|
27
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return from[k];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
return from;
|
|
35
|
+
}
|
package/dist/cjs/YAxisLabel.js
CHANGED