@lincyaw/aegis-ui 0.10.0 → 0.12.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/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.d.ts +5 -0
- package/dist/agent/ask/AskPanel.js +105 -98
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/commands/commandContext.cjs.map +1 -1
- package/dist/commands/commandContext.d.ts +4 -1
- package/dist/commands/commandContext.js.map +1 -1
- package/dist/components/ui/AgentPanel.cjs +1 -1
- package/dist/components/ui/AgentPanel.cjs.map +1 -1
- package/dist/components/ui/AgentPanel.js +15 -14
- package/dist/components/ui/AgentPanel.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +1 -1
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +21 -19
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +16 -4
- package/dist/components/ui/BlastRadiusBar.js +27 -23
- package/dist/components/ui/BlastRadiusBar.js.map +1 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.ts +4 -2
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/ChatComposer.cjs +1 -1
- package/dist/components/ui/ChatComposer.cjs.map +1 -1
- package/dist/components/ui/ChatComposer.js +32 -31
- package/dist/components/ui/ChatComposer.js.map +1 -1
- package/dist/components/ui/ChatSessionList.cjs +1 -1
- package/dist/components/ui/ChatSessionList.cjs.map +1 -1
- package/dist/components/ui/ChatSessionList.js +68 -66
- package/dist/components/ui/ChatSessionList.js.map +1 -1
- package/dist/components/ui/CheckGrid.cjs +1 -1
- package/dist/components/ui/CheckGrid.cjs.map +1 -1
- package/dist/components/ui/CheckGrid.js +18 -17
- package/dist/components/ui/CheckGrid.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.d.ts +6 -2
- package/dist/components/ui/Checkbox.js +21 -17
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.d.ts +13 -4
- package/dist/components/ui/ChoiceCardGroup.js +47 -35
- package/dist/components/ui/ChoiceCardGroup.js.map +1 -1
- package/dist/components/ui/CodeEditor.cjs +1 -1
- package/dist/components/ui/CodeEditor.cjs.map +1 -1
- package/dist/components/ui/CodeEditor.d.ts +11 -1
- package/dist/components/ui/CodeEditor.js +108 -74
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
- package/dist/components/ui/CommandInvocationCard.js +23 -26
- package/dist/components/ui/CommandInvocationCard.js.map +1 -1
- package/dist/components/ui/CommandPalette.cjs +1 -1
- package/dist/components/ui/CommandPalette.cjs.map +1 -1
- package/dist/components/ui/CommandPalette.d.ts +3 -3
- package/dist/components/ui/CommandPalette.js +75 -75
- package/dist/components/ui/CommandPalette.js.map +1 -1
- package/dist/components/ui/CommitGraph.cjs +1 -1
- package/dist/components/ui/CommitGraph.cjs.map +1 -1
- package/dist/components/ui/CommitGraph.d.ts +3 -1
- package/dist/components/ui/CommitGraph.js +77 -74
- package/dist/components/ui/CommitGraph.js.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.js +25 -31
- package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
- package/dist/components/ui/ContentPreview.cjs +2 -2
- package/dist/components/ui/ContentPreview.cjs.map +1 -1
- package/dist/components/ui/ContentPreview.js +55 -56
- package/dist/components/ui/ContentPreview.js.map +1 -1
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +9 -8
- package/dist/components/ui/DangerZone.js.map +1 -1
- package/dist/components/ui/DataList.cjs +1 -1
- package/dist/components/ui/DataList.cjs.map +1 -1
- package/dist/components/ui/DataList.js +27 -25
- package/dist/components/ui/DataList.js.map +1 -1
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +2 -1
- package/dist/components/ui/DataTable.js +141 -124
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/DiffViewer.cjs +1 -1
- package/dist/components/ui/DiffViewer.cjs.map +1 -1
- package/dist/components/ui/DiffViewer.js +29 -25
- package/dist/components/ui/DiffViewer.js.map +1 -1
- package/dist/components/ui/DropdownMenu.cjs +1 -1
- package/dist/components/ui/DropdownMenu.cjs.map +1 -1
- package/dist/components/ui/DropdownMenu.d.ts +1 -0
- package/dist/components/ui/DropdownMenu.js +41 -40
- package/dist/components/ui/DropdownMenu.js.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.js +26 -24
- package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
- package/dist/components/ui/EventTable.cjs +1 -1
- package/dist/components/ui/EventTable.cjs.map +1 -1
- package/dist/components/ui/EventTable.js +60 -53
- package/dist/components/ui/EventTable.js.map +1 -1
- package/dist/components/ui/FileDropzone.cjs +1 -1
- package/dist/components/ui/FileDropzone.cjs.map +1 -1
- package/dist/components/ui/FileDropzone.js +40 -42
- package/dist/components/ui/FileDropzone.js.map +1 -1
- package/dist/components/ui/FilePreview.cjs +1 -1
- package/dist/components/ui/FilePreview.cjs.map +1 -1
- package/dist/components/ui/FilePreview.js +63 -61
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/FolderDropzone.cjs +1 -1
- package/dist/components/ui/FolderDropzone.cjs.map +1 -1
- package/dist/components/ui/FolderDropzone.js +114 -84
- package/dist/components/ui/FolderDropzone.js.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.js +22 -21
- package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
- package/dist/components/ui/FormRow.cjs +1 -1
- package/dist/components/ui/FormRow.cjs.map +1 -1
- package/dist/components/ui/FormRow.d.ts +32 -11
- package/dist/components/ui/FormRow.js +24 -15
- package/dist/components/ui/FormRow.js.map +1 -1
- package/dist/components/ui/InboxPage.cjs +1 -1
- package/dist/components/ui/InboxPage.cjs.map +1 -1
- package/dist/components/ui/InboxPage.d.ts +12 -3
- package/dist/components/ui/InboxPage.js +91 -77
- package/dist/components/ui/InboxPage.js.map +1 -1
- package/dist/components/ui/LoginForm.cjs +1 -1
- package/dist/components/ui/LoginForm.cjs.map +1 -1
- package/dist/components/ui/LoginForm.js +43 -43
- package/dist/components/ui/LoginForm.js.map +1 -1
- package/dist/components/ui/MonoValue.cjs +1 -1
- package/dist/components/ui/MonoValue.cjs.map +1 -1
- package/dist/components/ui/MonoValue.d.ts +5 -1
- package/dist/components/ui/MonoValue.js +17 -17
- package/dist/components/ui/MonoValue.js.map +1 -1
- package/dist/components/ui/NotificationBell.cjs +1 -1
- package/dist/components/ui/NotificationBell.cjs.map +1 -1
- package/dist/components/ui/NotificationBell.d.ts +17 -1
- package/dist/components/ui/NotificationBell.js +129 -75
- package/dist/components/ui/NotificationBell.js.map +1 -1
- package/dist/components/ui/NumberField.cjs +1 -1
- package/dist/components/ui/NumberField.cjs.map +1 -1
- package/dist/components/ui/NumberField.d.ts +3 -1
- package/dist/components/ui/NumberField.js +52 -49
- package/dist/components/ui/NumberField.js.map +1 -1
- package/dist/components/ui/ObjectBrowser.cjs +1 -1
- package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
- package/dist/components/ui/ObjectBrowser.js +83 -78
- package/dist/components/ui/ObjectBrowser.js.map +1 -1
- package/dist/components/ui/PageSizeSelect.cjs +1 -1
- package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
- package/dist/components/ui/PageSizeSelect.js +30 -29
- package/dist/components/ui/PageSizeSelect.js.map +1 -1
- package/dist/components/ui/Panel.cjs.map +1 -1
- package/dist/components/ui/Panel.d.ts +5 -2
- package/dist/components/ui/Panel.js.map +1 -1
- package/dist/components/ui/ParetoChart.cjs +1 -1
- package/dist/components/ui/ParetoChart.cjs.map +1 -1
- package/dist/components/ui/ParetoChart.js +247 -212
- package/dist/components/ui/ParetoChart.js.map +1 -1
- package/dist/components/ui/ParquetViewer.cjs +1 -1
- package/dist/components/ui/ParquetViewer.cjs.map +1 -1
- package/dist/components/ui/ParquetViewer.js +69 -74
- package/dist/components/ui/ParquetViewer.js.map +1 -1
- package/dist/components/ui/PasswordField.cjs +1 -1
- package/dist/components/ui/PasswordField.cjs.map +1 -1
- package/dist/components/ui/PasswordField.js +28 -27
- package/dist/components/ui/PasswordField.js.map +1 -1
- package/dist/components/ui/PickerField.cjs +1 -1
- package/dist/components/ui/PickerField.cjs.map +1 -1
- package/dist/components/ui/PickerField.d.ts +25 -6
- package/dist/components/ui/PickerField.js +20 -17
- package/dist/components/ui/PickerField.js.map +1 -1
- package/dist/components/ui/ProjectSelector.cjs +1 -1
- package/dist/components/ui/ProjectSelector.cjs.map +1 -1
- package/dist/components/ui/ProjectSelector.js +40 -37
- package/dist/components/ui/ProjectSelector.js.map +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
- package/dist/components/ui/QueryAutocomplete.d.ts +11 -2
- package/dist/components/ui/QueryAutocomplete.js +146 -126
- package/dist/components/ui/QueryAutocomplete.js.map +1 -1
- package/dist/components/ui/RankBar.cjs +1 -1
- package/dist/components/ui/RankBar.cjs.map +1 -1
- package/dist/components/ui/RankBar.js +9 -9
- package/dist/components/ui/RankBar.js.map +1 -1
- package/dist/components/ui/RegisterForm.cjs +1 -1
- package/dist/components/ui/RegisterForm.cjs.map +1 -1
- package/dist/components/ui/RegisterForm.js +41 -40
- package/dist/components/ui/RegisterForm.js.map +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs.map +1 -1
- package/dist/components/ui/ReplayStepStrip.d.ts +6 -3
- package/dist/components/ui/ReplayStepStrip.js +71 -61
- package/dist/components/ui/ReplayStepStrip.js.map +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
- package/dist/components/ui/ResizableSidePanel.js +41 -40
- package/dist/components/ui/ResizableSidePanel.js.map +1 -1
- package/dist/components/ui/SavedQueryBar.cjs +1 -1
- package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
- package/dist/components/ui/SavedQueryBar.d.ts +1 -1
- package/dist/components/ui/SavedQueryBar.js +375 -277
- package/dist/components/ui/SavedQueryBar.js.map +1 -1
- package/dist/components/ui/SearchInput.cjs +1 -1
- package/dist/components/ui/SearchInput.cjs.map +1 -1
- package/dist/components/ui/SearchInput.d.ts +5 -1
- package/dist/components/ui/SearchInput.js +28 -24
- package/dist/components/ui/SearchInput.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +3 -1
- package/dist/components/ui/Select.js +21 -19
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/ServiceMap.cjs +1 -1
- package/dist/components/ui/ServiceMap.cjs.map +1 -1
- package/dist/components/ui/ServiceMap.d.ts +18 -4
- package/dist/components/ui/ServiceMap.js +353 -228
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/Slider.cjs +1 -1
- package/dist/components/ui/Slider.cjs.map +1 -1
- package/dist/components/ui/Slider.d.ts +3 -1
- package/dist/components/ui/Slider.js +11 -9
- package/dist/components/ui/Slider.js.map +1 -1
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.d.ts +5 -2
- package/dist/components/ui/SparkLine.js +36 -31
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/Steps.cjs +1 -1
- package/dist/components/ui/Steps.cjs.map +1 -1
- package/dist/components/ui/Steps.js +25 -29
- package/dist/components/ui/Steps.js.map +1 -1
- package/dist/components/ui/TableOfContents.cjs +1 -1
- package/dist/components/ui/TableOfContents.cjs.map +1 -1
- package/dist/components/ui/TableOfContents.js +16 -19
- package/dist/components/ui/TableOfContents.js.map +1 -1
- package/dist/components/ui/Tabs.cjs +2 -2
- package/dist/components/ui/Tabs.cjs.map +1 -1
- package/dist/components/ui/Tabs.js +107 -87
- package/dist/components/ui/Tabs.js.map +1 -1
- package/dist/components/ui/Terminal.cjs +1 -1
- package/dist/components/ui/Terminal.cjs.map +1 -1
- package/dist/components/ui/Terminal.js +18 -17
- package/dist/components/ui/Terminal.js.map +1 -1
- package/dist/components/ui/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +6 -6
- package/dist/components/ui/TextField.js.map +1 -1
- package/dist/components/ui/ThemeToggle.cjs +1 -1
- package/dist/components/ui/ThemeToggle.cjs.map +1 -1
- package/dist/components/ui/ThemeToggle.js +15 -18
- package/dist/components/ui/ThemeToggle.js.map +1 -1
- package/dist/components/ui/TimeDisplay.cjs +1 -1
- package/dist/components/ui/TimeDisplay.cjs.map +1 -1
- package/dist/components/ui/TimeDisplay.js +12 -12
- package/dist/components/ui/TimeDisplay.js.map +1 -1
- package/dist/components/ui/TimeRangePicker.cjs +1 -1
- package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
- package/dist/components/ui/TimeRangePicker.d.ts +12 -1
- package/dist/components/ui/TimeRangePicker.js +136 -113
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/Timeline.cjs.map +1 -1
- package/dist/components/ui/Timeline.d.ts +4 -4
- package/dist/components/ui/Timeline.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +2 -2
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +1 -0
- package/dist/components/ui/TimelineChart.js +131 -137
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
- package/dist/components/ui/TraceSpanInspector.js +43 -46
- package/dist/components/ui/TraceSpanInspector.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +5 -1
- package/dist/components/ui/TraceTree.js +98 -97
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/TrajectoryStep.cjs +2 -1
- package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
- package/dist/components/ui/TrajectoryStep.js +64 -43
- package/dist/components/ui/TrajectoryStep.js.map +1 -1
- package/dist/components/ui/UploadQueue.cjs +1 -1
- package/dist/components/ui/UploadQueue.cjs.map +1 -1
- package/dist/components/ui/UploadQueue.js +59 -70
- package/dist/components/ui/UploadQueue.js.map +1 -1
- package/dist/components/ui/authValidation.cjs +1 -1
- package/dist/components/ui/authValidation.cjs.map +1 -1
- package/dist/components/ui/authValidation.d.ts +2 -2
- package/dist/components/ui/authValidation.js +4 -5
- package/dist/components/ui/authValidation.js.map +1 -1
- package/dist/components/ui/classifyContent.cjs +3 -3
- package/dist/components/ui/classifyContent.cjs.map +1 -1
- package/dist/components/ui/classifyContent.d.ts +2 -1
- package/dist/components/ui/classifyContent.js +52 -54
- package/dist/components/ui/classifyContent.js.map +1 -1
- package/dist/components/ui/relativeTime.cjs +1 -1
- package/dist/components/ui/relativeTime.cjs.map +1 -1
- package/dist/components/ui/relativeTime.d.ts +5 -3
- package/dist/components/ui/relativeTime.js +15 -6
- package/dist/components/ui/relativeTime.js.map +1 -1
- package/dist/components/ui/useColumnWidths.cjs +1 -1
- package/dist/components/ui/useColumnWidths.cjs.map +1 -1
- package/dist/components/ui/useColumnWidths.d.ts +6 -1
- package/dist/components/ui/useColumnWidths.js +139 -123
- package/dist/components/ui/useColumnWidths.js.map +1 -1
- package/dist/hooks/popoverOverflow.cjs +2 -0
- package/dist/hooks/popoverOverflow.cjs.map +1 -0
- package/dist/hooks/popoverOverflow.d.ts +8 -0
- package/dist/hooks/popoverOverflow.js +9 -0
- package/dist/hooks/popoverOverflow.js.map +1 -0
- package/dist/hooks/useDialogPopover.cjs +2 -0
- package/dist/hooks/useDialogPopover.cjs.map +1 -0
- package/dist/hooks/useDialogPopover.d.ts +23 -0
- package/dist/hooks/useDialogPopover.js +48 -0
- package/dist/hooks/useDialogPopover.js.map +1 -0
- package/dist/hooks/useMenuPopover.cjs +1 -1
- package/dist/hooks/useMenuPopover.cjs.map +1 -1
- package/dist/hooks/useMenuPopover.d.ts +0 -8
- package/dist/hooks/useMenuPopover.js +17 -22
- package/dist/hooks/useMenuPopover.js.map +1 -1
- package/dist/hooks/useSavedQueries.cjs +1 -1
- package/dist/hooks/useSavedQueries.cjs.map +1 -1
- package/dist/hooks/useSavedQueries.js +29 -28
- package/dist/hooks/useSavedQueries.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +58 -59
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
- package/dist/layouts/shell/AppSwitcher.js +53 -36
- package/dist/layouts/shell/AppSwitcher.js.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.js +24 -22
- package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.d.ts +4 -1
- package/dist/layouts/shell/RouteErrorBoundary.js +15 -10
- package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.js +17 -16
- package/dist/layouts/shell/ShellInboxPage.js.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.js +20 -14
- package/dist/layouts/shell/ShellNotificationBell.js.map +1 -1
- package/dist/layouts/shell/TopHeader.cjs +1 -1
- package/dist/layouts/shell/TopHeader.cjs.map +1 -1
- package/dist/layouts/shell/TopHeader.js +74 -74
- package/dist/layouts/shell/TopHeader.js.map +1 -1
- package/dist/layouts/shell/useShellUser.cjs +1 -1
- package/dist/layouts/shell/useShellUser.cjs.map +1 -1
- package/dist/layouts/shell/useShellUser.js +15 -13
- package/dist/layouts/shell/useShellUser.js.map +1 -1
- package/dist/lib/breakAtSeparators.cjs +2 -0
- package/dist/lib/breakAtSeparators.cjs.map +1 -0
- package/dist/lib/breakAtSeparators.d.ts +6 -0
- package/dist/lib/breakAtSeparators.js +10 -0
- package/dist/lib/breakAtSeparators.js.map +1 -0
- package/dist/lib/chart.cjs +1 -1
- package/dist/lib/chart.cjs.map +1 -1
- package/dist/lib/chart.d.ts +5 -7
- package/dist/lib/chart.js +49 -34
- package/dist/lib/chart.js.map +1 -1
- package/dist/lib/timeRange.cjs +1 -1
- package/dist/lib/timeRange.cjs.map +1 -1
- package/dist/lib/timeRange.d.ts +14 -4
- package/dist/lib/timeRange.js +41 -40
- package/dist/lib/timeRange.js.map +1 -1
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +247 -2
- package/dist/locale/strings.js +562 -37
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +12 -2
- package/dist/notifications/notificationContext.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.js +52 -29
- package/dist/theme/antdTheme.js.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.js +66 -61
- package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
1
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { useId as h } from "react";
|
|
3
3
|
import { DownOutlined as z } from "@ant-design/icons";
|
|
4
|
-
import { Popover as
|
|
5
|
-
import {
|
|
4
|
+
import { Popover as O } from "antd";
|
|
5
|
+
import { POPOVER_OVERFLOW as N } from "../../hooks/popoverOverflow.js";
|
|
6
|
+
import { useMenuPopover as y } from "../../hooks/useMenuPopover.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { useStrings as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
value:
|
|
11
|
-
onChange:
|
|
12
|
-
options:
|
|
8
|
+
import { useStrings as P } from "../../locale/useStrings.js";
|
|
9
|
+
const w = [10, 20, 50, 100];
|
|
10
|
+
function k({
|
|
11
|
+
value: i,
|
|
12
|
+
onChange: p,
|
|
13
|
+
options: g = w,
|
|
13
14
|
disabled: t = !1,
|
|
14
|
-
label:
|
|
15
|
-
className:
|
|
16
|
-
placement:
|
|
15
|
+
label: m,
|
|
16
|
+
className: d,
|
|
17
|
+
placement: _ = "top"
|
|
17
18
|
}) {
|
|
18
|
-
const
|
|
19
|
-
e.close(), a !==
|
|
19
|
+
const l = P(), o = m ?? l.rowsPerPage, n = h(), e = y(), f = ["aegis-page-size-select", d ?? ""].filter(Boolean).join(" "), u = (a) => {
|
|
20
|
+
e.close(), a !== i && p(a);
|
|
20
21
|
}, b = /* @__PURE__ */ s(
|
|
21
22
|
"ul",
|
|
22
23
|
{
|
|
@@ -25,20 +26,20 @@ function S({
|
|
|
25
26
|
role: "listbox",
|
|
26
27
|
tabIndex: -1,
|
|
27
28
|
onKeyDown: e.onPanelKeyDown,
|
|
28
|
-
children:
|
|
29
|
-
const
|
|
29
|
+
children: g.map((a) => {
|
|
30
|
+
const r = a === i;
|
|
30
31
|
return /* @__PURE__ */ s("li", { role: "presentation", children: /* @__PURE__ */ s(
|
|
31
32
|
"button",
|
|
32
33
|
{
|
|
33
34
|
type: "button",
|
|
34
35
|
role: "option",
|
|
35
|
-
"aria-selected":
|
|
36
|
+
"aria-selected": r,
|
|
36
37
|
className: [
|
|
37
38
|
"aegis-page-size-select__item",
|
|
38
|
-
|
|
39
|
+
r ? "aegis-page-size-select__item--selected" : ""
|
|
39
40
|
].filter(Boolean).join(" "),
|
|
40
41
|
onClick: () => {
|
|
41
|
-
|
|
42
|
+
u(a);
|
|
42
43
|
},
|
|
43
44
|
children: /* @__PURE__ */ s("span", { className: "aegis-page-size-select__item-value", children: a })
|
|
44
45
|
}
|
|
@@ -46,21 +47,21 @@ function S({
|
|
|
46
47
|
})
|
|
47
48
|
}
|
|
48
49
|
);
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
50
|
+
return /* @__PURE__ */ c("div", { className: f, children: [
|
|
51
|
+
o && /* @__PURE__ */ s("span", { className: "aegis-page-size-select__label", id: n, children: o }),
|
|
51
52
|
/* @__PURE__ */ s(
|
|
52
|
-
|
|
53
|
+
O,
|
|
53
54
|
{
|
|
54
55
|
content: b,
|
|
55
56
|
trigger: "click",
|
|
56
57
|
open: t ? !1 : e.open,
|
|
57
58
|
onOpenChange: e.setOpen,
|
|
58
|
-
placement:
|
|
59
|
-
autoAdjustOverflow:
|
|
59
|
+
placement: _ === "top" ? "topRight" : "bottomRight",
|
|
60
|
+
autoAdjustOverflow: N,
|
|
60
61
|
arrow: !1,
|
|
61
62
|
classNames: { root: "aegis-page-size-select__overlay" },
|
|
62
63
|
destroyOnHidden: !0,
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ c(
|
|
64
65
|
"button",
|
|
65
66
|
{
|
|
66
67
|
ref: e.triggerRef,
|
|
@@ -68,12 +69,12 @@ function S({
|
|
|
68
69
|
className: "aegis-page-size-select__trigger",
|
|
69
70
|
"aria-haspopup": "listbox",
|
|
70
71
|
"aria-expanded": e.open,
|
|
71
|
-
"aria-labelledby":
|
|
72
|
-
"aria-label":
|
|
72
|
+
"aria-labelledby": o ? n : void 0,
|
|
73
|
+
"aria-label": o ? void 0 : l.pageSize,
|
|
73
74
|
disabled: t,
|
|
74
75
|
onKeyDown: e.onTriggerKeyDown,
|
|
75
76
|
children: [
|
|
76
|
-
/* @__PURE__ */ s("span", { className: "aegis-page-size-select__value", children:
|
|
77
|
+
/* @__PURE__ */ s("span", { className: "aegis-page-size-select__value", children: i }),
|
|
77
78
|
/* @__PURE__ */ s(z, { className: "aegis-page-size-select__caret", "aria-hidden": !0 })
|
|
78
79
|
]
|
|
79
80
|
}
|
|
@@ -83,6 +84,6 @@ function S({
|
|
|
83
84
|
] });
|
|
84
85
|
}
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
+
k as PageSizeSelect
|
|
87
88
|
};
|
|
88
89
|
//# sourceMappingURL=PageSizeSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSizeSelect.js","sources":["../../../src/components/ui/PageSizeSelect.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { DownOutlined } from '@ant-design/icons';\nimport { Popover } from 'antd';\n\nimport {
|
|
1
|
+
{"version":3,"file":"PageSizeSelect.js","sources":["../../../src/components/ui/PageSizeSelect.tsx"],"sourcesContent":["import { type ReactElement, useId } from 'react';\n\nimport { DownOutlined } from '@ant-design/icons';\nimport { Popover } from 'antd';\n\nimport { POPOVER_OVERFLOW } from '../../hooks/popoverOverflow';\nimport { useMenuPopover } from '../../hooks/useMenuPopover';\nimport { useStrings } from '../../locale';\nimport './PageSizeSelect.css';\n\nexport interface PageSizeSelectProps {\n value: number;\n onChange: (next: number) => void;\n options?: number[];\n disabled?: boolean;\n /** Defaults to the locale's \"rows per page\"; pass '' to hide the caption. */\n label?: string;\n className?: string;\n /**\n * Preferred side for the options panel: `top` (default) for a pager\n * under a table, `bottom` for a trigger at the top of a section. The panel\n * flips when the preferred side has no room.\n */\n placement?: 'top' | 'bottom';\n}\n\nconst DEFAULT_OPTIONS: readonly number[] = [10, 20, 50, 100];\n\nexport function PageSizeSelect({\n value,\n onChange,\n options = DEFAULT_OPTIONS as number[],\n disabled = false,\n label: labelProp,\n className,\n placement = 'top',\n}: PageSizeSelectProps): ReactElement {\n const strings = useStrings();\n const label = labelProp ?? strings.rowsPerPage;\n const labelId = useId();\n const menu = useMenuPopover<HTMLUListElement>();\n\n const cls = ['aegis-page-size-select', className ?? '']\n .filter(Boolean)\n .join(' ');\n\n const pickOption = (next: number): void => {\n menu.close();\n if (next !== value) {\n onChange(next);\n }\n };\n\n const panel = (\n <ul\n ref={menu.panelRef}\n className=\"aegis-page-size-select__panel\"\n role=\"listbox\"\n tabIndex={-1}\n onKeyDown={menu.onPanelKeyDown}\n >\n {options.map((opt) => {\n const selected = opt === value;\n return (\n <li key={opt} role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n aria-selected={selected}\n className={[\n 'aegis-page-size-select__item',\n selected ? 'aegis-page-size-select__item--selected' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n pickOption(opt);\n }}\n >\n <span className=\"aegis-page-size-select__item-value\">{opt}</span>\n </button>\n </li>\n );\n })}\n </ul>\n );\n\n return (\n <div className={cls}>\n {label && (\n <span className=\"aegis-page-size-select__label\" id={labelId}>\n {label}\n </span>\n )}\n <Popover\n content={panel}\n trigger=\"click\"\n open={disabled ? false : menu.open}\n onOpenChange={menu.setOpen}\n placement={placement === 'top' ? 'topRight' : 'bottomRight'}\n autoAdjustOverflow={POPOVER_OVERFLOW}\n arrow={false}\n classNames={{ root: 'aegis-page-size-select__overlay' }}\n destroyOnHidden\n >\n <button\n ref={menu.triggerRef}\n type=\"button\"\n className=\"aegis-page-size-select__trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={menu.open}\n aria-labelledby={label ? labelId : undefined}\n aria-label={!label ? strings.pageSize : undefined}\n disabled={disabled}\n onKeyDown={menu.onTriggerKeyDown}\n >\n <span className=\"aegis-page-size-select__value\">{value}</span>\n <DownOutlined className=\"aegis-page-size-select__caret\" aria-hidden />\n </button>\n </Popover>\n </div>\n );\n}\n"],"names":["DEFAULT_OPTIONS","PageSizeSelect","value","onChange","options","disabled","labelProp","className","placement","strings","useStrings","label","labelId","useId","menu","useMenuPopover","cls","pickOption","next","panel","jsx","opt","selected","jsxs","Popover","POPOVER_OVERFLOW","DownOutlined"],"mappings":";;;;;;;;AA0BA,MAAMA,IAAqC,CAAC,IAAI,IAAI,IAAI,GAAG;AAEpD,SAASC,EAAe;AAAA,EAC7B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAUJ;AAAA,EACV,UAAAK,IAAW;AAAA,EACX,OAAOC;AAAA,EACP,WAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAsC;AACpC,QAAMC,IAAUC,EAAA,G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;AAAA,QAC9C,oBAAoBiB;AAAA,QACpB,OAAO;AAAA,QACP,YAAY,EAAE,MAAM,kCAAA;AAAA,QACpB,iBAAe;AAAA,QAEf,UAAA,gBAAAF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAKT,EAAK;AAAA,YACV,MAAK;AAAA,YACL,WAAU;AAAA,YACV,iBAAc;AAAA,YACd,iBAAeA,EAAK;AAAA,YACpB,mBAAiBH,IAAQC,IAAU;AAAA,YACnC,cAAaD,IAA2B,SAAnBF,EAAQ;AAAA,YAC7B,UAAAJ;AAAA,YACA,WAAWS,EAAK;AAAA,YAEhB,UAAA;AAAA,cAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,iCAAiC,UAAAlB,GAAM;AAAA,cACvD,gBAAAkB,EAACM,GAAA,EAAa,WAAU,iCAAgC,eAAW,GAAA,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACtE;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.cjs","sources":["../../../src/components/ui/Panel.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useId, useRef } from 'react';\n\nimport {\n type ContainerSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './Panel.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type PanelSurface = ContainerSurface;\n\n/**\n * `tint` for showcase blocks on overview and article pages, `brand` for\n * featured content, `glass` for a panel laid over a gradient or image.\n */\nexport type PanelVariant = 'solid' | 'tint' | 'brand' | 'glass';\n\n
|
|
1
|
+
{"version":3,"file":"Panel.cjs","sources":["../../../src/components/ui/Panel.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useId, useRef } from 'react';\n\nimport {\n type ContainerSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './Panel.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type PanelSurface = ContainerSurface;\n\n/**\n * `tint` for showcase blocks on overview and article pages, `brand` for\n * featured content, `glass` for a panel laid over a gradient or image.\n */\nexport type PanelVariant = 'solid' | 'tint' | 'brand' | 'glass';\n\n/**\n * `raised` lifts featured and hero cards above the resting cards. `flat`\n * casts no shadow, for a panel inside another panel: one shadow per layer.\n */\nexport type PanelElevation = 'rest' | 'raised' | 'flat';\n\ninterface PanelBaseProps {\n /**\n * Muted line under the title, e.g. a chart's metric and direction. Shows\n * the header on its own, as `title` does.\n */\n description?: ReactNode;\n /** Controls at the header's end. Show the header on their own, as `title` does. */\n extra?: ReactNode;\n variant?: PanelVariant;\n elevation?: PanelElevation;\n /** False drops the body padding, e.g. for a table that fills the panel. */\n padded?: boolean;\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n surface?: PanelSurface;\n}\n\ninterface PanelStaticProps extends PanelBaseProps {\n /**\n * The panel's heading, and the accessible name of the panel, which is then\n * a `region`. The header shows when `title`, `description` or `extra` has\n * content, i.e. anything React renders: `0` counts, while `undefined`,\n * `null`, `true`, `false` and `''` do not.\n */\n title?: ReactNode;\n to?: undefined;\n linkComponent?: undefined;\n}\n\ninterface PanelLinkProps extends PanelBaseProps {\n /** The link's text, and the panel's accessible name; the link covers the whole panel. */\n title: ReactNode;\n /**\n * Destination; the panel lifts on hover. Controls belong in `extra`,\n * which stays clickable above the link; the body is part of the link.\n */\n to: string;\n /** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */\n linkComponent?: LinkComponent;\n}\n\ntype PanelProps = PanelStaticProps | PanelLinkProps;\n\nfunction hasContent(node: ReactNode): boolean {\n return (\n node !== undefined &&\n node !== null &&\n typeof node !== 'boolean' &&\n node !== ''\n );\n}\n\nexport function Panel({\n title,\n description,\n extra,\n variant = 'solid',\n elevation = 'rest',\n padded = true,\n to,\n linkComponent,\n className,\n style,\n children,\n surface,\n}: PanelProps) {\n const wrapRef = useRef<HTMLElement>(null);\n const titleId = useId();\n const agentAttrs = usePrimitiveSurface(surface, null, 'panel', wrapRef);\n const LinkImpl = linkComponent ?? DefaultLink;\n const rootClass = [\n 'aegis-panel',\n `aegis-panel--${variant}`,\n `aegis-panel--${elevation}`,\n to === undefined ? '' : 'aegis-panel--link',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const hasDescription = hasContent(description);\n const hasExtra = hasContent(extra);\n const hasTitle = hasContent(title);\n const showHeader = hasTitle || hasDescription || hasExtra;\n const titleText = !hasTitle ? null : typeof title === 'string' ? (\n <span id={titleId} className=\"aegis-panel__title\">\n {title}\n </span>\n ) : (\n <span id={titleId}>{title}</span>\n );\n const titleNode =\n to === undefined ? (\n titleText\n ) : (\n <LinkImpl to={to} className=\"aegis-panel__link\">\n {titleText}\n </LinkImpl>\n );\n\n return (\n <section\n ref={wrapRef}\n className={rootClass}\n style={style}\n aria-labelledby={hasTitle ? titleId : undefined}\n {...agentAttrs}\n >\n {showHeader && (\n <header className=\"aegis-panel__header\">\n {!hasDescription ? (\n titleNode\n ) : (\n <div className=\"aegis-panel__heading\">\n {titleNode}\n <span className=\"aegis-panel__description\">{description}</span>\n </div>\n )}\n {hasExtra && <div className=\"aegis-panel__extra\">{extra}</div>}\n </header>\n )}\n <div\n className={`aegis-panel__body${padded ? ' aegis-panel__body--padded' : ''}`}\n >\n {children}\n </div>\n </section>\n );\n}\n"],"names":["hasContent","node","Panel","title","description","extra","variant","elevation","padded","to","linkComponent","className","style","children","surface","wrapRef","useRef","titleId","useId","agentAttrs","usePrimitiveSurface","LinkImpl","DefaultLink","rootClass","hasDescription","hasExtra","hasTitle","showHeader","titleText","jsx","titleNode","jsxs"],"mappings":"gQAmEA,SAASA,EAAWC,EAA0B,CAC5C,OAEEA,GAAS,MACT,OAAOA,GAAS,WAChBA,IAAS,EAEb,CAEO,SAASC,EAAM,CACpB,MAAAC,EACA,YAAAC,EACA,MAAAC,EACA,QAAAC,EAAU,QACV,UAAAC,EAAY,OACZ,OAAAC,EAAS,GACT,GAA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6BAA+B,EAAE,GAExE,SAAAK,CAAA,CAAA,CACH,CAAA,CAAA,CAGN"}
|
|
@@ -7,8 +7,11 @@ export type PanelSurface = ContainerSurface;
|
|
|
7
7
|
* featured content, `glass` for a panel laid over a gradient or image.
|
|
8
8
|
*/
|
|
9
9
|
export type PanelVariant = 'solid' | 'tint' | 'brand' | 'glass';
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* `raised` lifts featured and hero cards above the resting cards. `flat`
|
|
12
|
+
* casts no shadow, for a panel inside another panel: one shadow per layer.
|
|
13
|
+
*/
|
|
14
|
+
export type PanelElevation = 'rest' | 'raised' | 'flat';
|
|
12
15
|
interface PanelBaseProps {
|
|
13
16
|
/**
|
|
14
17
|
* Muted line under the title, e.g. a chart's metric and direction. Shows
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.js","sources":["../../../src/components/ui/Panel.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useId, useRef } from 'react';\n\nimport {\n type ContainerSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './Panel.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type PanelSurface = ContainerSurface;\n\n/**\n * `tint` for showcase blocks on overview and article pages, `brand` for\n * featured content, `glass` for a panel laid over a gradient or image.\n */\nexport type PanelVariant = 'solid' | 'tint' | 'brand' | 'glass';\n\n
|
|
1
|
+
{"version":3,"file":"Panel.js","sources":["../../../src/components/ui/Panel.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useId, useRef } from 'react';\n\nimport {\n type ContainerSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './Panel.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\n\nexport type PanelSurface = ContainerSurface;\n\n/**\n * `tint` for showcase blocks on overview and article pages, `brand` for\n * featured content, `glass` for a panel laid over a gradient or image.\n */\nexport type PanelVariant = 'solid' | 'tint' | 'brand' | 'glass';\n\n/**\n * `raised` lifts featured and hero cards above the resting cards. `flat`\n * casts no shadow, for a panel inside another panel: one shadow per layer.\n */\nexport type PanelElevation = 'rest' | 'raised' | 'flat';\n\ninterface PanelBaseProps {\n /**\n * Muted line under the title, e.g. a chart's metric and direction. Shows\n * the header on its own, as `title` does.\n */\n description?: ReactNode;\n /** Controls at the header's end. Show the header on their own, as `title` does. */\n extra?: ReactNode;\n variant?: PanelVariant;\n elevation?: PanelElevation;\n /** False drops the body padding, e.g. for a table that fills the panel. */\n padded?: boolean;\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n surface?: PanelSurface;\n}\n\ninterface PanelStaticProps extends PanelBaseProps {\n /**\n * The panel's heading, and the accessible name of the panel, which is then\n * a `region`. The header shows when `title`, `description` or `extra` has\n * content, i.e. anything React renders: `0` counts, while `undefined`,\n * `null`, `true`, `false` and `''` do not.\n */\n title?: ReactNode;\n to?: undefined;\n linkComponent?: undefined;\n}\n\ninterface PanelLinkProps extends PanelBaseProps {\n /** The link's text, and the panel's accessible name; the link covers the whole panel. */\n title: ReactNode;\n /**\n * Destination; the panel lifts on hover. Controls belong in `extra`,\n * which stays clickable above the link; the body is part of the link.\n */\n to: string;\n /** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */\n linkComponent?: LinkComponent;\n}\n\ntype PanelProps = PanelStaticProps | PanelLinkProps;\n\nfunction hasContent(node: ReactNode): boolean {\n return (\n node !== undefined &&\n node !== null &&\n typeof node !== 'boolean' &&\n node !== ''\n );\n}\n\nexport function Panel({\n title,\n description,\n extra,\n variant = 'solid',\n elevation = 'rest',\n padded = true,\n to,\n linkComponent,\n className,\n style,\n children,\n surface,\n}: PanelProps) {\n const wrapRef = useRef<HTMLElement>(null);\n const titleId = useId();\n const agentAttrs = usePrimitiveSurface(surface, null, 'panel', wrapRef);\n const LinkImpl = linkComponent ?? DefaultLink;\n const rootClass = [\n 'aegis-panel',\n `aegis-panel--${variant}`,\n `aegis-panel--${elevation}`,\n to === undefined ? '' : 'aegis-panel--link',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const hasDescription = hasContent(description);\n const hasExtra = hasContent(extra);\n const hasTitle = hasContent(title);\n const showHeader = hasTitle || hasDescription || hasExtra;\n const titleText = !hasTitle ? null : typeof title === 'string' ? (\n <span id={titleId} className=\"aegis-panel__title\">\n {title}\n </span>\n ) : (\n <span id={titleId}>{title}</span>\n );\n const titleNode =\n to === undefined ? (\n titleText\n ) : (\n <LinkImpl to={to} className=\"aegis-panel__link\">\n {titleText}\n </LinkImpl>\n );\n\n return (\n <section\n ref={wrapRef}\n className={rootClass}\n style={style}\n aria-labelledby={hasTitle ? titleId : undefined}\n {...agentAttrs}\n >\n {showHeader && (\n <header className=\"aegis-panel__header\">\n {!hasDescription ? (\n titleNode\n ) : (\n <div className=\"aegis-panel__heading\">\n {titleNode}\n <span className=\"aegis-panel__description\">{description}</span>\n </div>\n )}\n {hasExtra && <div className=\"aegis-panel__extra\">{extra}</div>}\n </header>\n )}\n <div\n className={`aegis-panel__body${padded ? ' aegis-panel__body--padded' : ''}`}\n >\n {children}\n </div>\n </section>\n );\n}\n"],"names":["hasContent","node","Panel","title","description","extra","variant","elevation","padded","to","linkComponent","className","style","children","surface","wrapRef","useRef","titleId","useId","agentAttrs","usePrimitiveSurface","LinkImpl","DefaultLink","rootClass","hasDescription","hasExtra","hasTitle","showHeader","titleText","jsx","titleNode","jsxs"],"mappings":";;;;;AAmEA,SAASA,EAAWC,GAA0B;AAC5C,SAEEA,KAAS,QACT,OAAOA,KAAS,aAChBA,MAAS;AAEb;AAEO,SAASC,EAAM;AAAA,EACpB,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,QAAAC,IAAS;AAAA,EACT,IAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;A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D;AAAA,QAEF,gBAAAwB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,oBAAoBrB,IAAS,+BAA+B,EAAE;AAAA,YAExE,UAAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),ae=require("react"),Ae=require("../../hooks/useElementWidth.cjs"),C=require("../../lib/chart.cjs"),Le=require("./ChartLegend.cjs"),Ne=require("./EmptyState.cjs");;/* empty css */const Ee=require("../../locale/useStrings.cjs"),Me=320,fe=220,Pe=56,Ie=16,we=28,Be=44,$=5,j=8,ue=4,Se=6.2,Ce=11,A=14,F=A/4,$e=520;function Y(t,g,x){return x==="lower"?t<g:t>g}function pe(t){return[...t].reduce((g,x)=>g+((x.codePointAt(0)??0)>255?Ce:Se),0)}function He([t,g],x){const f=g.x-t.x,y=g.y-t.y;let u=0,p=1;for(const[a,s]of[[-f,t.x-x.l],[f,x.r-t.x],[-y,t.y-x.t],[y,x.b-t.y]])if(a===0){if(s<0)return!1}else a<0?u=Math.max(u,s/a):p=Math.min(p,s/a);return u<=p}function Te(t,g,x,f,y){const u=[...f],p=new Map,a=$+j/2;for(const s of t){const L=pe(s.label),v=[{x:s.x+a,y:s.y+A/3,anchor:"start"},{x:s.x-a,y:s.y+A/3,anchor:"end"},{x:s.x-L/2,y:s.y-a,anchor:"start"},{x:s.x-L/2,y:s.y+a+A,anchor:"start"},{x:s.x-a,y:s.y-a,anchor:"end"},{x:s.x+a,y:s.y+a+A,anchor:"start"},{x:s.x+a,y:s.y-a,anchor:"start"},{x:s.x-a,y:s.y+a+A,anchor:"end"}],b=o=>{const d=o.anchor==="end"?o.x-L:o.x;return{l:d,r:d+L,t:o.y-A+F,b:o.y+F}},P=o=>{const{l:d,r:N,t:I,b:w}=b(o);return d>=y.left&&N<=y.right&&I>=y.top&&w<=y.bottom},R=o=>{const{l:d,r:N,t:I,b:w}=b(o);return P(o)&&u.every(n=>N<n.l||d>n.r||w<n.t||I>n.b)&&g.every(n=>n.key===s.key||n.x+$<d||n.x-$>N||n.y+$<I||n.y-$>w)},O=o=>R(o)&&x.every(d=>!He(d,b(o))),H=v.find(O)??v.find(R)??v.find(P)??v[s.x>(y.left+y.right)/2?1:0];u.push(b(H)),p.set(s.key,H)}return p}function qe({points:t,xLabel:g,yLabel:x,xDirection:f="lower",yDirection:y="higher",formatX:u=String,formatY:p=String,xScale:a="linear",xDomain:s,yDomain:L,xTicks:v,yTicks:b,labels:P="front",fadeDominated:R=!0,highlightKeys:O,maxHeight:H=Me,onSelect:o,legend:d,empty:N,emptyTitle:I,emptyDescription:w,progress:n,frontProgress:le,className:ve}){const ne=Ee.useStrings(),ce=ae.useId(),G=ae.useRef(null),E=Ae.useElementWidth(G),U=["aegis-pareto",n===void 0&&le===void 0?"":"aegis-pareto--scroll",ve??""].filter(Boolean).join(" "),m=ae.useMemo(()=>{if(t.length===0||E===0)return null;const e=Math.round(Math.min(H,Math.max(fe,E/2))),c=t.map(r=>r.x),_=Math.min(...c),K=Math.max(...c),[ee,de]=s??(a==="log"?[K>_?_:_/2,K>_?K:K*2]:C.zeroAnchoredDomain(c)),[q,te]=L??C.zeroAnchoredDomain(t.map(r=>r.y)),z=a==="log"?Math.log10:r=>r,D=Pe,re=E-Ie,he=we,se=e-Be,V=r=>D+(z(r)-z(ee))/(z(de)-z(ee))*(re-D),oe=r=>se-(r-q)/(te-q)*(se-he),me=t.filter(r=>!t.some(i=>i.key!==r.key&&(Y(i.x,r.x,f)||i.x===r.x)&&(Y(i.y,r.y,y)||i.y===r.y)&&(Y(i.x,r.x,f)||Y(i.y,r.y,y)))).sort((r,i)=>r.x-i.x),_e=Array.from({length:ue},(r,i)=>(i+1)/ue),je=new Map([...t].sort((r,i)=>V(r.x)-V(i.x)).map((r,i)=>[r.key,i]));return{height:e,order:je,left:D,right:re,top:he,bottom:se,sx:V,sy:oe,front:me,frontKeys:new Set(me.map(r=>r.key)),gridX:v?.map(V)??_e.map(r=>D+(re-D)*r),gridY:b?.map(oe)??_e.map(r=>oe(q+(te-q)*r)),xLabels:v??[ee,de],yLabels:b??[q,te]}},[t,E,f,y,a,s,L,v,b,H]);if(t.length===0)return l.jsx("div",{ref:G,className:U,children:N===void 0?l.jsx(Ne.EmptyState,{title:I??ne.paretoEmptyTitle,description:w}):l.jsx("div",{className:"aegis-pareto__empty",style:{"--aegis-pareto-min-height":`${fe.toString()}px`},children:N})});if(!m)return l.jsx("div",{ref:G,className:U});const{height:W,left:h,right:B,top:J,bottom:S,sx:k,sy:M,front:X,frontKeys:ie}=m,Q=O===void 0?null:new Set(O),xe=e=>Q!==null&&!Q.has(e),Z=J-j*2,ye=P==="all"&&E>=$e,be=Te(t.filter(e=>ye||ie.has(e.key)||(Q?.has(e.key)??!1)).map(e=>({key:e.key,label:e.label,x:k(e.x),y:M(e.y)})),t.map(e=>({key:e.key,x:k(e.x),y:M(e.y)})),X.slice(1).map((e,c)=>{const _=X[c];return[{x:k(_.x),y:M(_.y)},{x:k(e.x),y:M(e.y)}]}),[{l:h-j,r:h-j+pe(x),t:Z-A+F,b:Z+F}],{left:h,right:B,top:0,bottom:S}),ge=d?.map(e=>({key:e.key,label:e.label,color:e.color??"var(--bg-inverted)"}))??(P==="all"&&!ye?t.map(e=>({key:e.key,label:e.label,color:e.color??"var(--bg-inverted)"})):[]),T=le??(n===void 0?void 0:C.staggeredProgress(n,t.length,t.length+1)),ke=(e,c)=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o?.(c))};return l.jsxs("div",{ref:G,className:U,children:[l.jsxs("svg",{className:"aegis-pareto__svg",width:E,height:W,viewBox:`0 0 ${E.toString()} ${W.toString()}`,role:o?"group":"img","aria-label":ne.paretoChartLabel(g,x),style:{"--aegis-pareto-count":t.length,...T===void 0?{}:{"--aegis-pareto-front-progress":T}},children:[m.gridY.map(e=>l.jsx("line",{className:"aegis-pareto__grid",x1:h,y1:e,x2:B,y2:e},`gy-${e.toString()}`)),m.gridX.map(e=>l.jsx("line",{className:"aegis-pareto__grid",x1:e,y1:J,x2:e,y2:S},`gx-${e.toString()}`)),l.jsx("line",{className:"aegis-pareto__axis",x1:h,y1:S,x2:B,y2:S}),l.jsx("line",{className:"aegis-pareto__axis",x1:h,y1:J,x2:h,y2:S}),T!==void 0&&l.jsx("clipPath",{id:ce,children:l.jsx("rect",{x:h,y:0,width:(B-h)*T,height:W})}),X.length>1&&l.jsx("polyline",{className:"aegis-pareto__front",clipPath:T===void 0?void 0:`url(#${ce})`,points:X.map(e=>`${k(e.x).toString()},${M(e.y).toString()}`).join(" ")}),t.map((e,c)=>l.jsx("circle",{className:["aegis-pareto__point",R&&!ie.has(e.key)?"aegis-pareto__point--dominated":"",xe(e.key)?"aegis-pareto__point--dimmed":"",o?"aegis-pareto__point--interactive":""].filter(Boolean).join(" "),style:{fill:e.color===void 0?void 0:C.chartColorValue(e.color),"--aegis-pareto-index":c,"--aegis-pareto-point-progress":n===void 0?1:C.staggeredProgress(n,m.order.get(e.key)??c,t.length+1)},cx:k(e.x),cy:M(e.y),r:$,role:o?"button":void 0,tabIndex:o?0:void 0,"aria-label":o?e.label:void 0,onClick:o?()=>{o(e.key)}:void 0,onKeyDown:o?_=>{ke(_,e.key)}:void 0,children:l.jsx("title",{children:e.label})},e.key)),t.map(e=>{const c=be.get(e.key);return c===void 0?null:l.jsx("text",{className:["aegis-pareto__point-label",xe(e.key)?"aegis-pareto__point-label--dimmed":""].filter(Boolean).join(" "),style:P==="all"?{"--aegis-pareto-front-progress":n===void 0?1:C.staggeredProgress(n,m.order.get(e.key)??0,t.length+1)}:void 0,x:c.x,y:c.y,textAnchor:c.anchor,children:e.label},`label-${e.key}`)}),m.xLabels.map((e,c)=>l.jsx("text",{className:"aegis-pareto__tick",x:k(e),y:S+j*2,textAnchor:c===m.xLabels.length-1&&k(e)>=B-1?"end":"middle",children:u(e)},`x-${e.toString()}`)),m.yLabels.map(e=>l.jsx("text",{className:"aegis-pareto__tick",x:h-j,y:M(e),textAnchor:"end",dominantBaseline:"middle",children:p(e)},`y-${e.toString()}`)),l.jsx("text",{className:"aegis-pareto__axis-label",x:B,y:W-j,textAnchor:"end",children:g}),l.jsx("text",{className:"aegis-pareto__axis-label",x:h-j,y:Z,textAnchor:"start",children:x})]}),ge.length>0?l.jsx(Le.ChartLegend,{className:"aegis-pareto__legend",shape:"dot",items:ge}):null]})}exports.ParetoChart=qe;
|
|
2
2
|
//# sourceMappingURL=ParetoChart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParetoChart.cjs","sources":["../../../src/components/ui/ParetoChart.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n useId,\n useMemo,\n useRef,\n} from 'react';\n\nimport { useElementWidth } from '../../hooks/useElementWidth';\nimport {\n type ChartColor,\n chartColorValue,\n staggeredProgress,\n zeroAnchoredDomain,\n} from '../../lib/chart';\nimport { useStrings } from '../../locale';\nimport { ChartLegend } from './ChartLegend';\nimport { EmptyState } from './EmptyState';\nimport './ParetoChart.css';\n\nexport interface ParetoPoint {\n key: string;\n label: string;\n x: number;\n y: number;\n /** Point fill, e.g. `cat-2` or a series token, to match the series elsewhere. */\n color?: ChartColor;\n}\n\n/** One series in the legend under the plot, e.g. a model and its colour. */\nexport interface ParetoLegendItem {\n key: string;\n label: ReactNode;\n /** Swatch fill; the same value its points use. */\n color?: ChartColor;\n}\n\ninterface ParetoChartProps {\n points: ParetoPoint[];\n xLabel: string;\n yLabel: string;\n /** Which direction counts as better on each axis. */\n xDirection?: 'lower' | 'higher';\n yDirection?: 'lower' | 'higher';\n /** Formats the labels of each axis. */\n formatX?: (value: number) => string;\n formatY?: (value: number) => string;\n /**\n * `log` spaces the horizontal axis by ratio, e.g. for a cost that spans\n * orders of magnitude; its values must be above 0. Defaults to `linear`.\n */\n xScale?: 'linear' | 'log';\n /** The ends of each axis. Defaults to from 0, or the data's own range on a log axis. */\n xDomain?: [number, number];\n yDomain?: [number, number];\n /**\n * The labelled gridlines of each axis. Defaults to plain gridlines with\n * labels at the two ends.\n */\n xTicks?: number[];\n yTicks?: number[];\n /**\n * Which points carry their name. `front` names the frontier; `all` names\n * every point, so the chart needs no legend. A plot too narrow for them\n * names the frontier and `highlightKeys` and lists every point under it.\n * Defaults to `front`.\n */\n labels?: 'front' | 'all';\n /** Fades the points off the frontier. Defaults to true. */\n fadeDominated?: boolean;\n /** Fades every other point, to pick out the ones a finding is about. */\n highlightKeys?: string[];\n /** The tallest the plot grows. */\n maxHeight?: number;\n onSelect?: (key: string) => void;\n /** Series swatches with labels, listed under the plot. */\n legend?: ParetoLegendItem[];\n /**\n * Shown in place of the plot, at its minimum height, while there are no\n * points — e.g. an EmptyState with an icon asking for both axes. Replaces\n * the default empty state built from `emptyTitle`.\n */\n empty?: ReactNode;\n emptyTitle?: string;\n emptyDescription?: string;\n /**\n * How far the chart is drawn, 0 to 1, for a chart that draws as its\n * section scrolls in (`useScrollProgress`): points fade in from left to\n * right, then the frontier. Omitted, they fade in once on mount.\n */\n progress?: number;\n /**\n * How far the frontier is traced, 0 to 1, for a host that draws it apart\n * from the points, such as one step of a scrolling story.\n */\n frontProgress?: number;\n className?: string;\n}\n\n// The SVG is drawn at its measured CSS width, so these are true px.\nconst MAX_HEIGHT = 320;\nconst MIN_HEIGHT = 220;\nconst PAD_LEFT = 56;\nconst PAD_RIGHT = 16;\nconst PAD_TOP = 28;\nconst PAD_BOTTOM = 44;\nconst POINT_RADIUS = 5;\nconst LABEL_GAP = 8;\nconst GRID_STEPS = 4;\n// Estimates for placing labels: --fs-11 text, and the width below which\n// `labels='all'` would crowd the plot.\nconst LABEL_CHAR = 6.2;\nconst LABEL_WIDE_CHAR = 11;\nconst LABEL_LINE = 14;\nconst ALL_LABELS_MIN_WIDTH = 520;\n\ntype Direction = 'lower' | 'higher';\n\nfunction better(a: number, b: number, direction: Direction): boolean {\n return direction === 'lower' ? a < b : a > b;\n}\n\ninterface LabelBox {\n x: number;\n y: number;\n anchor: 'start' | 'end';\n}\n\nfunction labelWidth(text: string): number {\n return [...text].reduce(\n (sum, char) =>\n sum + ((char.codePointAt(0) ?? 0) > 255 ? LABEL_WIDE_CHAR : LABEL_CHAR),\n 0,\n );\n}\n\n/**\n * Puts each label beside its point on the first side where it stays on the\n * plot and clear of the labels already placed and of the other points.\n */\nfunction placeLabels(\n labelled: Array<{ key: string; label: string; x: number; y: number }>,\n allPoints: Array<{ key: string; x: number; y: number }>,\n bounds: { left: number; right: number; top: number; bottom: number },\n): Map<string, LabelBox> {\n const placed: Array<{ l: number; r: number; t: number; b: number }> = [];\n const result = new Map<string, LabelBox>();\n const reach = POINT_RADIUS + LABEL_GAP / 2;\n for (const point of labelled) {\n const w = labelWidth(point.label);\n const candidates: LabelBox[] = [\n { x: point.x + reach, y: point.y + LABEL_LINE / 3, anchor: 'start' },\n { x: point.x - reach, y: point.y + LABEL_LINE / 3, anchor: 'end' },\n { x: point.x - w / 2, y: point.y - reach, anchor: 'start' },\n { x: point.x - w / 2, y: point.y + reach + LABEL_LINE, anchor: 'start' },\n ];\n const box = (candidate: LabelBox) => {\n const l = candidate.anchor === 'end' ? candidate.x - w : candidate.x;\n return {\n l,\n r: l + w,\n t: candidate.y - LABEL_LINE,\n b: candidate.y,\n };\n };\n const onPlot = (candidate: LabelBox): boolean => {\n const { l, r, t, b } = box(candidate);\n return (\n l >= bounds.left &&\n r <= bounds.right &&\n t >= bounds.top &&\n b <= bounds.bottom\n );\n };\n const clear = (candidate: LabelBox): boolean => {\n const { l, r, t, b } = box(candidate);\n return (\n onPlot(candidate) &&\n placed.every(\n (other) => r < other.l || l > other.r || b < other.t || t > other.b,\n ) &&\n allPoints.every(\n (other) =>\n other.key === point.key ||\n other.x + POINT_RADIUS < l ||\n other.x - POINT_RADIUS > r ||\n other.y + POINT_RADIUS < t ||\n other.y - POINT_RADIUS > b,\n )\n );\n };\n // With no side free the label still stays on the plot, towards its middle.\n const chosen =\n candidates.find(clear) ??\n candidates.find(onPlot) ??\n candidates[point.x > (bounds.left + bounds.right) / 2 ? 1 : 0];\n placed.push(box(chosen));\n result.set(point.key, chosen);\n }\n return result;\n}\n\nexport function ParetoChart({\n points,\n xLabel,\n yLabel,\n xDirection = 'lower',\n yDirection = 'higher',\n formatX = String,\n formatY = String,\n xScale = 'linear',\n xDomain,\n yDomain,\n xTicks,\n yTicks,\n labels = 'front',\n fadeDominated = true,\n highlightKeys,\n maxHeight = MAX_HEIGHT,\n onSelect,\n legend,\n empty,\n emptyTitle,\n emptyDescription,\n progress,\n frontProgress,\n className,\n}: ParetoChartProps) {\n const strings = useStrings();\n const clipId = useId();\n const wrapRef = useRef<HTMLDivElement>(null);\n const width = useElementWidth(wrapRef);\n const cls = [\n 'aegis-pareto',\n progress === undefined && frontProgress === undefined\n ? ''\n : 'aegis-pareto--scroll',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const geometry = useMemo(() => {\n if (points.length === 0 || width === 0) {\n return null;\n }\n const height = Math.round(\n Math.min(maxHeight, Math.max(MIN_HEIGHT, width / 2)),\n );\n const xValues = points.map((point) => point.x);\n const logLo = Math.min(...xValues);\n const logHi = Math.max(...xValues);\n const [xLo, xHi] =\n xDomain ??\n (xScale === 'log'\n ? // One value has no span to divide, so it sits mid-axis.\n ([\n logHi > logLo ? logLo : logLo / 2,\n logHi > logLo ? logHi : logHi * 2,\n ] as const)\n : zeroAnchoredDomain(xValues));\n const [yLo, yHi] =\n yDomain ?? zeroAnchoredDomain(points.map((point) => point.y));\n const scaleX = xScale === 'log' ? Math.log10 : (value: number) => value;\n const left = PAD_LEFT;\n const right = width - PAD_RIGHT;\n const top = PAD_TOP;\n const bottom = height - PAD_BOTTOM;\n const sx = (value: number): number =>\n left +\n ((scaleX(value) - scaleX(xLo)) / (scaleX(xHi) - scaleX(xLo))) *\n (right - left);\n const sy = (value: number): number =>\n bottom - ((value - yLo) / (yHi - yLo)) * (bottom - top);\n const front = points\n .filter(\n (candidate) =>\n !points.some(\n (other) =>\n other.key !== candidate.key &&\n (better(other.x, candidate.x, xDirection) ||\n other.x === candidate.x) &&\n (better(other.y, candidate.y, yDirection) ||\n other.y === candidate.y) &&\n (better(other.x, candidate.x, xDirection) ||\n better(other.y, candidate.y, yDirection)),\n ),\n )\n .sort((a, b) => a.x - b.x);\n const steps = Array.from(\n { length: GRID_STEPS },\n (_, i) => (i + 1) / GRID_STEPS,\n );\n // Points draw in from left to right; the frontier comes last.\n const order = new Map(\n [...points]\n .sort((a, b) => sx(a.x) - sx(b.x))\n .map((point, rank) => [point.key, rank]),\n );\n return {\n height,\n order,\n left,\n right,\n top,\n bottom,\n sx,\n sy,\n front,\n frontKeys: new Set(front.map((point) => point.key)),\n // Even shares of the plot, which on a log axis are even ratios.\n gridX: xTicks?.map(sx) ?? steps.map((t) => left + (right - left) * t),\n gridY: yTicks?.map(sy) ?? steps.map((t) => sy(yLo + (yHi - yLo) * t)),\n xLabels: xTicks ?? [xLo, xHi],\n yLabels: yTicks ?? [yLo, yHi],\n };\n }, [\n points,\n width,\n xDirection,\n yDirection,\n xScale,\n xDomain,\n yDomain,\n xTicks,\n yTicks,\n maxHeight,\n ]);\n\n if (points.length === 0) {\n return (\n <div ref={wrapRef} className={cls}>\n {empty === undefined ? (\n <EmptyState\n title={emptyTitle ?? strings.paretoEmptyTitle}\n description={emptyDescription}\n />\n ) : (\n <div\n className=\"aegis-pareto__empty\"\n style={\n {\n '--aegis-pareto-min-height': `${MIN_HEIGHT.toString()}px`,\n } as CSSProperties\n }\n >\n {empty}\n </div>\n )}\n </div>\n );\n }\n\n if (!geometry) {\n return <div ref={wrapRef} className={cls} />;\n }\n\n const { height, left, right, top, bottom, sx, sy, front, frontKeys } =\n geometry;\n const highlighted =\n highlightKeys === undefined ? null : new Set(highlightKeys);\n const dimmed = (key: string): boolean =>\n highlighted !== null && !highlighted.has(key);\n const showAllLabels = labels === 'all' && width >= ALL_LABELS_MIN_WIDTH;\n const labelBoxes = placeLabels(\n points\n .filter(\n (point) =>\n showAllLabels ||\n frontKeys.has(point.key) ||\n (highlighted?.has(point.key) ?? false),\n )\n .map((point) => ({\n key: point.key,\n label: point.label,\n x: sx(point.x),\n y: sy(point.y),\n })),\n points.map((point) => ({\n key: point.key,\n x: sx(point.x),\n y: sy(point.y),\n })),\n // A label may run up into the space above the plot.\n { left, right, top: 0, bottom },\n );\n // A plot too narrow to name every point names them under it instead, so\n // none is left to a tooltip a phone cannot show.\n const legendItems =\n legend?.map((item) => ({\n key: item.key,\n label: item.label,\n color: item.color ?? ('var(--bg-inverted)' as const),\n })) ??\n (labels === 'all' && !showAllLabels\n ? points.map((point) => ({\n key: point.key,\n label: point.label,\n color: point.color ?? ('var(--bg-inverted)' as const),\n }))\n : []);\n const frontDrawn =\n frontProgress ??\n (progress === undefined\n ? undefined\n : staggeredProgress(progress, points.length, points.length + 1));\n const selectOnKey = (event: KeyboardEvent<SVGCircleElement>, key: string) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onSelect?.(key);\n }\n };\n\n return (\n <div ref={wrapRef} className={cls}>\n <svg\n className=\"aegis-pareto__svg\"\n width={width}\n height={height}\n viewBox={`0 0 ${width.toString()} ${height.toString()}`}\n role={onSelect ? 'group' : 'img'}\n aria-label={strings.paretoChartLabel(xLabel, yLabel)}\n style={\n {\n '--aegis-pareto-count': points.length,\n ...(frontDrawn === undefined\n ? {}\n : { '--aegis-pareto-front-progress': frontDrawn }),\n } as CSSProperties\n }\n >\n {geometry.gridY.map((y) => (\n <line\n key={`gy-${y.toString()}`}\n className=\"aegis-pareto__grid\"\n x1={left}\n y1={y}\n x2={right}\n y2={y}\n />\n ))}\n {geometry.gridX.map((x) => (\n <line\n key={`gx-${x.toString()}`}\n className=\"aegis-pareto__grid\"\n x1={x}\n y1={top}\n x2={x}\n y2={bottom}\n />\n ))}\n <line\n className=\"aegis-pareto__axis\"\n x1={left}\n y1={bottom}\n x2={right}\n y2={bottom}\n />\n <line\n className=\"aegis-pareto__axis\"\n x1={left}\n y1={top}\n x2={left}\n y2={bottom}\n />\n {frontDrawn !== undefined && (\n <clipPath id={clipId}>\n <rect\n x={left}\n y={0}\n width={(right - left) * frontDrawn}\n height={height}\n />\n </clipPath>\n )}\n {front.length > 1 && (\n <polyline\n className=\"aegis-pareto__front\"\n clipPath={frontDrawn === undefined ? undefined : `url(#${clipId})`}\n points={front\n .map(\n (point) =>\n `${sx(point.x).toString()},${sy(point.y).toString()}`,\n )\n .join(' ')}\n />\n )}\n {points.map((point, index) => (\n <circle\n key={point.key}\n className={[\n 'aegis-pareto__point',\n fadeDominated && !frontKeys.has(point.key)\n ? 'aegis-pareto__point--dominated'\n : '',\n dimmed(point.key) ? 'aegis-pareto__point--dimmed' : '',\n onSelect ? 'aegis-pareto__point--interactive' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n style={\n {\n fill:\n point.color === undefined\n ? undefined\n : chartColorValue(point.color),\n '--aegis-pareto-index': index,\n '--aegis-pareto-point-progress':\n progress === undefined\n ? 1\n : staggeredProgress(\n progress,\n geometry.order.get(point.key) ?? index,\n points.length + 1,\n ),\n } as CSSProperties\n }\n cx={sx(point.x)}\n cy={sy(point.y)}\n r={POINT_RADIUS}\n role={onSelect ? 'button' : undefined}\n tabIndex={onSelect ? 0 : undefined}\n aria-label={onSelect ? point.label : undefined}\n onClick={\n onSelect\n ? () => {\n onSelect(point.key);\n }\n : undefined\n }\n onKeyDown={\n onSelect\n ? (event) => {\n selectOnKey(event, point.key);\n }\n : undefined\n }\n >\n <title>{point.label}</title>\n </circle>\n ))}\n {points.map((point) => {\n const box = labelBoxes.get(point.key);\n return box === undefined ? null : (\n <text\n key={`label-${point.key}`}\n className={[\n 'aegis-pareto__point-label',\n dimmed(point.key) ? 'aegis-pareto__point-label--dimmed' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n style={\n labels === 'all'\n ? ({\n '--aegis-pareto-front-progress':\n progress === undefined\n ? 1\n : staggeredProgress(\n progress,\n geometry.order.get(point.key) ?? 0,\n points.length + 1,\n ),\n } as CSSProperties)\n : undefined\n }\n x={box.x}\n y={box.y}\n textAnchor={box.anchor}\n >\n {point.label}\n </text>\n );\n })}\n {geometry.xLabels.map((value, index) => (\n <text\n key={`x-${value.toString()}`}\n className=\"aegis-pareto__tick\"\n x={sx(value)}\n y={bottom + LABEL_GAP * 2}\n textAnchor={\n index === geometry.xLabels.length - 1 && sx(value) >= right - 1\n ? 'end'\n : 'middle'\n }\n >\n {formatX(value)}\n </text>\n ))}\n {geometry.yLabels.map((value) => (\n <text\n key={`y-${value.toString()}`}\n className=\"aegis-pareto__tick\"\n x={left - LABEL_GAP}\n y={sy(value)}\n textAnchor=\"end\"\n dominantBaseline=\"middle\"\n >\n {formatY(value)}\n </text>\n ))}\n <text\n className=\"aegis-pareto__axis-label\"\n x={right}\n y={height - LABEL_GAP}\n textAnchor=\"end\"\n >\n {xLabel}\n </text>\n <text\n className=\"aegis-pareto__axis-label\"\n x={left - LABEL_GAP}\n y={top - LABEL_GAP * 2}\n textAnchor=\"start\"\n >\n {yLabel}\n </text>\n </svg>\n {legendItems.length > 0 ? (\n <ChartLegend\n className=\"aegis-pareto__legend\"\n shape=\"dot\"\n items={legendItems}\n />\n ) : null}\n </div>\n );\n}\n"],"names":["MAX_HEIGHT","MIN_HEIGHT","PAD_LEFT","PAD_RIGHT","PAD_TOP","PAD_BOTTOM","POINT_RADIUS","LABEL_GAP","GRID_STEPS","LABEL_CHAR","LABEL_WIDE_CHAR","LABEL_LINE","ALL_LABELS_MIN_WIDTH","better","a","b","direction","labelWidth","text","sum","char","placeLabels","labelled","allPoints","bounds","placed","result","reach","point","w","candidates","box","candidate","l","onPlot","r","t","clear","other","chosen","ParetoChart","points","xLabel","yLabel","xDirection","yDirection","formatX","formatY","xScale","xDomain","yDomain","xTicks","yTicks","labels","fadeDominated","highlightKeys","maxHeight","onSelect","legend","empty","emptyTitle","emptyDescription","progress","frontProgress","className","strings","useStrings","clipId","useId","wrapRef","useRef","width","useElementWidth","cls","geometry","useMemo","height","xValues","logLo","logHi","xLo","xHi","zeroAnchoredDomain","yLo","yHi","scaleX","value","left","right","top","bottom","sx","sy","front","steps","_","i","order","rank","jsx","EmptyState","frontKeys","highlighted","dimmed","key","showAllLabels","labelBoxes","legendItems","item","frontDrawn","staggeredProgress","selectOnKey","event","jsxs","y","x","index","chartColorValue","ChartLegend"],"mappings":"wWAqGMA,GAAa,IACbC,GAAa,IACbC,GAAW,GACXC,GAAY,GACZC,GAAU,GACVC,GAAa,GACbC,EAAe,EACfC,EAAY,EACZC,GAAa,EAGbC,GAAa,IACbC,GAAkB,GAClBC,EAAa,GACbC,GAAuB,IAI7B,SAASC,EAAOC,EAAWC,EAAWC,EAA+B,CACnE,OAAOA,IAAc,QAAUF,EAAIC,EAAID,EAAIC,CAC7C,CAQA,SAASE,GAAWC,EAAsB,CACxC,MAAO,CAAC,GAAGA,CAAI,EAAE,OACf,CAACC,EAAKC,IACJD,IAAQC,EAAK,YAAY,CAAC,GAAK,GAAK,IAAMV,GAAkBD,IAC9D,CAAA,CAEJ,CAMA,SAASY,GACPC,EACAC,EACAC,EACuB,CACvB,MAAMC,EAAgE,CAAA,EAChEC,MAAa,IACbC,EAAQrB,EAAeC,EAAY,EACzC,UAAWqB,KAASN,EAAU,CAC5B,MAAMO,EAAIZ,GAAWW,EAAM,KAAK,EAC1BE,EAAyB,CAC7B,CAAE,EAAGF,EAAM,EAAID,EAAO,EAAGC,EAAM,EAAIjB,EAAa,EAAG,OAAQ,OAAA,EAC3D,CAAE,EAAGiB,EAAM,EAAID,EAAO,EAAGC,EAAM,EAAIjB,EAAa,EAAG,OAAQ,KAAA,EAC3D,CAAE,EAAGiB,EAAM,EAAIC,EAAI,EAAG,EAAGD,EAAM,EAAID,EAAO,OAAQ,OA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AAOhF,EACV,EAAGqF,EAAGN,CAAK,EACX,WAAW,MACX,iBAAiB,SAEhB,WAAQA,CAAK,CAAA,EAPT,KAAKA,EAAM,UAAU,EAAA,CAS7B,EACDa,EAAAA,IAAC,OAAA,CACC,UAAU,2BACV,EAAGX,EACH,EAAGZ,EAASrE,EACZ,WAAW,MAEV,SAAAmC,CAAA,CAAA,EAEHyD,EAAAA,IAAC,OAAA,CACC,UAAU,2BACV,EAAGZ,EAAOhF,EACV,EAAGkF,EAAMlF,EAAY,EACrB,WAAW,QAEV,SAAAoC,CAAA,CAAA,CACH,CAAA,CAAA,EAEDgE,GAAY,OAAS,EACpBR,EAAAA,IAACmB,GAAAA,YAAA,CACC,UAAU,uBACV,MAAM,MACN,MAAOX,EAAA,CAAA,EAEP,IAAA,EACN,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ParetoChart.cjs","sources":["../../../src/components/ui/ParetoChart.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n useId,\n useMemo,\n useRef,\n} from 'react';\n\nimport { useElementWidth } from '../../hooks/useElementWidth';\nimport {\n type ChartColor,\n chartColorValue,\n staggeredProgress,\n zeroAnchoredDomain,\n} from '../../lib/chart';\nimport { useStrings } from '../../locale';\nimport { ChartLegend } from './ChartLegend';\nimport { EmptyState } from './EmptyState';\nimport './ParetoChart.css';\n\nexport interface ParetoPoint {\n key: string;\n label: string;\n x: number;\n y: number;\n /** Point fill, e.g. `cat-2` or a series token, to match the series elsewhere. */\n color?: ChartColor;\n}\n\n/** One series in the legend under the plot, e.g. a model and its colour. */\nexport interface ParetoLegendItem {\n key: string;\n label: ReactNode;\n /** Swatch fill; the same value its points use. */\n color?: ChartColor;\n}\n\ninterface ParetoChartProps {\n points: ParetoPoint[];\n xLabel: string;\n yLabel: string;\n /** Which direction counts as better on each axis. */\n xDirection?: 'lower' | 'higher';\n yDirection?: 'lower' | 'higher';\n /** Formats the labels of each axis. */\n formatX?: (value: number) => string;\n formatY?: (value: number) => string;\n /**\n * `log` spaces the horizontal axis by ratio, e.g. for a cost that spans\n * orders of magnitude; its values must be above 0. Defaults to `linear`.\n */\n xScale?: 'linear' | 'log';\n /** The ends of each axis. Defaults to from 0, or the data's own range on a log axis. */\n xDomain?: [number, number];\n yDomain?: [number, number];\n /**\n * The labelled gridlines of each axis. Defaults to plain gridlines with\n * labels at the two ends.\n */\n xTicks?: number[];\n yTicks?: number[];\n /**\n * Which points carry their name. `front` names the frontier; `all` names\n * every point, so the chart needs no legend. A plot too narrow for them\n * names the frontier and `highlightKeys` and lists every point under it.\n * Defaults to `front`.\n */\n labels?: 'front' | 'all';\n /** Fades the points off the frontier. Defaults to true. */\n fadeDominated?: boolean;\n /** Fades every other point, to pick out the ones a finding is about. */\n highlightKeys?: string[];\n /** The tallest the plot grows. */\n maxHeight?: number;\n onSelect?: (key: string) => void;\n /** Series swatches with labels, listed under the plot. */\n legend?: ParetoLegendItem[];\n /**\n * Shown in place of the plot, at its minimum height, while there are no\n * points — e.g. an EmptyState with an icon asking for both axes. Replaces\n * the default empty state built from `emptyTitle`.\n */\n empty?: ReactNode;\n emptyTitle?: string;\n emptyDescription?: string;\n /**\n * How far the chart is drawn, 0 to 1, for a chart that draws as its\n * section scrolls in (`useScrollProgress`): points fade in from left to\n * right, then the frontier. Omitted, they fade in once on mount.\n */\n progress?: number;\n /**\n * How far the frontier is traced, 0 to 1, for a host that draws it apart\n * from the points, such as one step of a scrolling story.\n */\n frontProgress?: number;\n className?: string;\n}\n\n// The SVG is drawn at its measured CSS width, so these are true px.\nconst MAX_HEIGHT = 320;\nconst MIN_HEIGHT = 220;\nconst PAD_LEFT = 56;\nconst PAD_RIGHT = 16;\nconst PAD_TOP = 28;\nconst PAD_BOTTOM = 44;\nconst POINT_RADIUS = 5;\nconst LABEL_GAP = 8;\nconst GRID_STEPS = 4;\n// Estimates for placing labels: --fs-11 text, and the width below which\n// `labels='all'` would crowd the plot.\nconst LABEL_CHAR = 6.2;\nconst LABEL_WIDE_CHAR = 11;\nconst LABEL_LINE = 14;\n/** The part of a label's line below its baseline. */\nconst LABEL_DESCENT = LABEL_LINE / 4;\nconst ALL_LABELS_MIN_WIDTH = 520;\n\ntype Direction = 'lower' | 'higher';\n\nfunction better(a: number, b: number, direction: Direction): boolean {\n return direction === 'lower' ? a < b : a > b;\n}\n\ninterface LabelBox {\n x: number;\n y: number;\n anchor: 'start' | 'end';\n}\n\nfunction labelWidth(text: string): number {\n return [...text].reduce(\n (sum, char) =>\n sum + ((char.codePointAt(0) ?? 0) > 255 ? LABEL_WIDE_CHAR : LABEL_CHAR),\n 0,\n );\n}\n\ninterface Box {\n l: number;\n r: number;\n t: number;\n b: number;\n}\n\ntype Segment = [{ x: number; y: number }, { x: number; y: number }];\n\n/** Whether a straight segment crosses a box (Liang–Barsky clipping). */\nfunction segmentCrosses([a, b]: Segment, box: Box): boolean {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n let enter = 0;\n let exit = 1;\n for (const [p, q] of [\n [-dx, a.x - box.l],\n [dx, box.r - a.x],\n [-dy, a.y - box.t],\n [dy, box.b - a.y],\n ]) {\n if (p === 0) {\n if (q < 0) {\n return false;\n }\n } else if (p < 0) {\n enter = Math.max(enter, q / p);\n } else {\n exit = Math.min(exit, q / p);\n }\n }\n return enter <= exit;\n}\n\n/**\n * Puts each label beside its point on the first side where it stays on the\n * plot and clear of the labels already placed, of the `reserved` boxes, of\n * the other points and of the frontier. The frontier runs through the\n * points it joins, so the sides across it, diagonally off the point, are\n * candidates too.\n */\nfunction placeLabels(\n labelled: Array<{ key: string; label: string; x: number; y: number }>,\n allPoints: Array<{ key: string; x: number; y: number }>,\n frontier: Segment[],\n reserved: Box[],\n bounds: { left: number; right: number; top: number; bottom: number },\n): Map<string, LabelBox> {\n const placed: Box[] = [...reserved];\n const result = new Map<string, LabelBox>();\n const reach = POINT_RADIUS + LABEL_GAP / 2;\n for (const point of labelled) {\n const w = labelWidth(point.label);\n const candidates: LabelBox[] = [\n { x: point.x + reach, y: point.y + LABEL_LINE / 3, anchor: 'start' },\n { x: point.x - reach, y: point.y + LABEL_LINE / 3, anchor: 'end' },\n { x: point.x - w / 2, y: point.y - reach, anchor: 'start' },\n { x: point.x - w / 2, y: point.y + reach + LABEL_LINE, anchor: 'start' },\n { x: point.x - reach, y: point.y - reach, anchor: 'end' },\n { x: point.x + reach, y: point.y + reach + LABEL_LINE, anchor: 'start' },\n { x: point.x + reach, y: point.y - reach, anchor: 'start' },\n { x: point.x - reach, y: point.y + reach + LABEL_LINE, anchor: 'end' },\n ];\n const box = (candidate: LabelBox): Box => {\n const l = candidate.anchor === 'end' ? candidate.x - w : candidate.x;\n return {\n l,\n r: l + w,\n t: candidate.y - LABEL_LINE + LABEL_DESCENT,\n b: candidate.y + LABEL_DESCENT,\n };\n };\n const onPlot = (candidate: LabelBox): boolean => {\n const { l, r, t, b } = box(candidate);\n return (\n l >= bounds.left &&\n r <= bounds.right &&\n t >= bounds.top &&\n b <= bounds.bottom\n );\n };\n const clearOfMarks = (candidate: LabelBox): boolean => {\n const { l, r, t, b } = box(candidate);\n return (\n onPlot(candidate) &&\n placed.every(\n (other) => r < other.l || l > other.r || b < other.t || t > other.b,\n ) &&\n allPoints.every(\n (other) =>\n other.key === point.key ||\n other.x + POINT_RADIUS < l ||\n other.x - POINT_RADIUS > r ||\n other.y + POINT_RADIUS < t ||\n other.y - POINT_RADIUS > b,\n )\n );\n };\n const clear = (candidate: LabelBox): boolean =>\n clearOfMarks(candidate) &&\n frontier.every((segment) => !segmentCrosses(segment, box(candidate)));\n // With no side free the label still stays on the plot, towards its middle.\n const chosen =\n candidates.find(clear) ??\n candidates.find(clearOfMarks) ??\n candidates.find(onPlot) ??\n candidates[point.x > (bounds.left + bounds.right) / 2 ? 1 : 0];\n placed.push(box(chosen));\n result.set(point.key, chosen);\n }\n return result;\n}\n\nexport function ParetoChart({\n points,\n xLabel,\n yLabel,\n xDirection = 'lower',\n yDirection = 'higher',\n formatX = String,\n formatY = String,\n xScale = 'linear',\n xDomain,\n yDomain,\n xTicks,\n yTicks,\n labels = 'front',\n fadeDominated = true,\n highlightKeys,\n maxHeight = MAX_HEIGHT,\n onSelect,\n legend,\n empty,\n emptyTitle,\n emptyDescription,\n progress,\n frontProgress,\n className,\n}: ParetoChartProps) {\n const strings = useStrings();\n const clipId = useId();\n const wrapRef = useRef<HTMLDivElement>(null);\n const width = useElementWidth(wrapRef);\n const cls = [\n 'aegis-pareto',\n progress === undefined && frontProgress === undefined\n ? ''\n : 'aegis-pareto--scroll',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const geometry = useMemo(() => {\n if (points.length === 0 || width === 0) {\n return null;\n }\n const height = Math.round(\n Math.min(maxHeight, Math.max(MIN_HEIGHT, width / 2)),\n );\n const xValues = points.map((point) => point.x);\n const logLo = Math.min(...xValues);\n const logHi = Math.max(...xValues);\n const [xLo, xHi] =\n xDomain ??\n (xScale === 'log'\n ? // One value has no span to divide, so it sits mid-axis.\n ([\n logHi > logLo ? logLo : logLo / 2,\n logHi > logLo ? logHi : logHi * 2,\n ] as const)\n : zeroAnchoredDomain(xValues));\n const [yLo, yHi] =\n yDomain ?? zeroAnchoredDomain(points.map((point) => point.y));\n const scaleX = xScale === 'log' ? Math.log10 : (value: number) => value;\n const left = PAD_LEFT;\n const right = width - PAD_RIGHT;\n const top = PAD_TOP;\n const bottom = height - PAD_BOTTOM;\n const sx = (value: number): number =>\n left +\n ((scaleX(value) - scaleX(xLo)) / (scaleX(xHi) - scaleX(xLo))) *\n (right - left);\n const sy = (value: number): number =>\n bottom - ((value - yLo) / (yHi - yLo)) * (bottom - top);\n const front = points\n .filter(\n (candidate) =>\n !points.some(\n (other) =>\n other.key !== candidate.key &&\n (better(other.x, candidate.x, xDirection) ||\n other.x === candidate.x) &&\n (better(other.y, candidate.y, yDirection) ||\n other.y === candidate.y) &&\n (better(other.x, candidate.x, xDirection) ||\n better(other.y, candidate.y, yDirection)),\n ),\n )\n .sort((a, b) => a.x - b.x);\n const steps = Array.from(\n { length: GRID_STEPS },\n (_, i) => (i + 1) / GRID_STEPS,\n );\n // Points draw in from left to right; the frontier comes last.\n const order = new Map(\n [...points]\n .sort((a, b) => sx(a.x) - sx(b.x))\n .map((point, rank) => [point.key, rank]),\n );\n return {\n height,\n order,\n left,\n right,\n top,\n bottom,\n sx,\n sy,\n front,\n frontKeys: new Set(front.map((point) => point.key)),\n // Even shares of the plot, which on a log axis are even ratios.\n gridX: xTicks?.map(sx) ?? steps.map((t) => left + (right - left) * t),\n gridY: yTicks?.map(sy) ?? steps.map((t) => sy(yLo + (yHi - yLo) * t)),\n xLabels: xTicks ?? [xLo, xHi],\n yLabels: yTicks ?? [yLo, yHi],\n };\n }, [\n points,\n width,\n xDirection,\n yDirection,\n xScale,\n xDomain,\n yDomain,\n xTicks,\n yTicks,\n maxHeight,\n ]);\n\n if (points.length === 0) {\n return (\n <div ref={wrapRef} className={cls}>\n {empty === undefined ? (\n <EmptyState\n title={emptyTitle ?? strings.paretoEmptyTitle}\n description={emptyDescription}\n />\n ) : (\n <div\n className=\"aegis-pareto__empty\"\n style={\n {\n '--aegis-pareto-min-height': `${MIN_HEIGHT.toString()}px`,\n } as CSSProperties\n }\n >\n {empty}\n </div>\n )}\n </div>\n );\n }\n\n if (!geometry) {\n return <div ref={wrapRef} className={cls} />;\n }\n\n const { height, left, right, top, bottom, sx, sy, front, frontKeys } =\n geometry;\n const highlighted =\n highlightKeys === undefined ? null : new Set(highlightKeys);\n const dimmed = (key: string): boolean =>\n highlighted !== null && !highlighted.has(key);\n const yTitleBaseline = top - LABEL_GAP * 2;\n const showAllLabels = labels === 'all' && width >= ALL_LABELS_MIN_WIDTH;\n const labelBoxes = placeLabels(\n points\n .filter(\n (point) =>\n showAllLabels ||\n frontKeys.has(point.key) ||\n (highlighted?.has(point.key) ?? false),\n )\n .map((point) => ({\n key: point.key,\n label: point.label,\n x: sx(point.x),\n y: sy(point.y),\n })),\n points.map((point) => ({\n key: point.key,\n x: sx(point.x),\n y: sy(point.y),\n })),\n front.slice(1).map((point, index): Segment => {\n const previous = front[index];\n return [\n { x: sx(previous.x), y: sy(previous.y) },\n { x: sx(point.x), y: sy(point.y) },\n ];\n }),\n // The y axis's title, above the plot.\n [\n {\n l: left - LABEL_GAP,\n r: left - LABEL_GAP + labelWidth(yLabel),\n t: yTitleBaseline - LABEL_LINE + LABEL_DESCENT,\n b: yTitleBaseline + LABEL_DESCENT,\n },\n ],\n // A label may run up into the space above the plot.\n { left, right, top: 0, bottom },\n );\n // A plot too narrow to name every point names them under it instead, so\n // none is left to a tooltip a phone cannot show.\n const legendItems =\n legend?.map((item) => ({\n key: item.key,\n label: item.label,\n color: item.color ?? ('var(--bg-inverted)' as const),\n })) ??\n (labels === 'all' && !showAllLabels\n ? points.map((point) => ({\n key: point.key,\n label: point.label,\n color: point.color ?? ('var(--bg-inverted)' as const),\n }))\n : []);\n const frontDrawn =\n frontProgress ??\n (progress === undefined\n ? undefined\n : staggeredProgress(progress, points.length, points.length + 1));\n const selectOnKey = (event: KeyboardEvent<SVGCircleElement>, key: string) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onSelect?.(key);\n }\n };\n\n return (\n <div ref={wrapRef} className={cls}>\n <svg\n className=\"aegis-pareto__svg\"\n width={width}\n height={height}\n viewBox={`0 0 ${width.toString()} ${height.toString()}`}\n role={onSelect ? 'group' : 'img'}\n aria-label={strings.paretoChartLabel(xLabel, yLabel)}\n style={\n {\n '--aegis-pareto-count': points.length,\n ...(frontDrawn === undefined\n ? {}\n : { '--aegis-pareto-front-progress': frontDrawn }),\n } as CSSProperties\n }\n >\n {geometry.gridY.map((y) => (\n <line\n key={`gy-${y.toString()}`}\n className=\"aegis-pareto__grid\"\n x1={left}\n y1={y}\n x2={right}\n y2={y}\n />\n ))}\n {geometry.gridX.map((x) => (\n <line\n key={`gx-${x.toString()}`}\n className=\"aegis-pareto__grid\"\n x1={x}\n y1={top}\n x2={x}\n y2={bottom}\n />\n ))}\n <line\n className=\"aegis-pareto__axis\"\n x1={left}\n y1={bottom}\n x2={right}\n y2={bottom}\n />\n <line\n className=\"aegis-pareto__axis\"\n x1={left}\n y1={top}\n x2={left}\n y2={bottom}\n />\n {frontDrawn !== undefined && (\n <clipPath id={clipId}>\n <rect\n x={left}\n y={0}\n width={(right - left) * frontDrawn}\n height={height}\n />\n </clipPath>\n )}\n {front.length > 1 && (\n <polyline\n className=\"aegis-pareto__front\"\n clipPath={frontDrawn === undefined ? undefined : `url(#${clipId})`}\n points={front\n .map(\n (point) =>\n `${sx(point.x).toString()},${sy(point.y).toString()}`,\n )\n .join(' ')}\n />\n )}\n {points.map((point, index) => (\n <circle\n key={point.key}\n className={[\n 'aegis-pareto__point',\n fadeDominated && !frontKeys.has(point.key)\n ? 'aegis-pareto__point--dominated'\n : '',\n dimmed(point.key) ? 'aegis-pareto__point--dimmed' : '',\n onSelect ? 'aegis-pareto__point--interactive' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n style={\n {\n fill:\n point.color === undefined\n ? undefined\n : chartColorValue(point.color),\n '--aegis-pareto-index': index,\n '--aegis-pareto-point-progress':\n progress === undefined\n ? 1\n : staggeredProgress(\n progress,\n geometry.order.get(point.key) ?? index,\n points.length + 1,\n ),\n } as CSSProperties\n }\n cx={sx(point.x)}\n cy={sy(point.y)}\n r={POINT_RADIUS}\n role={onSelect ? 'button' : undefined}\n tabIndex={onSelect ? 0 : undefined}\n aria-label={onSelect ? point.label : undefined}\n onClick={\n onSelect\n ? () => {\n onSelect(point.key);\n }\n : undefined\n }\n onKeyDown={\n onSelect\n ? (event) => {\n selectOnKey(event, point.key);\n }\n : undefined\n }\n >\n <title>{point.label}</title>\n </circle>\n ))}\n {points.map((point) => {\n const box = labelBoxes.get(point.key);\n return box === undefined ? null : (\n <text\n key={`label-${point.key}`}\n className={[\n 'aegis-pareto__point-label',\n dimmed(point.key) ? 'aegis-pareto__point-label--dimmed' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n style={\n labels === 'all'\n ? ({\n '--aegis-pareto-front-progress':\n progress === undefined\n ? 1\n : staggeredProgress(\n progress,\n geometry.order.get(point.key) ?? 0,\n points.length + 1,\n ),\n } as CSSProperties)\n : undefined\n }\n x={box.x}\n y={box.y}\n textAnchor={box.anchor}\n >\n {point.label}\n </text>\n );\n })}\n {geometry.xLabels.map((value, index) => (\n <text\n key={`x-${value.toString()}`}\n className=\"aegis-pareto__tick\"\n x={sx(value)}\n y={bottom + LABEL_GAP * 2}\n textAnchor={\n index === geometry.xLabels.length - 1 && sx(value) >= right - 1\n ? 'end'\n : 'middle'\n }\n >\n {formatX(value)}\n </text>\n ))}\n {geometry.yLabels.map((value) => (\n <text\n key={`y-${value.toString()}`}\n className=\"aegis-pareto__tick\"\n x={left - LABEL_GAP}\n y={sy(value)}\n textAnchor=\"end\"\n dominantBaseline=\"middle\"\n >\n {formatY(value)}\n </text>\n ))}\n <text\n className=\"aegis-pareto__axis-label\"\n x={right}\n y={height - LABEL_GAP}\n textAnchor=\"end\"\n >\n {xLabel}\n </text>\n <text\n className=\"aegis-pareto__axis-label\"\n x={left - LABEL_GAP}\n y={yTitleBaseline}\n textAnchor=\"start\"\n >\n {yLabel}\n </text>\n </svg>\n {legendItems.length > 0 ? (\n <ChartLegend\n className=\"aegis-pareto__legend\"\n shape=\"dot\"\n items={legendItems}\n />\n ) : null}\n </div>\n );\n}\n"],"names":["MAX_HEIGHT","MIN_HEIGHT","PAD_LEFT","PAD_RIGHT","PAD_TOP","PAD_BOTTOM","POINT_RADIUS","LABEL_GAP","GRID_STEPS","LABEL_CHAR","LABEL_WIDE_CHAR","LABEL_LINE","LABEL_DESCENT","ALL_LABELS_MIN_WIDTH","better","a","b","direction","labelWidth","text","sum","char","segmentCrosses","box","dx","dy","enter","exit","p","q","placeLabels","labelled","allPoints","frontier","reserved","bounds","placed","result","reach","point","w","candidates","candidate","l","onPlot","r","t","clearOfMarks","other","clear","segment","chosen","ParetoChart","points","xLabel","yLabel","xDirection","yDirection","formatX","formatY","xScale","xDomain","yDomain","xTicks","yTicks","labels","fadeDominated","highlightKeys","maxHeight","onSelect","legend","empty","emptyTitle","emptyDescription","progress","frontProgress","className","strings","useStrings","clipId","useId","wrapRef","useRef","width","useElementWidth","cls","geometry","useMemo","height","xValues","logLo","logHi","xLo","xHi","zeroAnchoredDomain","yLo","yHi","scaleX","value","left","right","top","bottom","sx","sy","front","steps","_","order","rank","jsx","EmptyState","frontKeys","highlighted","dimmed","key","yTitleBaseline","showAllLabels","labelBoxes","index","previous","legendItems","item","frontDrawn","staggeredProgress","selectOnKey","event","jsxs","y","x","chartColorValue","ChartLegend"],"mappings":"wWAqGMA,GAAa,IACbC,GAAa,IACbC,GAAW,GACXC,GAAY,GACZC,GAAU,GACVC,GAAa,GACbC,EAAe,EACfC,EAAY,EACZC,GAAa,EAGbC,GAAa,IACbC,GAAkB,GAClBC,EAAa,GAEbC,EAAgBD,EAAa,EAC7BE,GAAuB,IAI7B,SAASC,EAAOC,EAAWC,EAAWC,EAA+B,CACnE,OAAOA,IAAc,QAAUF,EAAIC,EAAID,EAAIC,CAC7C,CAQA,SAASE,GAAWC,EAAsB,CACxC,MAAO,CAAC,GAAGA,CAAI,EAAE,OACf,CAACC,EAAKC,IACJD,IAAQC,EAAK,YAAY,CAAC,GAAK,GAAK,IAAMX,GAAkBD,IAC9D,CAAA,CAEJ,CAYA,SAASa,GAAe,CAACP,EAAGC,CAAC,EAAYO,EAAmB,CAC1D,MAAMC,EAAKR,EAAE,EAAID,EAAE,EACbU,EAAKT,EAAE,EAAID,EAAE,EACnB,IAAIW,EAAQ,EACRC,EAAO,EACX,SAAW,CAACC,EAAGC,CAAC,GAAK,CACnB,CAAC,CAACL,EAAIT,EAAE,EAAIQ,EAAI,CAAC,EACjB,CAACC,EAAID,EAAI,EAAIR,EAAE,CAAC,EAChB,CAAC,CAACU,EAAIV,EAAE,EAAIQ,EAAI,CAAC,EACjB,CAACE,EAAIF,EAAI,EAAIR,EAAE,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