@perses-dev/components 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +1 -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/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.js +1 -1
- package/dist/EChart.js.map +1 -1
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +3 -9
- 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/InfoTooltip.test.js +1 -1
- package/dist/InfoTooltip/InfoTooltip.test.js.map +1 -1
- package/dist/InfoTooltip/index.js +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.d.ts +5 -4
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +21 -16
- 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 +18 -6
- 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/LegendOptionsEditor.test.js +23 -2
- package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js.map +1 -1
- package/dist/LegendOptionsEditor/index.js +1 -1
- package/dist/LegendOptionsEditor/index.js.map +1 -1
- package/dist/LineChart/LineChart.js +3 -3
- 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 +1 -1
- 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 +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/StatChart/StatChart.js +1 -1
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/StatChart.test.js +1 -1
- package/dist/StatChart/StatChart.test.js.map +1 -1
- package/dist/StatChart/index.js +1 -1
- package/dist/StatChart/index.js.map +1 -1
- 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/SeriesInfo.test.d.ts +2 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.test.js +52 -0
- package/dist/TimeSeriesTooltip/SeriesInfo.test.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/TooltipContent.test.d.ts +2 -0
- package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/TooltipContent.test.js +78 -0
- package/dist/TimeSeriesTooltip/TooltipContent.test.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.d.ts +0 -0
- package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.js +3 -3
- package/dist/TimeSeriesTooltip/focused-series.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.test.d.ts +0 -0
- package/dist/TimeSeriesTooltip/focused-series.test.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/focused-series.test.js +1 -1
- package/dist/TimeSeriesTooltip/focused-series.test.js.map +1 -0
- package/dist/TimeSeriesTooltip/index.d.ts +9 -0
- package/dist/TimeSeriesTooltip/index.d.ts.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/index.js +8 -2
- package/dist/TimeSeriesTooltip/index.js.map +1 -0
- package/dist/{Tooltip → TimeSeriesTooltip}/tooltip-model.d.ts +0 -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/{Tooltip → TimeSeriesTooltip}/utils.d.ts +0 -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/UnitSelector.test.js +1 -1
- package/dist/UnitSelector/UnitSelector.test.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/DateTimeRangePicker/AbsoluteTimePicker.js +1 -1
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +1 -1
- package/dist/cjs/DateTimeRangePicker/index.js +1 -1
- package/dist/cjs/DateTimeRangePicker/utils.js +1 -1
- package/dist/cjs/Drawer/Drawer.js +1 -1
- package/dist/cjs/Drawer/index.js +1 -1
- package/dist/cjs/EChart.js +1 -1
- package/dist/cjs/ErrorAlert.js +1 -1
- package/dist/cjs/ErrorBoundary.js +1 -1
- package/dist/cjs/GaugeChart/GaugeChart.js +3 -9
- package/dist/cjs/GaugeChart/index.js +1 -1
- package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -18
- package/dist/cjs/InfoTooltip/InfoTooltip.test.js +1 -1
- package/dist/cjs/InfoTooltip/index.js +1 -1
- package/dist/cjs/JSONEditor.js +25 -15
- package/dist/cjs/Legend/CompactLegend.js +1 -1
- package/dist/cjs/Legend/Legend.js +17 -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/LegendOptionsEditor.test.js +23 -2
- package/dist/cjs/LegendOptionsEditor/index.js +1 -1
- package/dist/cjs/LineChart/LineChart.js +3 -3
- package/dist/cjs/LineChart/index.js +1 -1
- package/dist/cjs/LineChart/utils.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/cjs/OptionsEditorLayout/index.js +1 -1
- package/dist/cjs/StatChart/StatChart.js +1 -1
- package/dist/cjs/StatChart/StatChart.test.js +1 -1
- package/dist/cjs/StatChart/index.js +1 -1
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +95 -0
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.test.js +54 -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/TimeSeriesTooltip/TooltipContent.test.js +80 -0
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/focused-series.js +3 -3
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/focused-series.test.js +1 -1
- package/dist/cjs/{Tooltip → TimeSeriesTooltip}/index.js +8 -2
- 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/UnitSelector.test.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 +2 -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/legend.test.js +29 -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 +1 -1
- 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/model/units/units.test.js +5 -6
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test-utils/index.js +1 -1
- package/dist/cjs/test-utils/theme.js +1 -1
- package/dist/cjs/theme/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 +12 -1
- package/dist/cjs/theme/types/ThemeExtension.d.js +1 -1
- package/dist/cjs/theme/typography.js +1 -1
- package/dist/cjs/utils/combine-sx.js +1 -1
- package/dist/cjs/utils/component-ids.js +1 -1
- package/dist/cjs/utils/format.js +1 -1
- package/dist/cjs/utils/format.test.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 +1 -1
- package/dist/cjs/utils/theme-gen.test.js +1 -1
- 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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +1 -16
- 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/legend.test.d.ts +2 -0
- package/dist/model/legend.test.d.ts.map +1 -0
- package/dist/model/legend.test.js +27 -0
- package/dist/model/legend.test.js.map +1 -0
- package/dist/model/theme.js +1 -1
- package/dist/model/theme.js.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.js +1 -1
- 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.js +1 -1
- package/dist/model/units/percent.js.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.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/model/units/units.test.js +5 -6
- package/dist/model/units/units.test.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.js +1 -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 +13 -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.js +1 -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/format.test.js +1 -1
- package/dist/utils/format.test.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.js +1 -1
- package/dist/utils/theme-gen.js.map +1 -1
- package/dist/utils/theme-gen.test.js +1 -1
- package/dist/utils/theme-gen.test.js.map +1 -1
- package/package.json +4 -2
- 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.map +0 -1
- 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/index.js.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/cjs/Tooltip/SeriesInfo.js +0 -149
package/dist/JSONEditor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSONEditor.d.ts","sourceRoot":"","sources":["../src/JSONEditor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"JSONEditor.d.ts","sourceRoot":"","sources":["../src/JSONEditor.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,aAAK,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC,GAAG;IAC/G,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;CAC9B,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,eAgCtD"}
|
package/dist/JSONEditor.js
CHANGED
|
@@ -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
|
|
@@ -12,37 +12,42 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useEffect, useState } from 'react';
|
|
15
|
-
import
|
|
15
|
+
import CodeMirror from '@uiw/react-codemirror';
|
|
16
|
+
import { json, jsonParseLinter } from '@codemirror/lang-json';
|
|
17
|
+
import { linter, lintGutter } from '@codemirror/lint';
|
|
18
|
+
import { useTheme } from '@mui/material';
|
|
16
19
|
export function JSONEditor(props) {
|
|
20
|
+
const theme = useTheme();
|
|
21
|
+
const isDarkMode = theme.palette.mode === 'dark';
|
|
17
22
|
const [value, setValue] = useState(()=>JSON.stringify(props.value, null, 2));
|
|
18
|
-
const [invalidJSON, setInvalidJSON] = useState(false);
|
|
19
23
|
useEffect(()=>{
|
|
20
24
|
setValue(JSON.stringify(props.value, null, 2));
|
|
21
|
-
setInvalidJSON(false);
|
|
22
25
|
}, [
|
|
23
26
|
props.value
|
|
24
27
|
]);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
return /*#__PURE__*/ _jsx(CodeMirror, {
|
|
29
|
+
...props,
|
|
30
|
+
style: {
|
|
31
|
+
border: `1px solid ${theme.palette.divider}`
|
|
32
|
+
},
|
|
33
|
+
theme: isDarkMode ? 'dark' : 'light',
|
|
34
|
+
extensions: [
|
|
35
|
+
json(),
|
|
36
|
+
linter(jsonParseLinter()),
|
|
37
|
+
lintGutter()
|
|
38
|
+
],
|
|
32
39
|
value: value,
|
|
33
|
-
onChange: (
|
|
34
|
-
setValue(
|
|
40
|
+
onChange: (newValue)=>{
|
|
41
|
+
setValue(newValue);
|
|
35
42
|
},
|
|
36
|
-
maxRows: 20,
|
|
37
43
|
onBlur: ()=>{
|
|
38
44
|
try {
|
|
39
45
|
const json = JSON.parse(value !== null && value !== void 0 ? value : '{}');
|
|
40
|
-
setInvalidJSON(false);
|
|
41
46
|
if (props.onChange !== undefined) {
|
|
42
47
|
props.onChange(json);
|
|
43
48
|
}
|
|
44
49
|
} catch (e) {
|
|
45
|
-
|
|
50
|
+
// ignore this error
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
});
|
package/dist/JSONEditor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/JSONEditor.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../src/JSONEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useEffect, useState } from 'react';\nimport CodeMirror from '@uiw/react-codemirror';\nimport { json, jsonParseLinter } from '@codemirror/lang-json';\nimport { linter, lintGutter } from '@codemirror/lint';\nimport { useTheme } from '@mui/material';\nimport { ReactCodeMirrorProps } from '@uiw/react-codemirror/src';\n\ntype JSONEditorProps<T> = Omit<ReactCodeMirrorProps, 'onBlur' | 'theme' | 'extensions' | 'onChange' | 'value'> & {\n value: T;\n onChange?: (next: T) => void;\n};\n\nexport function JSONEditor<T>(props: JSONEditorProps<T>) {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n const [value, setValue] = useState(() => JSON.stringify(props.value, null, 2));\n\n useEffect(() => {\n setValue(JSON.stringify(props.value, null, 2));\n }, [props.value]);\n\n return (\n <CodeMirror\n {...props}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n extensions={[json(), linter(jsonParseLinter()), lintGutter()]}\n value={value}\n onChange={(newValue) => {\n setValue(newValue);\n }}\n onBlur={() => {\n try {\n const json = JSON.parse(value ?? '{}');\n if (props.onChange !== undefined) {\n props.onChange(json);\n }\n } catch (e) {\n // ignore this error\n }\n }}\n />\n );\n}\n"],"names":["useEffect","useState","CodeMirror","json","jsonParseLinter","linter","lintGutter","useTheme","JSONEditor","props","theme","isDarkMode","palette","mode","value","setValue","JSON","stringify","style","border","divider","extensions","onChange","newValue","onBlur","parse","undefined","e"],"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,SAAS,EAAEC,QAAQ,QAAQ,OAAO,CAAC;AAC5C,OAAOC,UAAU,MAAM,uBAAuB,CAAC;AAC/C,SAASC,IAAI,EAAEC,eAAe,QAAQ,uBAAuB,CAAC;AAC9D,SAASC,MAAM,EAAEC,UAAU,QAAQ,kBAAkB,CAAC;AACtD,SAASC,QAAQ,QAAQ,eAAe,CAAC;AAQzC,OAAO,SAASC,UAAU,CAAIC,KAAyB,EAAE;IACvD,MAAMC,KAAK,GAAGH,QAAQ,EAAE,AAAC;IACzB,MAAMI,UAAU,GAAGD,KAAK,CAACE,OAAO,CAACC,IAAI,KAAK,MAAM,AAAC;IAEjD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGd,QAAQ,CAAC,IAAMe,IAAI,CAACC,SAAS,CAACR,KAAK,CAACK,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,AAAC;IAE/Ed,SAAS,CAAC,IAAM;QACde,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACR,KAAK,CAACK,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC,EAAE;QAACL,KAAK,CAACK,KAAK;KAAC,CAAC,CAAC;IAElB,qBACE,KAACZ,UAAU;QACR,GAAGO,KAAK;QACTS,KAAK,EAAE;YAAEC,MAAM,EAAE,CAAC,UAAU,EAAET,KAAK,CAACE,OAAO,CAACQ,OAAO,CAAC,CAAC;SAAE;QACvDV,KAAK,EAAEC,UAAU,GAAG,MAAM,GAAG,OAAO;QACpCU,UAAU,EAAE;YAAClB,IAAI,EAAE;YAAEE,MAAM,CAACD,eAAe,EAAE,CAAC;YAAEE,UAAU,EAAE;SAAC;QAC7DQ,KAAK,EAAEA,KAAK;QACZQ,QAAQ,EAAE,CAACC,QAAQ,GAAK;YACtBR,QAAQ,CAACQ,QAAQ,CAAC,CAAC;QACrB,CAAC;QACDC,MAAM,EAAE,IAAM;YACZ,IAAI;gBACF,MAAMrB,IAAI,GAAGa,IAAI,CAACS,KAAK,CAACX,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI,CAAC,AAAC;gBACvC,IAAIL,KAAK,CAACa,QAAQ,KAAKI,SAAS,EAAE;oBAChCjB,KAAK,CAACa,QAAQ,CAACnB,IAAI,CAAC,CAAC;gBACvB,CAAC;YACH,EAAE,OAAOwB,CAAC,EAAE;YACV,oBAAoB;YACtB,CAAC;QACH,CAAC;MACD,CACF;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/CompactLegend.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/Legend/CompactLegend.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { LegendItem } from '../model';\nimport { ListLegendItem } from './ListLegendItem';\n\ninterface CompactLegendProps {\n height: number;\n items: LegendItem[];\n}\n\n/**\n * CompactLegend is default and used when legend items need to show side by side\n * which corresponds to when legend.position is `bottom`\n */\nexport function CompactLegend({ height, items }: CompactLegendProps) {\n return (\n <Box component=\"ul\" sx={{ width: '100%', height, padding: [0, 1, 0, 0], overflowY: 'scroll', margin: 0 }}>\n {items.map((item) => (\n <ListLegendItem\n key={item.id}\n item={item}\n sx={{\n width: 'auto',\n float: 'left',\n paddingRight: 1.5,\n }}\n />\n ))}\n </Box>\n );\n}\n"],"names":["Box","ListLegendItem","CompactLegend","height","items","component","sx","width","padding","overflowY","margin","map","item","float","paddingRight","id"],"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,GAAG,QAAQ,eAAe,CAAC;AAEpC,SAASC,cAAc,QAAQ,kBAAkB,CAAC;AAOlD;;;CAGC,GACD,OAAO,SAASC,aAAa,CAAC,EAAEC,MAAM,CAAA,EAAEC,KAAK,CAAA,EAAsB,EAAE;IACnE,qBACE,KAACJ,GAAG;QAACK,SAAS,EAAC,IAAI;QAACC,EAAE,EAAE;YAAEC,KAAK,EAAE,MAAM;YAAEJ,MAAM;YAAEK,OAAO,EAAE;AAAC,iBAAC;AAAE,iBAAC;AAAE,iBAAC;AAAE,iBAAC;aAAC;YAAEC,SAAS,EAAE,QAAQ;YAAEC,MAAM,EAAE,CAAC;SAAE;kBACrGN,KAAK,CAACO,GAAG,CAAC,CAACC,IAAI,iBACd,KAACX,cAAc;gBAEbW,IAAI,EAAEA,IAAI;gBACVN,EAAE,EAAE;oBACFC,KAAK,EAAE,MAAM;oBACbM,KAAK,EAAE,MAAM;oBACbC,YAAY,EAAE,GAAG;iBAClB;eANIF,IAAI,CAACG,EAAE,CAOZ,AACH,CAAC;MACE,CACN;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/Legend/Legend.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIrD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/Legend/Legend.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIrD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,eA+BnE"}
|
package/dist/Legend/Legend.js
CHANGED
|
@@ -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
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Box } from '@mui/material';
|
|
15
15
|
import { ListLegend } from './ListLegend';
|
|
16
16
|
import { CompactLegend } from './CompactLegend';
|
|
17
17
|
export function Legend({ width , height , options , data }) {
|
|
18
|
-
if (options.position === '
|
|
18
|
+
if (options.position === 'Right') {
|
|
19
19
|
return /*#__PURE__*/ _jsx(Box, {
|
|
20
20
|
sx: {
|
|
21
21
|
width: width,
|
|
@@ -23,6 +23,7 @@ export function Legend({ width , height , options , data }) {
|
|
|
23
23
|
position: 'absolute',
|
|
24
24
|
top: 0,
|
|
25
25
|
right: 0,
|
|
26
|
+
overflowX: 'hidden',
|
|
26
27
|
overflowY: 'scroll'
|
|
27
28
|
},
|
|
28
29
|
children: /*#__PURE__*/ _jsx(ListLegend, {
|
|
@@ -30,9 +31,20 @@ export function Legend({ width , height , options , data }) {
|
|
|
30
31
|
})
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
return /*#__PURE__*/
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
35
|
+
sx: {
|
|
36
|
+
width: width,
|
|
37
|
+
height: height,
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
bottom: 0
|
|
40
|
+
},
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ _jsx(CompactLegend, {
|
|
43
|
+
items: data,
|
|
44
|
+
height: height
|
|
45
|
+
}),
|
|
46
|
+
";"
|
|
47
|
+
]
|
|
36
48
|
});
|
|
37
49
|
}
|
|
38
50
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/Legend.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/Legend/Legend.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { LegendOptions, LegendItem } from '../model';\nimport { ListLegend } from './ListLegend';\nimport { CompactLegend } from './CompactLegend';\n\ninterface LegendProps {\n width: number;\n height: number;\n data: LegendItem[];\n options: LegendOptions;\n}\n\nexport function Legend({ width, height, options, data }: LegendProps) {\n if (options.position === 'Right') {\n return (\n <Box\n sx={{\n width: width,\n height: '100%',\n position: 'absolute',\n top: 0,\n right: 0,\n overflowX: 'hidden',\n overflowY: 'scroll',\n }}\n >\n <ListLegend items={data} />\n </Box>\n );\n }\n\n return (\n <Box\n sx={{\n width: width,\n height: height,\n position: 'absolute',\n bottom: 0,\n }}\n >\n <CompactLegend items={data} height={height} />;\n </Box>\n );\n}\n"],"names":["Box","ListLegend","CompactLegend","Legend","width","height","options","data","position","sx","top","right","overflowX","overflowY","items","bottom"],"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,GAAG,QAAQ,eAAe,CAAC;AAEpC,SAASC,UAAU,QAAQ,cAAc,CAAC;AAC1C,SAASC,aAAa,QAAQ,iBAAiB,CAAC;AAShD,OAAO,SAASC,MAAM,CAAC,EAAEC,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAEC,IAAI,CAAA,EAAe,EAAE;IACpE,IAAID,OAAO,CAACE,QAAQ,KAAK,OAAO,EAAE;QAChC,qBACE,KAACR,GAAG;YACFS,EAAE,EAAE;gBACFL,KAAK,EAAEA,KAAK;gBACZC,MAAM,EAAE,MAAM;gBACdG,QAAQ,EAAE,UAAU;gBACpBE,GAAG,EAAE,CAAC;gBACNC,KAAK,EAAE,CAAC;gBACRC,SAAS,EAAE,QAAQ;gBACnBC,SAAS,EAAE,QAAQ;aACpB;sBAED,cAAA,KAACZ,UAAU;gBAACa,KAAK,EAAEP,IAAI;cAAI;UACvB,CACN;IACJ,CAAC;IAED,qBACE,MAACP,GAAG;QACFS,EAAE,EAAE;YACFL,KAAK,EAAEA,KAAK;YACZC,MAAM,EAAEA,MAAM;YACdG,QAAQ,EAAE,UAAU;YACpBO,MAAM,EAAE,CAAC;SACV;;0BAED,KAACb,aAAa;gBAACY,KAAK,EAAEP,IAAI;gBAAEF,MAAM,EAAEA,MAAM;cAAI;YAAA,GAChD;;MAAM,CACN;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/LegendColorBadge.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/Legend/LegendColorBadge.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { combineSx } from '../utils';\n\nexport interface LegendColorBadgeProps extends BoxProps<'div'> {\n color: string;\n}\n\nexport const LegendColorBadge = React.memo(function LegendColorBadge({ color, sx, ...others }: LegendColorBadgeProps) {\n return (\n <Box\n {...others}\n sx={combineSx(\n {\n height: 4,\n width: 16,\n margin: (theme) => theme.spacing(0.5),\n },\n sx\n )}\n style={{ backgroundColor: color }}\n />\n );\n});\n"],"names":["React","Box","combineSx","LegendColorBadge","memo","color","sx","others","height","width","margin","theme","spacing","style","backgroundColor"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SAASC,GAAG,QAAkB,eAAe,CAAC;AAC9C,SAASC,SAAS,QAAQ,UAAU,CAAC;AAMrC,OAAO,MAAMC,gBAAgB,iBAAGH,KAAK,CAACI,IAAI,CAAC,SAASD,gBAAgB,CAAC,EAAEE,KAAK,CAAA,EAAEC,EAAE,CAAA,EAAE,GAAGC,MAAM,EAAyB,EAAE;IACpH,qBACE,KAACN,GAAG;QACD,GAAGM,MAAM;QACVD,EAAE,EAAEJ,SAAS,CACX;YACEM,MAAM,EAAE,CAAC;YACTC,KAAK,EAAE,EAAE;YACTC,MAAM,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,GAAG,CAAC;SACtC,EACDN,EAAE,CACH;QACDO,KAAK,EAAE;YAAEC,eAAe,EAAET,KAAK;SAAE;MACjC,CACF;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/ListLegend.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/Legend/ListLegend.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { List } from '@mui/material';\nimport { LegendItem } from '../model';\nimport { ListLegendItem } from './ListLegendItem';\n\ninterface ListLegendProps {\n items: LegendItem[];\n}\n\n/**\n * ListLegend is used when legend.position is 'right' since legend items are stacked\n */\nexport function ListLegend({ items }: ListLegendProps) {\n // show full labels on hover when there are many total series\n const truncateLabels = items.length > 5;\n return (\n <List>\n {items.map((item) => (\n <ListLegendItem\n key={item.id}\n item={item}\n sx={{\n width: 190,\n textOverflow: 'ellipsis',\n wordBreak: 'break-word',\n overflow: truncateLabels ? 'hidden' : 'visible',\n whiteSpace: truncateLabels ? 'nowrap' : 'normal',\n // TODO: add optional hover effect to show unformatted label\n '&:hover': {\n overflow: 'visible',\n whiteSpace: 'normal', // this allow you to see the full label on hover\n },\n }}\n />\n ))}\n </List>\n );\n}\n"],"names":["List","ListLegendItem","ListLegend","items","truncateLabels","length","map","item","sx","width","textOverflow","wordBreak","overflow","whiteSpace","id"],"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,IAAI,QAAQ,eAAe,CAAC;AAErC,SAASC,cAAc,QAAQ,kBAAkB,CAAC;AAMlD;;CAEC,GACD,OAAO,SAASC,UAAU,CAAC,EAAEC,KAAK,CAAA,EAAmB,EAAE;IACrD,6DAA6D;IAC7D,MAAMC,cAAc,GAAGD,KAAK,CAACE,MAAM,GAAG,CAAC,AAAC;IACxC,qBACE,KAACL,IAAI;kBACFG,KAAK,CAACG,GAAG,CAAC,CAACC,IAAI,iBACd,KAACN,cAAc;gBAEbM,IAAI,EAAEA,IAAI;gBACVC,EAAE,EAAE;oBACFC,KAAK,EAAE,GAAG;oBACVC,YAAY,EAAE,UAAU;oBACxBC,SAAS,EAAE,YAAY;oBACvBC,QAAQ,EAAER,cAAc,GAAG,QAAQ,GAAG,SAAS;oBAC/CS,UAAU,EAAET,cAAc,GAAG,QAAQ,GAAG,QAAQ;oBAChD,4DAA4D;oBAC5D,SAAS,EAAE;wBACTQ,QAAQ,EAAE,SAAS;wBACnBC,UAAU,EAAE,QAAQ;qBACrB;iBACF;eAbIN,IAAI,CAACO,EAAE,CAcZ,AACH,CAAC;MACG,CACP;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/ListLegendItem.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/Legend/ListLegendItem.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { Box, ListItemText, ListItem, ListItemProps } from '@mui/material';\nimport { LegendItem } from '../model';\nimport { combineSx } from '../utils';\nimport { LegendColorBadge } from './LegendColorBadge';\n\ninterface ListLegendItemProps extends ListItemProps {\n item: LegendItem;\n}\n\nexport const ListLegendItem = React.memo(function ListLegendItem({ item, sx, ...others }: ListLegendItemProps) {\n return (\n <ListItem\n {...others}\n sx={combineSx(\n {\n padding: 0,\n cursor: 'pointer',\n },\n sx\n )}\n dense={true}\n key={item.id}\n onClick={item.onClick}\n selected={item.isSelected}\n >\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n <LegendColorBadge color={item.color} />\n </Box>\n <ListItemText primary={item.label}></ListItemText>\n </ListItem>\n );\n});\n"],"names":["React","Box","ListItemText","ListItem","combineSx","LegendColorBadge","ListLegendItem","memo","item","sx","others","padding","cursor","dense","key","id","onClick","selected","isSelected","display","alignItems","color","primary","label"],"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,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SAASC,GAAG,EAAEC,YAAY,EAAEC,QAAQ,QAAuB,eAAe,CAAC;AAE3E,SAASC,SAAS,QAAQ,UAAU,CAAC;AACrC,SAASC,gBAAgB,QAAQ,oBAAoB,CAAC;AAMtD,OAAO,MAAMC,cAAc,iBAAGN,KAAK,CAACO,IAAI,CAAC,SAASD,cAAc,CAAC,EAAEE,IAAI,CAAA,EAAEC,EAAE,CAAA,EAAE,GAAGC,MAAM,EAAuB,EAAE;IAC7G,qBACE,eAACP,QAAQ;QACN,GAAGO,MAAM;QACVD,EAAE,EAAEL,SAAS,CACX;YACEO,OAAO,EAAE,CAAC;YACVC,MAAM,EAAE,SAAS;SAClB,EACDH,EAAE,CACH;QACDI,KAAK,EAAE,IAAI;QACXC,GAAG,EAAEN,IAAI,CAACO,EAAE;QACZC,OAAO,EAAER,IAAI,CAACQ,OAAO;QACrBC,QAAQ,EAAET,IAAI,CAACU,UAAU;;0BAEzB,KAACjB,GAAG;gBAACQ,EAAE,EAAE;oBAAEU,OAAO,EAAE,MAAM;oBAAEC,UAAU,EAAE,QAAQ;iBAAE;0BAChD,cAAA,KAACf,gBAAgB;oBAACgB,KAAK,EAAEb,IAAI,CAACa,KAAK;kBAAI;cACnC;0BACN,KAACnB,YAAY;gBAACoB,OAAO,EAAEd,IAAI,CAACe,KAAK;cAAiB;;MACzC,CACX;AACJ,CAAC,CAAC,CAAC"}
|
package/dist/Legend/index.js
CHANGED
package/dist/Legend/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Legend/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/Legend/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './Legend';\n"],"names":[],"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,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendOptionsEditor.d.ts","sourceRoot":"","sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"LegendOptionsEditor.d.ts","sourceRoot":"","sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.tsx"],"names":[],"mappings":";AAeA,OAAO,EAKL,aAAa,EAEd,MAAM,UAAU,CAAC;AAYlB,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CAC5C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eA2ChF"}
|
|
@@ -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
|
|
@@ -12,20 +12,9 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { Autocomplete, Switch, TextField } from '@mui/material';
|
|
15
|
-
import {
|
|
15
|
+
import { ErrorAlert } from '../ErrorAlert';
|
|
16
|
+
import { DEFAULT_LEGEND, getLegendPosition, validateLegendSpec, LEGEND_POSITIONS_CONFIG } from '../model';
|
|
16
17
|
import { OptionsEditorControl } from '../OptionsEditorLayout';
|
|
17
|
-
const LEGEND_POSITIONS = [
|
|
18
|
-
'bottom',
|
|
19
|
-
'right'
|
|
20
|
-
];
|
|
21
|
-
const LEGEND_POSITIONS_CONFIG = {
|
|
22
|
-
bottom: {
|
|
23
|
-
label: 'Bottom'
|
|
24
|
-
},
|
|
25
|
-
right: {
|
|
26
|
-
label: 'Right'
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
18
|
const POSITION_OPTIONS = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config])=>{
|
|
30
19
|
return {
|
|
31
20
|
id: id,
|
|
@@ -46,11 +35,17 @@ export function LegendOptionsEditor({ value , onChange }) {
|
|
|
46
35
|
position: newValue.id
|
|
47
36
|
});
|
|
48
37
|
};
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
38
|
+
const isValidLegend = validateLegendSpec(value);
|
|
39
|
+
const currentPosition = getLegendPosition(value === null || value === void 0 ? void 0 : value.position);
|
|
40
|
+
const legendConfig = LEGEND_POSITIONS_CONFIG[currentPosition];
|
|
52
41
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
53
42
|
children: [
|
|
43
|
+
!isValidLegend && /*#__PURE__*/ _jsx(ErrorAlert, {
|
|
44
|
+
error: {
|
|
45
|
+
name: 'invalid-legend',
|
|
46
|
+
message: 'Invalid legend spec'
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
54
49
|
/*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
55
50
|
label: "Show",
|
|
56
51
|
control: /*#__PURE__*/ _jsx(Switch, {
|
|
@@ -63,7 +58,7 @@ export function LegendOptionsEditor({ value , onChange }) {
|
|
|
63
58
|
control: /*#__PURE__*/ _jsx(Autocomplete, {
|
|
64
59
|
value: {
|
|
65
60
|
...legendConfig,
|
|
66
|
-
id:
|
|
61
|
+
id: currentPosition
|
|
67
62
|
},
|
|
68
63
|
options: POSITION_OPTIONS,
|
|
69
64
|
isOptionEqualToValue: (option, value)=>option.id === value.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Autocomplete, Switch, SwitchProps, TextField } from '@mui/material';\nimport { ErrorAlert } from '../ErrorAlert';\nimport {\n DEFAULT_LEGEND,\n getLegendPosition,\n validateLegendSpec,\n LEGEND_POSITIONS_CONFIG,\n LegendOptions,\n LegendPositionConfig,\n} from '../model';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\n\ntype LegendPositionOption = LegendPositionConfig & { id: LegendOptions['position'] };\n\nconst POSITION_OPTIONS: LegendPositionOption[] = Object.entries(LEGEND_POSITIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as LegendOptions['position'],\n ...config,\n };\n});\n\nexport interface LegendOptionsEditorProps {\n value?: LegendOptions;\n onChange: (legend?: LegendOptions) => void;\n}\n\nexport function LegendOptionsEditor({ value, onChange }: LegendOptionsEditorProps) {\n const handleLegendShowChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n // legend is hidden when legend obj is undefined\n const legendValue = checked === true ? { position: DEFAULT_LEGEND.position } : undefined;\n onChange(legendValue);\n };\n\n const handleLegendPositionChange = (_: unknown, newValue: LegendPositionOption) => {\n onChange({\n ...value,\n position: newValue.id,\n });\n };\n\n const isValidLegend = validateLegendSpec(value);\n const currentPosition = getLegendPosition(value?.position);\n const legendConfig = LEGEND_POSITIONS_CONFIG[currentPosition];\n return (\n <>\n {!isValidLegend && <ErrorAlert error={{ name: 'invalid-legend', message: 'Invalid legend spec' }} />}\n <OptionsEditorControl\n label=\"Show\"\n control={<Switch checked={value !== undefined} onChange={handleLegendShowChange} />}\n />\n <OptionsEditorControl\n label=\"Position\"\n control={\n <Autocomplete\n value={{\n ...legendConfig,\n id: currentPosition,\n }}\n options={POSITION_OPTIONS}\n isOptionEqualToValue={(option, value) => option.id === value.id}\n renderInput={(params) => <TextField {...params} />}\n onChange={handleLegendPositionChange}\n disabled={value === undefined}\n disableClearable\n ></Autocomplete>\n }\n />\n </>\n );\n}\n"],"names":["Autocomplete","Switch","TextField","ErrorAlert","DEFAULT_LEGEND","getLegendPosition","validateLegendSpec","LEGEND_POSITIONS_CONFIG","OptionsEditorControl","POSITION_OPTIONS","Object","entries","map","id","config","LegendOptionsEditor","value","onChange","handleLegendShowChange","_","checked","legendValue","position","undefined","handleLegendPositionChange","newValue","isValidLegend","currentPosition","legendConfig","error","name","message","label","control","options","isOptionEqualToValue","option","renderInput","params","disabled","disableClearable"],"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,YAAY,EAAEC,MAAM,EAAeC,SAAS,QAAQ,eAAe,CAAC;AAC7E,SAASC,UA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B;oBAAEC,OAAO,EAAE,qBAAqB;iBAAE;cAAI;0BACpG,KAACvB,oBAAoB;gBACnBwB,KAAK,EAAC,MAAM;gBACZC,OAAO,gBAAE,KAAChC,MAAM;oBAACmB,OAAO,EAAEJ,KAAK,KAAKO,SAAS;oBAAEN,QAAQ,EAAEC,sBAAsB;kBAAI;cACnF;0BACF,KAACV,oBAAoB;gBACnBwB,KAAK,EAAC,UAAU;gBAChBC,OAAO,gBACL,KAACjC,YAAY;oBACXgB,KAAK,EAAE;wBACL,GAAGY,YAAY;wBACff,EAAE,EAAEc,eAAe;qBACpB;oBACDO,OAAO,EAAEzB,gBAAgB;oBACzB0B,oBAAoB,EAAE,CAACC,MAAM,EAAEpB,KAAK,GAAKoB,MAAM,CAACvB,EAAE,KAAKG,KAAK,CAACH,EAAE;oBAC/DwB,WAAW,EAAE,CAACC,MAAM,iBAAK,KAACpC,SAAS;4BAAE,GAAGoC,MAAM;0BAAI;oBAClDrB,QAAQ,EAAEO,0BAA0B;oBACpCe,QAAQ,EAAEvB,KAAK,KAAKO,SAAS;oBAC7BiB,gBAAgB;kBACF;cAElB;;MACD,CACH;AACJ,CAAC"}
|
|
@@ -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
|
|
@@ -28,12 +28,33 @@ describe('LegendOptionsEditor', ()=>{
|
|
|
28
28
|
name: 'Show'
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
+
const getLegendPositionSelector = ()=>{
|
|
32
|
+
return screen.getByRole('combobox', {
|
|
33
|
+
name: 'Position'
|
|
34
|
+
});
|
|
35
|
+
};
|
|
31
36
|
it('can change legend visibility by clicking', ()=>{
|
|
32
37
|
const onChange = jest.fn();
|
|
33
38
|
renderLegendOptionsEditor(undefined, onChange);
|
|
39
|
+
expect(getLegendPositionSelector()).toBeDisabled();
|
|
34
40
|
userEvent.click(getLegendShowSwitch());
|
|
35
41
|
expect(onChange).toHaveBeenCalledWith({
|
|
36
|
-
position: '
|
|
42
|
+
position: 'Bottom'
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
it('should allow changing legend position', ()=>{
|
|
46
|
+
const onChange = jest.fn();
|
|
47
|
+
renderLegendOptionsEditor({
|
|
48
|
+
position: 'Bottom'
|
|
49
|
+
}, onChange);
|
|
50
|
+
expect(getLegendPositionSelector()).toBeEnabled();
|
|
51
|
+
userEvent.click(getLegendPositionSelector());
|
|
52
|
+
const positionRightOption = screen.getByRole('option', {
|
|
53
|
+
name: 'Right'
|
|
54
|
+
});
|
|
55
|
+
userEvent.click(positionRightOption);
|
|
56
|
+
expect(onChange).toHaveBeenCalledWith({
|
|
57
|
+
position: 'Right'
|
|
37
58
|
});
|
|
38
59
|
});
|
|
39
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.test.tsx"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/LegendOptionsEditor/LegendOptionsEditor.test.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { render, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { LegendOptions } from '../model';\nimport { LegendOptionsEditor } from './LegendOptionsEditor';\n\ndescribe('LegendOptionsEditor', () => {\n const renderLegendOptionsEditor = (value?: LegendOptions, onChange = jest.fn()) => {\n render(\n <div>\n <LegendOptionsEditor value={value} onChange={onChange} />\n </div>\n );\n };\n\n const getLegendShowSwitch = () => {\n return screen.getByRole('checkbox', { name: 'Show' });\n };\n\n const getLegendPositionSelector = () => {\n return screen.getByRole('combobox', { name: 'Position' });\n };\n\n it('can change legend visibility by clicking', () => {\n const onChange = jest.fn();\n renderLegendOptionsEditor(undefined, onChange);\n expect(getLegendPositionSelector()).toBeDisabled();\n userEvent.click(getLegendShowSwitch());\n expect(onChange).toHaveBeenCalledWith({ position: 'Bottom' });\n });\n\n it('should allow changing legend position', () => {\n const onChange = jest.fn();\n renderLegendOptionsEditor({ position: 'Bottom' }, onChange);\n expect(getLegendPositionSelector()).toBeEnabled();\n userEvent.click(getLegendPositionSelector());\n const positionRightOption = screen.getByRole('option', {\n name: 'Right',\n });\n userEvent.click(positionRightOption);\n expect(onChange).toHaveBeenCalledWith({ position: 'Right' });\n });\n});\n"],"names":["render","screen","userEvent","LegendOptionsEditor","describe","renderLegendOptionsEditor","value","onChange","jest","fn","div","getLegendShowSwitch","getByRole","name","getLegendPositionSelector","it","undefined","expect","toBeDisabled","click","toHaveBeenCalledWith","position","toBeEnabled","positionRightOption"],"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,mBAAmB,QAAQ,uBAAuB,CAAC;AAE5DC,QAAQ,CAAC,qBAAqB,EAAE,IAAM;IACpC,MAAMC,yBAAyB,GAAG,CAACC,KAAqB,EAAEC,QAAQ,GAAGC,IAAI,CAACC,EAAE,EAAE,GAAK;QACjFT,MAAM,eACJ,KAACU,KAAG;sBACF,cAAA,KAACP,mBAAmB;gBAACG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,mBAAmB,CAAC,CAAC;QACrCN,MAAM,CAACV,QAAQ,CAAC,CAACa,oBAAoB,CAAC;YAAEC,QAAQ,EAAE,OAAO;SAAE,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LegendOptionsEditor/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/LegendOptionsEditor/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './LegendOptionsEditor';\n"],"names":[],"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,cAAc,uBAAuB,CAAC"}
|
|
@@ -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,7 +20,7 @@ import { CanvasRenderer } from 'echarts/renderers';
|
|
|
20
20
|
import { EChart } from '../EChart';
|
|
21
21
|
import { OPTIMIZED_MODE_SERIES_LIMIT } from '../model/graph';
|
|
22
22
|
import { useChartsTheme } from '../context/ChartsThemeProvider';
|
|
23
|
-
import {
|
|
23
|
+
import { TimeSeriesTooltip } from '../TimeSeriesTooltip';
|
|
24
24
|
import { useTimeZone } from '../context/TimeZoneProvider';
|
|
25
25
|
import { enableDataZoom, getDateRange, getFormattedDate, getYAxes, restoreChart } from './utils';
|
|
26
26
|
use([
|
|
@@ -168,7 +168,7 @@ export function LineChart({ height , data , yAxis , unit , grid , legend , onDat
|
|
|
168
168
|
},
|
|
169
169
|
onDoubleClick: handleOnDoubleClick,
|
|
170
170
|
children: [
|
|
171
|
-
showTooltip === true && /*#__PURE__*/ _jsx(
|
|
171
|
+
showTooltip === true && /*#__PURE__*/ _jsx(TimeSeriesTooltip, {
|
|
172
172
|
chartRef: chartRef,
|
|
173
173
|
chartData: data,
|
|
174
174
|
wrapLabels: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LineChart/LineChart.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 { MouseEvent, useMemo, useRef, useState } from 'react';\nimport { Box } from '@mui/material';\nimport type {\n EChartsCoreOption,\n GridComponentOption,\n LineSeriesOption,\n LegendComponentOption,\n YAXisComponentOption,\n} from 'echarts';\nimport { ECharts as EChartsInstance, use } from 'echarts/core';\nimport { LineChart as EChartsLineChart } from 'echarts/charts';\nimport {\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChart, OnEventsType } from '../EChart';\nimport { EChartsDataFormat, OPTIMIZED_MODE_SERIES_LIMIT } from '../model/graph';\nimport { UnitOptions } from '../model/units';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { Tooltip } from '../Tooltip/Tooltip';\nimport { useTimeZone } from '../context/TimeZoneProvider';\nimport { enableDataZoom, getDateRange, getFormattedDate, getYAxes, restoreChart, ZoomEventData } from './utils';\n\nuse([\n EChartsLineChart,\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n]);\n\ninterface LineChartProps {\n height: number;\n data: EChartsDataFormat;\n yAxis?: YAXisComponentOption;\n unit?: UnitOptions;\n grid?: GridComponentOption;\n legend?: LegendComponentOption;\n onDataZoom?: (e: ZoomEventData) => void;\n onDoubleClick?: (e: MouseEvent) => void;\n}\n\nexport function LineChart({ height, data, yAxis, unit, grid, legend, onDataZoom, onDoubleClick }: LineChartProps) {\n const chartsTheme = useChartsTheme();\n const chartRef = useRef<EChartsInstance>();\n const [showTooltip, setShowTooltip] = useState<boolean>(true);\n const [pinTooltip, setPinTooltip] = useState<boolean>(false);\n const { timeZone } = useTimeZone();\n\n const handleEvents: OnEventsType<LineSeriesOption['data'] | unknown> = useMemo(() => {\n return {\n datazoom: (params) => {\n if (onDataZoom === undefined) {\n setTimeout(() => {\n // workaround so unpin happens after click event\n setPinTooltip(false);\n }, 10);\n }\n if (onDataZoom === undefined || params.batch[0] === undefined) return;\n const startIndex = params.batch[0].startValue ?? 0;\n const endIndex = params.batch[0].endValue ?? data.xAxis.length - 1;\n const xAxisStartValue = data.xAxis[startIndex];\n const xAxisEndValue = data.xAxis[endIndex];\n\n if (xAxisStartValue !== undefined && xAxisEndValue !== undefined) {\n const zoomEvent: ZoomEventData = {\n start: xAxisStartValue,\n end: xAxisEndValue,\n startIndex,\n endIndex,\n };\n onDataZoom(zoomEvent);\n }\n },\n // TODO: use legendselectchanged event to fix tooltip when legend selected\n };\n }, [data, onDataZoom, setPinTooltip]);\n\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n\n const handleOnDoubleClick = (e: MouseEvent) => {\n setPinTooltip(false);\n // either dispatch ECharts restore action to return to orig state or allow consumer to define behavior\n if (onDoubleClick === undefined) {\n if (chartRef.current !== undefined) {\n restoreChart(chartRef.current);\n }\n } else {\n onDoubleClick(e);\n }\n };\n\n const { noDataOption } = chartsTheme;\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data.timeSeries === undefined) return {};\n if (data.timeSeries === null || data.timeSeries.length === 0) return noDataOption;\n\n // show symbols and axisPointer dashed line on hover\n const isOptimizedMode = data.timeSeries.length > OPTIMIZED_MODE_SERIES_LIMIT;\n\n const rangeMs = data.rangeMs ?? getDateRange(data.xAxis);\n\n const option: EChartsCoreOption = {\n series: data.timeSeries,\n xAxis: {\n type: 'category',\n data: data.xAxis,\n max: data.xAxisMax,\n axisLabel: {\n formatter: (value: number) => {\n return getFormattedDate(value, rangeMs, timeZone);\n },\n },\n },\n yAxis: getYAxes(yAxis, unit),\n animation: false,\n tooltip: {\n show: !isOptimizedMode,\n trigger: 'axis',\n showContent: false, // echarts tooltip content hidden since we use custom tooltip instead\n axisPointer: {\n type: isOptimizedMode ? 'none' : 'line',\n z: 0, // ensure point symbol shows on top of dashed line\n },\n },\n toolbox: {\n feature: {\n dataZoom: {\n icon: null, // https://stackoverflow.com/a/67684076/17575201\n yAxisIndex: 'none',\n },\n },\n },\n grid,\n legend,\n };\n\n return option;\n }, [data, yAxis, unit, grid, legend, noDataOption, timeZone]);\n\n return (\n <Box\n sx={{ height }}\n onClick={() => {\n setPinTooltip((current) => !current);\n }}\n onMouseDown={(e) => {\n // hide tooltip when user drags to zoom, but allow clicking inside tooltip to copy labels\n if (e.target instanceof HTMLCanvasElement) {\n setShowTooltip(false);\n }\n }}\n onMouseUp={() => {\n setShowTooltip(true);\n }}\n onMouseLeave={() => {\n setShowTooltip(false);\n setPinTooltip(false);\n }}\n onMouseEnter={() => {\n setShowTooltip(true);\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n }}\n onDoubleClick={handleOnDoubleClick}\n >\n {showTooltip === true && (\n <Tooltip chartRef={chartRef} chartData={data} wrapLabels={true} pinTooltip={pinTooltip} unit={unit}></Tooltip>\n )}\n\n <EChart\n sx={{\n width: '100%',\n height: '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n onEvents={handleEvents}\n _instance={chartRef}\n />\n </Box>\n );\n}\n"],"names":["useMemo","useRef","useState","Box","use","LineChart","EChartsLineChart","GridComponent","DataZoomComponent","MarkAreaComponent","MarkLineComponent","MarkPointComponent","TitleComponent","ToolboxComponent","TooltipComponent","LegendComponent","CanvasRenderer","EChart","OPTIMIZED_MODE_SERIES_LIMIT","useChartsTheme","Tooltip","useTimeZone","enableDataZoom","getDateRange","getFormattedDate","getYAxes","restoreChart","height","data","yAxis","unit","grid","legend","onDataZoom","onDoubleClick","chartsTheme","chartRef","showTooltip","setShowTooltip","pinTooltip","setPinTooltip","timeZone","handleEvents","datazoom","params","undefined","setTimeout","batch","startIndex","startValue","endIndex","endValue","xAxis","length","xAxisStartValue","xAxisEndValue","zoomEvent","start","end","current","handleOnDoubleClick","e","noDataOption","option","timeSeries","isOptimizedMode","rangeMs","series","type","max","xAxisMax","axisLabel","formatter","value","animation","tooltip","show","trigger","showContent","axisPointer","z","toolbox","feature","dataZoom","icon","yAxisIndex","sx","onClick","onMouseDown","target","HTMLCanvasElement","onMouseUp","onMouseLeave","onMouseEnter","chartData","wrapLabels","width","theme","echartsTheme","onEvents","_instance"],"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,SAAqBA,OAAO,EAAEC,MAAM,EAAEC,QAAQ,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C;YACxB,CAAC;QACH,CAAC;QACDqD,SAAS,EAAE,IAAM;YACfrD,cAAc,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACDsD,YAAY,EAAE,IAAM;YAClBtD,cAAc,CAAC,KAAK,CAAC,CAAC;YACtBE,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QACDqD,YAAY,EAAE,IAAM;YAClBvD,cAAc,CAAC,IAAI,CAAC,CAAC;YACrB,IAAIF,QAAQ,CAACuB,OAAO,KAAKd,SAAS,EAAE;gBAClCvB,cAAc,CAACc,QAAQ,CAACuB,OAAO,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QACDzB,aAAa,EAAE0B,mBAAmB;;YAEjCvB,WAAW,KAAK,IAAI,kBACnB,KAACjB,OAAO;gBAACgB,QAAQ,EAAEA,QAAQ;gBAAE0D,SAAS,EAAElE,IAAI;gBAAEmE,UAAU,EAAE,IAAI;gBAAExD,UAAU,EAAEA,UAAU;gBAAET,IAAI,EAAEA,IAAI;cAAY,AAC/G;0BAED,KAACb,MAAM;gBACLqE,EAAE,EAAE;oBACFU,KAAK,EAAE,MAAM;oBACbrE,MAAM,EAAE,MAAM;iBACf;gBACDoC,MAAM,EAAEA,MAAM;gBACdkC,KAAK,EAAE9D,WAAW,CAAC+D,YAAY;gBAC/BC,QAAQ,EAAEzD,YAAY;gBACtB0D,SAAS,EAAEhE,QAAQ;cACnB;;MACE,CACN;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/LineChart/LineChart.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { MouseEvent, useMemo, useRef, useState } from 'react';\nimport { Box } from '@mui/material';\nimport type {\n EChartsCoreOption,\n GridComponentOption,\n LineSeriesOption,\n LegendComponentOption,\n YAXisComponentOption,\n} from 'echarts';\nimport { ECharts as EChartsInstance, use } from 'echarts/core';\nimport { LineChart as EChartsLineChart } from 'echarts/charts';\nimport {\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChart, OnEventsType } from '../EChart';\nimport { EChartsDataFormat, OPTIMIZED_MODE_SERIES_LIMIT } from '../model/graph';\nimport { UnitOptions } from '../model/units';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { TimeSeriesTooltip } from '../TimeSeriesTooltip';\nimport { useTimeZone } from '../context/TimeZoneProvider';\nimport { enableDataZoom, getDateRange, getFormattedDate, getYAxes, restoreChart, ZoomEventData } from './utils';\n\nuse([\n EChartsLineChart,\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n]);\n\ninterface LineChartProps {\n height: number;\n data: EChartsDataFormat;\n yAxis?: YAXisComponentOption;\n unit?: UnitOptions;\n grid?: GridComponentOption;\n legend?: LegendComponentOption;\n onDataZoom?: (e: ZoomEventData) => void;\n onDoubleClick?: (e: MouseEvent) => void;\n}\n\nexport function LineChart({ height, data, yAxis, unit, grid, legend, onDataZoom, onDoubleClick }: LineChartProps) {\n const chartsTheme = useChartsTheme();\n const chartRef = useRef<EChartsInstance>();\n const [showTooltip, setShowTooltip] = useState<boolean>(true);\n const [pinTooltip, setPinTooltip] = useState<boolean>(false);\n const { timeZone } = useTimeZone();\n\n const handleEvents: OnEventsType<LineSeriesOption['data'] | unknown> = useMemo(() => {\n return {\n datazoom: (params) => {\n if (onDataZoom === undefined) {\n setTimeout(() => {\n // workaround so unpin happens after click event\n setPinTooltip(false);\n }, 10);\n }\n if (onDataZoom === undefined || params.batch[0] === undefined) return;\n const startIndex = params.batch[0].startValue ?? 0;\n const endIndex = params.batch[0].endValue ?? data.xAxis.length - 1;\n const xAxisStartValue = data.xAxis[startIndex];\n const xAxisEndValue = data.xAxis[endIndex];\n\n if (xAxisStartValue !== undefined && xAxisEndValue !== undefined) {\n const zoomEvent: ZoomEventData = {\n start: xAxisStartValue,\n end: xAxisEndValue,\n startIndex,\n endIndex,\n };\n onDataZoom(zoomEvent);\n }\n },\n // TODO: use legendselectchanged event to fix tooltip when legend selected\n };\n }, [data, onDataZoom, setPinTooltip]);\n\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n\n const handleOnDoubleClick = (e: MouseEvent) => {\n setPinTooltip(false);\n // either dispatch ECharts restore action to return to orig state or allow consumer to define behavior\n if (onDoubleClick === undefined) {\n if (chartRef.current !== undefined) {\n restoreChart(chartRef.current);\n }\n } else {\n onDoubleClick(e);\n }\n };\n\n const { noDataOption } = chartsTheme;\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data.timeSeries === undefined) return {};\n if (data.timeSeries === null || data.timeSeries.length === 0) return noDataOption;\n\n // show symbols and axisPointer dashed line on hover\n const isOptimizedMode = data.timeSeries.length > OPTIMIZED_MODE_SERIES_LIMIT;\n\n const rangeMs = data.rangeMs ?? getDateRange(data.xAxis);\n\n const option: EChartsCoreOption = {\n series: data.timeSeries,\n xAxis: {\n type: 'category',\n data: data.xAxis,\n max: data.xAxisMax,\n axisLabel: {\n formatter: (value: number) => {\n return getFormattedDate(value, rangeMs, timeZone);\n },\n },\n },\n yAxis: getYAxes(yAxis, unit),\n animation: false,\n tooltip: {\n show: !isOptimizedMode,\n trigger: 'axis',\n showContent: false, // echarts tooltip content hidden since we use custom tooltip instead\n axisPointer: {\n type: isOptimizedMode ? 'none' : 'line',\n z: 0, // ensure point symbol shows on top of dashed line\n },\n },\n toolbox: {\n feature: {\n dataZoom: {\n icon: null, // https://stackoverflow.com/a/67684076/17575201\n yAxisIndex: 'none',\n },\n },\n },\n grid,\n legend,\n };\n\n return option;\n }, [data, yAxis, unit, grid, legend, noDataOption, timeZone]);\n\n return (\n <Box\n sx={{ height }}\n onClick={() => {\n setPinTooltip((current) => !current);\n }}\n onMouseDown={(e) => {\n // hide tooltip when user drags to zoom, but allow clicking inside tooltip to copy labels\n if (e.target instanceof HTMLCanvasElement) {\n setShowTooltip(false);\n }\n }}\n onMouseUp={() => {\n setShowTooltip(true);\n }}\n onMouseLeave={() => {\n setShowTooltip(false);\n setPinTooltip(false);\n }}\n onMouseEnter={() => {\n setShowTooltip(true);\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n }}\n onDoubleClick={handleOnDoubleClick}\n >\n {showTooltip === true && (\n <TimeSeriesTooltip chartRef={chartRef} chartData={data} wrapLabels={true} pinTooltip={pinTooltip} unit={unit} />\n )}\n\n <EChart\n sx={{\n width: '100%',\n height: '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n onEvents={handleEvents}\n _instance={chartRef}\n />\n </Box>\n );\n}\n"],"names":["useMemo","useRef","useState","Box","use","LineChart","EChartsLineChart","GridComponent","DataZoomComponent","MarkAreaComponent","MarkLineComponent","MarkPointComponent","TitleComponent","ToolboxComponent","TooltipComponent","LegendComponent","CanvasRenderer","EChart","OPTIMIZED_MODE_SERIES_LIMIT","useChartsTheme","TimeSeriesTooltip","useTimeZone","enableDataZoom","getDateRange","getFormattedDate","getYAxes","restoreChart","height","data","yAxis","unit","grid","legend","onDataZoom","onDoubleClick","chartsTheme","chartRef","showTooltip","setShowTooltip","pinTooltip","setPinTooltip","timeZone","handleEvents","datazoom","params","undefined","setTimeout","batch","startIndex","startValue","endIndex","endValue","xAxis","length","xAxisStartValue","xAxisEndValue","zoomEvent","start","end","current","handleOnDoubleClick","e","noDataOption","option","timeSeries","isOptimizedMode","rangeMs","series","type","max","xAxisMax","axisLabel","formatter","value","animation","tooltip","show","trigger","showContent","axisPointer","z","toolbox","feature","dataZoom","icon","yAxisIndex","sx","onClick","onMouseDown","target","HTMLCanvasElement","onMouseUp","onMouseLeave","onMouseEnter","chartData","wrapLabels","width","theme","echartsTheme","onEvents","_instance"],"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,SAAqBA,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO,CAAC;AAC9D,SAASC,GAAG,QAAQ,eAAe,CAAC;AAQpC,SAAqCC,GAAG,QAAQ,cAAc,CAAC;AAC/D,SAASC,SAAS,IAAIC,gBAAgB,QAAQ,gBAAgB,CAAC;AAC/D,SACEC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,QACV,oBAAoB,CAAC;AAC5B,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,MAAM,QAAsB,WAAW,CAAC;AACjD,SAA4BC,2BAA2B,QAAQ,gBAAgB,CAAC;AAEhF,SAASC,cAAc,QAAQ,gCAAgC,CAAC;AAChE,SAASC,iBAAiB,QAAQ,sBAAsB,CAAC;AACzD,SAASC,WAAW,QAAQ,6BAA6B,CAAC;AAC1D,SAASC,cAAc,EAAEC,YAAY,EAAEC,gBAAgB,EAAEC,QAAQ,EAAEC,YAAY,QAAuB,SAAS,CAAC;AAEhHtB,GAAG,CAAC;IACFE,gBAAgB;IAChBC,aAAa;IACbC,iBAAiB;IACjBC,iBAAiB;IACjBC,iBAAiB;IACjBC,kBAAkB;IAClBC,cAAc;IACdC,gBAA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D,WAAW,CAAC+D,YAAY;gBAC/BC,QAAQ,EAAEzD,YAAY;gBACtB0D,SAAS,EAAEhE,QAAQ;cACnB;;MACE,CACN;AACJ,CAAC"}
|
package/dist/LineChart/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LineChart/index.ts"],"sourcesContent":["// Copyright
|
|
1
|
+
{"version":3,"sources":["../../src/LineChart/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './LineChart';\nexport type { ZoomEventData } from './utils';\n"],"names":[],"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,cAAc,aAAa,CAAC"}
|
package/dist/LineChart/utils.js
CHANGED