@react-magma/charts 12.0.0 → 12.0.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +2450 -1
- package/dist/charts.js.map +1 -1
- package/dist/charts.modern.module.js +2428 -1
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +48555 -1
- package/dist/charts.umd.js.map +1 -1
- package/dist/components/CarbonChart/CarbonChart.d.ts +42 -41
- package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +310 -12
- package/dist/components/CarbonChart/CarbonChartAreaStacked.stories.d.ts +136 -7
- package/dist/components/CarbonChart/CarbonChartBar.stories.d.ts +214 -12
- package/dist/components/CarbonChart/CarbonChartBarFloating.stories.d.ts +82 -6
- package/dist/components/CarbonChart/CarbonChartBarGrouped.stories.d.ts +234 -13
- package/dist/components/CarbonChart/CarbonChartBarStacked.stories.d.ts +266 -14
- package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +53 -5
- package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +196 -9
- package/dist/components/CarbonChart/CarbonChartBullet.stories.d.ts +35 -4
- package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +580 -15
- package/dist/components/CarbonChart/CarbonChartDonut.stories.d.ts +120 -8
- package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +43 -5
- package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +89 -6
- package/dist/components/CarbonChart/CarbonChartLine.stories.d.ts +577 -20
- package/dist/components/CarbonChart/CarbonChartLollipop.stories.d.ts +55 -5
- package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +127 -8
- package/dist/components/CarbonChart/CarbonChartPie.stories.d.ts +101 -8
- package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +98 -7
- package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +173 -9
- package/dist/components/CarbonChart/CarbonChartSparkline.stories.d.ts +51 -4
- package/dist/components/CarbonChart/CarbonChartStep.stories.d.ts +38 -4
- package/dist/components/CarbonChart/index.d.ts +1 -1
- package/dist/components/LineChart/Chart.d.ts +27 -27
- package/dist/components/LineChart/ChartDataTable.d.ts +17 -17
- package/dist/components/LineChart/CustomAxisComponent.d.ts +3 -3
- package/dist/components/LineChart/CustomPointComponent.d.ts +17 -17
- package/dist/components/LineChart/DataTable.d.ts +5 -5
- package/dist/components/LineChart/GraphTooltip.d.ts +3 -3
- package/dist/components/LineChart/LegendButton.d.ts +6 -6
- package/dist/components/LineChart/LineChart.d.ts +67 -67
- package/dist/components/LineChart/LineChart.stories.d.ts +113 -23
- package/dist/components/LineChart/index.d.ts +1 -1
- package/dist/components/LineChart/magma-charts.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +11 -6
- package/src/components/CarbonChart/CarbonChart.tsx +12 -16
- package/src/components/CarbonChart/CarbonChartArea.stories.tsx +674 -649
- package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +424 -414
- package/src/components/CarbonChart/CarbonChartBar.stories.tsx +352 -325
- package/src/components/CarbonChart/CarbonChartBarFloating.stories.tsx +127 -116
- package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +872 -843
- package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +913 -879
- package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +238 -232
- package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +565 -547
- package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +59 -56
- package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +1335 -1299
- package/src/components/CarbonChart/CarbonChartDonut.stories.tsx +170 -153
- package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +50 -44
- package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +733 -724
- package/src/components/CarbonChart/CarbonChartLine.stories.tsx +1656 -1605
- package/src/components/CarbonChart/CarbonChartLollipop.stories.tsx +81 -76
- package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +177 -162
- package/src/components/CarbonChart/CarbonChartPie.stories.tsx +154 -139
- package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +445 -433
- package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +427 -409
- package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +191 -188
- package/src/components/CarbonChart/CarbonChartStep.stories.tsx +145 -142
- package/src/components/CarbonChart/carbon-charts.css +7303 -0
- package/src/components/LineChart/LineChart.stories.tsx +91 -104
- package/dist/components/CarbonChart/CarbonChart.test.d.ts +0 -1
- package/dist/components/CarbonChart/embeddedStyles.d.ts +0 -1
- package/dist/components/LineChart/ChartDataTable.test.d.ts +0 -1
- package/dist/components/LineChart/LineChart.test.d.ts +0 -1
- package/dist/components/LineChart/test/exampleChartData.d.ts +0 -40
- package/src/components/CarbonChart/embeddedStyles.ts +0 -24880
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -23,184 +23,201 @@ export default {
|
|
|
23
23
|
},
|
|
24
24
|
} as Meta;
|
|
25
25
|
|
|
26
|
-
const Template:
|
|
26
|
+
const Template: StoryFn<CarbonChartProps> = args => (
|
|
27
27
|
<Card isInverse={args.isInverse} style={{ padding: '12px' }}>
|
|
28
28
|
<CarbonChart {...args}>Sample text</CarbonChart>
|
|
29
29
|
</Card>
|
|
30
30
|
);
|
|
31
31
|
|
|
32
|
-
export const Donut =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
group: 'L22I P66EP L22I P66EP L22I P66EP',
|
|
43
|
-
value: 65000,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
group: 'JQAI 2M4L1',
|
|
47
|
-
value: 75000,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
group: 'J9DZ F37AP',
|
|
51
|
-
value: 1200,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
group: 'YEL48 Q6XK YEL48',
|
|
55
|
-
value: 10000,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
group: 'Misc',
|
|
59
|
-
value: 25000,
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
options: {
|
|
63
|
-
title: 'Donut',
|
|
64
|
-
resizable: true,
|
|
65
|
-
donut: {
|
|
66
|
-
center: {
|
|
67
|
-
label: 'Browsers',
|
|
32
|
+
export const Donut = {
|
|
33
|
+
render: Template,
|
|
34
|
+
|
|
35
|
+
args: {
|
|
36
|
+
isInverse: false,
|
|
37
|
+
type: CarbonChartType.donut,
|
|
38
|
+
dataSet: [
|
|
39
|
+
{
|
|
40
|
+
group: '2V2N 9KYPM version 1',
|
|
41
|
+
value: 20000,
|
|
68
42
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
43
|
+
{
|
|
44
|
+
group: 'L22I P66EP L22I P66EP L22I P66EP',
|
|
45
|
+
value: 65000,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
group: 'JQAI 2M4L1',
|
|
49
|
+
value: 75000,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
group: 'J9DZ F37AP',
|
|
53
|
+
value: 1200,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
group: 'YEL48 Q6XK YEL48',
|
|
57
|
+
value: 10000,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
group: 'Misc',
|
|
61
|
+
value: 25000,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
options: {
|
|
65
|
+
title: 'Donut',
|
|
66
|
+
resizable: true,
|
|
67
|
+
donut: {
|
|
68
|
+
center: {
|
|
69
|
+
label: 'Browsers',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
height: '400px',
|
|
73
|
+
legend: {
|
|
74
|
+
truncation: {
|
|
75
|
+
type: 'none',
|
|
76
|
+
},
|
|
74
77
|
},
|
|
75
78
|
},
|
|
76
79
|
},
|
|
77
80
|
};
|
|
78
81
|
|
|
79
|
-
export const DonutCentered =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
group: 'L22I P66EP L22I P66EP L22I P66EP',
|
|
90
|
-
value: 65000,
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
group: 'JQAI 2M4L1',
|
|
94
|
-
value: 75000,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
group: 'J9DZ F37AP',
|
|
98
|
-
value: 1200,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
group: 'YEL48 Q6XK YEL48',
|
|
102
|
-
value: 10000,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
group: 'Misc',
|
|
106
|
-
value: 25000,
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
options: {
|
|
110
|
-
title: 'Donut (centered)',
|
|
111
|
-
resizable: true,
|
|
112
|
-
legend: {
|
|
113
|
-
alignment: 'center',
|
|
114
|
-
truncation: {
|
|
115
|
-
type: 'none',
|
|
82
|
+
export const DonutCentered = {
|
|
83
|
+
render: Template,
|
|
84
|
+
|
|
85
|
+
args: {
|
|
86
|
+
isInverse: false,
|
|
87
|
+
type: CarbonChartType.donut,
|
|
88
|
+
dataSet: [
|
|
89
|
+
{
|
|
90
|
+
group: '2V2N 9KYPM version 1',
|
|
91
|
+
value: 20000,
|
|
116
92
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
93
|
+
{
|
|
94
|
+
group: 'L22I P66EP L22I P66EP L22I P66EP',
|
|
95
|
+
value: 65000,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
group: 'JQAI 2M4L1',
|
|
99
|
+
value: 75000,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
group: 'J9DZ F37AP',
|
|
103
|
+
value: 1200,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
group: 'YEL48 Q6XK YEL48',
|
|
107
|
+
value: 10000,
|
|
121
108
|
},
|
|
122
|
-
|
|
109
|
+
{
|
|
110
|
+
group: 'Misc',
|
|
111
|
+
value: 25000,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
options: {
|
|
115
|
+
title: 'Donut (centered)',
|
|
116
|
+
resizable: true,
|
|
117
|
+
legend: {
|
|
118
|
+
alignment: 'center',
|
|
119
|
+
truncation: {
|
|
120
|
+
type: 'none',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
donut: {
|
|
124
|
+
center: {
|
|
125
|
+
label: 'Browsers',
|
|
126
|
+
},
|
|
127
|
+
alignment: 'center',
|
|
128
|
+
},
|
|
129
|
+
height: '400px',
|
|
123
130
|
},
|
|
124
|
-
height: '400px',
|
|
125
131
|
},
|
|
126
132
|
};
|
|
127
133
|
|
|
128
|
-
export const DonutValueMapsToCount =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
134
|
+
export const DonutValueMapsToCount = {
|
|
135
|
+
render: Template,
|
|
136
|
+
|
|
137
|
+
args: {
|
|
138
|
+
isInverse: false,
|
|
139
|
+
type: CarbonChartType.donut,
|
|
140
|
+
dataSet: [
|
|
141
|
+
{
|
|
142
|
+
group: '2V2N 9KYPM version 1',
|
|
143
|
+
count: 28000,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
group: 'L22I P66EP L22I P66EP L22I P66EP',
|
|
147
|
+
count: 65000,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
group: 'JQAI 2M4L1',
|
|
151
|
+
count: 75000,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
group: 'J9DZ F37AP',
|
|
155
|
+
count: 3200,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
group: 'YEL48 Q6XK YEL48',
|
|
159
|
+
count: 15000,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
group: 'Misc',
|
|
163
|
+
count: 25000,
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
options: {
|
|
167
|
+
title: 'Donut (value maps to count)',
|
|
168
|
+
resizable: true,
|
|
169
|
+
pie: {
|
|
170
|
+
valueMapsTo: 'count',
|
|
171
|
+
},
|
|
172
|
+
height: '400px',
|
|
173
|
+
legend: {
|
|
174
|
+
truncation: {
|
|
175
|
+
type: 'none',
|
|
176
|
+
},
|
|
168
177
|
},
|
|
169
178
|
},
|
|
170
179
|
},
|
|
171
180
|
};
|
|
172
|
-
|
|
173
|
-
DonutEmptyState
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
|
|
182
|
+
export const DonutEmptyState = {
|
|
183
|
+
render: Template,
|
|
184
|
+
|
|
185
|
+
args: {
|
|
186
|
+
isInverse: false,
|
|
187
|
+
type: CarbonChartType.donut,
|
|
188
|
+
dataSet: [],
|
|
189
|
+
options: {
|
|
190
|
+
title: 'Donut (empty state)',
|
|
191
|
+
resizable: true,
|
|
192
|
+
donut: {
|
|
193
|
+
center: {
|
|
194
|
+
label: 'Browsers',
|
|
195
|
+
},
|
|
183
196
|
},
|
|
197
|
+
height: '400px',
|
|
184
198
|
},
|
|
185
|
-
height: '400px',
|
|
186
199
|
},
|
|
187
200
|
};
|
|
188
|
-
|
|
189
|
-
DonutSkeleton
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
|
|
202
|
+
export const DonutSkeleton = {
|
|
203
|
+
render: Template,
|
|
204
|
+
|
|
205
|
+
args: {
|
|
206
|
+
isInverse: false,
|
|
207
|
+
type: CarbonChartType.donut,
|
|
208
|
+
dataSet: [],
|
|
209
|
+
options: {
|
|
210
|
+
title: 'Donut (skeleton)',
|
|
211
|
+
resizable: true,
|
|
212
|
+
donut: {
|
|
213
|
+
center: {
|
|
214
|
+
label: 'Browsers',
|
|
215
|
+
},
|
|
199
216
|
},
|
|
217
|
+
data: {
|
|
218
|
+
loading: true,
|
|
219
|
+
},
|
|
220
|
+
height: '400px',
|
|
200
221
|
},
|
|
201
|
-
data: {
|
|
202
|
-
loading: true,
|
|
203
|
-
},
|
|
204
|
-
height: '400px',
|
|
205
222
|
},
|
|
206
223
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -23,58 +23,64 @@ export default {
|
|
|
23
23
|
},
|
|
24
24
|
} as Meta;
|
|
25
25
|
|
|
26
|
-
const Template:
|
|
26
|
+
const Template: StoryFn<CarbonChartProps> = args => (
|
|
27
27
|
<Card isInverse={args.isInverse} style={{ padding: '12px' }}>
|
|
28
28
|
<CarbonChart {...args} />
|
|
29
29
|
</Card>
|
|
30
30
|
);
|
|
31
31
|
|
|
32
|
-
export const GaugeSemicircularDangerStatus =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
export const GaugeSemicircularDangerStatus = {
|
|
33
|
+
render: Template,
|
|
34
|
+
|
|
35
|
+
args: {
|
|
36
|
+
isInverse: false,
|
|
37
|
+
type: CarbonChartType.gauge,
|
|
38
|
+
dataSet: [
|
|
39
|
+
{
|
|
40
|
+
group: 'value',
|
|
41
|
+
value: 42,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
group: 'delta',
|
|
45
|
+
value: -13.37,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
options: {
|
|
49
|
+
title: 'Gauge semicircular -- danger status',
|
|
50
|
+
resizable: true,
|
|
51
|
+
height: '250px',
|
|
52
|
+
gauge: {
|
|
53
|
+
type: 'semi',
|
|
54
|
+
status: 'danger',
|
|
55
|
+
},
|
|
53
56
|
},
|
|
54
57
|
},
|
|
55
58
|
};
|
|
56
59
|
|
|
57
|
-
export const GaugeCircularWarningStatus =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
export const GaugeCircularWarningStatus = {
|
|
61
|
+
render: Template,
|
|
62
|
+
|
|
63
|
+
args: {
|
|
64
|
+
isInverse: false,
|
|
65
|
+
type: CarbonChartType.gauge,
|
|
66
|
+
dataSet: [
|
|
67
|
+
{
|
|
68
|
+
group: 'value',
|
|
69
|
+
value: 42,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
group: 'delta',
|
|
73
|
+
value: -13.37,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
options: {
|
|
77
|
+
title: 'Gauge circular -- warning status',
|
|
78
|
+
resizable: true,
|
|
79
|
+
height: '250px',
|
|
80
|
+
gauge: {
|
|
81
|
+
status: 'warning',
|
|
82
|
+
type: 'full',
|
|
83
|
+
},
|
|
78
84
|
},
|
|
79
85
|
},
|
|
80
86
|
};
|