@perses-dev/components 0.38.0 → 0.40.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/BarChart/BarChart.d.ts +2 -2
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +16 -10
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/BarChart/index.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/index.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +19 -19
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +6 -22
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
- package/dist/DateTimeRangePicker/index.js.map +1 -1
- package/dist/DateTimeRangePicker/utils.js.map +1 -1
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js.map +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/EChart/EChart.js +2 -2
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js.map +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormatControls/FormatControls.d.ts +9 -0
- package/dist/FormatControls/FormatControls.d.ts.map +1 -0
- package/dist/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +26 -26
- package/dist/FormatControls/FormatControls.js.map +1 -0
- package/dist/FormatControls/index.d.ts +2 -0
- package/dist/FormatControls/index.d.ts.map +1 -0
- package/dist/{UnitSelector → FormatControls}/index.js +1 -1
- package/dist/FormatControls/index.js.map +1 -0
- package/dist/GaugeChart/GaugeChart.d.ts +3 -3
- package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +12 -12
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/GaugeChart/index.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.js +3 -3
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +2 -2
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts +2 -2
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +17 -18
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RefreshIntervalPicker/index.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +2 -2
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SettingsAutocomplete/index.js.map +1 -1
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +2 -2
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +8 -8
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +7 -7
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.js +2 -2
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.js +6 -6
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +20 -20
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.js +9 -9
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +2 -2
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +19 -18
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/ThresholdsEditor/index.js.map +1 -1
- package/dist/TimeChart/TimeChart.d.ts +3 -3
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +108 -61
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeChart/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +3 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +9 -8
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +2 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +3 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +6 -5
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -0
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +11 -11
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +7 -7
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +35 -39
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +4 -0
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +6 -0
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +3 -3
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/BarChart/BarChart.js +24 -16
- package/dist/cjs/BarChart/index.js +10 -8
- package/dist/cjs/ColorPicker/ColorPicker.js +15 -13
- package/dist/cjs/ColorPicker/index.js +10 -8
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +12 -10
- package/dist/cjs/ContentWithLegend/index.js +10 -8
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +27 -23
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +29 -43
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +12 -10
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +13 -11
- package/dist/cjs/DateTimeRangePicker/index.js +12 -10
- package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
- package/dist/cjs/Dialog/Dialog.js +15 -13
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +11 -9
- package/dist/cjs/Dialog/index.js +11 -9
- package/dist/cjs/Drawer/Drawer.js +5 -3
- package/dist/cjs/Drawer/index.js +10 -8
- package/dist/cjs/EChart/EChart.js +12 -10
- package/dist/cjs/EChart/index.js +10 -8
- package/dist/cjs/ErrorAlert.js +5 -3
- package/dist/cjs/ErrorBoundary.js +4 -2
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +8 -6
- package/dist/cjs/FontSizeSelector/index.js +10 -8
- package/dist/cjs/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +38 -36
- package/dist/cjs/{UnitSelector → FormatControls}/index.js +10 -8
- package/dist/cjs/GaugeChart/GaugeChart.js +22 -18
- package/dist/cjs/GaugeChart/index.js +10 -8
- package/dist/cjs/InfoTooltip/InfoTooltip.js +13 -11
- package/dist/cjs/InfoTooltip/index.js +10 -8
- package/dist/cjs/JSONEditor.js +10 -8
- package/dist/cjs/Legend/CompactLegend.js +9 -7
- package/dist/cjs/Legend/Legend.js +15 -13
- package/dist/cjs/Legend/LegendColorBadge.js +7 -5
- package/dist/cjs/Legend/ListLegend.js +10 -8
- package/dist/cjs/Legend/ListLegendItem.js +12 -10
- package/dist/cjs/Legend/TableLegend.js +7 -5
- package/dist/cjs/Legend/index.js +11 -9
- package/dist/cjs/Legend/legend-model.js +3 -1
- package/dist/cjs/LineChart/LineChart.js +26 -25
- package/dist/cjs/LineChart/index.js +10 -8
- package/dist/cjs/ModeSelector/ModeSelector.js +8 -6
- package/dist/cjs/ModeSelector/index.js +10 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +6 -4
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +16 -14
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +5 -3
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +11 -9
- package/dist/cjs/OptionsEditorLayout/index.js +13 -11
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +8 -6
- package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +12 -10
- package/dist/cjs/SettingsAutocomplete/index.js +10 -8
- package/dist/cjs/SortSelector/SortSelector.js +8 -6
- package/dist/cjs/SortSelector/index.js +10 -8
- package/dist/cjs/StatChart/StatChart.js +20 -18
- package/dist/cjs/StatChart/calculateFontSize.js +10 -8
- package/dist/cjs/StatChart/index.js +10 -8
- package/dist/cjs/Table/InnerTable.js +5 -3
- package/dist/cjs/Table/Table.js +15 -13
- package/dist/cjs/Table/TableBody.js +5 -3
- package/dist/cjs/Table/TableCell.js +10 -8
- package/dist/cjs/Table/TableCheckbox.js +5 -3
- package/dist/cjs/Table/TableHead.js +5 -3
- package/dist/cjs/Table/TableHeaderCell.js +8 -6
- package/dist/cjs/Table/TableRow.js +5 -3
- package/dist/cjs/Table/VirtualizedTable.js +32 -30
- package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +3 -1
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +23 -21
- package/dist/cjs/Table/index.js +14 -10
- package/dist/cjs/Table/model/table-model.js +15 -11
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +15 -13
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +14 -12
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +44 -41
- package/dist/cjs/ThresholdsEditor/index.js +10 -8
- package/dist/cjs/TimeChart/TimeChart.js +121 -72
- package/dist/cjs/TimeChart/index.js +10 -8
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +30 -27
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +17 -15
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +15 -13
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +5 -3
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +24 -21
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +7 -5
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +36 -34
- package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +61 -47
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +57 -14
- package/dist/cjs/TimeSeriesTooltip/utils.js +17 -13
- package/dist/cjs/YAxisLabel.js +6 -4
- package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +38 -11
- package/dist/cjs/context/SnackbarProvider.js +6 -2
- package/dist/cjs/context/TimeZoneProvider.js +13 -7
- package/dist/cjs/context/index.js +32 -0
- package/dist/cjs/index.js +41 -41
- package/dist/cjs/model/graph.js +9 -3
- package/dist/cjs/model/index.js +12 -10
- package/dist/cjs/test/index.js +10 -8
- package/dist/cjs/test/render.js +7 -5
- package/dist/cjs/test-utils/index.js +10 -8
- package/dist/cjs/test-utils/theme.js +36 -19
- package/dist/cjs/theme/component-overrides/alert.js +3 -1
- package/dist/cjs/theme/component-overrides/paper.js +3 -1
- package/dist/cjs/theme/index.js +10 -8
- package/dist/cjs/theme/palette/background.js +6 -2
- package/dist/cjs/theme/palette/colors/blue.js +3 -1
- package/dist/cjs/theme/palette/colors/common.js +6 -2
- package/dist/cjs/theme/palette/colors/green.js +3 -1
- package/dist/cjs/theme/palette/colors/grey.js +3 -1
- package/dist/cjs/theme/palette/colors/index.js +17 -15
- package/dist/cjs/theme/palette/colors/orange.js +3 -1
- package/dist/cjs/theme/palette/colors/purple.js +3 -1
- package/dist/cjs/theme/palette/colors/red.js +3 -1
- package/dist/cjs/theme/palette/error.js +3 -1
- package/dist/cjs/theme/palette/grey.js +3 -1
- package/dist/cjs/theme/palette/index.js +10 -8
- package/dist/cjs/theme/palette/palette-options.js +3 -1
- package/dist/cjs/theme/palette/primary.js +3 -1
- package/dist/cjs/theme/palette/secondary.js +3 -1
- package/dist/cjs/theme/palette/success.js +3 -1
- package/dist/cjs/theme/palette/text.js +3 -1
- package/dist/cjs/theme/palette/warning.js +3 -1
- package/dist/cjs/theme/theme.js +5 -3
- package/dist/cjs/theme/typography.js +3 -1
- package/dist/cjs/utils/axis.js +11 -7
- package/dist/cjs/utils/chart-actions.js +59 -5
- package/dist/cjs/utils/combine-sx.js +3 -1
- package/dist/cjs/utils/component-ids.js +3 -1
- package/dist/cjs/utils/format.js +16 -8
- package/dist/cjs/utils/index.js +15 -13
- package/dist/cjs/utils/mathjs.js +3 -1
- package/dist/cjs/utils/theme-gen.js +12 -10
- package/dist/context/ChartsProvider.d.ts +19 -0
- package/dist/context/ChartsProvider.d.ts.map +1 -0
- package/dist/context/{ChartsThemeProvider.js → ChartsProvider.js} +24 -6
- package/dist/context/ChartsProvider.js.map +1 -0
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +17 -0
- package/dist/context/index.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/theme.d.ts +2 -0
- package/dist/test-utils/theme.d.ts.map +1 -1
- package/dist/test-utils/theme.js +23 -16
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/theme/component-overrides/paper.js.map +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/palette/background.d.ts.map +1 -1
- package/dist/theme/palette/background.js +3 -1
- package/dist/theme/palette/background.js.map +1 -1
- package/dist/theme/palette/colors/blue.js.map +1 -1
- package/dist/theme/palette/colors/common.js.map +1 -1
- package/dist/theme/palette/colors/green.js.map +1 -1
- package/dist/theme/palette/colors/grey.js.map +1 -1
- package/dist/theme/palette/colors/index.js.map +1 -1
- package/dist/theme/palette/colors/orange.js.map +1 -1
- package/dist/theme/palette/colors/purple.js.map +1 -1
- package/dist/theme/palette/colors/red.js.map +1 -1
- package/dist/theme/palette/error.js.map +1 -1
- package/dist/theme/palette/grey.js.map +1 -1
- package/dist/theme/palette/index.js.map +1 -1
- package/dist/theme/palette/palette-options.js.map +1 -1
- package/dist/theme/palette/primary.js.map +1 -1
- package/dist/theme/palette/secondary.js.map +1 -1
- package/dist/theme/palette/success.js.map +1 -1
- package/dist/theme/palette/text.js.map +1 -1
- package/dist/theme/palette/warning.js.map +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/utils/axis.d.ts +4 -4
- package/dist/utils/axis.d.ts.map +1 -1
- package/dist/utils/axis.js +4 -4
- package/dist/utils/axis.js.map +1 -1
- package/dist/utils/chart-actions.d.ts +5 -1
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +42 -0
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/combine-sx.js.map +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.js +7 -7
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +7 -6
- package/dist/UnitSelector/UnitSelector.d.ts +0 -9
- package/dist/UnitSelector/UnitSelector.d.ts.map +0 -1
- package/dist/UnitSelector/UnitSelector.js.map +0 -1
- package/dist/UnitSelector/index.d.ts +0 -2
- package/dist/UnitSelector/index.d.ts.map +0 -1
- package/dist/UnitSelector/index.js.map +0 -1
- package/dist/context/ChartsThemeProvider.d.ts +0 -10
- package/dist/context/ChartsThemeProvider.d.ts.map +0 -1
- package/dist/context/ChartsThemeProvider.js.map +0 -1
|
@@ -14,22 +14,24 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function
|
|
17
|
+
_export_star(require("./blue"), exports);
|
|
18
|
+
_export_star(require("./common"), exports);
|
|
19
|
+
_export_star(require("./green"), exports);
|
|
20
|
+
_export_star(require("./grey"), exports);
|
|
21
|
+
_export_star(require("./orange"), exports);
|
|
22
|
+
_export_star(require("./purple"), exports);
|
|
23
|
+
_export_star(require("./red"), exports);
|
|
24
|
+
_export_star(require("./types"), exports);
|
|
25
|
+
function _export_star(from, to) {
|
|
26
26
|
Object.keys(from).forEach(function(k) {
|
|
27
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
28
|
+
Object.defineProperty(to, k, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return from[k];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
33
35
|
});
|
|
34
36
|
return from;
|
|
35
37
|
}
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "greyOption", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return greyOption;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _grey = require("./colors/grey");
|
|
22
24
|
const greyOption = (mode)=>{
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./palette-options"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
19
|
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
26
28
|
});
|
|
27
29
|
return from;
|
|
28
30
|
}
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "getPaletteOptions", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return getPaletteOptions;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _text = require("./text");
|
|
22
24
|
const _background = require("./background");
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "primary", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return primary;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const primary = (mode)=>{
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "secondary", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return secondary;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const secondary = (mode)=>{
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "success", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return success;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const success = (mode)=>{
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "warning", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return warning;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _colors = require("./colors");
|
|
22
24
|
const warning = (mode)=>{
|
package/dist/cjs/theme/theme.js
CHANGED
|
@@ -16,12 +16,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "getTheme", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return getTheme;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _material = require("@mui/material");
|
|
22
24
|
const _alert = require("./component-overrides/alert");
|
|
23
25
|
const _paper = require("./component-overrides/paper");
|
|
24
|
-
const
|
|
26
|
+
const _paletteoptions = require("./palette/palette-options");
|
|
25
27
|
const _typography = require("./typography");
|
|
26
28
|
const getModalBackgroundStyle = ({ theme })=>{
|
|
27
29
|
const backgroundStyle = theme.palette.mode === 'light' ? {} : {
|
|
@@ -34,7 +36,7 @@ const getModalBackgroundStyle = ({ theme })=>{
|
|
|
34
36
|
};
|
|
35
37
|
function getTheme(mode) {
|
|
36
38
|
const theme = (0, _material.createTheme)({
|
|
37
|
-
palette: (0,
|
|
39
|
+
palette: (0, _paletteoptions.getPaletteOptions)(mode),
|
|
38
40
|
typography: _typography.typography,
|
|
39
41
|
mixins: {},
|
|
40
42
|
components
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "typography", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return typography;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
require("@fontsource/lato/300.css");
|
|
22
24
|
require("@fontsource/lato/400.css");
|
package/dist/cjs/utils/axis.js
CHANGED
|
@@ -21,19 +21,23 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
getFormattedAxis: function() {
|
|
25
|
+
return getFormattedAxis;
|
|
26
|
+
},
|
|
27
|
+
getDateRange: function() {
|
|
28
|
+
return getDateRange;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
|
-
const _merge = /*#__PURE__*/
|
|
31
|
+
const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
|
|
28
32
|
const _core = require("@perses-dev/core");
|
|
29
|
-
function
|
|
33
|
+
function _interop_require_default(obj) {
|
|
30
34
|
return obj && obj.__esModule ? obj : {
|
|
31
35
|
default: obj
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
|
-
function
|
|
38
|
+
function getFormattedAxis(axis, unit) {
|
|
35
39
|
// TODO: support alternate yAxis that shows on right side
|
|
36
|
-
const
|
|
40
|
+
const AXIS_DEFAULT = {
|
|
37
41
|
type: 'value',
|
|
38
42
|
boundaryGap: [
|
|
39
43
|
0,
|
|
@@ -46,7 +50,7 @@ function getYAxes(yAxis, unit) {
|
|
|
46
50
|
}
|
|
47
51
|
};
|
|
48
52
|
return [
|
|
49
|
-
(0, _merge.default)(
|
|
53
|
+
(0, _merge.default)(AXIS_DEFAULT, axis)
|
|
50
54
|
];
|
|
51
55
|
}
|
|
52
56
|
function getDateRange(data) {
|
|
@@ -21,12 +21,32 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
enableDataZoom: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
enableDataZoom: function() {
|
|
25
|
+
return enableDataZoom;
|
|
26
|
+
},
|
|
27
|
+
restoreChart: function() {
|
|
28
|
+
return restoreChart;
|
|
29
|
+
},
|
|
30
|
+
clearHighlightedSeries: function() {
|
|
31
|
+
return clearHighlightedSeries;
|
|
32
|
+
},
|
|
33
|
+
getPointInGrid: function() {
|
|
34
|
+
return getPointInGrid;
|
|
35
|
+
},
|
|
36
|
+
batchDispatchNearbySeriesActions: function() {
|
|
37
|
+
return batchDispatchNearbySeriesActions;
|
|
38
|
+
},
|
|
39
|
+
checkCrosshairPinnedStatus: function() {
|
|
40
|
+
return checkCrosshairPinnedStatus;
|
|
41
|
+
},
|
|
42
|
+
getClosestTimestamp: function() {
|
|
43
|
+
return getClosestTimestamp;
|
|
44
|
+
},
|
|
45
|
+
getClosestTimestampInFullDataset: function() {
|
|
46
|
+
return getClosestTimestampInFullDataset;
|
|
47
|
+
}
|
|
29
48
|
});
|
|
49
|
+
const _model = require("../model");
|
|
30
50
|
function enableDataZoom(chart) {
|
|
31
51
|
const chartModel = chart['_model'];
|
|
32
52
|
if (chartModel === undefined) return;
|
|
@@ -115,3 +135,37 @@ function batchDispatchNearbySeriesActions(chart, nearbySeriesIndexes, emphasized
|
|
|
115
135
|
});
|
|
116
136
|
}
|
|
117
137
|
}
|
|
138
|
+
function checkCrosshairPinnedStatus(seriesMapping) {
|
|
139
|
+
var _seriesMapping_;
|
|
140
|
+
const isCrosshairPinned = ((_seriesMapping_ = seriesMapping[seriesMapping.length - 1]) === null || _seriesMapping_ === void 0 ? void 0 : _seriesMapping_.name) === _model.PINNED_CROSSHAIR_SERIES_NAME;
|
|
141
|
+
return isCrosshairPinned;
|
|
142
|
+
}
|
|
143
|
+
function getClosestTimestamp(timeSeriesValues, cursorX) {
|
|
144
|
+
if (timeSeriesValues === undefined || cursorX === undefined) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
let currentClosestTimestamp = null;
|
|
148
|
+
let currentClosestDistance = Infinity;
|
|
149
|
+
for (const [timestamp] of timeSeriesValues){
|
|
150
|
+
const distance = Math.abs(timestamp - cursorX);
|
|
151
|
+
if (distance < currentClosestDistance) {
|
|
152
|
+
currentClosestTimestamp = timestamp;
|
|
153
|
+
currentClosestDistance = distance;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return currentClosestTimestamp;
|
|
157
|
+
}
|
|
158
|
+
function getClosestTimestampInFullDataset(data, cursorX) {
|
|
159
|
+
if (cursorX === undefined) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const totalSeries = data.length;
|
|
163
|
+
let closestTimestamp = null;
|
|
164
|
+
for(let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++){
|
|
165
|
+
const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;
|
|
166
|
+
if (currentDataset == null) break;
|
|
167
|
+
const currentValues = currentDataset.values;
|
|
168
|
+
closestTimestamp = getClosestTimestamp(currentValues, cursorX);
|
|
169
|
+
}
|
|
170
|
+
return closestTimestamp;
|
|
171
|
+
}
|
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "combineSx", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return combineSx;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
function combineSx(...sxProps) {
|
|
22
24
|
return sxProps.flatMap((sx)=>{
|
package/dist/cjs/utils/format.js
CHANGED
|
@@ -21,13 +21,21 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
dateFormatOptionsWithTimeZone: ()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
dateFormatOptionsWithTimeZone: function() {
|
|
25
|
+
return dateFormatOptionsWithTimeZone;
|
|
26
|
+
},
|
|
27
|
+
formatWithTimeZone: function() {
|
|
28
|
+
return formatWithTimeZone;
|
|
29
|
+
},
|
|
30
|
+
getFormattedDate: function() {
|
|
31
|
+
return getFormattedDate;
|
|
32
|
+
},
|
|
33
|
+
getFormattedAxisLabel: function() {
|
|
34
|
+
return getFormattedAxisLabel;
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
|
-
const
|
|
30
|
-
const
|
|
37
|
+
const _datefnstz = require("date-fns-tz");
|
|
38
|
+
const _datefns = require("date-fns");
|
|
31
39
|
function dateFormatOptionsWithTimeZone(dateFormatOptions, timeZone) {
|
|
32
40
|
/*
|
|
33
41
|
* if timeZone is provided, and is not local|browser,
|
|
@@ -51,9 +59,9 @@ function formatWithTimeZone(date, formatString, timeZone) {
|
|
|
51
59
|
* otherwise, format without timeZone option, defaulting to browser timeZone setting
|
|
52
60
|
*/ const lowerTimeZone = timeZone === null || timeZone === void 0 ? void 0 : timeZone.toLowerCase();
|
|
53
61
|
if (!timeZone || lowerTimeZone === 'local' || lowerTimeZone === 'browser') {
|
|
54
|
-
return (0,
|
|
62
|
+
return (0, _datefns.format)(date, formatString);
|
|
55
63
|
} else {
|
|
56
|
-
return (0,
|
|
64
|
+
return (0, _datefnstz.formatInTimeZone)(date, lowerTimeZone === 'utc' ? 'UTC' : timeZone, formatString);
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
function getFormattedDate(value, rangeMs, timeZone) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -14,20 +14,22 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function
|
|
17
|
+
_export_star(require("./axis"), exports);
|
|
18
|
+
_export_star(require("./chart-actions"), exports);
|
|
19
|
+
_export_star(require("./combine-sx"), exports);
|
|
20
|
+
_export_star(require("./component-ids"), exports);
|
|
21
|
+
_export_star(require("./format"), exports);
|
|
22
|
+
_export_star(require("./theme-gen"), exports);
|
|
23
|
+
function _export_star(from, to) {
|
|
24
24
|
Object.keys(from).forEach(function(k) {
|
|
25
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
26
|
+
Object.defineProperty(to, k, {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return from[k];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
31
33
|
});
|
|
32
34
|
return from;
|
|
33
35
|
}
|
package/dist/cjs/utils/mathjs.js
CHANGED
|
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "round", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return round;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
23
|
const _mathjs = require("mathjs");
|
|
22
24
|
// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
|
|
@@ -16,10 +16,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "generateChartsTheme", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return generateChartsTheme;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const _merge = /*#__PURE__*/
|
|
22
|
-
function
|
|
23
|
+
const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
|
|
24
|
+
function _interop_require_default(obj) {
|
|
23
25
|
return obj && obj.__esModule ? obj : {
|
|
24
26
|
default: obj
|
|
25
27
|
};
|
|
@@ -29,9 +31,9 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
29
31
|
* The id of the container that will have the chart tooltip appended to it.
|
|
30
32
|
* By default, chart tooltip uses the body of the top-level document object.
|
|
31
33
|
*/ tooltipPortalContainerId) {
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
const primaryTextColor = (
|
|
34
|
+
var _muiTheme_palette_text, _muiTheme_palette, _muiTheme_palette_action, _muiTheme_palette1, _muiTheme_palette_action1, _muiTheme_palette_designSystem, _muiTheme_palette_designSystem1;
|
|
35
|
+
var _muiTheme_palette_text_primary;
|
|
36
|
+
const primaryTextColor = (_muiTheme_palette_text_primary = (_muiTheme_palette_text = muiTheme.palette.text) === null || _muiTheme_palette_text === void 0 ? void 0 : _muiTheme_palette_text.primary) !== null && _muiTheme_palette_text_primary !== void 0 ? _muiTheme_palette_text_primary : DEFAULT_TEXT_COLOR;
|
|
35
37
|
const muiConvertedTheme = {
|
|
36
38
|
title: {
|
|
37
39
|
show: false
|
|
@@ -158,8 +160,8 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
158
160
|
pageTextStyle: {
|
|
159
161
|
color: muiTheme.palette.grey[600]
|
|
160
162
|
},
|
|
161
|
-
pageIconColor: muiTheme === null || muiTheme === void 0 ? void 0 : (
|
|
162
|
-
pageIconInactiveColor: muiTheme === null || muiTheme === void 0 ? void 0 : (
|
|
163
|
+
pageIconColor: muiTheme === null || muiTheme === void 0 ? void 0 : (_muiTheme_palette = muiTheme.palette) === null || _muiTheme_palette === void 0 ? void 0 : (_muiTheme_palette_action = _muiTheme_palette.action) === null || _muiTheme_palette_action === void 0 ? void 0 : _muiTheme_palette_action.active,
|
|
164
|
+
pageIconInactiveColor: muiTheme === null || muiTheme === void 0 ? void 0 : (_muiTheme_palette1 = muiTheme.palette) === null || _muiTheme_palette1 === void 0 ? void 0 : (_muiTheme_palette_action1 = _muiTheme_palette1.action) === null || _muiTheme_palette_action1 === void 0 ? void 0 : _muiTheme_palette_action1.disabled
|
|
163
165
|
},
|
|
164
166
|
toolbox: {
|
|
165
167
|
show: true,
|
|
@@ -170,8 +172,8 @@ function generateChartsTheme(muiTheme, echartsTheme, /**
|
|
|
170
172
|
}
|
|
171
173
|
},
|
|
172
174
|
tooltip: {
|
|
173
|
-
backgroundColor: (
|
|
174
|
-
borderColor: (
|
|
175
|
+
backgroundColor: (_muiTheme_palette_designSystem = muiTheme.palette.designSystem) === null || _muiTheme_palette_designSystem === void 0 ? void 0 : _muiTheme_palette_designSystem.grey[800],
|
|
176
|
+
borderColor: (_muiTheme_palette_designSystem1 = muiTheme.palette.designSystem) === null || _muiTheme_palette_designSystem1 === void 0 ? void 0 : _muiTheme_palette_designSystem1.grey[800],
|
|
175
177
|
textStyle: {
|
|
176
178
|
color: '#fff',
|
|
177
179
|
fontSize: 11
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PersesChartsTheme } from '../model';
|
|
3
|
+
import { CursorCoordinates } from '../TimeSeriesTooltip';
|
|
4
|
+
export interface ChartsProviderProps {
|
|
5
|
+
chartsTheme: PersesChartsTheme;
|
|
6
|
+
enablePinning?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface SharedChartsState {
|
|
10
|
+
chartsTheme: PersesChartsTheme;
|
|
11
|
+
enablePinning: boolean;
|
|
12
|
+
lastTooltipPinnedCoords: CursorCoordinates | null;
|
|
13
|
+
setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function ChartsProvider(props: ChartsProviderProps): JSX.Element;
|
|
16
|
+
export declare const ChartsThemeContext: React.Context<SharedChartsState | undefined>;
|
|
17
|
+
export declare function useChartsContext(): SharedChartsState;
|
|
18
|
+
export declare function useChartsTheme(): PersesChartsTheme;
|
|
19
|
+
//# sourceMappingURL=ChartsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartsProvider.d.ts","sourceRoot":"","sources":["../../src/context/ChartsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClD,0BAA0B,EAAE,CAAC,uBAAuB,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CACzF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAexD;AAED,eAAO,MAAM,kBAAkB,8CAA0D,CAAC;AAE1F,wBAAgB,gBAAgB,IAAI,iBAAiB,CAMpD;AAED,wBAAgB,cAAc,IAAI,iBAAiB,CAGlD"}
|
|
@@ -11,21 +11,39 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import React, { createContext, useContext } from 'react';
|
|
15
|
-
export function
|
|
16
|
-
const { children , chartsTheme } = props;
|
|
14
|
+
import React, { createContext, useContext, useMemo, useState } from 'react';
|
|
15
|
+
export function ChartsProvider(props) {
|
|
16
|
+
const { children , chartsTheme , enablePinning =false } = props;
|
|
17
|
+
const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState(null);
|
|
18
|
+
const ctx = useMemo(()=>{
|
|
19
|
+
return {
|
|
20
|
+
chartsTheme,
|
|
21
|
+
enablePinning,
|
|
22
|
+
lastTooltipPinnedCoords,
|
|
23
|
+
setLastTooltipPinnedCoords
|
|
24
|
+
};
|
|
25
|
+
}, [
|
|
26
|
+
chartsTheme,
|
|
27
|
+
enablePinning,
|
|
28
|
+
lastTooltipPinnedCoords,
|
|
29
|
+
setLastTooltipPinnedCoords
|
|
30
|
+
]);
|
|
17
31
|
return /*#__PURE__*/ _jsx(ChartsThemeContext.Provider, {
|
|
18
|
-
value:
|
|
32
|
+
value: ctx,
|
|
19
33
|
children: children
|
|
20
34
|
});
|
|
21
35
|
}
|
|
22
36
|
export const ChartsThemeContext = /*#__PURE__*/ createContext(undefined);
|
|
23
|
-
export function
|
|
37
|
+
export function useChartsContext() {
|
|
24
38
|
const ctx = useContext(ChartsThemeContext);
|
|
25
39
|
if (ctx === undefined) {
|
|
26
40
|
throw new Error('No ChartsThemeContext found. Did you forget a Provider?');
|
|
27
41
|
}
|
|
28
42
|
return ctx;
|
|
29
43
|
}
|
|
44
|
+
export function useChartsTheme() {
|
|
45
|
+
const ctx = useChartsContext();
|
|
46
|
+
return ctx.chartsTheme;
|
|
47
|
+
}
|
|
30
48
|
|
|
31
|
-
//# sourceMappingURL=
|
|
49
|
+
//# sourceMappingURL=ChartsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/context/ChartsProvider.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, { createContext, useContext, useMemo, useState } from 'react';\nimport { PersesChartsTheme } from '../model';\nimport { CursorCoordinates } from '../TimeSeriesTooltip';\n\nexport interface ChartsProviderProps {\n chartsTheme: PersesChartsTheme;\n enablePinning?: boolean;\n children?: React.ReactNode;\n}\n\nexport interface SharedChartsState {\n chartsTheme: PersesChartsTheme;\n enablePinning: boolean;\n lastTooltipPinnedCoords: CursorCoordinates | null;\n setLastTooltipPinnedCoords: (lastTooltipPinnedCoords: CursorCoordinates | null) => void;\n}\n\nexport function ChartsProvider(props: ChartsProviderProps) {\n const { children, chartsTheme, enablePinning = false } = props;\n\n const [lastTooltipPinnedCoords, setLastTooltipPinnedCoords] = useState<CursorCoordinates | null>(null);\n\n const ctx = useMemo(() => {\n return {\n chartsTheme,\n enablePinning,\n lastTooltipPinnedCoords,\n setLastTooltipPinnedCoords,\n };\n }, [chartsTheme, enablePinning, lastTooltipPinnedCoords, setLastTooltipPinnedCoords]);\n\n return <ChartsThemeContext.Provider value={ctx}>{children}</ChartsThemeContext.Provider>;\n}\n\nexport const ChartsThemeContext = createContext<SharedChartsState | undefined>(undefined);\n\nexport function useChartsContext(): SharedChartsState {\n const ctx = useContext(ChartsThemeContext);\n if (ctx === undefined) {\n throw new Error('No ChartsThemeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useChartsTheme(): PersesChartsTheme {\n const ctx = useChartsContext();\n return ctx.chartsTheme;\n}\n"],"names":["React","createContext","useContext","useMemo","useState","ChartsProvider","props","children","chartsTheme","enablePinning","lastTooltipPinnedCoords","setLastTooltipPinnedCoords","ctx","ChartsThemeContext","Provider","value","undefined","useChartsContext","Error","useChartsTheme"],"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,OAAOA,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAQ;AAiB5E,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,SAAQ,EAAEC,YAAW,EAAEC,eAAgB,MAAK,EAAE,GAAGH;IAEzD,MAAM,CAACI,yBAAyBC,2BAA2B,GAAGP,SAAmC;IAEjG,MAAMQ,MAAMT,QAAQ;QAClB,OAAO;YACLK;YACAC;YACAC;YACAC;QACF;IACF,GAAG;QAACH;QAAaC;QAAeC;QAAyBC;KAA2B;IAEpF,qBAAO,KAACE,mBAAmBC;QAASC,OAAOH;kBAAML;;AACnD;AAEA,OAAO,MAAMM,mCAAqBZ,cAA6Ce,WAAW;AAE1F,OAAO,SAASC;IACd,MAAML,MAAMV,WAAWW;IACvB,IAAID,QAAQI,WAAW;QACrB,MAAM,IAAIE,MAAM;IAClB;IACA,OAAON;AACT;AAEA,OAAO,SAASO;IACd,MAAMP,MAAMK;IACZ,OAAOL,IAAIJ;AACb"}
|