@conscience-technology/ovenn 0.0.0-stage → 0.7.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/README.md +189 -2
- package/assets/components/AIMessage/AIMessage.module.css +150 -0
- package/assets/components/AIMessage/AIMessage.tsx +106 -0
- package/assets/components/AIMessage/index.ts +2 -0
- package/assets/components/Accordion/Accordion.module.css +265 -0
- package/assets/components/Accordion/Accordion.tsx +209 -0
- package/assets/components/Accordion/index.ts +7 -0
- package/assets/components/AppFrame/AppFrame.module.css +200 -0
- package/assets/components/AppFrame/AppFrame.tsx +93 -0
- package/assets/components/AppFrame/index.ts +6 -0
- package/assets/components/AttachmentItem/AttachmentItem.module.css +124 -0
- package/assets/components/AttachmentItem/AttachmentItem.tsx +185 -0
- package/assets/components/AttachmentItem/index.ts +6 -0
- package/assets/components/AttachmentThumb/AttachmentThumb.module.css +141 -0
- package/assets/components/AttachmentThumb/AttachmentThumb.tsx +102 -0
- package/assets/components/AttachmentThumb/index.ts +2 -0
- package/assets/components/Avatar/Avatar.module.css +216 -0
- package/assets/components/Avatar/Avatar.tsx +283 -0
- package/assets/components/Avatar/index.ts +9 -0
- package/assets/components/AvatarUpload/AvatarUpload.module.css +83 -0
- package/assets/components/AvatarUpload/AvatarUpload.tsx +155 -0
- package/assets/components/AvatarUpload/index.ts +2 -0
- package/assets/components/Badge/Badge.module.css +178 -0
- package/assets/components/Badge/Badge.tsx +117 -0
- package/assets/components/Badge/index.ts +2 -0
- package/assets/components/BrandSet/BrandSetController.tsx +56 -0
- package/assets/components/BrandSet/index.ts +14 -0
- package/assets/components/BrandSet/resolve.ts +10 -0
- package/assets/components/BrandSet/types.ts +43 -0
- package/assets/components/Breadcrumb/Breadcrumb.module.css +281 -0
- package/assets/components/Breadcrumb/Breadcrumb.tsx +352 -0
- package/assets/components/Breadcrumb/index.ts +8 -0
- package/assets/components/Bubble/Bubble.module.css +71 -0
- package/assets/components/Bubble/Bubble.tsx +63 -0
- package/assets/components/Bubble/index.ts +2 -0
- package/assets/components/Button/Button.module.css +342 -0
- package/assets/components/Button/Button.tsx +217 -0
- package/assets/components/Button/index.ts +2 -0
- package/assets/components/ButtonGroup/ButtonGroup.tsx +22 -0
- package/assets/components/ButtonGroup/index.ts +5 -0
- package/assets/components/Calendar/Calendar.module.css +244 -0
- package/assets/components/Calendar/Calendar.tsx +419 -0
- package/assets/components/Calendar/index.ts +2 -0
- package/assets/components/Callout/Callout.module.css +147 -0
- package/assets/components/Callout/Callout.tsx +207 -0
- package/assets/components/Callout/index.ts +2 -0
- package/assets/components/Canvas/Canvas.module.css +75 -0
- package/assets/components/Canvas/Canvas.tsx +699 -0
- package/assets/components/Canvas/alignment.ts +34 -0
- package/assets/components/Canvas/clipboard.ts +30 -0
- package/assets/components/Canvas/collision.ts +67 -0
- package/assets/components/Canvas/edgeOptions.ts +11 -0
- package/assets/components/Canvas/graph.ts +11 -0
- package/assets/components/Canvas/history.ts +41 -0
- package/assets/components/Canvas/index.ts +4 -0
- package/assets/components/Canvas/selection.ts +56 -0
- package/assets/components/Canvas/tokens.css +61 -0
- package/assets/components/Canvas/types.ts +27 -0
- package/assets/components/Canvas/useCanvasSettlement.ts +79 -0
- package/assets/components/CanvasEdge/CanvasEdge.module.css +62 -0
- package/assets/components/CanvasEdge/CanvasEdge.tsx +121 -0
- package/assets/components/CanvasEdge/geometry.ts +350 -0
- package/assets/components/CanvasEdge/index.ts +4 -0
- package/assets/components/CanvasEdge/interactions.ts +14 -0
- package/assets/components/CanvasEdge/tokens.css +29 -0
- package/assets/components/CanvasNode/CanvasNode.module.css +314 -0
- package/assets/components/CanvasNode/CanvasNode.tsx +144 -0
- package/assets/components/CanvasNode/index.ts +2 -0
- package/assets/components/CanvasNode/runningOutline.ts +59 -0
- package/assets/components/CanvasNode/tokens.css +89 -0
- package/assets/components/Card/Card.module.css +127 -0
- package/assets/components/Card/Card.tsx +88 -0
- package/assets/components/Card/index.ts +2 -0
- package/assets/components/Chart/Chart.module.css +278 -0
- package/assets/components/Chart/Chart.tsx +385 -0
- package/assets/components/Chart/entrance.tsx +57 -0
- package/assets/components/Chart/index.ts +14 -0
- package/assets/components/ChatInput/ChatInput.module.css +378 -0
- package/assets/components/ChatInput/ChatInput.tsx +362 -0
- package/assets/components/ChatInput/ModelSelector.tsx +48 -0
- package/assets/components/ChatInput/SendButton.tsx +72 -0
- package/assets/components/ChatInput/index.ts +12 -0
- package/assets/components/Checkbox/Checkbox.module.css +186 -0
- package/assets/components/Checkbox/Checkbox.tsx +129 -0
- package/assets/components/Checkbox/index.ts +2 -0
- package/assets/components/CheckboxCard/CheckboxCard.module.css +1 -0
- package/assets/components/CheckboxCard/CheckboxCard.tsx +17 -0
- package/assets/components/CheckboxCard/index.ts +2 -0
- package/assets/components/Chip/Chip.module.css +209 -0
- package/assets/components/Chip/Chip.tsx +219 -0
- package/assets/components/Chip/index.ts +2 -0
- package/assets/components/Code/Code.module.css +26 -0
- package/assets/components/Code/Code.tsx +26 -0
- package/assets/components/Code/index.ts +2 -0
- package/assets/components/CodeBlock/CodeBlock.module.css +259 -0
- package/assets/components/CodeBlock/CodeBlock.tsx +283 -0
- package/assets/components/CodeBlock/copy-code.ts +15 -0
- package/assets/components/CodeBlock/index.ts +2 -0
- package/assets/components/ColorArea/ColorArea.module.css +148 -0
- package/assets/components/ColorArea/ColorArea.tsx +156 -0
- package/assets/components/ColorArea/index.ts +2 -0
- package/assets/components/ColorField/ColorField.module.css +201 -0
- package/assets/components/ColorField/ColorField.tsx +374 -0
- package/assets/components/ColorField/index.ts +2 -0
- package/assets/components/ColorPicker/ColorPicker.module.css +310 -0
- package/assets/components/ColorPicker/ColorPicker.tsx +387 -0
- package/assets/components/ColorPicker/index.ts +16 -0
- package/assets/components/ColorSlider/ColorSlider.module.css +170 -0
- package/assets/components/ColorSlider/ColorSlider.tsx +165 -0
- package/assets/components/ColorSlider/index.ts +15 -0
- package/assets/components/ColorSwatch/ColorSwatch.module.css +35 -0
- package/assets/components/ColorSwatch/ColorSwatch.tsx +69 -0
- package/assets/components/ColorSwatch/index.ts +2 -0
- package/assets/components/ColorSwatchPicker/ColorSwatchPicker.module.css +115 -0
- package/assets/components/ColorSwatchPicker/ColorSwatchPicker.tsx +183 -0
- package/assets/components/ColorSwatchPicker/index.ts +15 -0
- package/assets/components/Combobox/Combobox.module.css +13 -0
- package/assets/components/Combobox/Combobox.tsx +107 -0
- package/assets/components/Combobox/index.ts +2 -0
- package/assets/components/CommandPalette/CommandPalette.module.css +264 -0
- package/assets/components/CommandPalette/CommandPalette.tsx +425 -0
- package/assets/components/CommandPalette/index.ts +9 -0
- package/assets/components/CommandPalette/useCommandPaletteHotkey.ts +49 -0
- package/assets/components/Comment/Comment.module.css +25 -0
- package/assets/components/Comment/Comment.tsx +44 -0
- package/assets/components/Comment/CommentComposer.module.css +26 -0
- package/assets/components/Comment/CommentComposer.tsx +56 -0
- package/assets/components/Comment/CommentEditor.module.css +8 -0
- package/assets/components/Comment/CommentEditor.tsx +43 -0
- package/assets/components/Comment/CommentMentionInput.module.css +9 -0
- package/assets/components/Comment/CommentMentionInput.tsx +150 -0
- package/assets/components/Comment/index.ts +9 -0
- package/assets/components/Comment/types.ts +1 -0
- package/assets/components/ContextMenu/ContextMenu.module.css +121 -0
- package/assets/components/ContextMenu/ContextMenu.tsx +420 -0
- package/assets/components/ContextMenu/index.ts +9 -0
- package/assets/components/ControlGroup/ControlGroup.module.css +319 -0
- package/assets/components/ControlGroup/ControlGroup.tsx +69 -0
- package/assets/components/ControlGroup/context.tsx +12 -0
- package/assets/components/ControlGroup/index.ts +3 -0
- package/assets/components/ControlGroup/size.ts +9 -0
- package/assets/components/DataTable/DataTable.module.css +57 -0
- package/assets/components/DataTable/DataTable.tsx +137 -0
- package/assets/components/DataTable/index.ts +4 -0
- package/assets/components/DataTable/state.ts +34 -0
- package/assets/components/DatePicker/Calendar.tsx +485 -0
- package/assets/components/DatePicker/DESIGN_NOTES.md +106 -0
- package/assets/components/DatePicker/DESIGN_NOTES_TIME.md +125 -0
- package/assets/components/DatePicker/DateField.tsx +303 -0
- package/assets/components/DatePicker/DatePicker.module.css +623 -0
- package/assets/components/DatePicker/DatePicker.tsx +530 -0
- package/assets/components/DatePicker/TimeSelector.tsx +77 -0
- package/assets/components/DatePicker/index.ts +11 -0
- package/assets/components/DatePicker/presets.ts +84 -0
- package/assets/components/DatePicker/utils.ts +214 -0
- package/assets/components/Disclosure/Disclosure.module.css +74 -0
- package/assets/components/Disclosure/Disclosure.tsx +129 -0
- package/assets/components/Disclosure/index.ts +6 -0
- package/assets/components/Drawer/Drawer.module.css +197 -0
- package/assets/components/Drawer/Drawer.tsx +230 -0
- package/assets/components/Drawer/index.ts +15 -0
- package/assets/components/DropdownMenu/DropdownMenu.module.css +26 -0
- package/assets/components/DropdownMenu/DropdownMenu.tsx +400 -0
- package/assets/components/DropdownMenu/index.ts +9 -0
- package/assets/components/EmptyState/EmptyState.module.css +102 -0
- package/assets/components/EmptyState/EmptyState.tsx +80 -0
- package/assets/components/EmptyState/index.ts +2 -0
- package/assets/components/EventChip/EventChip.module.css +143 -0
- package/assets/components/EventChip/EventChip.tsx +95 -0
- package/assets/components/EventChip/index.ts +2 -0
- package/assets/components/EventListItem/EventListItem.module.css +223 -0
- package/assets/components/EventListItem/EventListItem.tsx +233 -0
- package/assets/components/EventListItem/index.ts +8 -0
- package/assets/components/FileIcon/FileIcon.module.css +78 -0
- package/assets/components/FileIcon/FileIcon.tsx +142 -0
- package/assets/components/FileIcon/fileExtMap.ts +166 -0
- package/assets/components/FileIcon/index.ts +9 -0
- package/assets/components/FileUpload/FileUpload.module.css +19 -0
- package/assets/components/FileUpload/FileUpload.tsx +96 -0
- package/assets/components/FileUpload/FileUploadItem.tsx +34 -0
- package/assets/components/FileUpload/index.ts +2 -0
- package/assets/components/FileUpload/utils.ts +8 -0
- package/assets/components/GalleryItem/GalleryItem.module.css +217 -0
- package/assets/components/GalleryItem/GalleryItem.tsx +163 -0
- package/assets/components/GalleryItem/index.ts +7 -0
- package/assets/components/GeneratedImage/GeneratedImage.module.css +93 -0
- package/assets/components/GeneratedImage/GeneratedImage.tsx +84 -0
- package/assets/components/GeneratedImage/index.ts +5 -0
- package/assets/components/Hint/Hint.module.css +75 -0
- package/assets/components/Hint/Hint.tsx +89 -0
- package/assets/components/Hint/index.ts +2 -0
- package/assets/components/Icon/Icon.tsx +654 -0
- package/assets/components/Icon/LucideFamilyIcon.tsx +434 -0
- package/assets/components/Icon/MissingIcon.tsx +25 -0
- package/assets/components/Icon/SolarFamilyIcon.tsx +439 -0
- package/assets/components/Icon/catalogNames.ts +8 -0
- package/assets/components/Icon/context.tsx +39 -0
- package/assets/components/Icon/index.ts +6 -0
- package/assets/components/Icon/lucideCatalog.ts +11358 -0
- package/assets/components/Icon/phosphorCatalog.ts +3052 -0
- package/assets/components/Icon/solarCatalog.ts +16064 -0
- package/assets/components/IconButton/IconButton.module.css +117 -0
- package/assets/components/IconButton/IconButton.tsx +113 -0
- package/assets/components/IconButton/index.ts +2 -0
- package/assets/components/Input/Input.module.css +375 -0
- package/assets/components/Input/Input.tsx +424 -0
- package/assets/components/Input/index.ts +2 -0
- package/assets/components/Kanban/Kanban.module.css +353 -0
- package/assets/components/Kanban/Kanban.tsx +371 -0
- package/assets/components/Kanban/index.ts +10 -0
- package/assets/components/ListItem/ListItem.module.css +235 -0
- package/assets/components/ListItem/ListItem.tsx +262 -0
- package/assets/components/ListItem/index.ts +9 -0
- package/assets/components/MenuItem/MenuItem.module.css +603 -0
- package/assets/components/MenuItem/MenuItem.tsx +704 -0
- package/assets/components/MenuItem/index.ts +8 -0
- package/assets/components/MessageActions/MessageActions.module.css +79 -0
- package/assets/components/MessageActions/MessageActions.tsx +139 -0
- package/assets/components/MessageActions/index.ts +6 -0
- package/assets/components/MessageQuote/MessageQuote.module.css +30 -0
- package/assets/components/MessageQuote/MessageQuote.tsx +33 -0
- package/assets/components/MessageQuote/index.ts +2 -0
- package/assets/components/MessageSources/MessageSources.module.css +60 -0
- package/assets/components/MessageSources/MessageSources.tsx +60 -0
- package/assets/components/MessageSources/index.ts +2 -0
- package/assets/components/MessageState/MessageState.module.css +118 -0
- package/assets/components/MessageState/MessageState.tsx +150 -0
- package/assets/components/MessageState/index.ts +2 -0
- package/assets/components/MessageTable/MessageTable.module.css +59 -0
- package/assets/components/MessageTable/MessageTable.tsx +21 -0
- package/assets/components/MessageTable/index.ts +2 -0
- package/assets/components/MetricCard/MetricCard.module.css +141 -0
- package/assets/components/MetricCard/MetricCard.tsx +162 -0
- package/assets/components/MetricCard/index.ts +2 -0
- package/assets/components/MetricCard/tokens.css +10 -0
- package/assets/components/MiniCalendar/MiniCalendar.module.css +130 -0
- package/assets/components/MiniCalendar/MiniCalendar.tsx +161 -0
- package/assets/components/MiniCalendar/index.ts +2 -0
- package/assets/components/Modal/Modal.module.css +294 -0
- package/assets/components/Modal/Modal.tsx +402 -0
- package/assets/components/Modal/index.ts +22 -0
- package/assets/components/MultiSelect/MultiSelect.tsx +7 -0
- package/assets/components/MultiSelect/index.ts +2 -0
- package/assets/components/Onboarding/DocsIndex.tsx +102 -0
- package/assets/components/Onboarding/LayoutBuilder.tsx +166 -0
- package/assets/components/Onboarding/Onboarding.module.css +1494 -0
- package/assets/components/Onboarding/OnboardingAxisPanel.tsx +472 -0
- package/assets/components/Onboarding/OnboardingPage.tsx +1258 -0
- package/assets/components/Onboarding/PresetsGallery.tsx +56 -0
- package/assets/components/Onboarding/actions.ts +529 -0
- package/assets/components/Onboarding/index.ts +8 -0
- package/assets/components/Onboarding/palette.css +48 -0
- package/assets/components/Onboarding/wizardData.ts +529 -0
- package/assets/components/PageHeader/PageHeader.module.css +119 -0
- package/assets/components/PageHeader/PageHeader.tsx +126 -0
- package/assets/components/PageHeader/index.ts +2 -0
- package/assets/components/Pagination/Pagination.module.css +132 -0
- package/assets/components/Pagination/Pagination.tsx +294 -0
- package/assets/components/Pagination/index.ts +6 -0
- package/assets/components/ProgressBar/ProgressBar.module.css +127 -0
- package/assets/components/ProgressBar/ProgressBar.tsx +85 -0
- package/assets/components/ProgressBar/index.ts +6 -0
- package/assets/components/QuotationBar/QuotationBar.module.css +63 -0
- package/assets/components/QuotationBar/QuotationBar.tsx +60 -0
- package/assets/components/QuotationBar/index.ts +2 -0
- package/assets/components/Radio/Radio.module.css +125 -0
- package/assets/components/Radio/Radio.tsx +39 -0
- package/assets/components/Radio/index.ts +2 -0
- package/assets/components/RadioCard/RadioCard.module.css +283 -0
- package/assets/components/RadioCard/RadioCard.tsx +186 -0
- package/assets/components/RadioCard/index.ts +2 -0
- package/assets/components/SegmentedChart/SegmentedChart.module.css +237 -0
- package/assets/components/SegmentedChart/SegmentedChart.tsx +121 -0
- package/assets/components/SegmentedChart/index.ts +2 -0
- package/assets/components/Select/Select.module.css +161 -0
- package/assets/components/Select/Select.tsx +453 -0
- package/assets/components/Select/index.ts +10 -0
- package/assets/components/Shortcut/Shortcut.module.css +79 -0
- package/assets/components/Shortcut/Shortcut.tsx +206 -0
- package/assets/components/Shortcut/index.ts +2 -0
- package/assets/components/Sidebar/Sidebar.module.css +407 -0
- package/assets/components/Sidebar/Sidebar.tsx +585 -0
- package/assets/components/Sidebar/index.ts +7 -0
- package/assets/components/Skeleton/Skeleton.module.css +33 -0
- package/assets/components/Skeleton/Skeleton.tsx +20 -0
- package/assets/components/Skeleton/index.ts +2 -0
- package/assets/components/Skeleton/tokens.css +11 -0
- package/assets/components/Slider/Slider.module.css +137 -0
- package/assets/components/Slider/Slider.tsx +104 -0
- package/assets/components/Slider/index.ts +2 -0
- package/assets/components/Spinner/LottiePlayer.tsx +179 -0
- package/assets/components/Spinner/Spinner.module.css +208 -0
- package/assets/components/Spinner/Spinner.tsx +133 -0
- package/assets/components/Spinner/index.ts +10 -0
- package/assets/components/Spinner/lottieColor.ts +166 -0
- package/assets/components/Spinner/lottieManifest.ts +103 -0
- package/assets/components/Stepper/Stepper.module.css +378 -0
- package/assets/components/Stepper/Stepper.tsx +253 -0
- package/assets/components/Stepper/index.ts +2 -0
- package/assets/components/Switch/Switch.module.css +176 -0
- package/assets/components/Switch/Switch.tsx +77 -0
- package/assets/components/Switch/index.ts +2 -0
- package/assets/components/TabStrip/TabStrip.module.css +362 -0
- package/assets/components/TabStrip/TabStrip.tsx +404 -0
- package/assets/components/TabStrip/index.ts +7 -0
- package/assets/components/TableCell/TableCell.module.css +137 -0
- package/assets/components/TableCell/TableCellAvatar.tsx +66 -0
- package/assets/components/TableCell/TableCellBadge.tsx +30 -0
- package/assets/components/TableCell/TableCellImage.tsx +49 -0
- package/assets/components/TableCell/TableCellMeter.tsx +55 -0
- package/assets/components/TableCell/TableCellNumber.tsx +43 -0
- package/assets/components/TableCell/TableCellTag.tsx +23 -0
- package/assets/components/TableCell/TableCellText.tsx +33 -0
- package/assets/components/TableCell/index.ts +22 -0
- package/assets/components/TableHeader/TableHeader.module.css +355 -0
- package/assets/components/TableHeader/TableHeader.tsx +658 -0
- package/assets/components/TableHeader/index.ts +9 -0
- package/assets/components/TableRow/TableRow.module.css +355 -0
- package/assets/components/TableRow/TableRow.tsx +292 -0
- package/assets/components/TableRow/index.ts +8 -0
- package/assets/components/TableRowEdit/TableRowEdit.module.css +164 -0
- package/assets/components/TableRowEdit/TableRowEdit.tsx +279 -0
- package/assets/components/TableRowEdit/index.ts +2 -0
- package/assets/components/TableRowSelect/TableRowSelect.module.css +23 -0
- package/assets/components/TableRowSelect/TableRowSelect.tsx +173 -0
- package/assets/components/TableRowSelect/index.ts +2 -0
- package/assets/components/TableToolbar/TableToolbar.module.css +38 -0
- package/assets/components/TableToolbar/TableToolbar.tsx +105 -0
- package/assets/components/TableToolbar/index.ts +5 -0
- package/assets/components/Tabs/Tabs.module.css +387 -0
- package/assets/components/Tabs/Tabs.tsx +518 -0
- package/assets/components/Tabs/index.ts +9 -0
- package/assets/components/Tag/Tag.module.css +101 -0
- package/assets/components/Tag/Tag.tsx +55 -0
- package/assets/components/Tag/index.ts +2 -0
- package/assets/components/TemplateBoundary/TemplateBoundary.module.css +4 -0
- package/assets/components/TemplateBoundary/TemplateBoundary.tsx +54 -0
- package/assets/components/TemplateBoundary/index.ts +3 -0
- package/assets/components/TemplateBoundary/types.ts +25 -0
- package/assets/components/Textarea/Textarea.module.css +350 -0
- package/assets/components/Textarea/Textarea.tsx +438 -0
- package/assets/components/Textarea/index.ts +7 -0
- package/assets/components/ThemeController.tsx +396 -0
- package/assets/components/TimePicker/TimePicker.module.css +113 -0
- package/assets/components/TimePicker/TimePicker.tsx +424 -0
- package/assets/components/TimePicker/index.ts +8 -0
- package/assets/components/TimePicker/utils.ts +116 -0
- package/assets/components/TimelineView/TimelineEventBar.tsx +109 -0
- package/assets/components/TimelineView/TimelineView.module.css +203 -0
- package/assets/components/TimelineView/TimelineView.tsx +137 -0
- package/assets/components/TimelineView/axis.ts +62 -0
- package/assets/components/TimelineView/index.ts +3 -0
- package/assets/components/TimelineView/layout.ts +56 -0
- package/assets/components/TimelineView/move.ts +51 -0
- package/assets/components/TimelineView/useTimelineDrag.ts +215 -0
- package/assets/components/TimelineView/useTimelineZoom.ts +92 -0
- package/assets/components/Toast/Toast.module.css +334 -0
- package/assets/components/Toast/Toast.tsx +310 -0
- package/assets/components/Toast/index.ts +16 -0
- package/assets/components/Toolbar/Toolbar.module.css +135 -0
- package/assets/components/Toolbar/Toolbar.tsx +187 -0
- package/assets/components/Toolbar/index.ts +7 -0
- package/assets/components/Tooltip/Tooltip.module.css +52 -0
- package/assets/components/Tooltip/Tooltip.tsx +341 -0
- package/assets/components/Tooltip/index.ts +2 -0
- package/assets/components/TopLoader/TopLoader.module.css +65 -0
- package/assets/components/TopLoader/TopLoader.tsx +58 -0
- package/assets/components/TopLoader/index.ts +2 -0
- package/assets/components/Topbar/Topbar.module.css +54 -0
- package/assets/components/Topbar/Topbar.tsx +102 -0
- package/assets/components/Topbar/index.ts +2 -0
- package/assets/components/TreeNav/TreeNav.module.css +33 -0
- package/assets/components/TreeNav/TreeNav.tsx +130 -0
- package/assets/components/TreeNav/index.ts +2 -0
- package/assets/components/UserMessage/UserMessage.module.css +47 -0
- package/assets/components/UserMessage/UserMessage.tsx +66 -0
- package/assets/components/UserMessage/index.ts +2 -0
- package/assets/components/_cn.ts +3 -0
- package/assets/components/_color.ts +75 -0
- package/assets/components/_data.ts +608 -0
- package/assets/components/_rowInteraction.ts +16 -0
- package/assets/components/_utils.css +135 -0
- package/assets/components/app-shell.css +17 -0
- package/assets/components/axisOptions.ts +17 -0
- package/assets/components/component-registry.json +1063 -0
- package/assets/components/index.ts +118 -0
- package/assets/components/materialScope.tsx +11 -0
- package/assets/components/reset.css +78 -0
- package/assets/components/themeBootScript.ts +125 -0
- package/assets/components/tokens.css +1275 -0
- package/assets/components/useChartEntrance.ts +119 -0
- package/assets/prompts/ASSEMBLY.md +72 -0
- package/assets/prompts/CASCADE.md +49 -0
- package/assets/prompts/CATALOG.md +141 -0
- package/assets/prompts/FEEDBACK_PROCESS.md +19 -0
- package/assets/prompts/GUIDE.md +307 -0
- package/assets/prompts/MEMORY.md +202 -0
- package/assets/prompts/OVERRIDE.md +30 -0
- package/assets/prompts/PRINCIPLES.md +128 -0
- package/assets/prompts/SLOTS.md +194 -0
- package/assets/prompts/WORKFLOW_DESIGN.md +132 -0
- package/assets/prompts/axes/density.md +42 -0
- package/assets/prompts/axes/font.md +35 -0
- package/assets/prompts/axes/icon.md +59 -0
- package/assets/prompts/axes/material.md +40 -0
- package/assets/prompts/axes/mode.md +52 -0
- package/assets/prompts/axes/motion.md +77 -0
- package/assets/prompts/axes/palette.md +51 -0
- package/assets/prompts/axes/shape.md +41 -0
- package/assets/prompts/axes/voice.md +57 -0
- package/assets/prompts/brand-sets/_SCHEMA.md +27 -0
- package/assets/prompts/components/README.md +84 -0
- package/assets/prompts/components/_variants.md +86 -0
- package/assets/prompts/components/accordion.md +151 -0
- package/assets/prompts/components/ai-message.md +53 -0
- package/assets/prompts/components/app-frame.md +141 -0
- package/assets/prompts/components/attachment-item.md +89 -0
- package/assets/prompts/components/attachment-thumb.md +54 -0
- package/assets/prompts/components/avatar-upload.md +62 -0
- package/assets/prompts/components/avatar.md +106 -0
- package/assets/prompts/components/badge.md +58 -0
- package/assets/prompts/components/breadcrumb.md +124 -0
- package/assets/prompts/components/bubble.md +61 -0
- package/assets/prompts/components/button-group.md +35 -0
- package/assets/prompts/components/button.md +133 -0
- package/assets/prompts/components/calendar.md +151 -0
- package/assets/prompts/components/callout.md +98 -0
- package/assets/prompts/components/canvas-edge.md +67 -0
- package/assets/prompts/components/canvas-node.md +80 -0
- package/assets/prompts/components/canvas.md +82 -0
- package/assets/prompts/components/card.md +167 -0
- package/assets/prompts/components/chart-bar.md +77 -0
- package/assets/prompts/components/chart-pie.md +63 -0
- package/assets/prompts/components/chart-radar.md +56 -0
- package/assets/prompts/components/chart-radial.md +56 -0
- package/assets/prompts/components/chart.md +129 -0
- package/assets/prompts/components/chat-input.md +103 -0
- package/assets/prompts/components/checkbox-card.md +53 -0
- package/assets/prompts/components/checkbox.md +121 -0
- package/assets/prompts/components/chip.md +163 -0
- package/assets/prompts/components/code-block.md +95 -0
- package/assets/prompts/components/code.md +62 -0
- package/assets/prompts/components/color-area.md +95 -0
- package/assets/prompts/components/color-field.md +108 -0
- package/assets/prompts/components/color-picker.md +173 -0
- package/assets/prompts/components/color-slider.md +108 -0
- package/assets/prompts/components/color-swatch-picker.md +96 -0
- package/assets/prompts/components/color-swatch.md +85 -0
- package/assets/prompts/components/combobox.md +35 -0
- package/assets/prompts/components/command-palette.md +194 -0
- package/assets/prompts/components/comment.md +72 -0
- package/assets/prompts/components/context-menu.md +153 -0
- package/assets/prompts/components/control-group.md +67 -0
- package/assets/prompts/components/data-table.md +90 -0
- package/assets/prompts/components/date-picker.md +156 -0
- package/assets/prompts/components/disclosure.md +55 -0
- package/assets/prompts/components/drawer.md +151 -0
- package/assets/prompts/components/dropdown-menu.md +167 -0
- package/assets/prompts/components/empty-state.md +74 -0
- package/assets/prompts/components/event-chip.md +123 -0
- package/assets/prompts/components/event-list-item.md +112 -0
- package/assets/prompts/components/file-icon.md +83 -0
- package/assets/prompts/components/file-upload.md +35 -0
- package/assets/prompts/components/gallery-item.md +164 -0
- package/assets/prompts/components/generated-image.md +85 -0
- package/assets/prompts/components/hint.md +94 -0
- package/assets/prompts/components/icon-button.md +99 -0
- package/assets/prompts/components/icon.md +101 -0
- package/assets/prompts/components/input.md +134 -0
- package/assets/prompts/components/kanban.md +172 -0
- package/assets/prompts/components/list-item.md +334 -0
- package/assets/prompts/components/menu-item.md +252 -0
- package/assets/prompts/components/message-actions.md +63 -0
- package/assets/prompts/components/message-quote.md +34 -0
- package/assets/prompts/components/message-sources.md +46 -0
- package/assets/prompts/components/message-state.md +61 -0
- package/assets/prompts/components/message-table.md +42 -0
- package/assets/prompts/components/metric-card.md +85 -0
- package/assets/prompts/components/mini-calendar.md +72 -0
- package/assets/prompts/components/modal.md +236 -0
- package/assets/prompts/components/multi-select.md +31 -0
- package/assets/prompts/components/onboarding.md +55 -0
- package/assets/prompts/components/page-header.md +170 -0
- package/assets/prompts/components/pagination.md +99 -0
- package/assets/prompts/components/progress-bar.md +85 -0
- package/assets/prompts/components/quotation-bar.md +44 -0
- package/assets/prompts/components/radio-card.md +62 -0
- package/assets/prompts/components/radio.md +56 -0
- package/assets/prompts/components/segmented-chart.md +79 -0
- package/assets/prompts/components/select.md +146 -0
- package/assets/prompts/components/shortcut.md +81 -0
- package/assets/prompts/components/sidebar.md +537 -0
- package/assets/prompts/components/skeleton.md +44 -0
- package/assets/prompts/components/slider.md +111 -0
- package/assets/prompts/components/spinner.md +124 -0
- package/assets/prompts/components/stepper.md +122 -0
- package/assets/prompts/components/switch.md +108 -0
- package/assets/prompts/components/tab-strip.md +163 -0
- package/assets/prompts/components/table-cell.md +67 -0
- package/assets/prompts/components/table-header.md +181 -0
- package/assets/prompts/components/table-row-edit.md +144 -0
- package/assets/prompts/components/table-row-select.md +90 -0
- package/assets/prompts/components/table-row.md +184 -0
- package/assets/prompts/components/table-toolbar.md +103 -0
- package/assets/prompts/components/tabs.md +136 -0
- package/assets/prompts/components/tag.md +54 -0
- package/assets/prompts/components/textarea.md +114 -0
- package/assets/prompts/components/time-picker.md +87 -0
- package/assets/prompts/components/timeline-view.md +129 -0
- package/assets/prompts/components/toast.md +155 -0
- package/assets/prompts/components/toolbar.md +99 -0
- package/assets/prompts/components/tooltip.md +94 -0
- package/assets/prompts/components/top-loader.md +64 -0
- package/assets/prompts/components/topbar.md +186 -0
- package/assets/prompts/components/tree-nav.md +77 -0
- package/assets/prompts/components/user-message.md +50 -0
- package/assets/prompts/design-examples/README.md +57 -0
- package/assets/prompts/design-examples/catalog.json +1 -0
- package/assets/prompts/primitives/emerge.md +43 -0
- package/assets/prompts/primitives/fade.md +31 -0
- package/assets/prompts/primitives/mobile.md +53 -0
- package/assets/prompts/primitives/scale.md +32 -0
- package/assets/prompts/primitives/scroll.md +170 -0
- package/assets/prompts/primitives/slide.md +31 -0
- package/assets/prompts/recipes/README.md +104 -0
- package/assets/prompts/recipes/card-row.md +39 -0
- package/assets/prompts/recipes/form-footer.md +76 -0
- package/assets/prompts/recipes/meta-line.md +61 -0
- package/assets/prompts/recipes/page-banner.md +121 -0
- package/assets/prompts/recipes/page-header.md +107 -0
- package/assets/prompts/recipes/section-header.md +90 -0
- package/assets/prompts/templates/README.md +9 -0
- package/assets/prompts/templates/ains.md +631 -0
- package/assets/prompts/templates/aurora.md +440 -0
- package/assets/prompts/templates/glass-button.md +337 -0
- package/assets/prompts/templates/minimal.md +209 -0
- package/assets/prompts/templates/workspace.md +346 -0
- package/assets/prompts/themes/_SCHEMA.md +135 -0
- package/assets/prompts/themes/_TEMPLATE.md +73 -0
- package/assets/prompts/themes/expressive.md +118 -0
- package/assets/prompts/themes/pure.md +87 -0
- package/assets/prompts/themes/spare.md +73 -0
- package/assets/prompts/tokens/breakpoint.md +29 -0
- package/assets/prompts/tokens/color.md +105 -0
- package/assets/prompts/tokens/material.md +51 -0
- package/assets/prompts/tokens/radius.md +45 -0
- package/assets/prompts/tokens/shadow.md +35 -0
- package/assets/prompts/tokens/spacing.md +96 -0
- package/assets/prompts/tokens/typography.md +89 -0
- package/assets/prompts/tokens/z-index.md +35 -0
- package/assets/prompts/use-cases/chart-chart-area.md +1334 -0
- package/assets/prompts/use-cases/chart-chart-bar.md +1886 -0
- package/assets/prompts/use-cases/chart-chart-pie.md +1031 -0
- package/assets/prompts/use-cases/chart-chart-radar.md +785 -0
- package/assets/prompts/use-cases/chart-chart-radial.md +988 -0
- package/assets/prompts/use-cases/chart-segmented-chart.md +262 -0
- package/assets/prompts/use-cases/data-comment.md +360 -0
- package/assets/prompts/use-cases/data-data-table.md +249 -0
- package/assets/prompts/use-cases/data-list-item.md +1056 -0
- package/assets/prompts/use-cases/data-metric-card.md +673 -0
- package/assets/prompts/use-cases/data-table-row.md +966 -0
- package/assets/prompts/use-cases/data-table-toolbar.md +481 -0
- package/assets/prompts/use-cases/feedback-drawer.md +1163 -0
- package/assets/prompts/use-cases/feedback-progress-bar.md +427 -0
- package/assets/prompts/use-cases/general-toolbar.md +854 -0
- package/assets/prompts/use-cases/general-tooltip.md +652 -0
- package/assets/prompts/use-cases/input-checkbox.md +443 -0
- package/assets/prompts/use-cases/structure-card.md +603 -0
- package/assets/prompts/use-cases/structure-page-header.md +755 -0
- package/assets/prompts/use-cases/structure-sidebar.md +1132 -0
- package/assets/prompts/use-cases/structure-topbar.md +1200 -0
- package/assets/public/expressive.png +0 -0
- package/assets/public/ovenn-wordmark.svg +19 -0
- package/assets/public/pure.png +0 -0
- package/assets/public/spare.png +0 -0
- package/assets/skills/ovenn/SKILL.md +12 -0
- package/assets/skills/ovenn-component/SKILL.md +12 -0
- package/assets/skills/ovenn-page/SKILL.md +12 -0
- package/assets/skills/ovenn-theme/SKILL.md +12 -0
- package/assets/skills/ovenn-validate/SKILL.md +14 -0
- package/assets/skills/ovenn-validate/fixtures/clean/Clean.module.css +12 -0
- package/assets/skills/ovenn-validate/fixtures/clean/Clean.tsx +9 -0
- package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +112 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-graph.js +15 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-utils.mjs +25 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-utils.test.mjs +52 -0
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.mjs +151 -0
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.test.mjs +91 -0
- package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.mjs +69 -0
- package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.test.mjs +52 -0
- package/assets/skills/ovenn-validate/scripts/rules/hardcoded.mjs +145 -0
- package/assets/skills/ovenn-validate/scripts/rules/hardcoded.test.mjs +83 -0
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.mjs +252 -0
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.test.mjs +131 -0
- package/assets/skills/ovenn-validate/scripts/validate.mjs +169 -0
- package/assets/skills/ovenn-wireframe/SKILL.md +12 -0
- package/bin/ovenn.js +85 -0
- package/package.json +143 -4
- package/src/commands/info.js +217 -0
- package/src/commands/init.js +386 -0
- package/src/commands/update.js +65 -0
- package/src/utils/agents.js +83 -0
- package/src/utils/assets.js +51 -0
- package/src/utils/client-bridges.js +32 -0
- package/src/utils/component-usage.js +112 -0
- package/src/utils/deps.js +59 -0
- package/src/utils/design-examples.js +101 -0
- package/src/utils/design-workflow.js +155 -0
- package/src/utils/detect.js +59 -0
- package/src/utils/diff.js +52 -0
- package/src/utils/doctor.js +47 -0
- package/src/utils/hash.js +16 -0
- package/src/utils/launch.js +94 -0
- package/src/utils/log.js +41 -0
- package/src/utils/managed-assets.js +50 -0
- package/src/utils/mcp-client.js +47 -0
- package/src/utils/meta.js +73 -0
- package/src/utils/patch.js +334 -0
- package/src/utils/prompt.js +28 -0
- package/src/utils/source-graph.js +15 -0
- package/src/utils/update-transaction.js +79 -0
|
@@ -0,0 +1,988 @@
|
|
|
1
|
+
# Radial Chart 사용 사례 소스
|
|
2
|
+
|
|
3
|
+
<!-- Generated by scripts/build-use-cases.mjs. Edit original TSX/CSS, then regenerate. -->
|
|
4
|
+
|
|
5
|
+
### 사례 목록
|
|
6
|
+
|
|
7
|
+
- Monthly goal card
|
|
8
|
+
|
|
9
|
+
문서: /en/components/chart/chart-radial#use-cases
|
|
10
|
+
|
|
11
|
+
문서 페이지에서 렌더하는 사례입니다.
|
|
12
|
+
|
|
13
|
+
### 조회 방법
|
|
14
|
+
|
|
15
|
+
get_guide(topic="use-cases/chart-chart-radial", sections=["사례 목록", "파일 목록"])로 먼저 확인하고, 필요한 Section 또는 Source 파일 헤딩만 sections로 조회하세요. 전체 문서는 문서 페이지의 다른 예제도 포함합니다. 공용 컴포넌트 계약은 get_component로 읽고, 예제의 docs 전용 셸·locale·import 경로는 대상 프로젝트에 맞게 조합하세요. 이 연결은 디자인 승인이나 기능 검증을 뜻하지 않습니다.
|
|
16
|
+
|
|
17
|
+
### 파일 목록
|
|
18
|
+
|
|
19
|
+
- `web/app/[lang]/components/chart/chart-radial/_strings.tsx`
|
|
20
|
+
- `web/app/[lang]/components/chart/chart-radial/page.module.css`
|
|
21
|
+
- `web/app/[lang]/components/chart/chart-radial/page.tsx`
|
|
22
|
+
- `web/examples/ChartCardExamples.module.css`
|
|
23
|
+
- `web/examples/ChartCardExamples.tsx`
|
|
24
|
+
- `web/examples/TrafficComparisonExample.module.css`
|
|
25
|
+
- `web/examples/TrafficComparisonExample.tsx`
|
|
26
|
+
|
|
27
|
+
### Section: web/app/[lang]/components/chart/chart-radial/page.tsx#use-cases
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<section id="use-cases">
|
|
31
|
+
<h2>In Use</h2>
|
|
32
|
+
<h3>{en ? "Monthly goal card" : "월간 목표 카드"}</h3>
|
|
33
|
+
<ExampleBlock previewWidth="full"><GoalCardExample /></ExampleBlock>
|
|
34
|
+
</section>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Source: web/app/[lang]/components/chart/chart-radial/_strings.tsx
|
|
38
|
+
|
|
39
|
+
````tsx
|
|
40
|
+
import type { ReactNode } from "react";
|
|
41
|
+
|
|
42
|
+
type Strings = {
|
|
43
|
+
title: string;
|
|
44
|
+
lead: ReactNode;
|
|
45
|
+
browsers: [string, string, string, string, string];
|
|
46
|
+
visitors: string;
|
|
47
|
+
completion: string;
|
|
48
|
+
desktop: string;
|
|
49
|
+
mobile: string;
|
|
50
|
+
seriesLegend: string;
|
|
51
|
+
usage: { heading: string; desc: ReactNode };
|
|
52
|
+
center: { heading: string; desc: ReactNode };
|
|
53
|
+
stacked: { heading: string; desc: ReactNode };
|
|
54
|
+
api: { heading: string; desc: ReactNode; official: string };
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const en: Strings = {
|
|
58
|
+
title: "Radial Chart",
|
|
59
|
+
lead: "Shows progress or a small set of values as circular bars. Use Bar Chart when exact differences matter.",
|
|
60
|
+
browsers: ["Chrome", "Safari", "Firefox", "Edge", "Other"],
|
|
61
|
+
visitors: "Visitors",
|
|
62
|
+
completion: "Completion",
|
|
63
|
+
desktop: "Desktop",
|
|
64
|
+
mobile: "Mobile",
|
|
65
|
+
seriesLegend: "Series legend",
|
|
66
|
+
usage: {
|
|
67
|
+
heading: "Usage",
|
|
68
|
+
desc: "Use when a compact overview matters more than precise comparisons.",
|
|
69
|
+
},
|
|
70
|
+
center: {
|
|
71
|
+
heading: "Center Value",
|
|
72
|
+
desc: "For one progress measure, show the current value in the center.",
|
|
73
|
+
},
|
|
74
|
+
stacked: {
|
|
75
|
+
heading: "Stacked",
|
|
76
|
+
desc: "Stack only two parts of the same total and include a legend.",
|
|
77
|
+
},
|
|
78
|
+
api: {
|
|
79
|
+
heading: "API Reference",
|
|
80
|
+
desc: "For circular bar and track options, see the",
|
|
81
|
+
official: "RadialBar documentation",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const ko: Strings = {
|
|
86
|
+
title: "Radial Chart",
|
|
87
|
+
lead: "진행률이나 소수 항목의 수치를 원형 막대로 보여줍니다. 정확한 차이를 비교할 때는 Bar Chart를 사용합니다.",
|
|
88
|
+
browsers: ["크롬", "사파리", "파이어폭스", "엣지", "기타"],
|
|
89
|
+
visitors: "방문자",
|
|
90
|
+
completion: "완료율",
|
|
91
|
+
desktop: "데스크톱",
|
|
92
|
+
mobile: "모바일",
|
|
93
|
+
seriesLegend: "시리즈 범례",
|
|
94
|
+
usage: {
|
|
95
|
+
heading: "Usage",
|
|
96
|
+
desc: "정확한 수치 차이보다 전체 흐름을 간결하게 보여줄 때 사용합니다.",
|
|
97
|
+
},
|
|
98
|
+
center: {
|
|
99
|
+
heading: "중앙 값",
|
|
100
|
+
desc: "하나의 진행률을 보여줄 때는 현재 값을 중앙에 표시합니다.",
|
|
101
|
+
},
|
|
102
|
+
stacked: {
|
|
103
|
+
heading: "누적",
|
|
104
|
+
desc: "같은 전체를 이루는 두 항목만 쌓고, 구분할 수 있도록 범례를 표시합니다.",
|
|
105
|
+
},
|
|
106
|
+
api: {
|
|
107
|
+
heading: "API Reference",
|
|
108
|
+
desc: "원형 막대와 배경 트랙 옵션은",
|
|
109
|
+
official: "RadialBar 문서",
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const strings: Record<"en" | "ko", Strings> = { en, ko };
|
|
114
|
+
````
|
|
115
|
+
|
|
116
|
+
### Source: web/app/[lang]/components/chart/chart-radial/page.module.css
|
|
117
|
+
|
|
118
|
+
````css
|
|
119
|
+
.radialChart,
|
|
120
|
+
.playgroundChart {
|
|
121
|
+
width: 100%;
|
|
122
|
+
max-width: calc(var(--size-24) * 4);
|
|
123
|
+
aspect-ratio: 1;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.radialChart :global(.recharts-radial-bar-sector),
|
|
127
|
+
.playgroundChart :global(.recharts-radial-bar-sector) {
|
|
128
|
+
transition: var(--transition-hover);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.radialChart :global(.recharts-radial-bar-sector:hover),
|
|
132
|
+
.playgroundChart :global(.recharts-radial-bar-sector:hover) {
|
|
133
|
+
opacity: 0.82;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.interactiveSector {
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
opacity: 1;
|
|
139
|
+
filter: none;
|
|
140
|
+
transition: var(--transition-hover);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.interactiveSector:hover,
|
|
144
|
+
.interactiveSector[data-selected="true"] {
|
|
145
|
+
opacity: 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.interactiveSector[data-selected="true"] {
|
|
149
|
+
stroke: var(--bg);
|
|
150
|
+
stroke-width: var(--size-0-5);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.interactiveSector[data-muted="true"] {
|
|
154
|
+
opacity: 0.2;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.interactiveSector[data-muted="true"]:hover {
|
|
158
|
+
opacity: 0.42;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.selectionLabel {
|
|
162
|
+
pointer-events: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.selectionName,
|
|
166
|
+
.selectionValue {
|
|
167
|
+
text-anchor: middle;
|
|
168
|
+
dominant-baseline: central;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.selectionName {
|
|
172
|
+
font-size: var(--text-xs);
|
|
173
|
+
font-weight: var(--font-weight-semibold);
|
|
174
|
+
transform: translateY(calc(-1 * var(--size-3)));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.selectionValue {
|
|
178
|
+
fill: var(--fg-strong);
|
|
179
|
+
font-size: var(--text-xl);
|
|
180
|
+
font-weight: var(--font-weight-semibold);
|
|
181
|
+
font-variant-numeric: tabular-nums;
|
|
182
|
+
transform: translateY(var(--size-2-5));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.summaryChart {
|
|
186
|
+
max-width: calc(var(--size-24) * 2.5);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.centerValue {
|
|
190
|
+
fill: var(--fg-strong);
|
|
191
|
+
font-size: var(--text-4xl);
|
|
192
|
+
font-weight: var(--font-weight-medium);
|
|
193
|
+
font-variant-numeric: tabular-nums;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.centerUnit {
|
|
197
|
+
fill: var(--fg-muted);
|
|
198
|
+
font-size: var(--text-base);
|
|
199
|
+
baseline-shift: calc(var(--space-1) * -1);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.stackedDemo {
|
|
203
|
+
display: flex;
|
|
204
|
+
width: 100%;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
align-items: center;
|
|
207
|
+
gap: var(--space-1);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.stackedLegend,
|
|
211
|
+
.legendItem {
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.stackedLegend {
|
|
217
|
+
gap: var(--space-4);
|
|
218
|
+
color: var(--fg-muted);
|
|
219
|
+
font-size: var(--text-xs);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.legendItem {
|
|
223
|
+
gap: var(--space-2);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.desktopSwatch,
|
|
227
|
+
.mobileSwatch {
|
|
228
|
+
width: var(--size-2);
|
|
229
|
+
height: var(--size-2);
|
|
230
|
+
corner-shape: var(--corner-shape);
|
|
231
|
+
border-radius: var(--radius-full);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.desktopSwatch {
|
|
235
|
+
background: var(--chart-1);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.mobileSwatch {
|
|
239
|
+
background: var(--chart-2);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.radialDemo {
|
|
243
|
+
display: flex;
|
|
244
|
+
flex-wrap: wrap;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: center;
|
|
247
|
+
column-gap: var(--space-4);
|
|
248
|
+
row-gap: var(--space-1);
|
|
249
|
+
width: 100%;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.radialDemo .withLegend {
|
|
253
|
+
flex: 1 1 calc(var(--size-24) * 2.5);
|
|
254
|
+
min-width: 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.compactDemo {
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
gap: var(--space-2);
|
|
260
|
+
}
|
|
261
|
+
````
|
|
262
|
+
|
|
263
|
+
### Source: web/app/[lang]/components/chart/chart-radial/page.tsx
|
|
264
|
+
|
|
265
|
+
````tsx
|
|
266
|
+
"use client";
|
|
267
|
+
|
|
268
|
+
import { GoalCardExample } from "@/examples/ChartCardExamples";
|
|
269
|
+
import { useEffect, useMemo, useState } from "react";
|
|
270
|
+
import { usePathname } from "next/navigation";
|
|
271
|
+
import {
|
|
272
|
+
Label,
|
|
273
|
+
PolarAngleAxis,
|
|
274
|
+
PolarRadiusAxis,
|
|
275
|
+
RadialBar,
|
|
276
|
+
RadialBarChart,
|
|
277
|
+
Sector,
|
|
278
|
+
type LabelProps,
|
|
279
|
+
type RadialBarSectorProps,
|
|
280
|
+
} from "recharts";
|
|
281
|
+
import {
|
|
282
|
+
ChartContainer,
|
|
283
|
+
ChartTooltip,
|
|
284
|
+
ChartTooltipContent,
|
|
285
|
+
type ChartConfig,
|
|
286
|
+
} from "@/components/Chart";
|
|
287
|
+
import { ChartItemLegend } from "../../../../_components/ChartItemLegend";
|
|
288
|
+
import { ExampleBlock } from "../../../../_components/ExampleBlock";
|
|
289
|
+
import { Playground } from "../../../../_components/Playground";
|
|
290
|
+
import { DocsTable } from "../../../../_components/DocsTable";
|
|
291
|
+
import { localeFromPathname } from "../../../../_dict";
|
|
292
|
+
import { strings } from "./_strings";
|
|
293
|
+
import styles from "./page.module.css";
|
|
294
|
+
|
|
295
|
+
const SHAPES = ["full", "gauge"] as const;
|
|
296
|
+
type ShapeMode = (typeof SHAPES)[number];
|
|
297
|
+
const LEGEND_TYPES = ["detailed", "compact"] as const;
|
|
298
|
+
type LegendType = (typeof LEGEND_TYPES)[number];
|
|
299
|
+
|
|
300
|
+
type RadialDatum = {
|
|
301
|
+
browser: string;
|
|
302
|
+
label: string;
|
|
303
|
+
visitors: number;
|
|
304
|
+
fill: string;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
function interactiveSector(
|
|
308
|
+
props: RadialBarSectorProps,
|
|
309
|
+
selectedKey: string | null,
|
|
310
|
+
onSelect: (key: string) => void,
|
|
311
|
+
unit: string,
|
|
312
|
+
) {
|
|
313
|
+
const row = props.payload as RadialDatum | undefined;
|
|
314
|
+
const key = row?.browser ?? "";
|
|
315
|
+
const isSelected = selectedKey === key;
|
|
316
|
+
const isMuted = selectedKey !== null && !isSelected;
|
|
317
|
+
const select = () => key && onSelect(key);
|
|
318
|
+
|
|
319
|
+
return (
|
|
320
|
+
<Sector
|
|
321
|
+
cx={props.cx}
|
|
322
|
+
cy={props.cy}
|
|
323
|
+
innerRadius={props.innerRadius}
|
|
324
|
+
outerRadius={props.outerRadius}
|
|
325
|
+
startAngle={props.startAngle}
|
|
326
|
+
endAngle={props.endAngle}
|
|
327
|
+
cornerRadius={props.cornerRadius}
|
|
328
|
+
cornerIsExternal={props.cornerIsExternal}
|
|
329
|
+
forceCornerRadius={props.forceCornerRadius}
|
|
330
|
+
fill={props.fill}
|
|
331
|
+
className={styles.interactiveSector}
|
|
332
|
+
data-selected={isSelected ? "true" : "false"}
|
|
333
|
+
data-muted={isMuted ? "true" : "false"}
|
|
334
|
+
data-chart-selectable="true"
|
|
335
|
+
role="button"
|
|
336
|
+
tabIndex={0}
|
|
337
|
+
aria-pressed={isSelected}
|
|
338
|
+
aria-label={row ? `${row.label}: ${row.visitors.toLocaleString()} ${unit}` : undefined}
|
|
339
|
+
onClick={(event) => {
|
|
340
|
+
event.stopPropagation();
|
|
341
|
+
select();
|
|
342
|
+
}}
|
|
343
|
+
onKeyDown={(event) => {
|
|
344
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
select();
|
|
347
|
+
}
|
|
348
|
+
}}
|
|
349
|
+
/>
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function selectionLabel(props: LabelProps, row: RadialDatum | undefined) {
|
|
354
|
+
const { viewBox } = props;
|
|
355
|
+
if (!row || !viewBox || !("cx" in viewBox) || !("cy" in viewBox)) return null;
|
|
356
|
+
const cx = Number(viewBox.cx);
|
|
357
|
+
const cy = Number(viewBox.cy);
|
|
358
|
+
|
|
359
|
+
return (
|
|
360
|
+
<g key={row.browser} className={`${styles.selectionLabel} m-fade`}>
|
|
361
|
+
<text x={cx} y={cy} className={styles.selectionName} style={{ fill: row.fill }}>
|
|
362
|
+
{row.label}
|
|
363
|
+
</text>
|
|
364
|
+
<text x={cx} y={cy} className={styles.selectionValue}>{row.visitors.toLocaleString()}</text>
|
|
365
|
+
</g>
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function renderProgressValue({ x, y }: LabelProps) {
|
|
370
|
+
if (x == null || y == null) return null;
|
|
371
|
+
return <text x={x} y={y}
|
|
372
|
+
textAnchor="middle" dominantBaseline="central" className={styles.centerValue}>
|
|
373
|
+
<tspan>72</tspan><tspan className={styles.centerUnit}>%</tspan>
|
|
374
|
+
</text>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function RadialLegend({ data, config, selected, onSelect, compact = false }: {
|
|
378
|
+
compact?: boolean;
|
|
379
|
+
data: RadialDatum[];
|
|
380
|
+
config: ChartConfig;
|
|
381
|
+
selected: string | null;
|
|
382
|
+
onSelect: (key: string) => void;
|
|
383
|
+
}) {
|
|
384
|
+
return <ChartItemLegend compact={compact} selected={selected} onSelect={onSelect}
|
|
385
|
+
items={[...data].reverse().map((row) => ({ id: row.browser, label: row.label, value: row.visitors, color: config[row.browser].color }))} />;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export default function ChartRadialPage() {
|
|
389
|
+
const pathname = usePathname() ?? "/";
|
|
390
|
+
const en = localeFromPathname(pathname) === "en";
|
|
391
|
+
const t = strings[en ? "en" : "ko"];
|
|
392
|
+
const data = useMemo(
|
|
393
|
+
() => [
|
|
394
|
+
{ browser: "chrome", label: strings.en.browsers[0], visitors: 275, fill: "var(--color-chrome)" },
|
|
395
|
+
{ browser: "safari", label: strings.en.browsers[1], visitors: 200, fill: "var(--color-safari)" },
|
|
396
|
+
{ browser: "firefox", label: strings.en.browsers[2], visitors: 187, fill: "var(--color-firefox)" },
|
|
397
|
+
{ browser: "edge", label: strings.en.browsers[3], visitors: 173, fill: "var(--color-edge)" },
|
|
398
|
+
{ browser: "other", label: strings.en.browsers[4], visitors: 90, fill: "var(--color-other)" },
|
|
399
|
+
],
|
|
400
|
+
[strings.en.browsers],
|
|
401
|
+
);
|
|
402
|
+
const progressData = useMemo(
|
|
403
|
+
() => [{ metric: "completion", value: 72, fill: "var(--color-value)" }],
|
|
404
|
+
[],
|
|
405
|
+
);
|
|
406
|
+
const stackedData = useMemo(
|
|
407
|
+
() => [{ period: "current", desktop: 620, mobile: 380 }],
|
|
408
|
+
[],
|
|
409
|
+
);
|
|
410
|
+
const config = useMemo(
|
|
411
|
+
() =>
|
|
412
|
+
({
|
|
413
|
+
visitors: { label: strings.en.visitors },
|
|
414
|
+
chrome: { label: strings.en.browsers[0], color: "var(--chart-1)" },
|
|
415
|
+
safari: { label: strings.en.browsers[1], color: "var(--chart-2)" },
|
|
416
|
+
firefox: { label: strings.en.browsers[2], color: "var(--chart-3)" },
|
|
417
|
+
edge: { label: strings.en.browsers[3], color: "var(--chart-4)" },
|
|
418
|
+
other: { label: strings.en.browsers[4], color: "var(--chart-5)" },
|
|
419
|
+
}) satisfies ChartConfig,
|
|
420
|
+
[strings.en.browsers, strings.en.visitors],
|
|
421
|
+
);
|
|
422
|
+
const progressConfig = useMemo(
|
|
423
|
+
() => ({ value: { label: strings.en.completion, color: "var(--chart-1)" } }) satisfies ChartConfig,
|
|
424
|
+
[strings.en.completion],
|
|
425
|
+
);
|
|
426
|
+
const stackedConfig = useMemo(
|
|
427
|
+
() =>
|
|
428
|
+
({
|
|
429
|
+
desktop: { label: strings.en.desktop, color: "var(--chart-1)" },
|
|
430
|
+
mobile: { label: strings.en.mobile, color: "var(--chart-2)" },
|
|
431
|
+
}) satisfies ChartConfig,
|
|
432
|
+
[strings.en.desktop, strings.en.mobile],
|
|
433
|
+
);
|
|
434
|
+
|
|
435
|
+
const [shape, setShape] = useState<ShapeMode>("full");
|
|
436
|
+
const [showLegend, setShowLegend] = useState(true);
|
|
437
|
+
const [legendType, setLegendType] = useState<LegendType>("detailed");
|
|
438
|
+
const [showTrack, setShowTrack] = useState(true);
|
|
439
|
+
const [usageSelected, setUsageSelected] = useState<string | null>(null);
|
|
440
|
+
const [playgroundSelected, setPlaygroundSelected] = useState<string | null>(null);
|
|
441
|
+
const usageRow = data.find((row) => row.browser === usageSelected);
|
|
442
|
+
const playgroundRow = data.find((row) => row.browser === playgroundSelected);
|
|
443
|
+
const toggleUsage = (key: string) => setUsageSelected((current) => current === key ? null : key);
|
|
444
|
+
const togglePlayground = (key: string) => setPlaygroundSelected((current) => current === key ? null : key);
|
|
445
|
+
const startAngle = 90;
|
|
446
|
+
const endAngle = shape === "full" ? -270 : -90;
|
|
447
|
+
|
|
448
|
+
useEffect(() => {
|
|
449
|
+
const clearSelection = (event: PointerEvent) => {
|
|
450
|
+
const target = event.target;
|
|
451
|
+
if (target instanceof Element && target.closest('[data-chart-selectable="true"]')) return;
|
|
452
|
+
setUsageSelected(null);
|
|
453
|
+
setPlaygroundSelected(null);
|
|
454
|
+
};
|
|
455
|
+
document.addEventListener("pointerdown", clearSelection);
|
|
456
|
+
return () => document.removeEventListener("pointerdown", clearSelection);
|
|
457
|
+
}, []);
|
|
458
|
+
|
|
459
|
+
return (
|
|
460
|
+
<>
|
|
461
|
+
<h1 className="page-title">{t.title}</h1>
|
|
462
|
+
<p className="page-lead">{t.lead}</p>
|
|
463
|
+
|
|
464
|
+
<section id="usage" className="section-first">
|
|
465
|
+
<h2>{t.usage.heading}</h2>
|
|
466
|
+
<p className="desc">{t.usage.desc}</p>
|
|
467
|
+
<ExampleBlock code={`import { RadialBar, RadialBarChart } from "recharts";
|
|
468
|
+
import { ChartContainer } from "@/components/Chart";
|
|
469
|
+
|
|
470
|
+
<ChartContainer config={config}>
|
|
471
|
+
<RadialBarChart data={data} innerRadius="28%" outerRadius="88%" accessibilityLayer>
|
|
472
|
+
<RadialBar dataKey="visitors" background cornerRadius="50%" />
|
|
473
|
+
</RadialBarChart>
|
|
474
|
+
</ChartContainer>`}>
|
|
475
|
+
<div className={styles.radialDemo}>
|
|
476
|
+
<ChartContainer config={config} className={`${styles.radialChart} ${styles.withLegend}`}>
|
|
477
|
+
<RadialBarChart data={data} innerRadius="28%" outerRadius="88%" accessibilityLayer>
|
|
478
|
+
<ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel nameKey="browser" />} />
|
|
479
|
+
<RadialBar
|
|
480
|
+
dataKey="visitors"
|
|
481
|
+
background={{ fill: "var(--bg-muted)" }}
|
|
482
|
+
cornerRadius="50%"
|
|
483
|
+
shape={(props: RadialBarSectorProps) => interactiveSector(props, usageSelected, toggleUsage, strings.en.visitors)}
|
|
484
|
+
isAnimationActive={false}
|
|
485
|
+
/>
|
|
486
|
+
<PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
|
|
487
|
+
<Label content={(props) => selectionLabel(props, usageRow)} />
|
|
488
|
+
</PolarRadiusAxis>
|
|
489
|
+
</RadialBarChart>
|
|
490
|
+
</ChartContainer>
|
|
491
|
+
<RadialLegend data={data} config={config} selected={usageSelected} onSelect={toggleUsage} />
|
|
492
|
+
</div>
|
|
493
|
+
</ExampleBlock>
|
|
494
|
+
</section>
|
|
495
|
+
|
|
496
|
+
<Playground
|
|
497
|
+
axes={[
|
|
498
|
+
{ label: "shape", value: shape, onChange: (value) => setShape(value as ShapeMode), options: SHAPES },
|
|
499
|
+
{ label: "legend type", value: legendType, onChange: (value) => setLegendType(value as LegendType), options: LEGEND_TYPES },
|
|
500
|
+
]}
|
|
501
|
+
toggles={[
|
|
502
|
+
{ label: "legend", value: showLegend, onChange: setShowLegend },
|
|
503
|
+
{ label: "track", value: showTrack, onChange: setShowTrack },
|
|
504
|
+
]}
|
|
505
|
+
>
|
|
506
|
+
<div className={`${styles.radialDemo} ${showLegend && legendType === "compact" ? styles.compactDemo : ""}`}>
|
|
507
|
+
<ChartContainer config={config} className={`${styles.playgroundChart} ${showLegend && legendType === "detailed" ? styles.withLegend : ""}`}>
|
|
508
|
+
<RadialBarChart
|
|
509
|
+
data={data}
|
|
510
|
+
startAngle={startAngle}
|
|
511
|
+
endAngle={endAngle}
|
|
512
|
+
innerRadius="28%"
|
|
513
|
+
outerRadius="88%"
|
|
514
|
+
accessibilityLayer
|
|
515
|
+
>
|
|
516
|
+
<ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel nameKey="browser" />} />
|
|
517
|
+
<RadialBar
|
|
518
|
+
dataKey="visitors"
|
|
519
|
+
background={showTrack ? { fill: "var(--bg-muted)" } : false}
|
|
520
|
+
cornerRadius="50%"
|
|
521
|
+
shape={(props: RadialBarSectorProps) => interactiveSector(props, playgroundSelected, togglePlayground, strings.en.visitors)}
|
|
522
|
+
isAnimationActive="auto"
|
|
523
|
+
/>
|
|
524
|
+
<PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
|
|
525
|
+
<Label content={(props) => selectionLabel(props, playgroundRow)} />
|
|
526
|
+
</PolarRadiusAxis>
|
|
527
|
+
|
|
528
|
+
</RadialBarChart>
|
|
529
|
+
</ChartContainer>
|
|
530
|
+
{showLegend && <RadialLegend compact={legendType === "compact"} data={data} config={config} selected={playgroundSelected} onSelect={togglePlayground} />}
|
|
531
|
+
</div>
|
|
532
|
+
</Playground>
|
|
533
|
+
|
|
534
|
+
<section id="center-value">
|
|
535
|
+
<h2>{t.center.heading}</h2>
|
|
536
|
+
<p className="desc">{t.center.desc}</p>
|
|
537
|
+
<ExampleBlock code={`<PolarRadiusAxis tick={false} axisLine={false}>
|
|
538
|
+
<Label position="center" content={renderProgressValue} />
|
|
539
|
+
</PolarRadiusAxis>`}>
|
|
540
|
+
<ChartContainer config={progressConfig} className={`${styles.radialChart} ${styles.summaryChart}`}>
|
|
541
|
+
<RadialBarChart
|
|
542
|
+
data={progressData}
|
|
543
|
+
startAngle={90}
|
|
544
|
+
endAngle={-270}
|
|
545
|
+
innerRadius="76%"
|
|
546
|
+
outerRadius="90%"
|
|
547
|
+
accessibilityLayer
|
|
548
|
+
>
|
|
549
|
+
<PolarAngleAxis type="number" domain={[0, 100]} tick={false} />
|
|
550
|
+
<RadialBar dataKey="value" background={{ fill: "var(--bg-muted)" }} cornerRadius="50%" isAnimationActive={false} />
|
|
551
|
+
<PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
|
|
552
|
+
<Label position="center" content={renderProgressValue} />
|
|
553
|
+
</PolarRadiusAxis>
|
|
554
|
+
</RadialBarChart>
|
|
555
|
+
</ChartContainer>
|
|
556
|
+
</ExampleBlock>
|
|
557
|
+
</section>
|
|
558
|
+
|
|
559
|
+
<section id="stacked">
|
|
560
|
+
<h2>{t.stacked.heading}</h2>
|
|
561
|
+
<p className="desc">{t.stacked.desc}</p>
|
|
562
|
+
<ExampleBlock code={`<PolarAngleAxis type="number" domain={[0, 1000]} tick={false} />
|
|
563
|
+
<RadialBar dataKey="desktop" stackId="total" />
|
|
564
|
+
<RadialBar dataKey="mobile" stackId="total" />
|
|
565
|
+
<div role="list" aria-label="Series legend">...</div>`}>
|
|
566
|
+
<div className={styles.stackedDemo}>
|
|
567
|
+
<ChartContainer config={stackedConfig} className={`${styles.radialChart} ${styles.summaryChart}`}>
|
|
568
|
+
<RadialBarChart data={stackedData} startAngle={90} endAngle={-270} innerRadius="74%" outerRadius="90%" accessibilityLayer>
|
|
569
|
+
<PolarAngleAxis type="number" domain={[0, 1000]} tick={false} />
|
|
570
|
+
<ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
|
|
571
|
+
<RadialBar name={strings.en.desktop} dataKey="desktop" stackId="total" fill="var(--color-desktop)" cornerRadius="50%" isAnimationActive={false} />
|
|
572
|
+
<RadialBar name={strings.en.mobile} dataKey="mobile" stackId="total" fill="var(--color-mobile)" cornerRadius="50%" isAnimationActive={false} />
|
|
573
|
+
</RadialBarChart>
|
|
574
|
+
</ChartContainer>
|
|
575
|
+
<div className={styles.stackedLegend} role="list" aria-label={strings.en.seriesLegend}>
|
|
576
|
+
<span className={styles.legendItem} role="listitem"><span className={styles.desktopSwatch} />{strings.en.desktop}</span>
|
|
577
|
+
<span className={styles.legendItem} role="listitem"><span className={styles.mobileSwatch} />{strings.en.mobile}</span>
|
|
578
|
+
</div>
|
|
579
|
+
</div>
|
|
580
|
+
</ExampleBlock>
|
|
581
|
+
</section>
|
|
582
|
+
|
|
583
|
+
<section id="use-cases">
|
|
584
|
+
<h2>In Use</h2>
|
|
585
|
+
<h3>{en ? "Monthly goal card" : "월간 목표 카드"}</h3>
|
|
586
|
+
<ExampleBlock previewWidth="full"><GoalCardExample /></ExampleBlock>
|
|
587
|
+
</section>
|
|
588
|
+
|
|
589
|
+
<section id="api">
|
|
590
|
+
<h2>{t.api.heading}</h2>
|
|
591
|
+
<p className="desc">
|
|
592
|
+
{t.api.desc}{" "}<a href="https://recharts.github.io/en-US/api/RadialBar" target="_blank" rel="noreferrer">{t.api.official}</a>{en ? "." : "에서 확인하세요."}
|
|
593
|
+
</p>
|
|
594
|
+
<DocsTable
|
|
595
|
+
columns={[
|
|
596
|
+
{ key: "prop", label: "Prop", width: 160 },
|
|
597
|
+
{ key: "type", label: "Type", flex: true, minWidth: 220 },
|
|
598
|
+
{ key: "default", label: en ? "Default" : "기본값", width: 120 },
|
|
599
|
+
{ key: "desc", label: en ? "Description" : "설명", flex: true, minWidth: 260 },
|
|
600
|
+
]}
|
|
601
|
+
rows={[
|
|
602
|
+
{ prop: "dataKey", type: "DataKey", default: "-", desc: en ? "Numeric value key." : "수치를 읽을 데이터 키입니다." },
|
|
603
|
+
{ prop: "background", type: "boolean | object", default: "false", desc: en ? "Remaining-value track." : "남은 비중의 배경 트랙을 표시합니다." },
|
|
604
|
+
{ prop: "cornerRadius", type: "number | string", default: "0", desc: en ? "Arc end rounding." : "막대 끝의 둥근 정도를 지정합니다." },
|
|
605
|
+
{ prop: "stackId", type: "string | number", default: "-", desc: en ? "Shared radial stack." : "같은 값으로 지정한 막대를 쌓습니다." },
|
|
606
|
+
]}
|
|
607
|
+
/>
|
|
608
|
+
</section>
|
|
609
|
+
</>
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
````
|
|
613
|
+
|
|
614
|
+
### Source: web/examples/ChartCardExamples.module.css
|
|
615
|
+
|
|
616
|
+
````css
|
|
617
|
+
.card {
|
|
618
|
+
--chart-card-width: 384px; /* lint-hardcoded: ignore */
|
|
619
|
+
--chart-card-wide: 560px; /* lint-hardcoded: ignore */
|
|
620
|
+
--chart-card-plot-height: 208px; /* lint-hardcoded: ignore */
|
|
621
|
+
--chart-card-round-size: 208px; /* lint-hardcoded: ignore */
|
|
622
|
+
display: flex;
|
|
623
|
+
flex-direction: column;
|
|
624
|
+
gap: var(--space-4);
|
|
625
|
+
width: 100%;
|
|
626
|
+
max-width: var(--chart-card-width);
|
|
627
|
+
min-width: 0;
|
|
628
|
+
padding-top: var(--space-6);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.wide {
|
|
632
|
+
max-width: var(--chart-card-wide);
|
|
633
|
+
--comparison-chart-height: 248px; /* lint-hardcoded: ignore */
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.header {
|
|
637
|
+
display: flex;
|
|
638
|
+
flex-direction: column;
|
|
639
|
+
gap: var(--space-1);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.header h3 {
|
|
643
|
+
margin: 0;
|
|
644
|
+
font-size: var(--text-base);
|
|
645
|
+
font-weight: var(--font-weight-semibold);
|
|
646
|
+
line-height: var(--lh-tight);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.header > span,
|
|
650
|
+
.center > span,
|
|
651
|
+
.goalCaption {
|
|
652
|
+
color: var(--fg-muted);
|
|
653
|
+
font-size: var(--text-sm);
|
|
654
|
+
line-height: var(--lh-base);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.metric {
|
|
658
|
+
display: flex;
|
|
659
|
+
align-items: baseline;
|
|
660
|
+
gap: var(--space-2);
|
|
661
|
+
font-size: var(--text-3xl);
|
|
662
|
+
font-weight: var(--font-weight-book);
|
|
663
|
+
line-height: var(--lh-tight);
|
|
664
|
+
font-variant-numeric: tabular-nums;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.metric > span {
|
|
668
|
+
font-size: var(--text-sm);
|
|
669
|
+
color: var(--fg-muted);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.cartesian {
|
|
673
|
+
height: var(--chart-card-plot-height);
|
|
674
|
+
aspect-ratio: auto;
|
|
675
|
+
min-width: 0;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.donutWrap {
|
|
679
|
+
position: relative;
|
|
680
|
+
display: grid;
|
|
681
|
+
place-items: center;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.donut,
|
|
685
|
+
.radial {
|
|
686
|
+
width: var(--chart-card-round-size);
|
|
687
|
+
max-width: 100%;
|
|
688
|
+
height: var(--chart-card-round-size);
|
|
689
|
+
aspect-ratio: 1;
|
|
690
|
+
align-self: center;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.center {
|
|
694
|
+
position: absolute;
|
|
695
|
+
display: flex;
|
|
696
|
+
flex-direction: column;
|
|
697
|
+
align-items: center;
|
|
698
|
+
gap: 0;
|
|
699
|
+
pointer-events: none;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.center strong {
|
|
703
|
+
font-size: var(--text-3xl);
|
|
704
|
+
font-weight: var(--font-weight-book);
|
|
705
|
+
line-height: var(--lh-tight);
|
|
706
|
+
font-variant-numeric: tabular-nums;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.center > span {
|
|
710
|
+
font-size: var(--text-xs);
|
|
711
|
+
line-height: var(--lh-tight);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.radar {
|
|
715
|
+
height: auto;
|
|
716
|
+
aspect-ratio: 1.3;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.goalValue {
|
|
720
|
+
fill: var(--fg);
|
|
721
|
+
font-size: var(--text-4xl);
|
|
722
|
+
font-weight: var(--font-weight-book);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.percent {
|
|
726
|
+
fill: var(--fg-muted);
|
|
727
|
+
font-size: var(--text-base);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.goalCaption {
|
|
731
|
+
margin: 0;
|
|
732
|
+
text-align: center;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.goalCaption strong {
|
|
736
|
+
color: var(--fg);
|
|
737
|
+
font-weight: var(--font-weight-medium);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/* Keep Button padding and hover area; align its content with the card heading. */
|
|
741
|
+
.breakdown {
|
|
742
|
+
margin-inline: calc((var(--space-3) + var(--hairline)) * -1);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.breakdown > ul {
|
|
746
|
+
width: 100%;
|
|
747
|
+
max-width: none;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
@media (max-width: 360px) {
|
|
751
|
+
.radar {
|
|
752
|
+
aspect-ratio: 1.4;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
````
|
|
756
|
+
|
|
757
|
+
### Source: web/examples/ChartCardExamples.tsx
|
|
758
|
+
|
|
759
|
+
````tsx
|
|
760
|
+
"use client";
|
|
761
|
+
|
|
762
|
+
import { useId, useState, type ReactNode } from "react";
|
|
763
|
+
import {
|
|
764
|
+
Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, Label, Pie, PieChart,
|
|
765
|
+
PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart,
|
|
766
|
+
RadialBar, RadialBarChart, XAxis,
|
|
767
|
+
} from "recharts";
|
|
768
|
+
import { Card } from "@/components/Card";
|
|
769
|
+
import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig } from "@/components/Chart";
|
|
770
|
+
import { ChartItemLegend } from "@/app/_components/ChartItemLegend";
|
|
771
|
+
import { TrafficComparisonExample } from "./TrafficComparisonExample";
|
|
772
|
+
import styles from "./ChartCardExamples.module.css";
|
|
773
|
+
|
|
774
|
+
function ChartCard({ title, period, children, wide = false }: {
|
|
775
|
+
title: string; period: string; children: ReactNode; wide?: boolean;
|
|
776
|
+
}) {
|
|
777
|
+
return <Card variant="framed" className={`${styles.card} ${wide ? styles.wide : ""}`}>
|
|
778
|
+
<div className={styles.header}><h3>{title}</h3><span>{period}</span></div>
|
|
779
|
+
{children}
|
|
780
|
+
</Card>;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export function TrafficCardExample() {
|
|
784
|
+
return <ChartCard title="Website traffic" period="Today · 10:30 AM" wide>
|
|
785
|
+
<TrafficComparisonExample />
|
|
786
|
+
</ChartCard>;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const revenue = [
|
|
790
|
+
{ day: "Mon", revenue: 2400 }, { day: "Tue", revenue: 3200 },
|
|
791
|
+
{ day: "Wed", revenue: 2800 }, { day: "Thu", revenue: 4100 },
|
|
792
|
+
{ day: "Fri", revenue: 3600 }, { day: "Sat", revenue: 4800 }, { day: "Sun", revenue: 4200 },
|
|
793
|
+
];
|
|
794
|
+
const revenueConfig = { revenue: { label: "Revenue", color: "var(--chart-1)" } } satisfies ChartConfig;
|
|
795
|
+
|
|
796
|
+
export function RevenueCardExample() {
|
|
797
|
+
const gradient = `revenue-${useId().replace(/:/g, "")}`;
|
|
798
|
+
const total = revenue.reduce((sum, row) => sum + row.revenue, 0);
|
|
799
|
+
return <ChartCard title="Weekly revenue" period="Oct 26 – Nov 1">
|
|
800
|
+
<div className={styles.metric}>{total.toLocaleString("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 })}</div>
|
|
801
|
+
<ChartContainer config={revenueConfig} className={styles.cartesian} aria-label="Daily revenue for October 26 to November 1">
|
|
802
|
+
<AreaChart data={revenue} accessibilityLayer margin={{ left: 12, right: 12, top: 16, bottom: 0 }}>
|
|
803
|
+
<defs><linearGradient id={gradient} x1="0" y1="0" x2="0" y2="1">
|
|
804
|
+
<stop offset="0%" stopColor="var(--color-revenue)" stopOpacity={0.24} />
|
|
805
|
+
<stop offset="100%" stopColor="var(--color-revenue)" stopOpacity={0} />
|
|
806
|
+
</linearGradient></defs>
|
|
807
|
+
<CartesianGrid vertical={false} />
|
|
808
|
+
<XAxis dataKey="day" tickLine={false} axisLine={false} tickMargin={10} interval="preserveStartEnd" />
|
|
809
|
+
<ChartTooltip content={<ChartTooltipContent indicator="line" />} />
|
|
810
|
+
<Area dataKey="revenue" type="monotone" fill={`url(#${gradient})`} stroke="var(--color-revenue)" isAnimationActive={false} />
|
|
811
|
+
</AreaChart>
|
|
812
|
+
</ChartContainer>
|
|
813
|
+
</ChartCard>;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
const support = [
|
|
817
|
+
{ day: "Mon", tickets: 42 }, { day: "Tue", tickets: 58 }, { day: "Wed", tickets: 35 },
|
|
818
|
+
{ day: "Thu", tickets: 47 }, { day: "Fri", tickets: 64 },
|
|
819
|
+
];
|
|
820
|
+
const supportConfig = { tickets: { label: "Tickets", color: "var(--chart-1)" } } satisfies ChartConfig;
|
|
821
|
+
|
|
822
|
+
export function SupportCardExample() {
|
|
823
|
+
return <ChartCard title="Support requests" period="Oct 26–30">
|
|
824
|
+
<div className={styles.metric}>{support.reduce((sum, row) => sum + row.tickets, 0)}<span>tickets</span></div>
|
|
825
|
+
<ChartContainer config={supportConfig} className={styles.cartesian} aria-label="Support requests by weekday">
|
|
826
|
+
<BarChart data={support} accessibilityLayer maxBarSize={32} margin={{ top: 16, right: 0, bottom: 0, left: 0 }}>
|
|
827
|
+
<CartesianGrid vertical={false} />
|
|
828
|
+
<XAxis dataKey="day" tickLine={false} axisLine={false} tickMargin={10} interval="preserveStartEnd" />
|
|
829
|
+
<ChartTooltip cursor={false} content={<ChartTooltipContent />} />
|
|
830
|
+
<Bar dataKey="tickets" fill="var(--color-tickets)" radius={[6, 6, 0, 0]} isAnimationActive={false} />
|
|
831
|
+
</BarChart>
|
|
832
|
+
</ChartContainer>
|
|
833
|
+
</ChartCard>;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const acquisition = [
|
|
837
|
+
{ id: "organic", label: "Organic search", value: 1820, color: "var(--chart-1)" },
|
|
838
|
+
{ id: "direct", label: "Direct", value: 1140, color: "var(--chart-2)" },
|
|
839
|
+
{ id: "referral", label: "Referral", value: 680, color: "var(--chart-3)" },
|
|
840
|
+
{ id: "social", label: "Social", value: 360, color: "var(--chart-4)" },
|
|
841
|
+
];
|
|
842
|
+
const acquisitionConfig = Object.fromEntries(acquisition.map(row => [row.id, { label: row.label, color: row.color }])) satisfies ChartConfig;
|
|
843
|
+
|
|
844
|
+
export function AcquisitionCardExample() {
|
|
845
|
+
const [selected, setSelected] = useState<string | null>(null);
|
|
846
|
+
const current = acquisition.find(row => row.id === selected);
|
|
847
|
+
const value = current?.value ?? acquisition.reduce((sum, row) => sum + row.value, 0);
|
|
848
|
+
return <ChartCard title="Acquisition sources" period="October 2026">
|
|
849
|
+
<div className={styles.donutWrap}>
|
|
850
|
+
<ChartContainer config={acquisitionConfig} className={styles.donut} aria-label="October visitors by acquisition source">
|
|
851
|
+
<PieChart accessibilityLayer>
|
|
852
|
+
<ChartTooltip content={<ChartTooltipContent nameKey="id" hideLabel />} />
|
|
853
|
+
<Pie data={acquisition} dataKey="value" nameKey="id" innerRadius="72%" outerRadius="92%" paddingAngle={3} stroke="var(--bg)" isAnimationActive={false}>
|
|
854
|
+
{acquisition.map(row => <Cell key={row.id} fill={`var(--color-${row.id})`} opacity={selected && selected !== row.id ? 0.18 : 1} />)}
|
|
855
|
+
</Pie>
|
|
856
|
+
</PieChart>
|
|
857
|
+
</ChartContainer>
|
|
858
|
+
<div className={styles.center} aria-live="polite"><strong>{value.toLocaleString("en-US")}</strong><span>{current?.label ?? "Visitors"}</span></div>
|
|
859
|
+
</div>
|
|
860
|
+
<div className={styles.breakdown}><ChartItemLegend items={acquisition} selected={selected} onSelect={key => setSelected(value => value === key ? null : key)} /></div>
|
|
861
|
+
</ChartCard>;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const quality = [
|
|
865
|
+
{ axis: "Speed", current: 86, previous: 62 }, { axis: "Reliability", current: 92, previous: 78 },
|
|
866
|
+
{ axis: "Ease of use", current: 78, previous: 65 }, { axis: "Features", current: 84, previous: 72 },
|
|
867
|
+
{ axis: "Support", current: 90, previous: 80 },
|
|
868
|
+
];
|
|
869
|
+
const qualityConfig = {
|
|
870
|
+
current: { label: "Current release", color: "var(--chart-1)" },
|
|
871
|
+
previous: { label: "Previous release", color: "var(--chart-3)" },
|
|
872
|
+
} satisfies ChartConfig;
|
|
873
|
+
|
|
874
|
+
export function QualityCardExample() {
|
|
875
|
+
const [selected, setSelected] = useState<string | null>(null);
|
|
876
|
+
return <ChartCard title="Product quality" period="Score out of 100">
|
|
877
|
+
<ChartContainer config={qualityConfig} className={styles.radar} aria-label="Current and previous release quality scores out of 100">
|
|
878
|
+
<RadarChart data={quality} accessibilityLayer outerRadius="60%">
|
|
879
|
+
<PolarGrid radialLines={false} />
|
|
880
|
+
<PolarAngleAxis dataKey="axis" tickLine={false} tickSize={4} />
|
|
881
|
+
<PolarRadiusAxis domain={[0, 100]} tick={false} axisLine={false} />
|
|
882
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
883
|
+
<Radar dataKey="previous" hide={selected === "current"} stroke="var(--color-previous)" fill="var(--color-previous)" fillOpacity={0.08} isAnimationActive={false} />
|
|
884
|
+
<Radar dataKey="current" hide={selected === "previous"} stroke="var(--color-current)" fill="var(--color-current)" fillOpacity={0.16} isAnimationActive={false} />
|
|
885
|
+
</RadarChart>
|
|
886
|
+
</ChartContainer>
|
|
887
|
+
<ChartItemLegend compact items={Object.entries(qualityConfig).map(([id, row]) => ({ id, label: row.label, color: row.color, value: 0 }))}
|
|
888
|
+
selected={selected} onSelect={key => setSelected(value => value === key ? null : key)} />
|
|
889
|
+
</ChartCard>;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
const goal = { completed: 72, target: 100 };
|
|
893
|
+
const goalConfig = { completed: { label: "Completed", color: "var(--chart-1)" } } satisfies ChartConfig;
|
|
894
|
+
|
|
895
|
+
export function GoalCardExample() {
|
|
896
|
+
const percentage = Math.round(goal.completed / goal.target * 100);
|
|
897
|
+
return <ChartCard title="Monthly goal" period="November 2026">
|
|
898
|
+
<ChartContainer config={goalConfig} className={styles.radial} aria-label={`${goal.completed} of ${goal.target} reports completed, ${percentage}%`}>
|
|
899
|
+
<RadialBarChart data={[goal]} accessibilityLayer startAngle={90} endAngle={-270} innerRadius="78%" outerRadius="100%" barSize={14}>
|
|
900
|
+
<PolarAngleAxis type="number" domain={[0, goal.target]} tick={false} />
|
|
901
|
+
<RadialBar dataKey="completed" fill="var(--color-completed)" background={{ fill: "var(--bg-muted)" }} cornerRadius={8} isAnimationActive={false} />
|
|
902
|
+
<PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
|
|
903
|
+
<Label position="center" content={({ x, y }) => {
|
|
904
|
+
if (x == null || y == null) return null;
|
|
905
|
+
return <text x={x} y={y} textAnchor="middle" dominantBaseline="central" className={styles.goalValue}>{percentage}<tspan className={styles.percent}>%</tspan></text>;
|
|
906
|
+
}} />
|
|
907
|
+
</PolarRadiusAxis>
|
|
908
|
+
</RadialBarChart>
|
|
909
|
+
</ChartContainer>
|
|
910
|
+
<p className={styles.goalCaption}><strong>{goal.completed}</strong> of {goal.target} reports completed</p>
|
|
911
|
+
</ChartCard>;
|
|
912
|
+
}
|
|
913
|
+
````
|
|
914
|
+
|
|
915
|
+
### Source: web/examples/TrafficComparisonExample.module.css
|
|
916
|
+
|
|
917
|
+
````css
|
|
918
|
+
.chart {
|
|
919
|
+
width: 100%;
|
|
920
|
+
min-width: 0;
|
|
921
|
+
height: var(--comparison-chart-height, 320px); /* lint-hardcoded: ignore */
|
|
922
|
+
aspect-ratio: auto;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
.currentLine,
|
|
926
|
+
.previousLine {
|
|
927
|
+
display: inline-block;
|
|
928
|
+
width: var(--space-3);
|
|
929
|
+
height: 0;
|
|
930
|
+
flex-shrink: 0;
|
|
931
|
+
border-top: 2px solid var(--color-today); /* lint-hardcoded: ignore */
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.previousLine {
|
|
935
|
+
border-top-style: dotted;
|
|
936
|
+
border-top-color: var(--color-yesterday);
|
|
937
|
+
}
|
|
938
|
+
````
|
|
939
|
+
|
|
940
|
+
### Source: web/examples/TrafficComparisonExample.tsx
|
|
941
|
+
|
|
942
|
+
````tsx
|
|
943
|
+
"use client";
|
|
944
|
+
|
|
945
|
+
import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts";
|
|
946
|
+
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, type ChartConfig } from "@/components/Chart";
|
|
947
|
+
import styles from "./TrafficComparisonExample.module.css";
|
|
948
|
+
|
|
949
|
+
const today = [0, 0, 1720, 2100, 2280, 1950, 2800, 2200, 2480, 2890, 3300, 3250, 3905];
|
|
950
|
+
const yesterday = [0, 430, 260, 450, 510, 780, 520, 760, 470, 790, 1260, 1430, 2545];
|
|
951
|
+
const minutes = [0, 30, 60, 120, 180, 240, 300, 360, 420, 480, 540, 600, 630];
|
|
952
|
+
const data = today.map((value, index) => ({ minute: minutes[index], today: value as number | null, yesterday: yesterday[index] as number | null }));
|
|
953
|
+
data.push({ minute: 1439, today: null, yesterday: null });
|
|
954
|
+
|
|
955
|
+
function CurrentLine() { return <span className={styles.currentLine} />; }
|
|
956
|
+
function PreviousLine() { return <span className={styles.previousLine} />; }
|
|
957
|
+
const config = {
|
|
958
|
+
today: { label: "Today", color: "var(--chart-1)", icon: CurrentLine },
|
|
959
|
+
yesterday: { label: "Yesterday", color: "var(--fg-muted)", icon: PreviousLine },
|
|
960
|
+
} satisfies ChartConfig;
|
|
961
|
+
|
|
962
|
+
function formatTime(value: number) {
|
|
963
|
+
const hour = Math.floor(value / 60);
|
|
964
|
+
const minute = Math.floor(value % 60);
|
|
965
|
+
return `${hour % 12 || 12}:${String(minute).padStart(2, "0")}${hour < 12 ? "AM" : "PM"}`;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export function TrafficComparisonExample() {
|
|
969
|
+
return <ChartContainer config={config} className={styles.chart} role="group"
|
|
970
|
+
aria-label="Website visitors by time. At 10:30AM, today has 3,905 visitors and yesterday had 2,545.">
|
|
971
|
+
<LineChart data={data} accessibilityLayer margin={{ top: 12, right: 16, bottom: 8, left: 0 }}>
|
|
972
|
+
<CartesianGrid vertical={false} strokeOpacity={0.45} />
|
|
973
|
+
<XAxis dataKey="minute" type="number" domain={[0, 1439]} ticks={[0, 720, 1439]}
|
|
974
|
+
tickFormatter={formatTime} tickLine={false} axisLine={false} tickMargin={12} minTickGap={32} />
|
|
975
|
+
<YAxis domain={[0, 5000]} ticks={[0, 1000, 2000, 3000, 4000, 5000]} interval={0} width={40}
|
|
976
|
+
tickFormatter={(value: number) => value === 0 ? "0" : `${value / 1000}K`}
|
|
977
|
+
tickLine={false} axisLine={false} tickMargin={8} />
|
|
978
|
+
<ChartTooltip cursor={{ stroke: "var(--fg-muted)", strokeWidth: 1 }}
|
|
979
|
+
content={<ChartTooltipContent indicator="line" labelFormatter={(value) => `Today at ${formatTime(Number(value))}`} />} />
|
|
980
|
+
<ChartLegend align="left" content={<ChartLegendContent />} />
|
|
981
|
+
<Line dataKey="today" type="monotone" stroke="var(--color-today)" strokeWidth={1.75}
|
|
982
|
+
dot={false} activeDot={{ r: 4, fill: "var(--bg)", stroke: "var(--color-today)", strokeWidth: 1.75 }} isAnimationActive={false} />
|
|
983
|
+
<Line dataKey="yesterday" type="linear" stroke="var(--color-yesterday)" strokeWidth={1.5}
|
|
984
|
+
strokeDasharray="2 4" strokeLinecap="round" dot={false} activeDot={false} isAnimationActive={false} />
|
|
985
|
+
</LineChart>
|
|
986
|
+
</ChartContainer>;
|
|
987
|
+
}
|
|
988
|
+
````
|