@perses-dev/components 0.0.0-snapshot-time-range-height-80d08fc
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/LICENSE +201 -0
- package/README.md +18 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +9 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +181 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +12 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +79 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -0
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +17 -0
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -0
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +58 -0
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -0
- package/dist/DateTimeRangePicker/index.d.ts +4 -0
- package/dist/DateTimeRangePicker/index.d.ts.map +1 -0
- package/dist/DateTimeRangePicker/index.js +17 -0
- package/dist/DateTimeRangePicker/index.js.map +1 -0
- package/dist/DateTimeRangePicker/utils.d.ts +7 -0
- package/dist/DateTimeRangePicker/utils.d.ts.map +1 -0
- package/dist/DateTimeRangePicker/utils.js +37 -0
- package/dist/DateTimeRangePicker/utils.js.map +1 -0
- package/dist/Drawer/Drawer.d.ts +9 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -0
- package/dist/Drawer/Drawer.js +34 -0
- package/dist/Drawer/Drawer.js.map +1 -0
- package/dist/Drawer/index.d.ts +2 -0
- package/dist/Drawer/index.d.ts.map +1 -0
- package/dist/Drawer/index.js +15 -0
- package/dist/Drawer/index.js.map +1 -0
- package/dist/EChart.d.ts +61 -0
- package/dist/EChart.d.ts.map +1 -0
- package/dist/EChart.js +143 -0
- package/dist/EChart.js.map +1 -0
- package/dist/ErrorAlert.d.ts +9 -0
- package/dist/ErrorAlert.d.ts.map +1 -0
- package/dist/ErrorAlert.js +25 -0
- package/dist/ErrorAlert.js.map +1 -0
- package/dist/ErrorBoundary.d.ts +3 -0
- package/dist/ErrorBoundary.d.ts.map +1 -0
- package/dist/ErrorBoundary.js +16 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/GaugeChart/GaugeChart.d.ts +15 -0
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -0
- package/dist/GaugeChart/GaugeChart.js +172 -0
- package/dist/GaugeChart/GaugeChart.js.map +1 -0
- package/dist/GaugeChart/index.d.ts +2 -0
- package/dist/GaugeChart/index.d.ts.map +1 -0
- package/dist/GaugeChart/index.js +15 -0
- package/dist/GaugeChart/index.js.map +1 -0
- package/dist/InfoTooltip/InfoTooltip.d.ts +17 -0
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -0
- package/dist/InfoTooltip/InfoTooltip.js +76 -0
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -0
- package/dist/InfoTooltip/InfoTooltip.test.d.ts +2 -0
- package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +1 -0
- package/dist/InfoTooltip/InfoTooltip.test.js +36 -0
- package/dist/InfoTooltip/InfoTooltip.test.js.map +1 -0
- package/dist/InfoTooltip/index.d.ts +2 -0
- package/dist/InfoTooltip/index.d.ts.map +1 -0
- package/dist/InfoTooltip/index.js +15 -0
- package/dist/InfoTooltip/index.js.map +1 -0
- package/dist/JSONEditor.d.ts +8 -0
- package/dist/JSONEditor.d.ts.map +1 -0
- package/dist/JSONEditor.js +51 -0
- package/dist/JSONEditor.js.map +1 -0
- package/dist/Legend/CompactLegend.d.ts +13 -0
- package/dist/Legend/CompactLegend.d.ts.map +1 -0
- package/dist/Legend/CompactLegend.js +45 -0
- package/dist/Legend/CompactLegend.js.map +1 -0
- package/dist/Legend/Legend.d.ts +11 -0
- package/dist/Legend/Legend.d.ts.map +1 -0
- package/dist/Legend/Legend.js +39 -0
- package/dist/Legend/Legend.js.map +1 -0
- package/dist/Legend/LegendColorBadge.d.ts +7 -0
- package/dist/Legend/LegendColorBadge.d.ts.map +1 -0
- package/dist/Legend/LegendColorBadge.js +31 -0
- package/dist/Legend/LegendColorBadge.js.map +1 -0
- package/dist/Legend/ListLegend.d.ts +11 -0
- package/dist/Legend/ListLegend.d.ts.map +1 -0
- package/dist/Legend/ListLegend.js +40 -0
- package/dist/Legend/ListLegend.js.map +1 -0
- package/dist/Legend/ListLegendItem.d.ts +9 -0
- package/dist/Legend/ListLegendItem.d.ts.map +1 -0
- package/dist/Legend/ListLegendItem.js +47 -0
- package/dist/Legend/ListLegendItem.js.map +1 -0
- package/dist/Legend/index.d.ts +2 -0
- package/dist/Legend/index.d.ts.map +1 -0
- package/dist/Legend/index.js +15 -0
- package/dist/Legend/index.js.map +1 -0
- package/dist/LineChart/LineChart.d.ts +19 -0
- package/dist/LineChart/LineChart.d.ts.map +1 -0
- package/dist/LineChart/LineChart.js +189 -0
- package/dist/LineChart/LineChart.js.map +1 -0
- package/dist/LineChart/index.d.ts +3 -0
- package/dist/LineChart/index.d.ts.map +1 -0
- package/dist/LineChart/index.js +15 -0
- package/dist/LineChart/index.js.map +1 -0
- package/dist/LineChart/utils.d.ts +30 -0
- package/dist/LineChart/utils.d.ts.map +1 -0
- package/dist/LineChart/utils.js +90 -0
- package/dist/LineChart/utils.js.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +13 -0
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +28 -0
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +5 -0
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +50 -0
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +13 -0
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +26 -0
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +13 -0
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -0
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +36 -0
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -0
- package/dist/OptionsEditorLayout/index.d.ts +5 -0
- package/dist/OptionsEditorLayout/index.d.ts.map +1 -0
- package/dist/OptionsEditorLayout/index.js +18 -0
- package/dist/OptionsEditorLayout/index.js.map +1 -0
- package/dist/StatChart/StatChart.d.ts +19 -0
- package/dist/StatChart/StatChart.d.ts.map +1 -0
- package/dist/StatChart/StatChart.js +121 -0
- package/dist/StatChart/StatChart.js.map +1 -0
- package/dist/StatChart/StatChart.test.d.ts +2 -0
- package/dist/StatChart/StatChart.test.d.ts.map +1 -0
- package/dist/StatChart/StatChart.test.js +87 -0
- package/dist/StatChart/StatChart.test.js.map +1 -0
- package/dist/StatChart/index.d.ts +2 -0
- package/dist/StatChart/index.d.ts.map +1 -0
- package/dist/StatChart/index.js +15 -0
- package/dist/StatChart/index.js.map +1 -0
- package/dist/Tooltip/SeriesInfo.d.ts +12 -0
- package/dist/Tooltip/SeriesInfo.d.ts.map +1 -0
- package/dist/Tooltip/SeriesInfo.js +143 -0
- package/dist/Tooltip/SeriesInfo.js.map +1 -0
- package/dist/Tooltip/SeriesMarker.d.ts +7 -0
- package/dist/Tooltip/SeriesMarker.d.ts.map +1 -0
- package/dist/Tooltip/SeriesMarker.js +33 -0
- package/dist/Tooltip/SeriesMarker.js.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +13 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip/Tooltip.js +72 -0
- package/dist/Tooltip/Tooltip.js.map +1 -0
- package/dist/Tooltip/TooltipContent.d.ts +9 -0
- package/dist/Tooltip/TooltipContent.d.ts.map +1 -0
- package/dist/Tooltip/TooltipContent.js +89 -0
- package/dist/Tooltip/TooltipContent.js.map +1 -0
- package/dist/Tooltip/focused-series.d.ts +25 -0
- package/dist/Tooltip/focused-series.d.ts.map +1 -0
- package/dist/Tooltip/focused-series.js +111 -0
- package/dist/Tooltip/focused-series.js.map +1 -0
- package/dist/Tooltip/focused-series.test.d.ts +2 -0
- package/dist/Tooltip/focused-series.test.d.ts.map +1 -0
- package/dist/Tooltip/focused-series.test.js +93 -0
- package/dist/Tooltip/focused-series.test.js.map +1 -0
- package/dist/Tooltip/index.d.ts +3 -0
- package/dist/Tooltip/index.d.ts.map +1 -0
- package/dist/Tooltip/index.js +16 -0
- package/dist/Tooltip/index.js.map +1 -0
- package/dist/Tooltip/tooltip-model.d.ts +79 -0
- package/dist/Tooltip/tooltip-model.d.ts.map +1 -0
- package/dist/Tooltip/tooltip-model.js +80 -0
- package/dist/Tooltip/tooltip-model.js.map +1 -0
- package/dist/Tooltip/utils.d.ts +6 -0
- package/dist/Tooltip/utils.d.ts.map +1 -0
- package/dist/Tooltip/utils.js +46 -0
- package/dist/Tooltip/utils.js.map +1 -0
- package/dist/UnitSelector/UnitSelector.d.ts +8 -0
- package/dist/UnitSelector/UnitSelector.d.ts.map +1 -0
- package/dist/UnitSelector/UnitSelector.js +112 -0
- package/dist/UnitSelector/UnitSelector.js.map +1 -0
- package/dist/UnitSelector/UnitSelector.test.d.ts +2 -0
- package/dist/UnitSelector/UnitSelector.test.d.ts.map +1 -0
- package/dist/UnitSelector/UnitSelector.test.js +205 -0
- package/dist/UnitSelector/UnitSelector.test.js.map +1 -0
- package/dist/UnitSelector/index.d.ts +2 -0
- package/dist/UnitSelector/index.d.ts.map +1 -0
- package/dist/UnitSelector/index.js +15 -0
- package/dist/UnitSelector/index.js.map +1 -0
- package/dist/YAxisLabel.d.ts +8 -0
- package/dist/YAxisLabel.d.ts.map +1 -0
- package/dist/YAxisLabel.js +39 -0
- package/dist/YAxisLabel.js.map +1 -0
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +187 -0
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +85 -0
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +69 -0
- package/dist/cjs/DateTimeRangePicker/index.js +30 -0
- package/dist/cjs/DateTimeRangePicker/utils.js +45 -0
- package/dist/cjs/Drawer/Drawer.js +40 -0
- package/dist/cjs/Drawer/index.js +28 -0
- package/dist/cjs/EChart.js +188 -0
- package/dist/cjs/ErrorAlert.js +29 -0
- package/dist/cjs/ErrorBoundary.js +22 -0
- package/dist/cjs/GaugeChart/GaugeChart.js +178 -0
- package/dist/cjs/GaugeChart/index.js +28 -0
- package/dist/cjs/InfoTooltip/InfoTooltip.js +93 -0
- package/dist/cjs/InfoTooltip/InfoTooltip.test.js +43 -0
- package/dist/cjs/InfoTooltip/index.js +28 -0
- package/dist/cjs/JSONEditor.js +57 -0
- package/dist/cjs/Legend/CompactLegend.js +48 -0
- package/dist/cjs/Legend/Legend.js +45 -0
- package/dist/cjs/Legend/LegendColorBadge.js +42 -0
- package/dist/cjs/Legend/ListLegend.js +44 -0
- package/dist/cjs/Legend/ListLegendItem.js +91 -0
- package/dist/cjs/Legend/index.js +28 -0
- package/dist/cjs/LineChart/LineChart.js +195 -0
- package/dist/cjs/LineChart/index.js +28 -0
- package/dist/cjs/LineChart/utils.js +95 -0
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +32 -0
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +61 -0
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +29 -0
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +40 -0
- package/dist/cjs/OptionsEditorLayout/index.js +31 -0
- package/dist/cjs/StatChart/StatChart.js +165 -0
- package/dist/cjs/StatChart/StatChart.test.js +89 -0
- package/dist/cjs/StatChart/index.js +28 -0
- package/dist/cjs/Tooltip/SeriesInfo.js +149 -0
- package/dist/cjs/Tooltip/SeriesMarker.js +39 -0
- package/dist/cjs/Tooltip/Tooltip.js +116 -0
- package/dist/cjs/Tooltip/TooltipContent.js +95 -0
- package/dist/cjs/Tooltip/focused-series.js +117 -0
- package/dist/cjs/Tooltip/focused-series.test.js +95 -0
- package/dist/cjs/Tooltip/index.js +29 -0
- package/dist/cjs/Tooltip/tooltip-model.js +98 -0
- package/dist/cjs/Tooltip/utils.js +50 -0
- package/dist/cjs/UnitSelector/UnitSelector.js +118 -0
- package/dist/cjs/UnitSelector/UnitSelector.test.js +212 -0
- package/dist/cjs/UnitSelector/index.js +28 -0
- package/dist/cjs/YAxisLabel.js +45 -0
- package/dist/cjs/context/ChartsThemeProvider.js +83 -0
- package/dist/cjs/context/TimeZoneProvider.js +90 -0
- package/dist/cjs/index.js +47 -0
- package/dist/cjs/model/graph.js +21 -0
- package/dist/cjs/model/index.js +30 -0
- package/dist/cjs/model/theme.js +16 -0
- package/dist/cjs/model/units/bytes.js +60 -0
- package/dist/cjs/model/units/constants.js +23 -0
- package/dist/cjs/model/units/decimal.js +67 -0
- package/dist/cjs/model/units/index.js +30 -0
- package/dist/cjs/model/units/percent.js +64 -0
- package/dist/cjs/model/units/time.js +102 -0
- package/dist/cjs/model/units/types.js +28 -0
- package/dist/cjs/model/units/units.js +104 -0
- package/dist/cjs/test/index.js +28 -0
- package/dist/cjs/test/render.js +36 -0
- package/dist/cjs/test/setup-tests.js +20 -0
- package/dist/cjs/test-utils/index.js +28 -0
- package/dist/cjs/test-utils/theme.js +28 -0
- package/dist/cjs/theme/index.js +28 -0
- package/dist/cjs/theme/palette/background.js +40 -0
- package/dist/cjs/theme/palette/colors/blue.js +35 -0
- package/dist/cjs/theme/palette/colors/common.js +28 -0
- package/dist/cjs/theme/palette/colors/green.js +35 -0
- package/dist/cjs/theme/palette/colors/grey.js +35 -0
- package/dist/cjs/theme/palette/colors/index.js +35 -0
- package/dist/cjs/theme/palette/colors/orange.js +35 -0
- package/dist/cjs/theme/palette/colors/purple.js +35 -0
- package/dist/cjs/theme/palette/colors/red.js +35 -0
- package/dist/cjs/theme/palette/colors/types.js +16 -0
- package/dist/cjs/theme/palette/error.js +32 -0
- package/dist/cjs/theme/palette/grey.js +44 -0
- package/dist/cjs/theme/palette/index.js +28 -0
- package/dist/cjs/theme/palette/palette-options.js +59 -0
- package/dist/cjs/theme/palette/primary.js +32 -0
- package/dist/cjs/theme/palette/secondary.js +32 -0
- package/dist/cjs/theme/palette/success.js +32 -0
- package/dist/cjs/theme/palette/text.js +42 -0
- package/dist/cjs/theme/palette/warning.js +32 -0
- package/dist/cjs/theme/theme.js +64 -0
- package/dist/cjs/theme/types/ThemeExtension.d.js +17 -0
- package/dist/cjs/theme/typography.js +96 -0
- package/dist/cjs/utils/combine-sx.js +29 -0
- package/dist/cjs/utils/component-ids.js +31 -0
- package/dist/cjs/utils/format.js +56 -0
- package/dist/cjs/utils/format.test.js +47 -0
- package/dist/cjs/utils/index.js +31 -0
- package/dist/cjs/utils/mathjs.js +25 -0
- package/dist/cjs/utils/theme-gen.js +188 -0
- package/dist/cjs/utils/theme-gen.test.js +197 -0
- package/dist/context/ChartsThemeProvider.d.ts +10 -0
- package/dist/context/ChartsThemeProvider.d.ts.map +1 -0
- package/dist/context/ChartsThemeProvider.js +31 -0
- package/dist/context/ChartsThemeProvider.js.map +1 -0
- package/dist/context/TimeZoneProvider.d.ts +13 -0
- package/dist/context/TimeZoneProvider.d.ts.map +1 -0
- package/dist/context/TimeZoneProvider.js +38 -0
- package/dist/context/TimeZoneProvider.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/model/graph.d.ts +34 -0
- package/dist/model/graph.d.ts.map +1 -0
- package/dist/model/graph.js +16 -0
- package/dist/model/graph.js.map +1 -0
- package/dist/model/index.d.ts +4 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +17 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/theme.d.ts +15 -0
- package/dist/model/theme.d.ts.map +1 -0
- package/dist/model/theme.js +15 -0
- package/dist/model/theme.js.map +1 -0
- package/dist/model/units/bytes.d.ts +12 -0
- package/dist/model/units/bytes.d.ts.map +1 -0
- package/dist/model/units/bytes.js +48 -0
- package/dist/model/units/bytes.js.map +1 -0
- package/dist/model/units/constants.d.ts +2 -0
- package/dist/model/units/constants.d.ts.map +1 -0
- package/dist/model/units/constants.js +17 -0
- package/dist/model/units/constants.js.map +1 -0
- package/dist/model/units/decimal.d.ts +24 -0
- package/dist/model/units/decimal.d.ts.map +1 -0
- package/dist/model/units/decimal.js +59 -0
- package/dist/model/units/decimal.js.map +1 -0
- package/dist/model/units/index.d.ts +4 -0
- package/dist/model/units/index.d.ts.map +1 -0
- package/dist/model/units/index.js +17 -0
- package/dist/model/units/index.js.map +1 -0
- package/dist/model/units/percent.d.ts +12 -0
- package/dist/model/units/percent.d.ts.map +1 -0
- package/dist/model/units/percent.js +51 -0
- package/dist/model/units/percent.js.map +1 -0
- package/dist/model/units/time.d.ts +22 -0
- package/dist/model/units/time.d.ts.map +1 -0
- package/dist/model/units/time.js +88 -0
- package/dist/model/units/time.js.map +1 -0
- package/dist/model/units/types.d.ts +38 -0
- package/dist/model/units/types.d.ts.map +1 -0
- package/dist/model/units/types.js +22 -0
- package/dist/model/units/types.js.map +1 -0
- package/dist/model/units/units.d.ts +40 -0
- package/dist/model/units/units.d.ts.map +1 -0
- package/dist/model/units/units.js +83 -0
- package/dist/model/units/units.js.map +1 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +15 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/render.d.ts +7 -0
- package/dist/test/render.d.ts.map +1 -0
- package/dist/test/render.js +32 -0
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.d.ts +2 -0
- package/dist/test/setup-tests.d.ts.map +1 -0
- package/dist/test/setup-tests.js +18 -0
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +15 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/test-utils/theme.d.ts +3 -0
- package/dist/test-utils/theme.d.ts.map +1 -0
- package/dist/test-utils/theme.js +22 -0
- package/dist/test-utils/theme.js.map +1 -0
- package/dist/theme/index.d.ts +37 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +15 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/palette/background.d.ts +3 -0
- package/dist/theme/palette/background.d.ts.map +1 -0
- package/dist/theme/palette/background.js +34 -0
- package/dist/theme/palette/background.js.map +1 -0
- package/dist/theme/palette/colors/blue.d.ts +3 -0
- package/dist/theme/palette/colors/blue.d.ts.map +1 -0
- package/dist/theme/palette/colors/blue.js +29 -0
- package/dist/theme/palette/colors/blue.js.map +1 -0
- package/dist/theme/palette/colors/common.d.ts +3 -0
- package/dist/theme/palette/colors/common.d.ts.map +1 -0
- package/dist/theme/palette/colors/common.js +16 -0
- package/dist/theme/palette/colors/common.js.map +1 -0
- package/dist/theme/palette/colors/green.d.ts +3 -0
- package/dist/theme/palette/colors/green.d.ts.map +1 -0
- package/dist/theme/palette/colors/green.js +29 -0
- package/dist/theme/palette/colors/green.js.map +1 -0
- package/dist/theme/palette/colors/grey.d.ts +3 -0
- package/dist/theme/palette/colors/grey.d.ts.map +1 -0
- package/dist/theme/palette/colors/grey.js +29 -0
- package/dist/theme/palette/colors/grey.js.map +1 -0
- package/dist/theme/palette/colors/index.d.ts +9 -0
- package/dist/theme/palette/colors/index.d.ts.map +1 -0
- package/dist/theme/palette/colors/index.js +22 -0
- package/dist/theme/palette/colors/index.js.map +1 -0
- package/dist/theme/palette/colors/orange.d.ts +3 -0
- package/dist/theme/palette/colors/orange.d.ts.map +1 -0
- package/dist/theme/palette/colors/orange.js +29 -0
- package/dist/theme/palette/colors/orange.js.map +1 -0
- package/dist/theme/palette/colors/purple.d.ts +3 -0
- package/dist/theme/palette/colors/purple.d.ts.map +1 -0
- package/dist/theme/palette/colors/purple.js +29 -0
- package/dist/theme/palette/colors/purple.js.map +1 -0
- package/dist/theme/palette/colors/red.d.ts +3 -0
- package/dist/theme/palette/colors/red.d.ts.map +1 -0
- package/dist/theme/palette/colors/red.js +29 -0
- package/dist/theme/palette/colors/red.js.map +1 -0
- package/dist/theme/palette/colors/types.d.ts +17 -0
- package/dist/theme/palette/colors/types.d.ts.map +1 -0
- package/dist/theme/palette/colors/types.js +15 -0
- package/dist/theme/palette/colors/types.js.map +1 -0
- package/dist/theme/palette/error.d.ts +3 -0
- package/dist/theme/palette/error.d.ts.map +1 -0
- package/dist/theme/palette/error.js +26 -0
- package/dist/theme/palette/error.js.map +1 -0
- package/dist/theme/palette/grey.d.ts +3 -0
- package/dist/theme/palette/grey.d.ts.map +1 -0
- package/dist/theme/palette/grey.js +38 -0
- package/dist/theme/palette/grey.js.map +1 -0
- package/dist/theme/palette/index.d.ts +3 -0
- package/dist/theme/palette/index.d.ts.map +1 -0
- package/dist/theme/palette/index.js +15 -0
- package/dist/theme/palette/index.js.map +1 -0
- package/dist/theme/palette/palette-options.d.ts +6 -0
- package/dist/theme/palette/palette-options.d.ts.map +1 -0
- package/dist/theme/palette/palette-options.js +55 -0
- package/dist/theme/palette/palette-options.js.map +1 -0
- package/dist/theme/palette/primary.d.ts +3 -0
- package/dist/theme/palette/primary.d.ts.map +1 -0
- package/dist/theme/palette/primary.js +26 -0
- package/dist/theme/palette/primary.js.map +1 -0
- package/dist/theme/palette/secondary.d.ts +3 -0
- package/dist/theme/palette/secondary.d.ts.map +1 -0
- package/dist/theme/palette/secondary.js +26 -0
- package/dist/theme/palette/secondary.js.map +1 -0
- package/dist/theme/palette/success.d.ts +3 -0
- package/dist/theme/palette/success.d.ts.map +1 -0
- package/dist/theme/palette/success.js +26 -0
- package/dist/theme/palette/success.js.map +1 -0
- package/dist/theme/palette/text.d.ts +3 -0
- package/dist/theme/palette/text.d.ts.map +1 -0
- package/dist/theme/palette/text.js +36 -0
- package/dist/theme/palette/text.js.map +1 -0
- package/dist/theme/palette/warning.d.ts +3 -0
- package/dist/theme/palette/warning.d.ts.map +1 -0
- package/dist/theme/palette/warning.js +26 -0
- package/dist/theme/palette/warning.js.map +1 -0
- package/dist/theme/theme.d.ts +13 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +67 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/theme/types/ThemeExtension.d.js +16 -0
- package/dist/theme/types/ThemeExtension.d.js.map +1 -0
- package/dist/theme/typography.d.ts +10 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/dist/theme/typography.js +92 -0
- package/dist/theme/typography.js.map +1 -0
- package/dist/utils/combine-sx.d.ts +8 -0
- package/dist/utils/combine-sx.d.ts.map +1 -0
- package/dist/utils/combine-sx.js +27 -0
- package/dist/utils/combine-sx.js.map +1 -0
- package/dist/utils/component-ids.d.ts +8 -0
- package/dist/utils/component-ids.d.ts.map +1 -0
- package/dist/utils/component-ids.js +27 -0
- package/dist/utils/component-ids.js.map +1 -0
- package/dist/utils/format.d.ts +3 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +44 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/format.test.d.ts +2 -0
- package/dist/utils/format.test.d.ts.map +1 -0
- package/dist/utils/format.test.js +45 -0
- package/dist/utils/format.test.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/mathjs.d.ts +6 -0
- package/dist/utils/mathjs.d.ts.map +1 -0
- package/dist/utils/mathjs.js +20 -0
- package/dist/utils/mathjs.js.map +1 -0
- package/dist/utils/theme-gen.d.ts +6 -0
- package/dist/utils/theme-gen.d.ts.map +1 -0
- package/dist/utils/theme-gen.js +182 -0
- package/dist/utils/theme-gen.js.map +1 -0
- package/dist/utils/theme-gen.test.d.ts +2 -0
- package/dist/utils/theme-gen.test.d.ts.map +1 -0
- package/dist/utils/theme-gen.test.js +195 -0
- package/dist/utils/theme-gen.test.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,149 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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, "SeriesMarker", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>SeriesMarker
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _material = require("@mui/material");
|
|
23
|
+
function SeriesMarker(props) {
|
|
24
|
+
const { markerColor } = props;
|
|
25
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
26
|
+
sx: {
|
|
27
|
+
display: 'inline-block',
|
|
28
|
+
width: '12px',
|
|
29
|
+
borderRadius: '2px',
|
|
30
|
+
height: '12px',
|
|
31
|
+
marginTop: 0.25,
|
|
32
|
+
marginRight: 1,
|
|
33
|
+
verticalAlign: 'top'
|
|
34
|
+
},
|
|
35
|
+
style: {
|
|
36
|
+
backgroundColor: markerColor
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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, "Tooltip", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>Tooltip
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _focusedSeries = require("./focused-series");
|
|
25
|
+
const _tooltipModel = require("./tooltip-model");
|
|
26
|
+
const _tooltipContent = require("./TooltipContent");
|
|
27
|
+
const _utils = require("./utils");
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
29
|
+
if (typeof WeakMap !== "function") return null;
|
|
30
|
+
var cacheBabelInterop = new WeakMap();
|
|
31
|
+
var cacheNodeInterop = new WeakMap();
|
|
32
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
33
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
34
|
+
})(nodeInterop);
|
|
35
|
+
}
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
37
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
+
return {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
46
|
+
if (cache && cache.has(obj)) {
|
|
47
|
+
return cache.get(obj);
|
|
48
|
+
}
|
|
49
|
+
var newObj = {};
|
|
50
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
|
+
for(var key in obj){
|
|
52
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
53
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
|
56
|
+
} else {
|
|
57
|
+
newObj[key] = obj[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
newObj.default = obj;
|
|
62
|
+
if (cache) {
|
|
63
|
+
cache.set(obj, newObj);
|
|
64
|
+
}
|
|
65
|
+
return newObj;
|
|
66
|
+
}
|
|
67
|
+
const Tooltip = /*#__PURE__*/ _react.default.memo(function Tooltip({ chartRef , chartData , wrapLabels , pinTooltip , unit }) {
|
|
68
|
+
const [pinnedPos, setPinnedPos] = (0, _react.useState)(null);
|
|
69
|
+
const mousePos = (0, _tooltipModel.useMousePosition)();
|
|
70
|
+
if (mousePos === null || mousePos.target === null) return null;
|
|
71
|
+
// ensure user is hovering over a chart before checking for nearby series
|
|
72
|
+
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
73
|
+
const chart = chartRef.current;
|
|
74
|
+
const focusedSeries = (0, _focusedSeries.getFocusedSeriesData)(mousePos, chartData, pinnedPos, chart, unit);
|
|
75
|
+
var ref;
|
|
76
|
+
const chartWidth = (ref = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && ref !== void 0 ? ref : 750;
|
|
77
|
+
var ref1;
|
|
78
|
+
const chartHeight = (ref1 = chart === null || chart === void 0 ? void 0 : chart.getHeight()) !== null && ref1 !== void 0 ? ref1 : 230;
|
|
79
|
+
const cursorTransform = (0, _utils.assembleTransform)(mousePos, focusedSeries.length, chartWidth, chartHeight, pinnedPos);
|
|
80
|
+
if (focusedSeries.length === 0) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (pinTooltip === true && pinnedPos === null) {
|
|
84
|
+
setPinnedPos(mousePos);
|
|
85
|
+
}
|
|
86
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Portal, {
|
|
87
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
88
|
+
sx: (theme)=>({
|
|
89
|
+
maxWidth: _tooltipModel.TOOLTIP_MAX_WIDTH,
|
|
90
|
+
maxHeight: _tooltipModel.TOOLTIP_MAX_HEIGHT,
|
|
91
|
+
position: 'absolute',
|
|
92
|
+
top: 0,
|
|
93
|
+
left: 0,
|
|
94
|
+
backgroundColor: '#2E313E',
|
|
95
|
+
borderRadius: '6px',
|
|
96
|
+
color: '#fff',
|
|
97
|
+
fontSize: '11px',
|
|
98
|
+
visibility: 'visible',
|
|
99
|
+
opacity: 1,
|
|
100
|
+
transition: 'all 0.1s ease-out',
|
|
101
|
+
zIndex: theme.zIndex.tooltip,
|
|
102
|
+
overflow: 'hidden',
|
|
103
|
+
'&:hover': {
|
|
104
|
+
overflowY: 'auto'
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
style: {
|
|
108
|
+
transform: cursorTransform
|
|
109
|
+
},
|
|
110
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_tooltipContent.TooltipContent, {
|
|
111
|
+
focusedSeries: focusedSeries,
|
|
112
|
+
wrapLabels: wrapLabels
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
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, "TooltipContent", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>TooltipContent
|
|
20
|
+
});
|
|
21
|
+
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
const _react = require("react");
|
|
23
|
+
const _material = require("@mui/material");
|
|
24
|
+
const _seriesInfo = require("./SeriesInfo");
|
|
25
|
+
const _timeZoneProvider = require("../context/TimeZoneProvider");
|
|
26
|
+
function TooltipContent(props) {
|
|
27
|
+
const { focusedSeries , wrapLabels } = props;
|
|
28
|
+
const { formatWithUserTimeZone } = (0, _timeZoneProvider.useTimeZone)();
|
|
29
|
+
const seriesTime = focusedSeries && focusedSeries[0] && focusedSeries[0].date ? focusedSeries[0].date : null;
|
|
30
|
+
const formatTimeSeriesHeader = (timeString)=>{
|
|
31
|
+
const date = new Date(timeString);
|
|
32
|
+
const formattedDate = formatWithUserTimeZone(date, 'MMM dd, yyyy - ');
|
|
33
|
+
const formattedTime = formatWithUserTimeZone(date, 'HH:mm:ss');
|
|
34
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
37
|
+
variant: "caption",
|
|
38
|
+
sx: (theme)=>({
|
|
39
|
+
color: theme.palette.common.white
|
|
40
|
+
}),
|
|
41
|
+
children: formattedDate
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
44
|
+
variant: "caption",
|
|
45
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)("strong", {
|
|
46
|
+
children: formattedTime
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const sortedFocusedSeries = (0, _react.useMemo)(()=>{
|
|
53
|
+
if (focusedSeries === null) return null;
|
|
54
|
+
return focusedSeries.sort((a, b)=>a.y > b.y ? -1 : 1);
|
|
55
|
+
}, [
|
|
56
|
+
focusedSeries
|
|
57
|
+
]);
|
|
58
|
+
if (sortedFocusedSeries !== null && seriesTime !== null) {
|
|
59
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
60
|
+
py: 1,
|
|
61
|
+
px: 1.5,
|
|
62
|
+
spacing: 0.5,
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
|
|
65
|
+
variant: "caption",
|
|
66
|
+
children: formatTimeSeriesHeader(seriesTime)
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Divider, {
|
|
69
|
+
sx: (theme)=>({
|
|
70
|
+
borderColor: theme.palette.grey['500']
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
74
|
+
sx: {
|
|
75
|
+
display: 'table'
|
|
76
|
+
},
|
|
77
|
+
children: sortedFocusedSeries.map(({ datumIdx , seriesIdx , seriesName , y , formattedY , markerColor })=>{
|
|
78
|
+
if (datumIdx === null || seriesIdx === null) return null;
|
|
79
|
+
const key = seriesIdx.toString() + datumIdx.toString();
|
|
80
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_seriesInfo.SeriesInfo, {
|
|
81
|
+
seriesName: seriesName,
|
|
82
|
+
y: y,
|
|
83
|
+
formattedY: formattedY,
|
|
84
|
+
markerColor: markerColor,
|
|
85
|
+
totalSeries: sortedFocusedSeries.length,
|
|
86
|
+
wrapLabels: wrapLabels
|
|
87
|
+
}, key);
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
getNearbySeries: ()=>getNearbySeries,
|
|
25
|
+
getFocusedSeriesData: ()=>getFocusedSeriesData
|
|
26
|
+
});
|
|
27
|
+
const _model = require("../model");
|
|
28
|
+
const _tooltipModel = require("./tooltip-model");
|
|
29
|
+
function getNearbySeries(data, pointInGrid, yBuffer, unit) {
|
|
30
|
+
const currentFocusedData = [];
|
|
31
|
+
var ref;
|
|
32
|
+
const focusedX = (ref = pointInGrid[0]) !== null && ref !== void 0 ? ref : null;
|
|
33
|
+
var ref1;
|
|
34
|
+
const focusedY = (ref1 = pointInGrid[1]) !== null && ref1 !== void 0 ? ref1 : null;
|
|
35
|
+
if (focusedX === null || focusedY === null) {
|
|
36
|
+
return currentFocusedData;
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(data.xAxis) && Array.isArray(data.timeSeries)) {
|
|
39
|
+
for(let seriesIdx = 0; seriesIdx < data.timeSeries.length; seriesIdx++){
|
|
40
|
+
const currentSeries = data.timeSeries[seriesIdx];
|
|
41
|
+
if (currentFocusedData.length >= _tooltipModel.TOOLTIP_MAX_ITEMS) break;
|
|
42
|
+
if (currentSeries !== undefined) {
|
|
43
|
+
const currentSeriesName = currentSeries.name ? currentSeries.name.toString() : '';
|
|
44
|
+
var _color;
|
|
45
|
+
const markerColor = (_color = currentSeries.color) !== null && _color !== void 0 ? _color : '#000';
|
|
46
|
+
if (Array.isArray(currentSeries.data)) {
|
|
47
|
+
for(let datumIdx = 0; datumIdx < currentSeries.data.length; datumIdx++){
|
|
48
|
+
var _datumIdx;
|
|
49
|
+
const xValue = (_datumIdx = data.xAxis[datumIdx]) !== null && _datumIdx !== void 0 ? _datumIdx : 0;
|
|
50
|
+
var _datumIdx1;
|
|
51
|
+
const yValue = (_datumIdx1 = currentSeries.data[datumIdx]) !== null && _datumIdx1 !== void 0 ? _datumIdx1 : 0;
|
|
52
|
+
if (focusedX === datumIdx) {
|
|
53
|
+
if (yValue !== '-' && focusedY <= yValue + yBuffer && focusedY >= yValue - yBuffer) {
|
|
54
|
+
// determine whether to convert timestamp to ms, see: https://stackoverflow.com/a/23982005/17575201
|
|
55
|
+
const xValueMilliSeconds = xValue > 99999999999 ? xValue : xValue * 1000;
|
|
56
|
+
const formattedDate = _tooltipModel.TOOLTIP_DATE_FORMAT.format(xValueMilliSeconds);
|
|
57
|
+
const formattedY = (0, _model.formatValue)(yValue, unit);
|
|
58
|
+
currentFocusedData.push({
|
|
59
|
+
seriesIdx: seriesIdx,
|
|
60
|
+
datumIdx: datumIdx,
|
|
61
|
+
seriesName: currentSeriesName,
|
|
62
|
+
date: formattedDate,
|
|
63
|
+
x: xValue,
|
|
64
|
+
y: yValue,
|
|
65
|
+
formattedY: formattedY,
|
|
66
|
+
markerColor: markerColor.toString()
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return currentFocusedData;
|
|
76
|
+
}
|
|
77
|
+
function getFocusedSeriesData(mousePos, chartData, pinnedPos, chart, unit) {
|
|
78
|
+
if (chart === undefined || mousePos === null) return [];
|
|
79
|
+
// prevents multiple tooltips showing from adjacent charts
|
|
80
|
+
let cursorTargetMatchesChart = false;
|
|
81
|
+
if (mousePos.target !== null) {
|
|
82
|
+
const currentParent = mousePos.target.parentElement;
|
|
83
|
+
if (currentParent !== null) {
|
|
84
|
+
const currentGrandparent = currentParent.parentElement;
|
|
85
|
+
if (currentGrandparent !== null) {
|
|
86
|
+
const chartDom = chart.getDom();
|
|
87
|
+
if (chartDom === currentGrandparent) {
|
|
88
|
+
cursorTargetMatchesChart = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// allows moving cursor inside tooltip
|
|
94
|
+
if (pinnedPos !== null) {
|
|
95
|
+
mousePos = pinnedPos;
|
|
96
|
+
cursorTargetMatchesChart = true;
|
|
97
|
+
}
|
|
98
|
+
if (cursorTargetMatchesChart === false) return [];
|
|
99
|
+
if (chart['_model'] === undefined) return [];
|
|
100
|
+
const chartModel = chart['_model'];
|
|
101
|
+
const yAxisInterval = chartModel.getComponent('yAxis').axis.scale._interval;
|
|
102
|
+
const seriesNum = chartData.timeSeries.length;
|
|
103
|
+
// tooltip trigger area gets smaller with more series
|
|
104
|
+
const yBuffer = seriesNum > _tooltipModel.TOOLTIP_MAX_ITEMS ? yAxisInterval * 0.5 : yAxisInterval * 2;
|
|
105
|
+
var _x, _y;
|
|
106
|
+
const pointInPixel = [
|
|
107
|
+
(_x = mousePos.plotCanvas.x) !== null && _x !== void 0 ? _x : 0,
|
|
108
|
+
(_y = mousePos.plotCanvas.y) !== null && _y !== void 0 ? _y : 0
|
|
109
|
+
];
|
|
110
|
+
if (chart.containPixel('grid', pointInPixel)) {
|
|
111
|
+
const pointInGrid = chart.convertFromPixel('grid', pointInPixel);
|
|
112
|
+
if (pointInGrid[0] !== undefined && pointInGrid[1] !== undefined) {
|
|
113
|
+
return getNearbySeries(chartData, pointInGrid, yBuffer, unit);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
_exportStar(require("./Tooltip"), exports);
|
|
18
|
+
_exportStar(require("./SeriesMarker"), exports);
|
|
19
|
+
function _exportStar(from, to) {
|
|
20
|
+
Object.keys(from).forEach(function(k) {
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return from;
|
|
29
|
+
}
|