@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
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { render, screen } from '@testing-library/react';
|
|
15
|
-
import userEvent from '@testing-library/user-event';
|
|
16
|
-
import { UnitSelector } from './UnitSelector';
|
|
17
|
-
describe('UnitSelector', ()=>{
|
|
18
|
-
const renderUnitSelector = (value, onChange = jest.fn())=>{
|
|
19
|
-
render(/*#__PURE__*/ _jsx("div", {
|
|
20
|
-
children: /*#__PURE__*/ _jsx(UnitSelector, {
|
|
21
|
-
value: value,
|
|
22
|
-
onChange: onChange
|
|
23
|
-
})
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
const getUnitSelector = ()=>{
|
|
27
|
-
return screen.getByRole('combobox', {
|
|
28
|
-
name: 'Units'
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
const getDecimalSelector = ()=>{
|
|
32
|
-
return screen.getByRole('combobox', {
|
|
33
|
-
name: 'Decimal'
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const getAbbreviateSwitch = ()=>{
|
|
37
|
-
return screen.getByRole('checkbox', {
|
|
38
|
-
name: 'Abbreviate'
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
it('can change the unit kind by clicking', ()=>{
|
|
42
|
-
const onChange = jest.fn();
|
|
43
|
-
renderUnitSelector({
|
|
44
|
-
kind: 'Minutes'
|
|
45
|
-
}, onChange);
|
|
46
|
-
const unitSelector = getUnitSelector();
|
|
47
|
-
userEvent.click(unitSelector);
|
|
48
|
-
const decimalOption = screen.getByRole('option', {
|
|
49
|
-
name: 'Decimal'
|
|
50
|
-
});
|
|
51
|
-
userEvent.click(decimalOption);
|
|
52
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
53
|
-
kind: 'Decimal'
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
it('can change the unit kind using a keyboard', ()=>{
|
|
57
|
-
const onChange = jest.fn();
|
|
58
|
-
renderUnitSelector({
|
|
59
|
-
kind: 'Bytes'
|
|
60
|
-
}, onChange);
|
|
61
|
-
const unitSelector = getUnitSelector();
|
|
62
|
-
userEvent.tab();
|
|
63
|
-
userEvent.tab();
|
|
64
|
-
expect(unitSelector).toHaveFocus();
|
|
65
|
-
userEvent.clear(unitSelector);
|
|
66
|
-
userEvent.keyboard('years');
|
|
67
|
-
screen.getByRole('option', {
|
|
68
|
-
name: 'Years'
|
|
69
|
-
});
|
|
70
|
-
userEvent.keyboard('{arrowup}{enter}');
|
|
71
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
72
|
-
kind: 'Years'
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
it('can change the decimal places by clicking', ()=>{
|
|
76
|
-
const onChange = jest.fn();
|
|
77
|
-
renderUnitSelector({
|
|
78
|
-
kind: 'Decimal',
|
|
79
|
-
decimal_places: 0,
|
|
80
|
-
abbreviate: true
|
|
81
|
-
}, onChange);
|
|
82
|
-
userEvent.click(getDecimalSelector());
|
|
83
|
-
const decimalOption = screen.getByRole('option', {
|
|
84
|
-
name: '1'
|
|
85
|
-
});
|
|
86
|
-
userEvent.click(decimalOption);
|
|
87
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
88
|
-
kind: 'Decimal',
|
|
89
|
-
decimal_places: 1,
|
|
90
|
-
abbreviate: true
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
it('can change the decimal places using a keyboard', ()=>{
|
|
94
|
-
const onChange = jest.fn();
|
|
95
|
-
renderUnitSelector({
|
|
96
|
-
kind: 'Percent'
|
|
97
|
-
}, onChange);
|
|
98
|
-
const decimalSelector = getDecimalSelector();
|
|
99
|
-
userEvent.tab();
|
|
100
|
-
userEvent.tab();
|
|
101
|
-
expect(decimalSelector).toHaveFocus();
|
|
102
|
-
userEvent.clear(decimalSelector);
|
|
103
|
-
userEvent.keyboard('3');
|
|
104
|
-
screen.getByRole('option', {
|
|
105
|
-
name: '3'
|
|
106
|
-
});
|
|
107
|
-
userEvent.keyboard('{arrowup}{enter}');
|
|
108
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
109
|
-
kind: 'Percent',
|
|
110
|
-
decimal_places: 3
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
it('can change abbreviate by clicking', ()=>{
|
|
114
|
-
const onChange = jest.fn();
|
|
115
|
-
renderUnitSelector({
|
|
116
|
-
kind: 'Decimal',
|
|
117
|
-
decimal_places: 3,
|
|
118
|
-
abbreviate: true
|
|
119
|
-
}, onChange);
|
|
120
|
-
userEvent.click(getAbbreviateSwitch());
|
|
121
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
122
|
-
kind: 'Decimal',
|
|
123
|
-
decimal_places: 3,
|
|
124
|
-
abbreviate: false
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
it('can change abbreviate using a keyboard', ()=>{
|
|
128
|
-
const onChange = jest.fn();
|
|
129
|
-
renderUnitSelector({
|
|
130
|
-
kind: 'Decimal',
|
|
131
|
-
decimal_places: 0
|
|
132
|
-
}, onChange);
|
|
133
|
-
userEvent.tab();
|
|
134
|
-
userEvent.keyboard('{space}');
|
|
135
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
136
|
-
kind: 'Decimal',
|
|
137
|
-
decimal_places: 0,
|
|
138
|
-
abbreviate: true
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
describe('with a time unit selected', ()=>{
|
|
142
|
-
it('does not allow the user to set abbreviate', ()=>{
|
|
143
|
-
renderUnitSelector({
|
|
144
|
-
kind: 'Minutes'
|
|
145
|
-
});
|
|
146
|
-
expect(getAbbreviateSwitch()).toBeDisabled();
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
describe('with a percent unit selected', ()=>{
|
|
150
|
-
it('allows the user to modify the decimal places', ()=>{
|
|
151
|
-
renderUnitSelector({
|
|
152
|
-
kind: 'Percent'
|
|
153
|
-
});
|
|
154
|
-
expect(getDecimalSelector()).toBeEnabled();
|
|
155
|
-
});
|
|
156
|
-
it('does not allow the user to set abbreviate', ()=>{
|
|
157
|
-
renderUnitSelector({
|
|
158
|
-
kind: 'PercentDecimal'
|
|
159
|
-
});
|
|
160
|
-
expect(getAbbreviateSwitch()).toBeDisabled();
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
describe('with a decimal unit selected', ()=>{
|
|
164
|
-
it('allows the user to modify the decimal places', ()=>{
|
|
165
|
-
renderUnitSelector({
|
|
166
|
-
kind: 'Decimal'
|
|
167
|
-
});
|
|
168
|
-
expect(getDecimalSelector()).toBeEnabled();
|
|
169
|
-
});
|
|
170
|
-
it('allows the user to set abbreviate', ()=>{
|
|
171
|
-
renderUnitSelector({
|
|
172
|
-
kind: 'Decimal'
|
|
173
|
-
});
|
|
174
|
-
expect(getAbbreviateSwitch()).toBeEnabled();
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
describe('with a bytes unit selected', ()=>{
|
|
178
|
-
it('allows the user to modify the decimal places', ()=>{
|
|
179
|
-
renderUnitSelector({
|
|
180
|
-
kind: 'Bytes'
|
|
181
|
-
});
|
|
182
|
-
expect(getDecimalSelector()).toBeEnabled();
|
|
183
|
-
});
|
|
184
|
-
it('allows the user to set abbreviate', ()=>{
|
|
185
|
-
renderUnitSelector({
|
|
186
|
-
kind: 'Bytes'
|
|
187
|
-
});
|
|
188
|
-
expect(getAbbreviateSwitch()).toBeEnabled();
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
it('should not show an option for disabled units', ()=>{
|
|
192
|
-
const onChange = jest.fn();
|
|
193
|
-
renderUnitSelector({
|
|
194
|
-
kind: 'Decimal'
|
|
195
|
-
}, onChange);
|
|
196
|
-
userEvent.click(getUnitSelector());
|
|
197
|
-
const percentShorthandOption = screen.queryByRole('option', {
|
|
198
|
-
name: '%'
|
|
199
|
-
});
|
|
200
|
-
expect(percentShorthandOption).not.toBeInTheDocument();
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
//# sourceMappingURL=UnitSelector.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/UnitSelector/UnitSelector.test.tsx"],"sourcesContent":["// Copyright 2022 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 { render, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { UnitOptions } from '../model';\nimport { UnitSelector } from './UnitSelector';\n\ndescribe('UnitSelector', () => {\n const renderUnitSelector = (value: UnitOptions, onChange = jest.fn()) => {\n render(\n <div>\n <UnitSelector value={value} onChange={onChange} />\n </div>\n );\n };\n\n const getUnitSelector = () => {\n return screen.getByRole('combobox', { name: 'Units' });\n };\n\n const getDecimalSelector = () => {\n return screen.getByRole('combobox', { name: 'Decimal' });\n };\n\n const getAbbreviateSwitch = () => {\n return screen.getByRole('checkbox', { name: 'Abbreviate' });\n };\n\n it('can change the unit kind by clicking', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Minutes' }, onChange);\n\n const unitSelector = getUnitSelector();\n userEvent.click(unitSelector);\n const decimalOption = screen.getByRole('option', {\n name: 'Decimal',\n });\n userEvent.click(decimalOption);\n\n expect(onChange).toHaveBeenCalledWith({\n kind: 'Decimal',\n });\n });\n\n it('can change the unit kind using a keyboard', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Bytes' }, onChange);\n\n const unitSelector = getUnitSelector();\n userEvent.tab();\n userEvent.tab();\n expect(unitSelector).toHaveFocus();\n\n userEvent.clear(unitSelector);\n userEvent.keyboard('years');\n screen.getByRole('option', {\n name: 'Years',\n });\n\n userEvent.keyboard('{arrowup}{enter}');\n\n expect(onChange).toHaveBeenCalledWith({\n kind: 'Years',\n });\n });\n\n it('can change the decimal places by clicking', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Decimal', decimal_places: 0, abbreviate: true }, onChange);\n\n userEvent.click(getDecimalSelector());\n const decimalOption = screen.getByRole('option', {\n name: '1',\n });\n userEvent.click(decimalOption);\n\n expect(onChange).toHaveBeenCalledWith({\n kind: 'Decimal',\n decimal_places: 1,\n abbreviate: true,\n });\n });\n\n it('can change the decimal places using a keyboard', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Percent' }, onChange);\n\n const decimalSelector = getDecimalSelector();\n userEvent.tab();\n userEvent.tab();\n expect(decimalSelector).toHaveFocus();\n\n userEvent.clear(decimalSelector);\n userEvent.keyboard('3');\n screen.getByRole('option', {\n name: '3',\n });\n\n userEvent.keyboard('{arrowup}{enter}');\n\n expect(onChange).toHaveBeenCalledWith({\n kind: 'Percent',\n decimal_places: 3,\n });\n });\n\n it('can change abbreviate by clicking', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Decimal', decimal_places: 3, abbreviate: true }, onChange);\n\n userEvent.click(getAbbreviateSwitch());\n\n expect(onChange).toHaveBeenCalledWith({\n kind: 'Decimal',\n decimal_places: 3,\n abbreviate: false,\n });\n });\n\n it('can change abbreviate using a keyboard', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Decimal', decimal_places: 0 }, onChange);\n\n userEvent.tab();\n userEvent.keyboard('{space}');\n\n expect(onChange).toHaveBeenCalledWith({\n kind: 'Decimal',\n decimal_places: 0,\n abbreviate: true,\n });\n });\n\n describe('with a time unit selected', () => {\n it('does not allow the user to set abbreviate', () => {\n renderUnitSelector({ kind: 'Minutes' });\n expect(getAbbreviateSwitch()).toBeDisabled();\n });\n });\n\n describe('with a percent unit selected', () => {\n it('allows the user to modify the decimal places', () => {\n renderUnitSelector({ kind: 'Percent' });\n expect(getDecimalSelector()).toBeEnabled();\n });\n\n it('does not allow the user to set abbreviate', () => {\n renderUnitSelector({ kind: 'PercentDecimal' });\n expect(getAbbreviateSwitch()).toBeDisabled();\n });\n });\n\n describe('with a decimal unit selected', () => {\n it('allows the user to modify the decimal places', () => {\n renderUnitSelector({ kind: 'Decimal' });\n expect(getDecimalSelector()).toBeEnabled();\n });\n\n it('allows the user to set abbreviate', () => {\n renderUnitSelector({ kind: 'Decimal' });\n expect(getAbbreviateSwitch()).toBeEnabled();\n });\n });\n\n describe('with a bytes unit selected', () => {\n it('allows the user to modify the decimal places', () => {\n renderUnitSelector({ kind: 'Bytes' });\n expect(getDecimalSelector()).toBeEnabled();\n });\n\n it('allows the user to set abbreviate', () => {\n renderUnitSelector({ kind: 'Bytes' });\n expect(getAbbreviateSwitch()).toBeEnabled();\n });\n });\n\n it('should not show an option for disabled units', () => {\n const onChange = jest.fn();\n renderUnitSelector({ kind: 'Decimal' }, onChange);\n\n userEvent.click(getUnitSelector());\n const percentShorthandOption = screen.queryByRole('option', {\n name: '%',\n });\n expect(percentShorthandOption).not.toBeInTheDocument();\n });\n});\n"],"names":["render","screen","userEvent","UnitSelector","describe","renderUnitSelector","value","onChange","jest","fn","div","getUnitSelector","getByRole","name","getDecimalSelector","getAbbreviateSwitch","it","kind","unitSelector","click","decimalOption","expect","toHaveBeenCalledWith","tab","toHaveFocus","clear","keyboard","decimal_places","abbreviate","decimalSelector","toBeDisabled","toBeEnabled","percentShorthandOption","queryByRole","not","toBeInTheDocument"],"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;AAAA,SAASA,MAAM,EAAEC,MAAM,QAAQ,wBAAwB,CAAC;AACxD,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AAEpD,SAASC,YAAY,QAAQ,gBAAgB,CAAC;AAE9CC,QAAQ,CAAC,cAAc,EAAE,IAAM;IAC7B,MAAMC,kBAAkB,GAAG,CAACC,KAAkB,EAAEC,QAAQ,GAAGC,IAAI,CAACC,EAAE,EAAE,GAAK;QACvET,MAAM,eACJ,KAACU,KAAG;sBACF,cAAA,KAACP,YAAY;gBAACG,KAAK,EAAEA,KAAK;gBAAEC,QAAQ,EAAEA,QAAQ;cAAI;UAC9C,CACP,CAAC;IACJ,CAAC,AAAC;IAEF,MAAMI,eAAe,GAAG,IAAM;QAC5B,OAAOV,MAAM,CAACW,SAAS,CAAC,UAAU,EAAE;YAAEC,IAAI,EAAE,OAAO;SAAE,CAAC,CAAC;IACzD,CAAC,AAAC;IAEF,MAAMC,kBAAkB,GAAG,IAAM;QAC/B,OAAOb,MAAM,CAACW,SAAS,CAAC,UAAU,EAAE;YAAEC,IAAI,EAAE,SAAS;SAAE,CAA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,CAAC,CAAC;IAEH3B,QAAQ,CAAC,4BAA4B,EAAE,IAAM;QAC3CY,EAAE,CAAC,8CAA8C,EAAE,IAAM;YACvDX,kBAAkB,CAAC;gBAAEY,IAAI,EAAE,OAAO;aAAE,CAAC,CAAC;YACtCI,MAAM,CAACP,kBAAkB,EAAE,CAAC,CAACiB,WAAW,EAAE,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEHf,EAAE,CAAC,mCAAmC,EAAE,IAAM;YAC5CX,kBAAkB,CAAC;gBAAEY,IAAI,EAAE,OAAO;aAAE,CAAC,CAAC;YACtCI,MAAM,CAACN,mBAAmB,EAAE,CAAC,CAACgB,WAAW,EAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEHf,EAAE,CAAC,8CAA8C,EAAE,IAAM;QACvD,MAAMT,QAAQ,GAAGC,IAAI,CAACC,EAAE,EAAE,AAAC;QAC3BJ,kBAAkB,CAAC;YAAEY,IAAI,EAAE,SAAS;SAAE,EAAEV,QAAQ,CAAC,CAAC;QAElDL,SAAS,CAACiB,KAAK,CAACR,eAAe,EAAE,CAAC,CAAC;QACnC,MAAMqB,sBAAsB,GAAG/B,MAAM,CAACgC,WAAW,CAAC,QAAQ,EAAE;YAC1DpB,IAAI,EAAE,GAAG;SACV,CAAC,AAAC;QACHQ,MAAM,CAACW,sBAAsB,CAAC,CAACE,GAAG,CAACC,iBAAiB,EAAE,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 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
|
-
const _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _react = require("@testing-library/react");
|
|
19
|
-
const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
|
|
20
|
-
const _dom = require("@testing-library/dom");
|
|
21
|
-
const _infoTooltip = require("./InfoTooltip");
|
|
22
|
-
function _interopRequireDefault(obj) {
|
|
23
|
-
return obj && obj.__esModule ? obj : {
|
|
24
|
-
default: obj
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
describe('InfoTooltip', ()=>{
|
|
28
|
-
const title = 'Tooltip Title';
|
|
29
|
-
const description = 'this is a tooltip';
|
|
30
|
-
it('should render title and description', async ()=>{
|
|
31
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
|
|
32
|
-
title: title,
|
|
33
|
-
description: description,
|
|
34
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|
|
35
|
-
children: "tooltipAnchor"
|
|
36
|
-
})
|
|
37
|
-
}));
|
|
38
|
-
const tooltipAnchor = _dom.screen.getByText('tooltipAnchor');
|
|
39
|
-
_userEvent.default.hover(tooltipAnchor);
|
|
40
|
-
await _dom.screen.findByText(title);
|
|
41
|
-
_dom.screen.findByText(description);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 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
|
-
const _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _react = require("@testing-library/react");
|
|
19
|
-
const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
|
|
20
|
-
const _legendOptionsEditor = require("./LegendOptionsEditor");
|
|
21
|
-
function _interopRequireDefault(obj) {
|
|
22
|
-
return obj && obj.__esModule ? obj : {
|
|
23
|
-
default: obj
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
describe('LegendOptionsEditor', ()=>{
|
|
27
|
-
const renderLegendOptionsEditor = (value, onChange = jest.fn())=>{
|
|
28
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
|
|
29
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_legendOptionsEditor.LegendOptionsEditor, {
|
|
30
|
-
value: value,
|
|
31
|
-
onChange: onChange
|
|
32
|
-
})
|
|
33
|
-
}));
|
|
34
|
-
};
|
|
35
|
-
const getLegendShowSwitch = ()=>{
|
|
36
|
-
return _react.screen.getByRole('checkbox', {
|
|
37
|
-
name: 'Show'
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
it('can change legend visibility by clicking', ()=>{
|
|
41
|
-
const onChange = jest.fn();
|
|
42
|
-
renderLegendOptionsEditor(undefined, onChange);
|
|
43
|
-
_userEvent.default.click(getLegendShowSwitch());
|
|
44
|
-
expect(onChange).toHaveBeenCalledWith({
|
|
45
|
-
position: 'bottom'
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 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
|
-
const _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _react = require("@testing-library/react");
|
|
19
|
-
const _chartsThemeProvider = require("../context/ChartsThemeProvider");
|
|
20
|
-
const _testUtils = require("../test-utils");
|
|
21
|
-
const _statChart = require("./StatChart");
|
|
22
|
-
describe('StatChart', ()=>{
|
|
23
|
-
const renderChart = (unit)=>{
|
|
24
|
-
const contentDimensions = {
|
|
25
|
-
width: 200,
|
|
26
|
-
height: 200
|
|
27
|
-
};
|
|
28
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(_chartsThemeProvider.ChartsThemeProvider, {
|
|
29
|
-
chartsTheme: _testUtils.testChartsTheme,
|
|
30
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_statChart.StatChart, {
|
|
31
|
-
width: contentDimensions.width,
|
|
32
|
-
height: contentDimensions.height,
|
|
33
|
-
data: mockStatData,
|
|
34
|
-
unit: unit
|
|
35
|
-
})
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
const mockStatData = {
|
|
39
|
-
calculatedValue: 7.72931659687181,
|
|
40
|
-
name: 'Example Stat Chart',
|
|
41
|
-
seriesData: {
|
|
42
|
-
name: '(((count(count(node_cpu_seconds_total{job="example"}) by (cpu))',
|
|
43
|
-
values: [
|
|
44
|
-
[
|
|
45
|
-
1654006170000,
|
|
46
|
-
7.736401673473903
|
|
47
|
-
],
|
|
48
|
-
[
|
|
49
|
-
1654006185000,
|
|
50
|
-
7.733891213538757
|
|
51
|
-
],
|
|
52
|
-
[
|
|
53
|
-
1654006200000,
|
|
54
|
-
7.731101813010433
|
|
55
|
-
],
|
|
56
|
-
[
|
|
57
|
-
1654006215000,
|
|
58
|
-
7.722454672079215
|
|
59
|
-
],
|
|
60
|
-
[
|
|
61
|
-
1654006230000,
|
|
62
|
-
7.722733612256738
|
|
63
|
-
]
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
it('render default options (no sparkline)', ()=>{
|
|
68
|
-
const unit = {
|
|
69
|
-
kind: 'Decimal',
|
|
70
|
-
decimal_places: 2
|
|
71
|
-
};
|
|
72
|
-
renderChart(unit);
|
|
73
|
-
expect(_react.screen.getByText('7.73')).toBeInTheDocument();
|
|
74
|
-
});
|
|
75
|
-
it('show value with bytes unit formatting', ()=>{
|
|
76
|
-
const unit = {
|
|
77
|
-
kind: 'Bytes'
|
|
78
|
-
};
|
|
79
|
-
renderChart(unit);
|
|
80
|
-
expect(_react.screen.getByText('7.73 bytes')).toBeInTheDocument();
|
|
81
|
-
});
|
|
82
|
-
it('show value with seconds time unit formatting', ()=>{
|
|
83
|
-
const unit = {
|
|
84
|
-
kind: 'Seconds'
|
|
85
|
-
};
|
|
86
|
-
renderChart(unit);
|
|
87
|
-
expect(_react.screen.getByText('7.73 seconds')).toBeInTheDocument();
|
|
88
|
-
});
|
|
89
|
-
it('show value with months time unit formatting', ()=>{
|
|
90
|
-
const unit = {
|
|
91
|
-
kind: 'Months'
|
|
92
|
-
};
|
|
93
|
-
renderChart(unit);
|
|
94
|
-
expect(_react.screen.getByText('7.73 months')).toBeInTheDocument();
|
|
95
|
-
});
|
|
96
|
-
});
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 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 _tooltipModel = require("./tooltip-model");
|
|
25
|
-
function SeriesInfo(props) {
|
|
26
|
-
const { seriesName , formattedY , markerColor , totalSeries , wrapLabels } = props;
|
|
27
|
-
// TODO (sjcobb): regex to remove __name__, improve series labels
|
|
28
|
-
const formattedSeriesLabels = seriesName.replace(/[{}"]/g, '');
|
|
29
|
-
if (totalSeries === 1) {
|
|
30
|
-
const jsonFormattedSeries = seriesName[0] === '{' ? true : false;
|
|
31
|
-
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
32
|
-
spacing: 0.5,
|
|
33
|
-
children: [
|
|
34
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
35
|
-
sx: (theme)=>({
|
|
36
|
-
height: '16px',
|
|
37
|
-
display: 'flex',
|
|
38
|
-
flexDirection: 'row',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
justifyContent: 'left',
|
|
41
|
-
color: theme.palette.common.white,
|
|
42
|
-
fontSize: '11px'
|
|
43
|
-
}),
|
|
44
|
-
children: [
|
|
45
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_seriesMarker.SeriesMarker, {
|
|
46
|
-
markerColor: markerColor
|
|
47
|
-
}),
|
|
48
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
49
|
-
component: "span",
|
|
50
|
-
children: [
|
|
51
|
-
"value:",
|
|
52
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
53
|
-
component: "span",
|
|
54
|
-
sx: (theme)=>({
|
|
55
|
-
color: theme.palette.common.white,
|
|
56
|
-
fontWeight: 700,
|
|
57
|
-
paddingLeft: '2px'
|
|
58
|
-
}),
|
|
59
|
-
children: formattedY
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Divider, {
|
|
66
|
-
sx: (theme)=>({
|
|
67
|
-
borderColor: theme.palette.grey['500']
|
|
68
|
-
})
|
|
69
|
-
}),
|
|
70
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
71
|
-
sx: (theme)=>({
|
|
72
|
-
color: theme.palette.common.white
|
|
73
|
-
}),
|
|
74
|
-
children: formattedSeriesLabels.split(',').map((name)=>{
|
|
75
|
-
if (name) {
|
|
76
|
-
const [key, value] = jsonFormattedSeries ? name.split(':') : name.split('=');
|
|
77
|
-
const formattedKey = value !== undefined ? `${key}: ` : key;
|
|
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: formattedKey
|
|
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: value
|
|
97
|
-
})
|
|
98
|
-
]
|
|
99
|
-
}, name);
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
]
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
const inlineSeriesLabels = formattedSeriesLabels.replace(/[,]/g, ', ').replace(/[:=]/g, ': ');
|
|
107
|
-
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
108
|
-
sx: {
|
|
109
|
-
display: 'table-row',
|
|
110
|
-
paddingTop: 0.5
|
|
111
|
-
},
|
|
112
|
-
children: [
|
|
113
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
114
|
-
sx: {
|
|
115
|
-
display: 'table-cell',
|
|
116
|
-
maxWidth: '520px'
|
|
117
|
-
},
|
|
118
|
-
children: [
|
|
119
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_seriesMarker.SeriesMarker, {
|
|
120
|
-
markerColor: markerColor
|
|
121
|
-
}),
|
|
122
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
123
|
-
component: "span",
|
|
124
|
-
sx: (theme)=>({
|
|
125
|
-
color: theme.palette.common.white,
|
|
126
|
-
display: 'inline-block',
|
|
127
|
-
maxWidth: _tooltipModel.TOOLTIP_LABELS_MAX_WIDTH,
|
|
128
|
-
overflow: 'hidden',
|
|
129
|
-
textOverflow: 'ellipsis',
|
|
130
|
-
whiteSpace: wrapLabels ? 'normal' : 'nowrap',
|
|
131
|
-
width: 'calc(100% - 20px)'
|
|
132
|
-
}),
|
|
133
|
-
children: inlineSeriesLabels
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
}),
|
|
137
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
138
|
-
sx: {
|
|
139
|
-
display: 'table-cell',
|
|
140
|
-
fontWeight: '700',
|
|
141
|
-
paddingLeft: 1.5,
|
|
142
|
-
textAlign: 'right',
|
|
143
|
-
verticalAlign: 'top'
|
|
144
|
-
},
|
|
145
|
-
children: formattedY
|
|
146
|
-
})
|
|
147
|
-
]
|
|
148
|
-
});
|
|
149
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 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
|
-
const _focusedSeries = require("./focused-series");
|
|
18
|
-
describe('getNearbySeries', ()=>{
|
|
19
|
-
const chartData = {
|
|
20
|
-
timeSeries: [
|
|
21
|
-
{
|
|
22
|
-
type: 'line',
|
|
23
|
-
name: 'env="demo", instance="demo.do.prometheus", job="node", mode="test"',
|
|
24
|
-
color: 'hsla(-1365438424,50%,50%,0.8)',
|
|
25
|
-
data: [
|
|
26
|
-
0.0002315202231525094,
|
|
27
|
-
0.00022873082287300112,
|
|
28
|
-
0.00023152022315149463,
|
|
29
|
-
0.00023152022315149463,
|
|
30
|
-
0.00022873082287300112
|
|
31
|
-
],
|
|
32
|
-
symbol: 'circle'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: 'line',
|
|
36
|
-
name: 'env="demo", instance="demo.do.prometheus", job="node", mode="test alt"',
|
|
37
|
-
color: 'hsla(286664040,50%,50%,0.8)',
|
|
38
|
-
data: [
|
|
39
|
-
0.05245188284519867,
|
|
40
|
-
0.0524463040446356,
|
|
41
|
-
0.0524463040446356,
|
|
42
|
-
0.05247140864723438,
|
|
43
|
-
0.052482566248230646
|
|
44
|
-
],
|
|
45
|
-
symbol: 'circle'
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
xAxis: [
|
|
49
|
-
1654007865000,
|
|
50
|
-
1654007880000,
|
|
51
|
-
1654007895000,
|
|
52
|
-
1654007910000,
|
|
53
|
-
1654007925000
|
|
54
|
-
],
|
|
55
|
-
rangeMs: 60000
|
|
56
|
-
};
|
|
57
|
-
// https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel
|
|
58
|
-
const pointInGrid = [
|
|
59
|
-
2,
|
|
60
|
-
0.0560655737704918
|
|
61
|
-
]; // converted from chart.getZr() mousemove coordinates
|
|
62
|
-
const yBuffer = 0.02; // calculated from y axis interval
|
|
63
|
-
const focusedSeriesOutput = [
|
|
64
|
-
{
|
|
65
|
-
date: 'May 31, 2022, 2:38:15 PM',
|
|
66
|
-
datumIdx: 2,
|
|
67
|
-
markerColor: 'hsla(286664040,50%,50%,0.8)',
|
|
68
|
-
seriesName: 'env="demo", instance="demo.do.prometheus", job="node", mode="test alt"',
|
|
69
|
-
seriesIdx: 1,
|
|
70
|
-
x: 1654007895000,
|
|
71
|
-
y: 0.0524463040446356,
|
|
72
|
-
formattedY: '0.05'
|
|
73
|
-
}
|
|
74
|
-
];
|
|
75
|
-
it('should return focused series data for points nearby the cursor', ()=>{
|
|
76
|
-
const decimalUnit = {
|
|
77
|
-
kind: 'Decimal',
|
|
78
|
-
decimal_places: 2
|
|
79
|
-
};
|
|
80
|
-
expect((0, _focusedSeries.getNearbySeries)(chartData, pointInGrid, yBuffer, decimalUnit)).toEqual(focusedSeriesOutput);
|
|
81
|
-
});
|
|
82
|
-
it('should return series values formatted as a percent', ()=>{
|
|
83
|
-
const percentFormattedOutput = [
|
|
84
|
-
...focusedSeriesOutput
|
|
85
|
-
];
|
|
86
|
-
if (percentFormattedOutput[0]) {
|
|
87
|
-
percentFormattedOutput[0].formattedY = '5%';
|
|
88
|
-
}
|
|
89
|
-
const percentFormattedUnit = {
|
|
90
|
-
kind: 'PercentDecimal',
|
|
91
|
-
decimal_places: 0
|
|
92
|
-
};
|
|
93
|
-
expect((0, _focusedSeries.getNearbySeries)(chartData, pointInGrid, yBuffer, percentFormattedUnit)).toEqual(percentFormattedOutput);
|
|
94
|
-
});
|
|
95
|
-
});
|