@perses-dev/components 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59
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 +3 -4
- package/dist/BarChart/BarChart.d.ts.map +1 -1
- package/dist/BarChart/BarChart.js +17 -11
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/BarChart/index.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.d.ts +1 -2
- package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +1 -1
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.d.ts +1 -2
- package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +2 -2
- 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 +3 -3
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +21 -21
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +1 -2
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +8 -24
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +1 -2
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +2 -2
- 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.d.ts +6 -6
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +5 -5
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +1 -2
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/Dialog/index.js.map +1 -1
- package/dist/Drawer/Drawer.d.ts +1 -2
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +4 -3
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Drawer/index.js.map +1 -1
- package/dist/EChart/EChart.d.ts +7 -7
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +3 -3
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/EChart/index.js.map +1 -1
- package/dist/ErrorAlert.d.ts +1 -2
- package/dist/ErrorAlert.d.ts.map +1 -1
- package/dist/ErrorAlert.js +1 -1
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ErrorBoundary.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.d.ts +2 -3
- package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js +2 -2
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FontSizeSelector/index.js.map +1 -1
- package/dist/FormatControls/FormatControls.d.ts +8 -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 +6 -7
- 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.d.ts +2 -2
- package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +4 -4
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/InfoTooltip/index.js.map +1 -1
- package/dist/JSONEditor.d.ts +4 -4
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +9 -8
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.d.ts +1 -2
- package/dist/Legend/CompactLegend.d.ts.map +1 -1
- package/dist/Legend/CompactLegend.js +1 -1
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts +1 -2
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +4 -4
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js +1 -1
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.d.ts +1 -2
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js +1 -1
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +2 -2
- package/dist/Legend/ListLegendItem.d.ts.map +1 -1
- package/dist/Legend/ListLegendItem.js +7 -11
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts +1 -2
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +2 -2
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/index.js.map +1 -1
- package/dist/Legend/legend-model.d.ts +2 -2
- package/dist/Legend/legend-model.d.ts.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 +22 -24
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LineChart/index.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.d.ts +2 -3
- package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
- package/dist/ModeSelector/ModeSelector.js +2 -2
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/ModeSelector/index.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -3
- package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -2
- package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/OptionsEditorLayout/index.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +1 -2
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +23 -7
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RefreshIntervalPicker/index.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +4 -4
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SettingsAutocomplete/index.js.map +1 -1
- package/dist/SortSelector/SortSelector.d.ts +2 -3
- package/dist/SortSelector/SortSelector.d.ts.map +1 -1
- package/dist/SortSelector/SortSelector.js +2 -2
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts +3 -4
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +10 -10
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +8 -8
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatChart/index.js.map +1 -1
- package/dist/Table/InnerTable.d.ts +2 -2
- package/dist/Table/InnerTable.d.ts.map +1 -1
- package/dist/Table/InnerTable.js +2 -2
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +1 -2
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -3
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.d.ts +2 -2
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.d.ts +1 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +4 -4
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.d.ts +1 -2
- package/dist/Table/TableCheckbox.d.ts.map +1 -1
- package/dist/Table/TableCheckbox.js +1 -1
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableHead.d.ts +2 -2
- package/dist/Table/TableHead.d.ts.map +1 -1
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.d.ts +1 -2
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.d.ts +1 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +2 -2
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +8 -8
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.d.ts +2 -2
- package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +21 -21
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +6 -6
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +11 -11
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +1 -2
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js +4 -4
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.d.ts +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +2 -2
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +1 -2
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +23 -21
- 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 +110 -67
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeChart/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +11 -10
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +3 -3
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +1 -2
- package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +6 -6
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts +1 -2
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +2 -2
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +7 -7
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +8 -8
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +44 -45
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +13 -26
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +5 -11
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +5 -4
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js +32 -0
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
- package/dist/ToolbarIconButton/index.d.ts +2 -0
- package/dist/ToolbarIconButton/index.d.ts.map +1 -0
- package/dist/ToolbarIconButton/index.js +15 -0
- package/dist/ToolbarIconButton/index.js.map +1 -0
- package/dist/YAxisLabel.d.ts +1 -2
- package/dist/YAxisLabel.d.ts.map +1 -1
- package/dist/YAxisLabel.js +1 -1
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/cjs/BarChart/BarChart.js +25 -17
- package/dist/cjs/BarChart/index.js +10 -8
- package/dist/cjs/ColorPicker/ColorPicker.js +19 -15
- package/dist/cjs/ColorPicker/index.js +10 -8
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +13 -11
- package/dist/cjs/ContentWithLegend/index.js +10 -8
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +29 -25
- package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +30 -44
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +13 -11
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +14 -12
- package/dist/cjs/DateTimeRangePicker/index.js +12 -10
- package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
- package/dist/cjs/Dialog/Dialog.js +16 -14
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +12 -10
- package/dist/cjs/Dialog/index.js +11 -9
- package/dist/cjs/Drawer/Drawer.js +8 -5
- package/dist/cjs/Drawer/index.js +10 -8
- package/dist/cjs/EChart/EChart.js +16 -12
- package/dist/cjs/EChart/index.js +10 -8
- package/dist/cjs/ErrorAlert.js +6 -4
- package/dist/cjs/ErrorBoundary.js +4 -2
- package/dist/cjs/FontSizeSelector/FontSizeSelector.js +10 -8
- 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 +16 -14
- package/dist/cjs/InfoTooltip/index.js +10 -8
- package/dist/cjs/JSONEditor.js +19 -16
- package/dist/cjs/Legend/CompactLegend.js +10 -8
- package/dist/cjs/Legend/Legend.js +16 -14
- package/dist/cjs/Legend/LegendColorBadge.js +8 -6
- package/dist/cjs/Legend/ListLegend.js +11 -9
- package/dist/cjs/Legend/ListLegendItem.js +20 -20
- package/dist/cjs/Legend/TableLegend.js +8 -6
- package/dist/cjs/Legend/index.js +11 -9
- package/dist/cjs/Legend/legend-model.js +3 -1
- package/dist/cjs/LineChart/LineChart.js +31 -31
- package/dist/cjs/LineChart/index.js +10 -8
- package/dist/cjs/ModeSelector/ModeSelector.js +10 -8
- package/dist/cjs/ModeSelector/index.js +10 -8
- package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +7 -5
- package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +17 -15
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +6 -4
- package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +12 -10
- package/dist/cjs/OptionsEditorLayout/index.js +13 -11
- package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +28 -10
- package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +13 -11
- package/dist/cjs/SettingsAutocomplete/index.js +10 -8
- package/dist/cjs/SortSelector/SortSelector.js +10 -8
- package/dist/cjs/SortSelector/index.js +10 -8
- package/dist/cjs/StatChart/StatChart.js +22 -20
- package/dist/cjs/StatChart/calculateFontSize.js +11 -9
- package/dist/cjs/StatChart/index.js +10 -8
- package/dist/cjs/Table/InnerTable.js +7 -5
- package/dist/cjs/Table/Table.js +18 -16
- package/dist/cjs/Table/TableBody.js +5 -3
- package/dist/cjs/Table/TableCell.js +12 -10
- package/dist/cjs/Table/TableCheckbox.js +6 -4
- package/dist/cjs/Table/TableHead.js +5 -3
- package/dist/cjs/Table/TableHeaderCell.js +9 -7
- package/dist/cjs/Table/TableRow.js +5 -3
- package/dist/cjs/Table/VirtualizedTable.js +34 -32
- package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +4 -2
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +24 -22
- package/dist/cjs/Table/index.js +14 -10
- package/dist/cjs/Table/model/table-model.js +17 -13
- package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +17 -15
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +15 -13
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +50 -44
- package/dist/cjs/ThresholdsEditor/index.js +10 -8
- package/dist/cjs/TimeChart/TimeChart.js +123 -78
- package/dist/cjs/TimeChart/index.js +10 -8
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +31 -28
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +18 -16
- package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +16 -14
- package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +6 -4
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +23 -21
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +9 -7
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +35 -33
- package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +70 -53
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +56 -28
- package/dist/cjs/TimeSeriesTooltip/utils.js +19 -14
- package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +40 -0
- package/dist/cjs/ToolbarIconButton/index.js +30 -0
- package/dist/cjs/YAxisLabel.js +7 -5
- package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +41 -12
- package/dist/cjs/context/SnackbarProvider.js +7 -3
- package/dist/cjs/context/TimeZoneProvider.js +17 -9
- package/dist/cjs/context/index.js +32 -0
- package/dist/cjs/index.js +42 -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 +38 -19
- package/dist/cjs/theme/component-overrides/alert.js +7 -5
- package/dist/cjs/theme/component-overrides/paper.js +4 -2
- 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 +6 -4
- package/dist/cjs/theme/typography.js +3 -1
- package/dist/cjs/utils/axis.js +11 -7
- package/dist/cjs/utils/chart-actions.js +68 -12
- 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 +4 -2
- package/dist/cjs/utils/theme-gen.js +16 -18
- 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.d.ts +2 -2
- package/dist/context/SnackbarProvider.d.ts.map +1 -1
- package/dist/context/SnackbarProvider.js +1 -1
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.d.ts +1 -1
- package/dist/context/TimeZoneProvider.d.ts.map +1 -1
- package/dist/context/TimeZoneProvider.js +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 +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +8 -8
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/graph.js.map +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/theme.d.ts +1 -1
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/timeOption.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 +25 -16
- package/dist/test-utils/theme.js.map +1 -1
- package/dist/theme/component-overrides/alert.js +4 -4
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/theme/component-overrides/paper.js +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/colors/types.d.ts +1 -1
- package/dist/theme/palette/colors/types.d.ts.map +1 -1
- package/dist/theme/palette/colors/types.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 +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/types/ThemeExtension.d.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 +6 -2
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +51 -7
- 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 +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/theme-gen.d.ts +3 -8
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +11 -15
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +8 -7
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/utils.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Theme } from '@mui/material';\nimport {\n CursorCoordinates,\n CursorData,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MIN_WIDTH,\n TOOLTIP_ADJUST_Y_POS_MULTIPLIER,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_PADDING,\n} from './tooltip-model';\n\n/**\n * Determine position of tooltip depending on chart dimensions and the number of focused series\n */\nexport function assembleTransform(\n mousePos: CursorData['coords'],\n chartWidth: number,\n pinnedPos: CursorCoordinates | null,\n tooltipHeight: number,\n tooltipWidth: number,\n containerElement?: Element | null\n) {\n if (mousePos === null) {\n return
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/utils.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Theme } from '@mui/material';\nimport {\n CursorCoordinates,\n CursorData,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MIN_WIDTH,\n TOOLTIP_ADJUST_Y_POS_MULTIPLIER,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_PADDING,\n} from './tooltip-model';\n\n/**\n * Determine position of tooltip depending on chart dimensions and the number of focused series\n */\nexport function assembleTransform(\n mousePos: CursorData['coords'],\n chartWidth: number,\n pinnedPos: CursorCoordinates | null,\n tooltipHeight: number,\n tooltipWidth: number,\n containerElement?: Element | null\n) {\n if (mousePos === null) {\n return undefined;\n }\n\n const cursorPaddingX = 32;\n const cursorPaddingY = 16;\n\n if (pinnedPos !== null) {\n mousePos = pinnedPos;\n }\n\n if (mousePos.plotCanvas.x === undefined) return undefined;\n\n // By default, tooltip is located in a Portal attached to the body.\n // Using page coordinates instead of viewport ensures the tooltip is\n // absolutely positioned correctly as the user scrolls\n let x = mousePos.page.x;\n let y = mousePos.page.y + cursorPaddingY;\n\n // If containerElement is defined, tooltip is attached to the containerElement instead.\n let containerRect;\n if (containerElement) {\n // get the container's position relative to viewport\n containerRect = containerElement.getBoundingClientRect();\n // calculate the mouse position relative to container\n x = x - containerRect.left + containerElement.scrollLeft;\n y = y - containerRect.top + containerElement.scrollTop;\n }\n\n if (mousePos.client.y + tooltipHeight + cursorPaddingY > window.innerHeight) {\n // adjust so tooltip does not get cut off at bottom of chart\n // multiplier ensures tooltip isn't overly adjusted and gets cut off at the top of the viewport\n y = y - tooltipHeight * TOOLTIP_ADJUST_Y_POS_MULTIPLIER;\n\n // If y is now above of the top of containerElement, set y close to 0 so tooltip does not get cut off\n if (containerRect && y < containerRect.top) {\n y = TOOLTIP_PADDING / 2; // leaves room for some padding around tooltip\n }\n }\n\n // use tooltip width to determine when to repos from right to left\n const xPosAdjustThreshold = chartWidth - tooltipWidth * 0.9;\n\n // reposition so tooltip is never too close to right side of chart or left side of browser window\n return mousePos.plotCanvas.x > xPosAdjustThreshold && x > TOOLTIP_MAX_WIDTH\n ? `translate3d(${x - cursorPaddingX}px, ${y}px, 0) translateX(-100%)`\n : `translate3d(${x + cursorPaddingX}px, ${y}px, 0)`;\n}\n\n/**\n * Helper for tooltip positioning styles\n */\nexport function getTooltipStyles(theme: Theme, pinnedPos: CursorCoordinates | null, maxHeight?: number) {\n const adjustedMaxHeight = maxHeight ? maxHeight - TOOLTIP_PADDING : undefined;\n return {\n minWidth: TOOLTIP_MIN_WIDTH,\n maxWidth: TOOLTIP_MAX_WIDTH,\n maxHeight: adjustedMaxHeight ?? TOOLTIP_MAX_HEIGHT,\n padding: 0,\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n borderRadius: '6px',\n color: '#fff',\n fontSize: '11px',\n visibility: 'visible',\n opacity: 1,\n transition: 'all 0.1s ease-out',\n // Ensure pinned tooltip shows behind edit panel drawer and sticky header\n zIndex: pinnedPos !== null ? 'auto' : theme.zIndex.tooltip,\n overflow: 'hidden',\n '&:hover': {\n overflowY: 'auto',\n },\n };\n}\n"],"names":["TOOLTIP_MAX_WIDTH","TOOLTIP_MAX_HEIGHT","TOOLTIP_MIN_WIDTH","TOOLTIP_ADJUST_Y_POS_MULTIPLIER","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_PADDING","assembleTransform","mousePos","chartWidth","pinnedPos","tooltipHeight","tooltipWidth","containerElement","undefined","cursorPaddingX","cursorPaddingY","plotCanvas","x","page","y","containerRect","getBoundingClientRect","left","scrollLeft","top","scrollTop","client","window","innerHeight","xPosAdjustThreshold","getTooltipStyles","theme","maxHeight","adjustedMaxHeight","minWidth","maxWidth","padding","position","backgroundColor","palette","designSystem","grey","borderRadius","color","fontSize","visibility","opacity","transition","zIndex","tooltip","overflow","overflowY"],"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;AAGjC,SAGEA,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,+BAA+B,EAC/BC,yBAAyB,EACzBC,eAAe,QACV,kBAAkB;AAEzB;;CAEC,GACD,OAAO,SAASC,kBACdC,QAA8B,EAC9BC,UAAkB,EAClBC,SAAmC,EACnCC,aAAqB,EACrBC,YAAoB,EACpBC,gBAAiC;IAEjC,IAAIL,aAAa,MAAM;QACrB,OAAOM;IACT;IAEA,MAAMC,iBAAiB;IACvB,MAAMC,iBAAiB;IAEvB,IAAIN,cAAc,MAAM;QACtBF,WAAWE;IACb;IAEA,IAAIF,SAASS,UAAU,CAACC,CAAC,KAAKJ,WAAW,OAAOA;IAEhD,mEAAmE;IACnE,oEAAoE;IACpE,sDAAsD;IACtD,IAAII,IAAIV,SAASW,IAAI,CAACD,CAAC;IACvB,IAAIE,IAAIZ,SAASW,IAAI,CAACC,CAAC,GAAGJ;IAE1B,uFAAuF;IACvF,IAAIK;IACJ,IAAIR,kBAAkB;QACpB,oDAAoD;QACpDQ,gBAAgBR,iBAAiBS,qBAAqB;QACtD,qDAAqD;QACrDJ,IAAIA,IAAIG,cAAcE,IAAI,GAAGV,iBAAiBW,UAAU;QACxDJ,IAAIA,IAAIC,cAAcI,GAAG,GAAGZ,iBAAiBa,SAAS;IACxD;IAEA,IAAIlB,SAASmB,MAAM,CAACP,CAAC,GAAGT,gBAAgBK,iBAAiBY,OAAOC,WAAW,EAAE;QAC3E,4DAA4D;QAC5D,+FAA+F;QAC/FT,IAAIA,IAAIT,gBAAgBP;QAExB,qGAAqG;QACrG,IAAIiB,iBAAiBD,IAAIC,cAAcI,GAAG,EAAE;YAC1CL,IAAId,kBAAkB,GAAG,8CAA8C;QACzE;IACF;IAEA,kEAAkE;IAClE,MAAMwB,sBAAsBrB,aAAaG,eAAe;IAExD,iGAAiG;IACjG,OAAOJ,SAASS,UAAU,CAACC,CAAC,GAAGY,uBAAuBZ,IAAIjB,oBACtD,CAAC,YAAY,EAAEiB,IAAIH,eAAe,IAAI,EAAEK,EAAE,wBAAwB,CAAC,GACnE,CAAC,YAAY,EAAEF,IAAIH,eAAe,IAAI,EAAEK,EAAE,MAAM,CAAC;AACvD;AAEA;;CAEC,GACD,OAAO,SAASW,iBAAiBC,KAAY,EAAEtB,SAAmC,EAAEuB,SAAkB;QAUjFD;IATnB,MAAME,oBAAoBD,YAAYA,YAAY3B,kBAAkBQ;QASjDkB;IARnB,OAAO;QACLG,UAAUhC;QACViC,UAAUnC;QACVgC,WAAWC,8BAAAA,+BAAAA,oBAAqBhC;QAChCmC,SAAS;QACTC,UAAU;QACVb,KAAK;QACLF,MAAM;QACNgB,iBAAiBP,CAAAA,qCAAAA,8BAAAA,MAAMQ,OAAO,CAACC,YAAY,cAA1BT,kDAAAA,4BAA4BU,IAAI,CAAC,IAAI,cAArCV,+CAAAA,oCAAyC3B;QAC1DsC,cAAc;QACdC,OAAO;QACPC,UAAU;QACVC,YAAY;QACZC,SAAS;QACTC,YAAY;QACZ,yEAAyE;QACzEC,QAAQvC,cAAc,OAAO,SAASsB,MAAMiB,MAAM,CAACC,OAAO;QAC1DC,UAAU;QACV,WAAW;YACTC,WAAW;QACb;IACF;AACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps } from '@mui/material';
|
|
3
|
+
type ToolbarIconButtonProps = ButtonProps;
|
|
4
|
+
export declare const ToolbarIconButton: import("react").ForwardRefExoticComponent<Omit<ToolbarIconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=ToolbarIconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../src/ToolbarIconButton/ToolbarIconButton.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,KAAK,sBAAsB,GAAG,WAAW,CAAC;AAa1C,eAAO,MAAM,iBAAiB,mIAAyB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { forwardRef } from 'react';
|
|
15
|
+
import { Button, styled } from '@mui/material';
|
|
16
|
+
function IconButton(props, ref) {
|
|
17
|
+
return /*#__PURE__*/ _jsx(StyledIconButton, {
|
|
18
|
+
ref: ref,
|
|
19
|
+
variant: "outlined",
|
|
20
|
+
color: "secondary",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const StyledIconButton = styled(Button)(({ theme })=>({
|
|
25
|
+
// Using a button with some adjusted styles because it is easier to inherit
|
|
26
|
+
// styling and variants from themes than with an IconButton.
|
|
27
|
+
padding: theme.spacing(0.5),
|
|
28
|
+
minWidth: 'auto'
|
|
29
|
+
}));
|
|
30
|
+
export const ToolbarIconButton = /*#__PURE__*/ forwardRef(IconButton);
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=ToolbarIconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ToolbarIconButton/ToolbarIconButton.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 { ForwardedRef, forwardRef } from 'react';\nimport { Button, styled, ButtonProps } from '@mui/material';\n\ntype ToolbarIconButtonProps = ButtonProps;\n\nfunction IconButton(props: ToolbarIconButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n return <StyledIconButton ref={ref} variant=\"outlined\" color=\"secondary\" {...props} />;\n}\n\nconst StyledIconButton = styled(Button)(({ theme }) => ({\n // Using a button with some adjusted styles because it is easier to inherit\n // styling and variants from themes than with an IconButton.\n padding: theme.spacing(0.5),\n minWidth: 'auto',\n}));\n\nexport const ToolbarIconButton = forwardRef(IconButton);\n"],"names":["forwardRef","Button","styled","IconButton","props","ref","StyledIconButton","variant","color","theme","padding","spacing","minWidth","ToolbarIconButton"],"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,SAAuBA,UAAU,QAAQ,QAAQ;AACjD,SAASC,MAAM,EAAEC,MAAM,QAAqB,gBAAgB;AAI5D,SAASC,WAAWC,KAA6B,EAAEC,GAAoC;IACrF,qBAAO,KAACC;QAAiBD,KAAKA;QAAKE,SAAQ;QAAWC,OAAM;QAAa,GAAGJ,KAAK;;AACnF;AAEA,MAAME,mBAAmBJ,OAAOD,QAAQ,CAAC,EAAEQ,KAAK,EAAE,GAAM,CAAA;QACtD,2EAA2E;QAC3E,4DAA4D;QAC5DC,SAASD,MAAME,OAAO,CAAC;QACvBC,UAAU;IACZ,CAAA;AAEA,OAAO,MAAMC,kCAAoBb,WAAWG,YAAY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToolbarIconButton/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './ToolbarIconButton';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ToolbarIconButton/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ToolbarIconButton';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAsB"}
|
package/dist/YAxisLabel.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
interface YAxisLabelProps {
|
|
3
2
|
name: string;
|
|
4
3
|
height: number;
|
|
5
4
|
}
|
|
6
|
-
export declare function YAxisLabel({ name, height }: YAxisLabelProps): JSX.Element;
|
|
5
|
+
export declare function YAxisLabel({ name, height }: YAxisLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
8
7
|
//# sourceMappingURL=YAxisLabel.d.ts.map
|
package/dist/YAxisLabel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YAxisLabel.d.ts","sourceRoot":"","sources":["../src/YAxisLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YAxisLabel.d.ts","sourceRoot":"","sources":["../src/YAxisLabel.tsx"],"names":[],"mappings":"AAeA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,eAAe,2CA2B3D"}
|
package/dist/YAxisLabel.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { Box, Typography } from '@mui/material';
|
|
15
|
-
export function YAxisLabel({ name
|
|
15
|
+
export function YAxisLabel({ name, height }) {
|
|
16
16
|
return /*#__PURE__*/ _jsx(Box, {
|
|
17
17
|
sx: {
|
|
18
18
|
display: 'inline-block',
|
package/dist/YAxisLabel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/YAxisLabel.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, Typography } from '@mui/material';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps) {\n return (\n <Box\n sx={{\n display: 'inline-block',\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n position: 'absolute',\n top: `calc(${height}px / 2)`,\n transform: 'translateX(-50%) rotate(-90deg)',\n transformOrigin: 'top',\n textAlign: 'center',\n zIndex: 1,\n }}\n >\n <Typography\n variant=\"body1\"\n aria-label=\"y axis label\"\n sx={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","Typography","YAxisLabel","name","height","sx","display","maxWidth","position","top","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"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
|
|
1
|
+
{"version":3,"sources":["../src/YAxisLabel.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, Typography } from '@mui/material';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps) {\n return (\n <Box\n sx={{\n display: 'inline-block',\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n position: 'absolute',\n top: `calc(${height}px / 2)`,\n transform: 'translateX(-50%) rotate(-90deg)',\n transformOrigin: 'top',\n textAlign: 'center',\n zIndex: 1,\n }}\n >\n <Typography\n variant=\"body1\"\n aria-label=\"y axis label\"\n sx={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","Typography","YAxisLabel","name","height","sx","display","maxWidth","position","top","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"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,SAASA,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AAOhD,OAAO,SAASC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAmB;IAC1D,qBACE,KAACJ;QACCK,IAAI;YACFC,SAAS;YACTC,UAAUH;YACVI,UAAU;YACVC,KAAK,CAAC,KAAK,EAAEL,OAAO,OAAO,CAAC;YAC5BM,WAAW;YACXC,iBAAiB;YACjBC,WAAW;YACXC,QAAQ;QACV;kBAEA,cAAA,KAACZ;YACCa,SAAQ;YACRC,cAAW;YACXV,IAAI;gBACFW,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;sBAECf;;;AAIT"}
|
|
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "BarChart", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return BarChart;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _react = require("react");
|
|
23
25
|
const _core = require("@perses-dev/core");
|
|
24
26
|
const _core1 = require("echarts/core");
|
|
@@ -26,8 +28,9 @@ const _charts = require("echarts/charts");
|
|
|
26
28
|
const _components = require("echarts/components");
|
|
27
29
|
const _renderers = require("echarts/renderers");
|
|
28
30
|
const _material = require("@mui/material");
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
+
const _ChartsProvider = require("../context/ChartsProvider");
|
|
32
|
+
const _EChart = require("../EChart");
|
|
33
|
+
const _utils = require("../utils");
|
|
31
34
|
(0, _core1.use)([
|
|
32
35
|
_charts.BarChart,
|
|
33
36
|
_components.GridComponent,
|
|
@@ -39,12 +42,12 @@ const _echart = require("../EChart");
|
|
|
39
42
|
const BAR_WIN_WIDTH = 14;
|
|
40
43
|
const BAR_GAP = 6;
|
|
41
44
|
function BarChart(props) {
|
|
42
|
-
const { width
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
const chartsTheme = (0,
|
|
45
|
+
const { width, height, data, format = {
|
|
46
|
+
unit: 'decimal'
|
|
47
|
+
}, mode = 'value' } = props;
|
|
48
|
+
const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
|
|
46
49
|
const option = (0, _react.useMemo)(()=>{
|
|
47
|
-
if (data == null) return chartsTheme.noDataOption;
|
|
50
|
+
if (data == null || !data.length) return chartsTheme.noDataOption;
|
|
48
51
|
const source = [];
|
|
49
52
|
data.map((d)=>{
|
|
50
53
|
source.push([
|
|
@@ -65,7 +68,7 @@ function BarChart(props) {
|
|
|
65
68
|
source: source
|
|
66
69
|
}
|
|
67
70
|
],
|
|
68
|
-
xAxis: {},
|
|
71
|
+
xAxis: (0, _utils.getFormattedAxis)({}, format),
|
|
69
72
|
yAxis: {
|
|
70
73
|
type: 'category',
|
|
71
74
|
splitLine: {
|
|
@@ -84,11 +87,11 @@ function BarChart(props) {
|
|
|
84
87
|
formatter: (params)=>{
|
|
85
88
|
if (mode === 'percentage') {
|
|
86
89
|
return params.data[1] && (0, _core.formatValue)(params.data[1], {
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
unit: 'percent',
|
|
91
|
+
decimalPlaces: format.decimalPlaces
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
|
-
return params.data[1] && (0, _core.formatValue)(params.data[1],
|
|
94
|
+
return params.data[1] && (0, _core.formatValue)(params.data[1], format);
|
|
92
95
|
},
|
|
93
96
|
barMinWidth: BAR_WIN_WIDTH,
|
|
94
97
|
barCategoryGap: BAR_GAP
|
|
@@ -101,7 +104,12 @@ function BarChart(props) {
|
|
|
101
104
|
tooltip: {
|
|
102
105
|
appendToBody: true,
|
|
103
106
|
confine: true,
|
|
104
|
-
formatter: (params)=>params.data[1] && `<b>${params.name}</b>   ${(0, _core.formatValue)(params.data[1],
|
|
107
|
+
formatter: (params)=>params.data[1] && `<b>${params.name}</b>   ${(0, _core.formatValue)(params.data[1], format)}`
|
|
108
|
+
},
|
|
109
|
+
// increase distance between grid and container to prevent y axis labels from getting cut off
|
|
110
|
+
grid: {
|
|
111
|
+
left: '5%',
|
|
112
|
+
right: '5%'
|
|
105
113
|
}
|
|
106
114
|
};
|
|
107
115
|
}, [
|
|
@@ -109,15 +117,15 @@ function BarChart(props) {
|
|
|
109
117
|
chartsTheme,
|
|
110
118
|
width,
|
|
111
119
|
mode,
|
|
112
|
-
|
|
120
|
+
format
|
|
113
121
|
]);
|
|
114
|
-
return /*#__PURE__*/ (0,
|
|
122
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
115
123
|
sx: {
|
|
116
124
|
width: width,
|
|
117
125
|
height: height,
|
|
118
126
|
overflow: 'auto'
|
|
119
127
|
},
|
|
120
|
-
children: /*#__PURE__*/ (0,
|
|
128
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_EChart.EChart, {
|
|
121
129
|
sx: {
|
|
122
130
|
minHeight: height,
|
|
123
131
|
height: data ? data.length * (BAR_WIN_WIDTH + BAR_GAP) : '100%'
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./BarChart"), 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,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ColorPicker", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ColorPicker;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
22
24
|
const _material = require("@mui/material");
|
|
23
|
-
const _react = /*#__PURE__*/
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
function
|
|
25
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
26
|
+
const _reactcolorful = require("react-colorful");
|
|
27
|
+
const _Circle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Circle"));
|
|
28
|
+
function _interop_require_default(obj) {
|
|
27
29
|
return obj && obj.__esModule ? obj : {
|
|
28
30
|
default: obj
|
|
29
31
|
};
|
|
@@ -36,7 +38,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
36
38
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
37
39
|
})(nodeInterop);
|
|
38
40
|
}
|
|
39
|
-
function
|
|
41
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
40
42
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
41
43
|
return obj;
|
|
42
44
|
}
|
|
@@ -49,7 +51,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
49
51
|
if (cache && cache.has(obj)) {
|
|
50
52
|
return cache.get(obj);
|
|
51
53
|
}
|
|
52
|
-
var newObj = {
|
|
54
|
+
var newObj = {
|
|
55
|
+
__proto__: null
|
|
56
|
+
};
|
|
53
57
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
54
58
|
for(var key in obj){
|
|
55
59
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -67,7 +71,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
67
71
|
}
|
|
68
72
|
return newObj;
|
|
69
73
|
}
|
|
70
|
-
const ColorPicker = ({ color
|
|
74
|
+
const ColorPicker = ({ color, onChange, palette })=>{
|
|
71
75
|
// value is the visible value for the controlled text input
|
|
72
76
|
const [value, setValue] = (0, _react.useState)(color);
|
|
73
77
|
const handleColorChange = (color)=>{
|
|
@@ -83,29 +87,29 @@ const ColorPicker = ({ color , onChange , palette })=>{
|
|
|
83
87
|
onChange && onChange(e.target.value);
|
|
84
88
|
}
|
|
85
89
|
};
|
|
86
|
-
return /*#__PURE__*/ (0,
|
|
90
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
87
91
|
spacing: 1,
|
|
88
92
|
children: [
|
|
89
|
-
/*#__PURE__*/ (0,
|
|
93
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcolorful.HexColorPicker, {
|
|
90
94
|
color: color,
|
|
91
95
|
onChange: handleColorChange
|
|
92
96
|
}),
|
|
93
|
-
/*#__PURE__*/ (0,
|
|
97
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
94
98
|
direction: "row",
|
|
95
99
|
flexWrap: "wrap",
|
|
96
100
|
justifyContent: "space-evenly",
|
|
97
101
|
width: '200px',
|
|
98
|
-
children: palette && palette.map((color, i)=>/*#__PURE__*/ (0,
|
|
102
|
+
children: palette && palette.map((color, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
99
103
|
size: "small",
|
|
100
104
|
"aria-label": `change color to ${color}`,
|
|
101
105
|
sx: {
|
|
102
106
|
color
|
|
103
107
|
},
|
|
104
108
|
onClick: ()=>handleColorChange(color),
|
|
105
|
-
children: /*#__PURE__*/ (0,
|
|
109
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {})
|
|
106
110
|
}, i))
|
|
107
111
|
}),
|
|
108
|
-
/*#__PURE__*/ (0,
|
|
112
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
109
113
|
inputProps: {
|
|
110
114
|
'aria-label': 'enter hex color'
|
|
111
115
|
},
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./ColorPicker"), 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,22 +16,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ContentWithLegend", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: ()
|
|
19
|
+
get: function() {
|
|
20
|
+
return ContentWithLegend;
|
|
21
|
+
}
|
|
20
22
|
});
|
|
21
|
-
const
|
|
22
|
-
const _react = /*#__PURE__*/
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
23
25
|
const _material = require("@mui/material");
|
|
24
26
|
const _core = require("@perses-dev/core");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
function
|
|
27
|
+
const _Legend = require("../Legend");
|
|
28
|
+
const _contentwithlegendmodel = require("./model/content-with-legend-model");
|
|
29
|
+
function _interop_require_default(obj) {
|
|
28
30
|
return obj && obj.__esModule ? obj : {
|
|
29
31
|
default: obj
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
function ContentWithLegend({ children
|
|
34
|
+
function ContentWithLegend({ children, legendProps, width, height, spacing = 0, legendSize, minChildrenWidth = 100, minChildrenHeight = 100 }) {
|
|
33
35
|
const theme = (0, _material.useTheme)();
|
|
34
|
-
const { content
|
|
36
|
+
const { content, legend, margin } = (0, _contentwithlegendmodel.getContentWithLegendLayout)({
|
|
35
37
|
width,
|
|
36
38
|
height,
|
|
37
39
|
legendProps,
|
|
@@ -41,7 +43,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
|
|
|
41
43
|
theme,
|
|
42
44
|
legendSize: (0, _core.getLegendSize)(legendSize)
|
|
43
45
|
});
|
|
44
|
-
return /*#__PURE__*/ (0,
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
45
47
|
sx: {
|
|
46
48
|
width,
|
|
47
49
|
height,
|
|
@@ -49,7 +51,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
|
|
|
49
51
|
overflow: 'hidden'
|
|
50
52
|
},
|
|
51
53
|
children: [
|
|
52
|
-
/*#__PURE__*/ (0,
|
|
54
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
53
55
|
sx: {
|
|
54
56
|
width: content.width,
|
|
55
57
|
height: content.height,
|
|
@@ -62,7 +64,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
|
|
|
62
64
|
height: content.height
|
|
63
65
|
}) : children
|
|
64
66
|
}),
|
|
65
|
-
legendProps && legend.show && /*#__PURE__*/ (0,
|
|
67
|
+
legendProps && legend.show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Legend.Legend, {
|
|
66
68
|
...legendProps,
|
|
67
69
|
height: legend.height,
|
|
68
70
|
width: legend.width
|
|
@@ -14,15 +14,17 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
function
|
|
17
|
+
_export_star(require("./ContentWithLegend"), 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
|
}
|
|
@@ -21,29 +21,33 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
TABLE_LEGEND_SIZE: ()
|
|
25
|
-
|
|
24
|
+
TABLE_LEGEND_SIZE: function() {
|
|
25
|
+
return TABLE_LEGEND_SIZE;
|
|
26
|
+
},
|
|
27
|
+
getContentWithLegendLayout: function() {
|
|
28
|
+
return getContentWithLegendLayout;
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
const _core = require("@perses-dev/core");
|
|
28
|
-
const
|
|
32
|
+
const _Table = require("../../Table");
|
|
29
33
|
const TABLE_LEGEND_SIZE = {
|
|
30
|
-
|
|
34
|
+
medium: {
|
|
31
35
|
// 5 rows plus header. Value to be multiplied by row height in pixels.
|
|
32
|
-
|
|
36
|
+
bottom: 6,
|
|
33
37
|
// Pixel value
|
|
34
|
-
|
|
38
|
+
right: 250
|
|
35
39
|
},
|
|
36
|
-
|
|
40
|
+
small: {
|
|
37
41
|
// 3 rows plus header. Value to be multiplied by row height in pixels.
|
|
38
|
-
|
|
42
|
+
bottom: 4,
|
|
39
43
|
// Pixel value
|
|
40
|
-
|
|
44
|
+
right: 150
|
|
41
45
|
}
|
|
42
46
|
};
|
|
43
47
|
const PANEL_HEIGHT_LG_BREAKPOINT = 300;
|
|
44
48
|
const LEGEND_HEIGHT_SM = 40;
|
|
45
49
|
const LEGEND_HEIGHT_LG = 100;
|
|
46
|
-
function getContentWithLegendLayout({ width
|
|
50
|
+
function getContentWithLegendLayout({ width, height, legendProps, legendSize, minChildrenHeight, minChildrenWidth, spacing, theme }) {
|
|
47
51
|
const legendOptions = legendProps === null || legendProps === void 0 ? void 0 : legendProps.options;
|
|
48
52
|
const hasLegend = !!legendOptions;
|
|
49
53
|
const noLegendLayout = {
|
|
@@ -64,40 +68,40 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
|
|
|
64
68
|
if (!hasLegend) {
|
|
65
69
|
return noLegendLayout;
|
|
66
70
|
}
|
|
67
|
-
const { position
|
|
71
|
+
const { position } = legendOptions;
|
|
68
72
|
const mode = (0, _core.getLegendMode)(legendOptions.mode);
|
|
69
73
|
let legendWidth;
|
|
70
74
|
let legendHeight;
|
|
71
|
-
if (mode === '
|
|
75
|
+
if (mode === 'list') {
|
|
72
76
|
// TODO: normalize list to share similar height options as the table
|
|
73
77
|
// when we add more size options.
|
|
74
|
-
legendWidth = position === '
|
|
78
|
+
legendWidth = position === 'right' ? 200 : width;
|
|
75
79
|
// TODO: account for number of legend items returned when adjusting legend spacing
|
|
76
80
|
legendHeight = LEGEND_HEIGHT_SM;
|
|
77
|
-
if (position === '
|
|
81
|
+
if (position === 'right') {
|
|
78
82
|
legendHeight = height;
|
|
79
83
|
} else if (height >= PANEL_HEIGHT_LG_BREAKPOINT) {
|
|
80
84
|
legendHeight = LEGEND_HEIGHT_LG;
|
|
81
85
|
}
|
|
82
86
|
} else {
|
|
83
|
-
var
|
|
87
|
+
var _legendProps_tableProps;
|
|
84
88
|
// Table mode
|
|
85
|
-
const tableLayout = (0,
|
|
86
|
-
const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (
|
|
89
|
+
const tableLayout = (0, _Table.getTableCellLayout)(theme, 'compact');
|
|
90
|
+
const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (_legendProps_tableProps = legendProps.tableProps) === null || _legendProps_tableProps === void 0 ? void 0 : _legendProps_tableProps.columns) || [];
|
|
87
91
|
const columnsWidth = tableColumns.reduce((total, col)=>{
|
|
88
92
|
if (typeof col.width === 'number') {
|
|
89
93
|
total += col.width;
|
|
90
94
|
}
|
|
91
95
|
return total;
|
|
92
96
|
}, 0);
|
|
93
|
-
legendWidth = position === '
|
|
97
|
+
legendWidth = position === 'right' ? TABLE_LEGEND_SIZE[legendSize]['right'] + columnsWidth : width;
|
|
94
98
|
// Use the smaller of the size-based row count or the number of legend items + 1 for the header.
|
|
95
|
-
const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['
|
|
96
|
-
legendHeight = position === '
|
|
99
|
+
const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['bottom'], legendProps.data.length + 1);
|
|
100
|
+
legendHeight = position === 'bottom' ? rowsToShow * tableLayout.height : height;
|
|
97
101
|
}
|
|
98
|
-
const contentWidth = position === '
|
|
99
|
-
const contentHeight = position === '
|
|
100
|
-
if (position === '
|
|
102
|
+
const contentWidth = position === 'right' ? width - legendWidth - spacing : width;
|
|
103
|
+
const contentHeight = position === 'bottom' ? height - legendHeight - spacing : height;
|
|
104
|
+
if (position === 'right' && contentWidth < minChildrenWidth || position === 'bottom' && contentHeight < minChildrenHeight) {
|
|
101
105
|
// Legend does not fit. Just show the content.
|
|
102
106
|
return noLegendLayout;
|
|
103
107
|
}
|
|
@@ -112,8 +116,8 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
|
|
|
112
116
|
height: contentHeight
|
|
113
117
|
},
|
|
114
118
|
margin: {
|
|
115
|
-
right: position === '
|
|
116
|
-
bottom: position === '
|
|
119
|
+
right: position === 'right' ? spacing : 0,
|
|
120
|
+
bottom: position === 'bottom' ? spacing : 0
|
|
117
121
|
}
|
|
118
122
|
};
|
|
119
123
|
}
|