@shohojdhara/atomix 0.2.3 → 0.2.5
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 +19 -0
- package/dist/atomix.css +1703 -1544
- package/dist/atomix.min.css +4 -4
- package/dist/index.d.ts +1465 -963
- package/dist/index.esm.js +16289 -25908
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15650 -21780
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/applemix.css +15008 -0
- package/dist/themes/applemix.min.css +72 -0
- package/dist/themes/boomdevs.css +1608 -1450
- package/dist/themes/boomdevs.min.css +5 -5
- package/dist/themes/esrar.css +1702 -1543
- package/dist/themes/esrar.min.css +4 -4
- package/dist/themes/flashtrade.css +15159 -0
- package/dist/themes/flashtrade.min.css +86 -0
- package/dist/themes/mashroom.css +1699 -1540
- package/dist/themes/mashroom.min.css +7 -7
- package/dist/themes/shaj-default.css +1693 -1534
- package/dist/themes/shaj-default.min.css +4 -4
- package/package.json +6 -17
- package/src/components/Accordion/Accordion.stories.tsx +662 -21
- package/src/components/Accordion/Accordion.tsx +21 -14
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
- package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
- package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
- package/src/components/AtomixGlass/README.md +124 -2
- package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
- package/src/components/AtomixGlass/glass-utils.ts +263 -0
- package/src/components/AtomixGlass/shader-utils.ts +792 -68
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
- package/src/components/AtomixGlass/utils.ts +3 -3
- package/src/components/Avatar/Avatar.tsx +3 -0
- package/src/components/Avatar/AvatarGroup.tsx +2 -1
- package/src/components/Badge/Badge.stories.tsx +76 -55
- package/src/components/Badge/Badge.tsx +12 -14
- package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
- package/src/components/Button/Button.stories.tsx +501 -20
- package/src/components/Button/Button.tsx +5 -8
- package/src/components/Callout/Callout.stories.tsx +86 -35
- package/src/components/Callout/Callout.tsx +31 -9
- package/src/components/Card/Card.stories.tsx +565 -2
- package/src/components/Card/Card.tsx +15 -4
- package/src/components/Card/ElevationCard.tsx +2 -0
- package/src/components/Chart/AnimatedChart.tsx +179 -156
- package/src/components/Chart/AreaChart.tsx +123 -12
- package/src/components/Chart/BarChart.tsx +91 -100
- package/src/components/Chart/BaseChart.tsx +80 -0
- package/src/components/Chart/BubbleChart.tsx +114 -290
- package/src/components/Chart/CandlestickChart.tsx +282 -622
- package/src/components/Chart/Chart.stories.tsx +576 -179
- package/src/components/Chart/Chart.tsx +374 -75
- package/src/components/Chart/ChartRenderer.tsx +371 -220
- package/src/components/Chart/ChartToolbar.tsx +372 -61
- package/src/components/Chart/ChartTooltip.tsx +33 -18
- package/src/components/Chart/DonutChart.tsx +172 -254
- package/src/components/Chart/FunnelChart.tsx +169 -240
- package/src/components/Chart/GaugeChart.tsx +224 -392
- package/src/components/Chart/HeatmapChart.tsx +302 -440
- package/src/components/Chart/LineChart.tsx +148 -103
- package/src/components/Chart/MultiAxisChart.tsx +267 -395
- package/src/components/Chart/PieChart.tsx +114 -64
- package/src/components/Chart/RadarChart.tsx +202 -218
- package/src/components/Chart/ScatterChart.tsx +111 -97
- package/src/components/Chart/TreemapChart.tsx +147 -222
- package/src/components/Chart/WaterfallChart.tsx +253 -291
- package/src/components/Chart/index.ts +11 -9
- package/src/components/Chart/types.ts +85 -9
- package/src/components/Chart/utils.ts +66 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
- package/src/components/Countdown/Countdown.tsx +4 -0
- package/src/components/DataTable/DataTable.tsx +2 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
- package/src/components/DatePicker/DatePicker.tsx +3 -9
- package/src/components/DatePicker/types.ts +5 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
- package/src/components/Dropdown/Dropdown.tsx +26 -28
- package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
- package/src/components/EdgePanel/EdgePanel.tsx +101 -13
- package/src/components/Footer/Footer.stories.tsx +187 -60
- package/src/components/Footer/Footer.test.tsx +134 -0
- package/src/components/Footer/Footer.tsx +133 -34
- package/src/components/Footer/FooterLink.tsx +1 -1
- package/src/components/Footer/FooterSection.tsx +53 -36
- package/src/components/Footer/FooterSocialLink.tsx +32 -29
- package/src/components/Footer/README.md +82 -3
- package/src/components/Footer/index.ts +1 -1
- package/src/components/Form/Checkbox.stories.tsx +13 -5
- package/src/components/Form/Checkbox.tsx +3 -6
- package/src/components/Form/Form.stories.tsx +10 -3
- package/src/components/Form/Form.tsx +2 -0
- package/src/components/Form/FormGroup.tsx +2 -1
- package/src/components/Form/Input.stories.tsx +12 -11
- package/src/components/Form/Input.tsx +97 -95
- package/src/components/Form/Radio.stories.tsx +22 -7
- package/src/components/Form/Radio.tsx +3 -6
- package/src/components/Form/Select.stories.tsx +21 -6
- package/src/components/Form/Select.tsx +3 -5
- package/src/components/Form/Textarea.stories.tsx +13 -11
- package/src/components/Form/Textarea.tsx +88 -86
- package/src/components/Hero/Hero.stories.tsx +2 -3
- package/src/components/Hero/Hero.tsx +5 -6
- package/src/components/Icon/Icon.tsx +12 -1
- package/src/components/List/List.tsx +2 -1
- package/src/components/List/ListGroup.tsx +2 -1
- package/src/components/Messages/Messages.stories.tsx +113 -0
- package/src/components/Messages/Messages.tsx +52 -9
- package/src/components/Modal/Modal.stories.tsx +48 -32
- package/src/components/Modal/Modal.tsx +19 -24
- package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
- package/src/components/Navigation/Menu/Menu.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
- package/src/components/Navigation/Nav/Nav.tsx +22 -4
- package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
- package/src/components/Pagination/Pagination.stories.tsx +13 -6
- package/src/components/Pagination/Pagination.tsx +7 -6
- package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
- package/src/components/Popover/Popover.stories.tsx +32 -24
- package/src/components/Popover/Popover.tsx +4 -1
- package/src/components/ProductReview/ProductReview.tsx +8 -2
- package/src/components/Progress/Progress.tsx +19 -3
- package/src/components/Rating/Rating.stories.tsx +11 -6
- package/src/components/Rating/Rating.tsx +3 -5
- package/src/components/River/River.tsx +5 -5
- package/src/components/SectionIntro/SectionIntro.tsx +8 -2
- package/src/components/Slider/Slider.stories.tsx +4 -4
- package/src/components/Slider/Slider.tsx +4 -3
- package/src/components/Spinner/Spinner.tsx +19 -3
- package/src/components/Steps/Steps.stories.tsx +5 -4
- package/src/components/Steps/Steps.tsx +8 -5
- package/src/components/Tab/Tab.stories.tsx +4 -3
- package/src/components/Tab/Tab.tsx +8 -6
- package/src/components/Testimonial/Testimonial.tsx +8 -2
- package/src/components/Todo/Todo.tsx +2 -1
- package/src/components/Toggle/Toggle.stories.tsx +5 -4
- package/src/components/Toggle/Toggle.tsx +8 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
- package/src/components/Tooltip/Tooltip.tsx +9 -2
- package/src/components/Upload/Upload.stories.tsx +252 -0
- package/src/components/Upload/Upload.tsx +92 -53
- package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
- package/src/components/index.ts +0 -4
- package/src/layouts/Grid/Grid.stories.tsx +10 -23
- package/src/layouts/Grid/Grid.tsx +20 -1
- package/src/layouts/Grid/GridCol.tsx +76 -48
- package/src/lib/composables/useAtomixGlass.ts +861 -44
- package/src/lib/composables/useBarChart.ts +21 -4
- package/src/lib/composables/useChart.ts +227 -370
- package/src/lib/composables/useChartExport.ts +19 -78
- package/src/lib/composables/useChartToolbar.ts +11 -21
- package/src/lib/composables/useEdgePanel.ts +125 -71
- package/src/lib/composables/useFooter.ts +3 -3
- package/src/lib/composables/useGlassContainer.ts +16 -7
- package/src/lib/composables/useLineChart.ts +11 -2
- package/src/lib/composables/usePieChart.ts +4 -14
- package/src/lib/composables/useRiver.ts +5 -0
- package/src/lib/composables/useSlider.ts +62 -24
- package/src/lib/composables/useVideoPlayer.ts +60 -63
- package/src/lib/constants/components.ts +147 -32
- package/src/lib/types/components.ts +355 -25
- package/src/lib/utils/displacement-generator.ts +55 -49
- package/src/lib/utils/icons.ts +1 -1
- package/src/lib/utils/index.ts +16 -10
- package/src/styles/01-settings/_settings.accordion.scss +19 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
- package/src/styles/01-settings/_settings.avatar.scss +17 -17
- package/src/styles/01-settings/_settings.background.scss +0 -3
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
- package/src/styles/01-settings/_settings.card.scss +1 -1
- package/src/styles/01-settings/_settings.chart.scss +65 -2
- package/src/styles/01-settings/_settings.dropdown.scss +1 -1
- package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
- package/src/styles/01-settings/_settings.footer.scss +35 -42
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.list.scss +1 -1
- package/src/styles/01-settings/_settings.rating.scss +1 -1
- package/src/styles/01-settings/_settings.tabs.scss +1 -1
- package/src/styles/01-settings/_settings.upload.scss +6 -5
- package/src/styles/02-tools/_tools.animations.scss +4 -5
- package/src/styles/02-tools/_tools.background.scss +1 -13
- package/src/styles/02-tools/_tools.glass.scss +0 -1
- package/src/styles/02-tools/_tools.utility-api.scss +91 -48
- package/src/styles/03-generic/_generic.root.scss +1 -4
- package/src/styles/04-elements/_elements.body.scss +0 -1
- package/src/styles/06-components/_components.atomix-glass.scss +249 -0
- package/src/styles/06-components/_components.badge.scss +8 -23
- package/src/styles/06-components/_components.button.scss +8 -3
- package/src/styles/06-components/_components.callout.scss +10 -5
- package/src/styles/06-components/_components.card.scss +2 -14
- package/src/styles/06-components/_components.chart.scss +969 -1449
- package/src/styles/06-components/_components.dropdown.scss +19 -7
- package/src/styles/06-components/_components.edge-panel.scss +103 -0
- package/src/styles/06-components/_components.footer.scss +166 -85
- package/src/styles/06-components/_components.input.scss +8 -9
- package/src/styles/06-components/_components.list.scss +1 -0
- package/src/styles/06-components/_components.messages.scss +176 -0
- package/src/styles/06-components/_components.modal.scss +16 -4
- package/src/styles/06-components/_components.navbar.scss +12 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -0
- package/src/styles/06-components/_components.skeleton.scss +8 -6
- package/src/styles/06-components/_components.upload.scss +219 -4
- package/src/styles/06-components/old.chart.styles.scss +1 -30
- package/src/styles/99-utilities/_index.scss +1 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
- package/src/components/Chart/AdvancedChart.tsx +0 -624
- package/src/components/Chart/LineChartNew.tsx +0 -167
- package/src/components/Chart/RealTimeChart.tsx +0 -436
- package/src/components/DatePicker/DatePicker copy.tsx +0 -551
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { useState } from 'react';
|
|
3
4
|
import { Container, Grid, GridCol } from '../../layouts/Grid';
|
|
4
5
|
import { Badge } from '../Badge';
|
|
@@ -10,7 +11,6 @@ import { SideMenuItem } from '../Navigation/SideMenu/SideMenuItem';
|
|
|
10
11
|
import { SideMenuList } from '../Navigation/SideMenu/SideMenuList';
|
|
11
12
|
|
|
12
13
|
import {
|
|
13
|
-
AdvancedChart,
|
|
14
14
|
AnimatedChart,
|
|
15
15
|
AreaChart,
|
|
16
16
|
BarChart,
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
MultiAxisChart,
|
|
26
26
|
PieChart,
|
|
27
27
|
RadarChart,
|
|
28
|
-
RealTimeChart,
|
|
29
28
|
ScatterChart,
|
|
30
29
|
TreemapChart,
|
|
31
30
|
WaterfallChart,
|
|
@@ -51,6 +50,94 @@ const meta: Meta<typeof Chart> = {
|
|
|
51
50
|
export default meta;
|
|
52
51
|
type Story = StoryObj<typeof Chart>;
|
|
53
52
|
|
|
53
|
+
// Glass Variant Story
|
|
54
|
+
export const GlassVariant: Story = {
|
|
55
|
+
render: () => {
|
|
56
|
+
const sampleData = [
|
|
57
|
+
{ label: 'Jan', value: 65 },
|
|
58
|
+
{ label: 'Feb', value: 78 },
|
|
59
|
+
{ label: 'Mar', value: 90 },
|
|
60
|
+
{ label: 'Apr', value: 81 },
|
|
61
|
+
{ label: 'May', value: 56 },
|
|
62
|
+
{ label: 'Jun', value: 55 },
|
|
63
|
+
{ label: 'Jul', value: 40 },
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
const datasets = [
|
|
67
|
+
{
|
|
68
|
+
label: 'Sales',
|
|
69
|
+
data: sampleData,
|
|
70
|
+
color: 'var(--atomix-primary)',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
style={{
|
|
77
|
+
padding: '2rem',
|
|
78
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
79
|
+
minHeight: '100vh',
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<Container>
|
|
83
|
+
<Grid>
|
|
84
|
+
<GridCol col={12}>
|
|
85
|
+
<h2 style={{ color: 'white', marginBottom: '2rem' }}>Chart Glass Variant</h2>
|
|
86
|
+
</GridCol>
|
|
87
|
+
<GridCol col={12} md={6}>
|
|
88
|
+
<LineChart
|
|
89
|
+
title="Sales Performance"
|
|
90
|
+
subtitle="Monthly revenue data"
|
|
91
|
+
datasets={datasets}
|
|
92
|
+
glass={true}
|
|
93
|
+
showToolbar={true}
|
|
94
|
+
config={{
|
|
95
|
+
showTooltips: true,
|
|
96
|
+
animate: true,
|
|
97
|
+
}}
|
|
98
|
+
/>
|
|
99
|
+
</GridCol>
|
|
100
|
+
<GridCol col={12} md={6}>
|
|
101
|
+
<BarChart
|
|
102
|
+
title="Revenue by Month"
|
|
103
|
+
subtitle="Q1-Q2 comparison"
|
|
104
|
+
datasets={datasets}
|
|
105
|
+
glass={{
|
|
106
|
+
displacementScale: 30,
|
|
107
|
+
saturation: 200,
|
|
108
|
+
mode: 'polar',
|
|
109
|
+
}}
|
|
110
|
+
showToolbar={true}
|
|
111
|
+
/>
|
|
112
|
+
</GridCol>
|
|
113
|
+
<GridCol col={12} md={6}>
|
|
114
|
+
<PieChart
|
|
115
|
+
title="Market Share"
|
|
116
|
+
data={sampleData}
|
|
117
|
+
glass={true}
|
|
118
|
+
showToolbar={true}
|
|
119
|
+
/>
|
|
120
|
+
</GridCol>
|
|
121
|
+
<GridCol col={12} md={6}>
|
|
122
|
+
<AreaChart
|
|
123
|
+
title="Growth Trend"
|
|
124
|
+
subtitle="Year over year"
|
|
125
|
+
datasets={datasets}
|
|
126
|
+
glass={{
|
|
127
|
+
blurAmount: 0,
|
|
128
|
+
saturation: 180,
|
|
129
|
+
enableBorderEffect: true,
|
|
130
|
+
}}
|
|
131
|
+
showToolbar={true}
|
|
132
|
+
/>
|
|
133
|
+
</GridCol>
|
|
134
|
+
</Grid>
|
|
135
|
+
</Container>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
54
141
|
// Data generators
|
|
55
142
|
const generateData = (points = 20) =>
|
|
56
143
|
Array.from({ length: points }, (_, i) => ({
|
|
@@ -60,10 +147,107 @@ const generateData = (points = 20) =>
|
|
|
60
147
|
value: Math.floor(Math.random() * 100) + 20,
|
|
61
148
|
}));
|
|
62
149
|
|
|
150
|
+
const generateTimeSeriesData = (points = 20) =>
|
|
151
|
+
Array.from({ length: points }, (_, i) => ({
|
|
152
|
+
label: new Date(Date.now() - (points - i) * 24 * 60 * 60 * 1000).toLocaleDateString(),
|
|
153
|
+
value: Math.floor(Math.random() * 1000) + 500,
|
|
154
|
+
}));
|
|
155
|
+
|
|
156
|
+
const generateCandlestickData = (points = 20) =>
|
|
157
|
+
Array.from({ length: points }, (_, i) => {
|
|
158
|
+
const open = Math.floor(Math.random() * 100) + 50;
|
|
159
|
+
const close = Math.floor(Math.random() * 100) + 50;
|
|
160
|
+
const high = Math.max(open, close) + Math.floor(Math.random() * 20);
|
|
161
|
+
const low = Math.min(open, close) - Math.floor(Math.random() * 20);
|
|
162
|
+
return {
|
|
163
|
+
date: `Day ${i + 1}`,
|
|
164
|
+
open,
|
|
165
|
+
high,
|
|
166
|
+
low,
|
|
167
|
+
close,
|
|
168
|
+
volume: Math.floor(Math.random() * 10000) + 1000,
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const generateBubbleData = (points = 15) =>
|
|
173
|
+
Array.from({ length: points }, (_, i) => ({
|
|
174
|
+
label: `Point ${i + 1}`,
|
|
175
|
+
x: Math.floor(Math.random() * 100),
|
|
176
|
+
y: Math.floor(Math.random() * 100),
|
|
177
|
+
size: Math.floor(Math.random() * 50) + 10,
|
|
178
|
+
value: Math.floor(Math.random() * 1000),
|
|
179
|
+
}));
|
|
180
|
+
|
|
181
|
+
const generateHeatmapData = () => {
|
|
182
|
+
const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
183
|
+
const hours = Array.from({ length: 24 }, (_, i) => `${i}:00`);
|
|
184
|
+
|
|
185
|
+
return days
|
|
186
|
+
.map(day =>
|
|
187
|
+
hours.map(hour => ({
|
|
188
|
+
x: hour,
|
|
189
|
+
y: day,
|
|
190
|
+
value: Math.floor(Math.random() * 100),
|
|
191
|
+
}))
|
|
192
|
+
)
|
|
193
|
+
.flat();
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const generateTreemapData = (count = 12) => {
|
|
197
|
+
const categories = [
|
|
198
|
+
'Technology',
|
|
199
|
+
'Finance',
|
|
200
|
+
'Healthcare',
|
|
201
|
+
'Education',
|
|
202
|
+
'Retail',
|
|
203
|
+
'Manufacturing',
|
|
204
|
+
'Energy',
|
|
205
|
+
'Transport',
|
|
206
|
+
'Media',
|
|
207
|
+
'Real Estate',
|
|
208
|
+
'Consulting',
|
|
209
|
+
'Food & Beverage',
|
|
210
|
+
'Sports',
|
|
211
|
+
'Entertainment',
|
|
212
|
+
'Travel',
|
|
213
|
+
'Automotive',
|
|
214
|
+
'Fashion',
|
|
215
|
+
'Telecom',
|
|
216
|
+
'Agriculture',
|
|
217
|
+
'Construction',
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
221
|
+
id: `category-${i}`,
|
|
222
|
+
label: categories[i % categories.length] || `Category ${i + 1}`,
|
|
223
|
+
value: Math.floor(Math.random() * 500) + 50,
|
|
224
|
+
metadata: {
|
|
225
|
+
growth: `${(Math.random() * 20 - 10).toFixed(1)}%`,
|
|
226
|
+
revenue: `$${(Math.random() * 1000 + 100).toFixed(0)}K`,
|
|
227
|
+
},
|
|
228
|
+
}));
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const generateFunnelData = () => {
|
|
232
|
+
const stages = [
|
|
233
|
+
{ label: 'Awareness', value: 10000 },
|
|
234
|
+
{ label: 'Interest', value: 5000 },
|
|
235
|
+
{ label: 'Consideration', value: 2500 },
|
|
236
|
+
{ label: 'Intent', value: 1200 },
|
|
237
|
+
{ label: 'Evaluation', value: 600 },
|
|
238
|
+
{ label: 'Purchase', value: 300 },
|
|
239
|
+
];
|
|
240
|
+
|
|
241
|
+
return stages.map(stage => ({
|
|
242
|
+
...stage,
|
|
243
|
+
percentage: ((stage.value / stages[0].value) * 100).toFixed(1),
|
|
244
|
+
}));
|
|
245
|
+
};
|
|
246
|
+
|
|
63
247
|
const datasets = [
|
|
64
|
-
{ label: 'Sales', data: generateData(), color: '
|
|
65
|
-
{ label: 'Revenue', data: generateData(), color: '
|
|
66
|
-
{ label: 'Profit', data: generateData(), color: '
|
|
248
|
+
{ label: 'Sales', data: generateData(), color: 'var(--atomix-primary)' },
|
|
249
|
+
{ label: 'Revenue', data: generateData(), color: 'var(--atomix-success)' },
|
|
250
|
+
{ label: 'Profit', data: generateData(), color: 'var(--atomix-warning)' },
|
|
67
251
|
];
|
|
68
252
|
|
|
69
253
|
// Modern Chart Gallery
|
|
@@ -95,16 +279,14 @@ export const ChartGallery: Story = {
|
|
|
95
279
|
{ key: 'funnel', icon: 'Funnel', label: 'Funnel', desc: 'Process stages' },
|
|
96
280
|
{ key: 'treemap', icon: 'Tree', label: 'Treemap', desc: 'Hierarchical data' },
|
|
97
281
|
{ key: 'animated', icon: 'Sparkle', label: 'Animated', desc: 'Motion graphics' },
|
|
98
|
-
{ key: 'realtime', icon: 'WifiHigh', label: 'Real-time', desc: 'Live streaming' },
|
|
99
282
|
{ key: 'multiaxis', icon: 'ChartLineUp', label: 'Multi-axis', desc: 'Multiple scales' },
|
|
100
|
-
{ key: 'advanced', icon: 'Rocket', label: 'Advanced', desc: 'Complex features' },
|
|
101
283
|
];
|
|
102
284
|
|
|
103
285
|
// Generate dynamic data based on dataPoints
|
|
104
286
|
const dynamicDatasets = [
|
|
105
|
-
{ label: 'Sales', data: generateData(dataPoints), color: '
|
|
106
|
-
{ label: 'Revenue', data: generateData(dataPoints), color: '
|
|
107
|
-
{ label: 'Profit', data: generateData(dataPoints), color: '
|
|
287
|
+
{ label: 'Sales', data: generateData(dataPoints), color: 'var(--atomix-primary)' },
|
|
288
|
+
{ label: 'Revenue', data: generateData(dataPoints), color: 'var(--atomix-success)' },
|
|
289
|
+
{ label: 'Profit', data: generateData(dataPoints), color: 'var(--atomix-warning)' },
|
|
108
290
|
];
|
|
109
291
|
|
|
110
292
|
const renderChart = () => {
|
|
@@ -148,6 +330,15 @@ export const ChartGallery: Story = {
|
|
|
148
330
|
icon={<Icon name="List" />}
|
|
149
331
|
label={`${showLegend ? 'Hide' : 'Show'} legend`}
|
|
150
332
|
/>
|
|
333
|
+
|
|
334
|
+
{/* Animation Toggle */}
|
|
335
|
+
<Button
|
|
336
|
+
size="sm"
|
|
337
|
+
variant={animated ? 'success' : 'secondary'}
|
|
338
|
+
onClick={() => setAnimated(!animated)}
|
|
339
|
+
icon={<Icon name="Sparkle" />}
|
|
340
|
+
label={`${animated ? 'Disable' : 'Enable'} animations`}
|
|
341
|
+
/>
|
|
151
342
|
</div>
|
|
152
343
|
</div>
|
|
153
344
|
);
|
|
@@ -179,7 +370,7 @@ export const ChartGallery: Story = {
|
|
|
179
370
|
<div>
|
|
180
371
|
{customToolbar}
|
|
181
372
|
<PieChart
|
|
182
|
-
datasets={[{ label: '
|
|
373
|
+
datasets={[{ label: 'Distribution', data: generateData(6) }]}
|
|
183
374
|
{...commonProps}
|
|
184
375
|
/>
|
|
185
376
|
</div>
|
|
@@ -189,7 +380,7 @@ export const ChartGallery: Story = {
|
|
|
189
380
|
<div>
|
|
190
381
|
{customToolbar}
|
|
191
382
|
<DonutChart
|
|
192
|
-
datasets={[{ label: '
|
|
383
|
+
datasets={[{ label: 'Distribution', data: generateData(6) }]}
|
|
193
384
|
{...commonProps}
|
|
194
385
|
/>
|
|
195
386
|
</div>
|
|
@@ -205,45 +396,28 @@ export const ChartGallery: Story = {
|
|
|
205
396
|
return (
|
|
206
397
|
<div>
|
|
207
398
|
{customToolbar}
|
|
208
|
-
<RadarChart datasets={
|
|
399
|
+
<RadarChart datasets={dynamicDatasets} {...commonProps} />
|
|
209
400
|
</div>
|
|
210
401
|
);
|
|
211
402
|
case 'bubble':
|
|
212
403
|
return (
|
|
213
404
|
<div>
|
|
214
405
|
{customToolbar}
|
|
215
|
-
<BubbleChart
|
|
216
|
-
bubbleData={Array.from({ length: dataPoints }, (_, i) => ({
|
|
217
|
-
label: `Point ${i + 1}`,
|
|
218
|
-
x: Math.random() * 100,
|
|
219
|
-
y: Math.random() * 100,
|
|
220
|
-
size: Math.random() * 50 + 20,
|
|
221
|
-
color: ['#3b82f6', '#10b981', '#f59e0b', '#ef4444'][i % 4],
|
|
222
|
-
}))}
|
|
223
|
-
{...commonProps}
|
|
224
|
-
/>
|
|
406
|
+
<BubbleChart bubbleData={generateBubbleData(dataPoints)} {...commonProps} />
|
|
225
407
|
</div>
|
|
226
408
|
);
|
|
227
409
|
case 'gauge':
|
|
228
410
|
return (
|
|
229
411
|
<div>
|
|
230
412
|
{customToolbar}
|
|
231
|
-
<GaugeChart value={
|
|
413
|
+
<GaugeChart value={75} max={100} {...commonProps} />
|
|
232
414
|
</div>
|
|
233
415
|
);
|
|
234
416
|
case 'heatmap':
|
|
235
417
|
return (
|
|
236
418
|
<div>
|
|
237
419
|
{customToolbar}
|
|
238
|
-
<HeatmapChart
|
|
239
|
-
data={Array.from({ length: dataPoints * 4 }, (_, i) => ({
|
|
240
|
-
x: i % Math.ceil(Math.sqrt(dataPoints * 4)),
|
|
241
|
-
y: Math.floor(i / Math.ceil(Math.sqrt(dataPoints * 4))),
|
|
242
|
-
value: Math.random() * 100,
|
|
243
|
-
label: `${i}`,
|
|
244
|
-
}))}
|
|
245
|
-
{...commonProps}
|
|
246
|
-
/>
|
|
420
|
+
<HeatmapChart data={generateHeatmapData()} {...commonProps} />
|
|
247
421
|
</div>
|
|
248
422
|
);
|
|
249
423
|
case 'candlestick':
|
|
@@ -251,13 +425,7 @@ export const ChartGallery: Story = {
|
|
|
251
425
|
<div>
|
|
252
426
|
{customToolbar}
|
|
253
427
|
<CandlestickChart
|
|
254
|
-
candlestickData={
|
|
255
|
-
date: new Date(2024, 0, i + 1).toISOString(),
|
|
256
|
-
open: 100 + Math.random() * 20,
|
|
257
|
-
high: 120 + Math.random() * 20,
|
|
258
|
-
low: 80 + Math.random() * 20,
|
|
259
|
-
close: 110 + Math.random() * 20,
|
|
260
|
-
}))}
|
|
428
|
+
candlestickData={generateCandlestickData(dataPoints)}
|
|
261
429
|
{...commonProps}
|
|
262
430
|
/>
|
|
263
431
|
</div>
|
|
@@ -267,16 +435,13 @@ export const ChartGallery: Story = {
|
|
|
267
435
|
<div>
|
|
268
436
|
{customToolbar}
|
|
269
437
|
<WaterfallChart
|
|
270
|
-
waterfallData={
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
type: Math.random() > 0.5 ? 'positive' : 'negative',
|
|
278
|
-
};
|
|
279
|
-
})}
|
|
438
|
+
waterfallData={[
|
|
439
|
+
{ label: 'Starting Balance', value: 1000, type: 'subtotal' },
|
|
440
|
+
{ label: 'Sales', value: 500, type: 'positive' },
|
|
441
|
+
{ label: 'Expenses', value: -200, type: 'negative' },
|
|
442
|
+
{ label: 'Taxes', value: -100, type: 'negative' },
|
|
443
|
+
{ label: 'Net Profit', value: 200, type: 'subtotal' },
|
|
444
|
+
]}
|
|
280
445
|
{...commonProps}
|
|
281
446
|
/>
|
|
282
447
|
</div>
|
|
@@ -286,10 +451,15 @@ export const ChartGallery: Story = {
|
|
|
286
451
|
<div>
|
|
287
452
|
{customToolbar}
|
|
288
453
|
<FunnelChart
|
|
289
|
-
funnelData={
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
454
|
+
funnelData={generateFunnelData()}
|
|
455
|
+
funnelOptions={{
|
|
456
|
+
showLabels: true,
|
|
457
|
+
showValues: true,
|
|
458
|
+
showPercentages: true,
|
|
459
|
+
showConversionRates: true,
|
|
460
|
+
useGradient: true,
|
|
461
|
+
animate: animated,
|
|
462
|
+
}}
|
|
293
463
|
{...commonProps}
|
|
294
464
|
/>
|
|
295
465
|
</div>
|
|
@@ -299,11 +469,15 @@ export const ChartGallery: Story = {
|
|
|
299
469
|
<div>
|
|
300
470
|
{customToolbar}
|
|
301
471
|
<TreemapChart
|
|
302
|
-
data={
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
472
|
+
data={generateTreemapData(Math.min(dataPoints, 20))}
|
|
473
|
+
algorithm="squarified"
|
|
474
|
+
colorConfig={{ scheme: 'category' }}
|
|
475
|
+
labelConfig={{
|
|
476
|
+
showLabels: true,
|
|
477
|
+
minSize: 500,
|
|
478
|
+
fontSize: 12,
|
|
479
|
+
textColor: 'var(--atomix-text-primary)',
|
|
480
|
+
}}
|
|
307
481
|
{...commonProps}
|
|
308
482
|
/>
|
|
309
483
|
</div>
|
|
@@ -315,20 +489,6 @@ export const ChartGallery: Story = {
|
|
|
315
489
|
<AnimatedChart datasets={dynamicDatasets} {...commonProps} />
|
|
316
490
|
</div>
|
|
317
491
|
);
|
|
318
|
-
case 'realtime':
|
|
319
|
-
return (
|
|
320
|
-
<div>
|
|
321
|
-
{customToolbar}
|
|
322
|
-
<RealTimeChart
|
|
323
|
-
datasets={[]}
|
|
324
|
-
dataSource={async () => [
|
|
325
|
-
{ label: new Date().toLocaleTimeString(), value: Math.random() * 100 },
|
|
326
|
-
]}
|
|
327
|
-
{...commonProps}
|
|
328
|
-
/>
|
|
329
|
-
</div>
|
|
330
|
-
);
|
|
331
|
-
|
|
332
492
|
case 'multiaxis':
|
|
333
493
|
return (
|
|
334
494
|
<div>
|
|
@@ -344,13 +504,6 @@ export const ChartGallery: Story = {
|
|
|
344
504
|
/>
|
|
345
505
|
</div>
|
|
346
506
|
);
|
|
347
|
-
case 'advanced':
|
|
348
|
-
return (
|
|
349
|
-
<div>
|
|
350
|
-
{customToolbar}
|
|
351
|
-
<AdvancedChart datasets={dynamicDatasets} {...commonProps} />
|
|
352
|
-
</div>
|
|
353
|
-
);
|
|
354
507
|
default:
|
|
355
508
|
return (
|
|
356
509
|
<div>
|
|
@@ -395,7 +548,7 @@ export const ChartGallery: Story = {
|
|
|
395
548
|
<Icon name={icon as any} size="sm" />
|
|
396
549
|
<div>
|
|
397
550
|
<div>{label}</div>
|
|
398
|
-
|
|
551
|
+
<small className="u-text-muted">{desc}</small>
|
|
399
552
|
</div>
|
|
400
553
|
</div>
|
|
401
554
|
</SideMenuItem>
|
|
@@ -404,9 +557,10 @@ export const ChartGallery: Story = {
|
|
|
404
557
|
</SideMenu>
|
|
405
558
|
</Card>
|
|
406
559
|
</GridCol>
|
|
407
|
-
|
|
408
560
|
<GridCol xs={9}>
|
|
409
|
-
<Card className="u-p-
|
|
561
|
+
<Card className="u-p-0 u-overflow-hidden">
|
|
562
|
+
<div className="u-h-100 u-min-h-100 u-overflow-auto">{renderChart()}</div>
|
|
563
|
+
</Card>
|
|
410
564
|
</GridCol>
|
|
411
565
|
</Grid>
|
|
412
566
|
</Container>
|
|
@@ -414,114 +568,357 @@ export const ChartGallery: Story = {
|
|
|
414
568
|
},
|
|
415
569
|
};
|
|
416
570
|
|
|
417
|
-
//
|
|
418
|
-
export const
|
|
571
|
+
// Individual chart stories for documentation
|
|
572
|
+
export const LineChartStory: Story = {
|
|
419
573
|
render: () => (
|
|
420
|
-
<Container className="u-py-
|
|
421
|
-
<
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
574
|
+
<Container className="u-py-6">
|
|
575
|
+
<Grid>
|
|
576
|
+
<GridCol xs={12}>
|
|
577
|
+
<Card className="u-p-6">
|
|
578
|
+
<LineChart
|
|
579
|
+
datasets={[
|
|
580
|
+
{ label: 'Sales', data: generateData(12), color: 'var(--atomix-primary)' },
|
|
581
|
+
{ label: 'Revenue', data: generateData(12), color: 'var(--atomix-success)' },
|
|
582
|
+
]}
|
|
583
|
+
title="Line Chart Example"
|
|
584
|
+
config={{ showLegend: true, animate: true }}
|
|
585
|
+
showToolbar
|
|
586
|
+
/>
|
|
587
|
+
</Card>
|
|
588
|
+
</GridCol>
|
|
589
|
+
</Grid>
|
|
590
|
+
</Container>
|
|
591
|
+
),
|
|
592
|
+
name: 'Line Chart',
|
|
593
|
+
};
|
|
433
594
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
595
|
+
export const BarChartStory: Story = {
|
|
596
|
+
render: () => (
|
|
597
|
+
<Container className="u-py-6">
|
|
598
|
+
<Grid>
|
|
599
|
+
<GridCol xs={12}>
|
|
600
|
+
<Card className="u-p-6">
|
|
601
|
+
<BarChart
|
|
602
|
+
datasets={[
|
|
603
|
+
{ label: 'Sales', data: generateData(8), color: 'var(--atomix-primary)' },
|
|
604
|
+
{ label: 'Revenue', data: generateData(8), color: 'var(--atomix-success)' },
|
|
605
|
+
]}
|
|
606
|
+
title="Bar Chart Example"
|
|
607
|
+
config={{ showLegend: true, animate: true }}
|
|
608
|
+
showToolbar
|
|
609
|
+
/>
|
|
610
|
+
</Card>
|
|
611
|
+
</GridCol>
|
|
612
|
+
</Grid>
|
|
613
|
+
</Container>
|
|
614
|
+
),
|
|
615
|
+
name: 'Bar Chart',
|
|
616
|
+
};
|
|
442
617
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
618
|
+
export const PieChartStory: Story = {
|
|
619
|
+
render: () => (
|
|
620
|
+
<Container className="u-py-6">
|
|
621
|
+
<Grid>
|
|
622
|
+
<GridCol xs={12}>
|
|
623
|
+
<Card className="u-p-6">
|
|
624
|
+
<PieChart
|
|
625
|
+
datasets={[{ label: 'Market Share', data: generateData(6) }]}
|
|
626
|
+
title="Pie Chart Example"
|
|
627
|
+
config={{ showLegend: true, animate: true }}
|
|
628
|
+
showToolbar
|
|
629
|
+
/>
|
|
630
|
+
</Card>
|
|
631
|
+
</GridCol>
|
|
632
|
+
</Grid>
|
|
633
|
+
</Container>
|
|
634
|
+
),
|
|
635
|
+
name: 'Pie Chart',
|
|
636
|
+
};
|
|
451
637
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
638
|
+
export const DonutChartStory: Story = {
|
|
639
|
+
render: () => (
|
|
640
|
+
<Container className="u-py-6">
|
|
641
|
+
<Grid>
|
|
642
|
+
<GridCol xs={12}>
|
|
643
|
+
<Card className="u-p-6">
|
|
644
|
+
<DonutChart
|
|
645
|
+
datasets={[{ label: 'Market Share', data: generateData(6) }]}
|
|
646
|
+
title="Donut Chart Example"
|
|
647
|
+
config={{ showLegend: true, animate: true }}
|
|
648
|
+
showToolbar
|
|
649
|
+
/>
|
|
650
|
+
</Card>
|
|
651
|
+
</GridCol>
|
|
652
|
+
</Grid>
|
|
461
653
|
</Container>
|
|
462
654
|
),
|
|
655
|
+
name: 'Donut Chart',
|
|
463
656
|
};
|
|
464
657
|
|
|
465
|
-
|
|
466
|
-
export const AdvancedFeatures: Story = {
|
|
658
|
+
export const CandlestickChartStory: Story = {
|
|
467
659
|
render: () => (
|
|
468
|
-
<Container className="u-py-
|
|
469
|
-
<
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
660
|
+
<Container className="u-py-6">
|
|
661
|
+
<Grid>
|
|
662
|
+
<GridCol xs={12}>
|
|
663
|
+
<Card className="u-p-6">
|
|
664
|
+
<CandlestickChart
|
|
665
|
+
candlestickData={generateCandlestickData(20)}
|
|
666
|
+
title="Candlestick Chart Example"
|
|
667
|
+
config={{ showLegend: true, animate: true, showTooltips: true }}
|
|
668
|
+
candlestickOptions={{ showTooltips: true }}
|
|
669
|
+
showToolbar
|
|
670
|
+
/>
|
|
671
|
+
</Card>
|
|
672
|
+
</GridCol>
|
|
673
|
+
</Grid>
|
|
674
|
+
</Container>
|
|
675
|
+
),
|
|
676
|
+
name: 'Candlestick Chart',
|
|
677
|
+
};
|
|
485
678
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
679
|
+
export const TreemapChartStory: Story = {
|
|
680
|
+
render: () => (
|
|
681
|
+
<Container className="u-py-6">
|
|
682
|
+
<Grid>
|
|
683
|
+
<GridCol xs={12}>
|
|
684
|
+
<Card className="u-p-6">
|
|
685
|
+
<TreemapChart
|
|
686
|
+
data={generateTreemapData(15)}
|
|
687
|
+
title="Treemap Chart Example"
|
|
688
|
+
algorithm="squarified"
|
|
689
|
+
colorConfig={{ scheme: 'category' }}
|
|
690
|
+
labelConfig={{
|
|
691
|
+
showLabels: true,
|
|
692
|
+
minSize: 500,
|
|
693
|
+
fontSize: 12,
|
|
694
|
+
textColor: 'var(--atomix-text-primary)',
|
|
695
|
+
}}
|
|
696
|
+
config={{ showLegend: true, animate: true }}
|
|
697
|
+
showToolbar
|
|
698
|
+
/>
|
|
699
|
+
</Card>
|
|
700
|
+
</GridCol>
|
|
701
|
+
</Grid>
|
|
702
|
+
</Container>
|
|
703
|
+
),
|
|
704
|
+
name: 'Treemap Chart',
|
|
705
|
+
};
|
|
494
706
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
707
|
+
export const FunnelChartStory: Story = {
|
|
708
|
+
render: () => (
|
|
709
|
+
<Container className="u-py-6">
|
|
710
|
+
<Grid>
|
|
711
|
+
<GridCol xs={12}>
|
|
712
|
+
<Card className="u-p-6">
|
|
713
|
+
<FunnelChart
|
|
714
|
+
funnelData={generateFunnelData()}
|
|
715
|
+
title="Funnel Chart Example"
|
|
716
|
+
funnelOptions={{
|
|
717
|
+
showLabels: true,
|
|
718
|
+
showValues: true,
|
|
719
|
+
showPercentages: true,
|
|
720
|
+
showConversionRates: true,
|
|
721
|
+
useGradient: true,
|
|
722
|
+
animate: true,
|
|
723
|
+
}}
|
|
724
|
+
config={{ showLegend: true, animate: true }}
|
|
725
|
+
showToolbar
|
|
726
|
+
/>
|
|
727
|
+
</Card>
|
|
728
|
+
</GridCol>
|
|
729
|
+
</Grid>
|
|
730
|
+
</Container>
|
|
731
|
+
),
|
|
732
|
+
name: 'Funnel Chart',
|
|
733
|
+
};
|
|
509
734
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
735
|
+
export const HeatmapChartStory: Story = {
|
|
736
|
+
render: () => (
|
|
737
|
+
<Container className="u-py-6">
|
|
738
|
+
<Grid>
|
|
739
|
+
<GridCol xs={12}>
|
|
740
|
+
<Card className="u-p-6">
|
|
741
|
+
<HeatmapChart
|
|
742
|
+
data={generateHeatmapData()}
|
|
743
|
+
title="Heatmap Chart Example"
|
|
744
|
+
colorScale={{
|
|
745
|
+
scheme: 'viridis',
|
|
746
|
+
steps: 9,
|
|
747
|
+
}}
|
|
748
|
+
cellConfig={{
|
|
749
|
+
width: 30,
|
|
750
|
+
height: 30,
|
|
751
|
+
spacing: 2,
|
|
752
|
+
borderRadius: 4,
|
|
753
|
+
showLabels: false,
|
|
754
|
+
}}
|
|
755
|
+
showColorLegend={true}
|
|
756
|
+
showGrid={true}
|
|
757
|
+
config={{ showLegend: true, animate: true }}
|
|
758
|
+
showToolbar
|
|
759
|
+
/>
|
|
760
|
+
</Card>
|
|
761
|
+
</GridCol>
|
|
762
|
+
</Grid>
|
|
763
|
+
</Container>
|
|
764
|
+
),
|
|
765
|
+
name: 'Heatmap Chart',
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
export const ScatterChartStory: Story = {
|
|
769
|
+
render: () => (
|
|
770
|
+
<Container className="u-py-6">
|
|
771
|
+
<Grid>
|
|
772
|
+
<GridCol xs={12}>
|
|
773
|
+
<Card className="u-p-6">
|
|
774
|
+
<ScatterChart
|
|
775
|
+
datasets={[
|
|
776
|
+
{ label: 'Sales', data: generateData(15), color: 'var(--atomix-primary)' },
|
|
777
|
+
{ label: 'Revenue', data: generateData(15), color: 'var(--atomix-success)' },
|
|
778
|
+
]}
|
|
779
|
+
title="Scatter Chart Example"
|
|
780
|
+
scatterOptions={{
|
|
781
|
+
pointRadius: 5,
|
|
782
|
+
showLabels: false,
|
|
783
|
+
enableHoverEffects: true,
|
|
784
|
+
}}
|
|
785
|
+
config={{ showLegend: true, animate: true }}
|
|
786
|
+
showToolbar
|
|
787
|
+
/>
|
|
788
|
+
</Card>
|
|
789
|
+
</GridCol>
|
|
790
|
+
</Grid>
|
|
791
|
+
</Container>
|
|
792
|
+
),
|
|
793
|
+
name: 'Scatter Chart',
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
export const BubbleChartStory: Story = {
|
|
797
|
+
render: () => (
|
|
798
|
+
<Container className="u-py-6">
|
|
799
|
+
<Grid>
|
|
800
|
+
<GridCol xs={12}>
|
|
801
|
+
<Card className="u-p-6">
|
|
802
|
+
<BubbleChart
|
|
803
|
+
bubbleData={generateBubbleData(20)}
|
|
804
|
+
title="Bubble Chart Example"
|
|
805
|
+
bubbleOptions={{
|
|
806
|
+
minBubbleSize: 10,
|
|
807
|
+
maxBubbleSize: 60,
|
|
808
|
+
bubbleOpacity: 0.7,
|
|
809
|
+
showLabels: true,
|
|
810
|
+
enableAnimations: true,
|
|
811
|
+
}}
|
|
812
|
+
config={{ showLegend: true, animate: true }}
|
|
813
|
+
showToolbar
|
|
814
|
+
/>
|
|
815
|
+
</Card>
|
|
816
|
+
</GridCol>
|
|
817
|
+
</Grid>
|
|
818
|
+
</Container>
|
|
819
|
+
),
|
|
820
|
+
name: 'Bubble Chart',
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
export const RadarChartStory: Story = {
|
|
824
|
+
render: () => (
|
|
825
|
+
<Container className="u-py-6">
|
|
826
|
+
<Grid>
|
|
827
|
+
<GridCol xs={12}>
|
|
828
|
+
<Card className="u-p-6">
|
|
829
|
+
<RadarChart
|
|
830
|
+
datasets={[
|
|
831
|
+
{ label: 'Performance', data: generateData(8), color: 'var(--atomix-primary)' },
|
|
832
|
+
{ label: 'Target', data: generateData(8), color: 'var(--atomix-success)' },
|
|
833
|
+
]}
|
|
834
|
+
title="Radar Chart Example"
|
|
835
|
+
radarOptions={{
|
|
836
|
+
gridLevels: 5,
|
|
837
|
+
showGrid: true,
|
|
838
|
+
showAxisLabels: true,
|
|
839
|
+
fillArea: true,
|
|
840
|
+
fillOpacity: 0.3,
|
|
841
|
+
showDataPoints: true,
|
|
842
|
+
pointRadius: 4,
|
|
843
|
+
lineWidth: 2,
|
|
844
|
+
}}
|
|
845
|
+
config={{ showLegend: true, animate: true }}
|
|
846
|
+
showToolbar
|
|
847
|
+
/>
|
|
848
|
+
</Card>
|
|
849
|
+
</GridCol>
|
|
850
|
+
</Grid>
|
|
851
|
+
</Container>
|
|
852
|
+
),
|
|
853
|
+
name: 'Radar Chart',
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
export const WaterfallChartStory: Story = {
|
|
857
|
+
render: () => (
|
|
858
|
+
<Container className="u-py-6">
|
|
859
|
+
<Grid>
|
|
860
|
+
<GridCol xs={12}>
|
|
861
|
+
<Card className="u-p-6">
|
|
862
|
+
<WaterfallChart
|
|
863
|
+
waterfallData={[
|
|
864
|
+
{ label: 'Starting Balance', value: 1000, type: 'subtotal' },
|
|
865
|
+
{ label: 'Sales', value: 500, type: 'positive' },
|
|
866
|
+
{ label: 'Investment', value: 200, type: 'positive' },
|
|
867
|
+
{ label: 'Expenses', value: -200, type: 'negative' },
|
|
868
|
+
{ label: 'Taxes', value: -100, type: 'negative' },
|
|
869
|
+
{ label: 'Fees', value: -50, type: 'negative' },
|
|
870
|
+
{ label: 'Ending Balance', value: 1350, type: 'total' },
|
|
871
|
+
]}
|
|
872
|
+
title="Waterfall Chart Example"
|
|
873
|
+
waterfallOptions={{
|
|
874
|
+
showConnectors: true,
|
|
875
|
+
showValues: true,
|
|
876
|
+
showBaseline: true,
|
|
877
|
+
animate: true,
|
|
878
|
+
}}
|
|
879
|
+
config={{ showLegend: true, animate: true }}
|
|
880
|
+
showToolbar
|
|
881
|
+
/>
|
|
882
|
+
</Card>
|
|
883
|
+
</GridCol>
|
|
884
|
+
</Grid>
|
|
885
|
+
</Container>
|
|
886
|
+
),
|
|
887
|
+
name: 'Waterfall Chart',
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
export const TooltipTestStory: Story = {
|
|
891
|
+
render: () => (
|
|
892
|
+
<Container className="u-py-6">
|
|
893
|
+
<Grid>
|
|
894
|
+
<GridCol xs={12}>
|
|
895
|
+
<Card className="u-p-6">
|
|
896
|
+
<LineChart
|
|
897
|
+
datasets={[
|
|
898
|
+
{
|
|
899
|
+
label: 'Sales',
|
|
900
|
+
data: generateData(12).map((d, i) => ({
|
|
901
|
+
...d,
|
|
902
|
+
metadata: {
|
|
903
|
+
trend: i % 2 === 0 ? 'Up' : 'Down',
|
|
904
|
+
change: `${Math.floor(Math.random() * 10)}%`,
|
|
905
|
+
},
|
|
906
|
+
})),
|
|
907
|
+
color: 'var(--atomix-primary)',
|
|
908
|
+
},
|
|
909
|
+
]}
|
|
910
|
+
title="Tooltip Test Chart"
|
|
911
|
+
config={{
|
|
912
|
+
showLegend: true,
|
|
913
|
+
animate: true,
|
|
914
|
+
showTooltips: true,
|
|
915
|
+
}}
|
|
916
|
+
showToolbar
|
|
917
|
+
/>
|
|
918
|
+
</Card>
|
|
919
|
+
</GridCol>
|
|
920
|
+
</Grid>
|
|
525
921
|
</Container>
|
|
526
922
|
),
|
|
923
|
+
name: 'Tooltip Test',
|
|
527
924
|
};
|