@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.
Files changed (72) hide show
  1. package/dist/charts.js +2450 -1
  2. package/dist/charts.js.map +1 -1
  3. package/dist/charts.modern.module.js +2428 -1
  4. package/dist/charts.modern.module.js.map +1 -1
  5. package/dist/charts.umd.js +48555 -1
  6. package/dist/charts.umd.js.map +1 -1
  7. package/dist/components/CarbonChart/CarbonChart.d.ts +42 -41
  8. package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +310 -12
  9. package/dist/components/CarbonChart/CarbonChartAreaStacked.stories.d.ts +136 -7
  10. package/dist/components/CarbonChart/CarbonChartBar.stories.d.ts +214 -12
  11. package/dist/components/CarbonChart/CarbonChartBarFloating.stories.d.ts +82 -6
  12. package/dist/components/CarbonChart/CarbonChartBarGrouped.stories.d.ts +234 -13
  13. package/dist/components/CarbonChart/CarbonChartBarStacked.stories.d.ts +266 -14
  14. package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +53 -5
  15. package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +196 -9
  16. package/dist/components/CarbonChart/CarbonChartBullet.stories.d.ts +35 -4
  17. package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +580 -15
  18. package/dist/components/CarbonChart/CarbonChartDonut.stories.d.ts +120 -8
  19. package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +43 -5
  20. package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +89 -6
  21. package/dist/components/CarbonChart/CarbonChartLine.stories.d.ts +577 -20
  22. package/dist/components/CarbonChart/CarbonChartLollipop.stories.d.ts +55 -5
  23. package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +127 -8
  24. package/dist/components/CarbonChart/CarbonChartPie.stories.d.ts +101 -8
  25. package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +98 -7
  26. package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +173 -9
  27. package/dist/components/CarbonChart/CarbonChartSparkline.stories.d.ts +51 -4
  28. package/dist/components/CarbonChart/CarbonChartStep.stories.d.ts +38 -4
  29. package/dist/components/CarbonChart/index.d.ts +1 -1
  30. package/dist/components/LineChart/Chart.d.ts +27 -27
  31. package/dist/components/LineChart/ChartDataTable.d.ts +17 -17
  32. package/dist/components/LineChart/CustomAxisComponent.d.ts +3 -3
  33. package/dist/components/LineChart/CustomPointComponent.d.ts +17 -17
  34. package/dist/components/LineChart/DataTable.d.ts +5 -5
  35. package/dist/components/LineChart/GraphTooltip.d.ts +3 -3
  36. package/dist/components/LineChart/LegendButton.d.ts +6 -6
  37. package/dist/components/LineChart/LineChart.d.ts +67 -67
  38. package/dist/components/LineChart/LineChart.stories.d.ts +113 -23
  39. package/dist/components/LineChart/index.d.ts +1 -1
  40. package/dist/components/LineChart/magma-charts.d.ts +1 -1
  41. package/dist/index.d.ts +2 -2
  42. package/package.json +11 -6
  43. package/src/components/CarbonChart/CarbonChart.tsx +12 -16
  44. package/src/components/CarbonChart/CarbonChartArea.stories.tsx +674 -649
  45. package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +424 -414
  46. package/src/components/CarbonChart/CarbonChartBar.stories.tsx +352 -325
  47. package/src/components/CarbonChart/CarbonChartBarFloating.stories.tsx +127 -116
  48. package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +872 -843
  49. package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +913 -879
  50. package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +238 -232
  51. package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +565 -547
  52. package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +59 -56
  53. package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +1335 -1299
  54. package/src/components/CarbonChart/CarbonChartDonut.stories.tsx +170 -153
  55. package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +50 -44
  56. package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +733 -724
  57. package/src/components/CarbonChart/CarbonChartLine.stories.tsx +1656 -1605
  58. package/src/components/CarbonChart/CarbonChartLollipop.stories.tsx +81 -76
  59. package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +177 -162
  60. package/src/components/CarbonChart/CarbonChartPie.stories.tsx +154 -139
  61. package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +445 -433
  62. package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +427 -409
  63. package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +191 -188
  64. package/src/components/CarbonChart/CarbonChartStep.stories.tsx +145 -142
  65. package/src/components/CarbonChart/carbon-charts.css +7303 -0
  66. package/src/components/LineChart/LineChart.stories.tsx +91 -104
  67. package/dist/components/CarbonChart/CarbonChart.test.d.ts +0 -1
  68. package/dist/components/CarbonChart/embeddedStyles.d.ts +0 -1
  69. package/dist/components/LineChart/ChartDataTable.test.d.ts +0 -1
  70. package/dist/components/LineChart/LineChart.test.d.ts +0 -1
  71. package/dist/components/LineChart/test/exampleChartData.d.ts +0 -40
  72. package/src/components/CarbonChart/embeddedStyles.ts +0 -24880
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Story, Meta } from '@storybook/react/types-6-0';
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: Story<CarbonChartProps> = args => (
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 = Template.bind({});
33
- Donut.args = {
34
- isInverse: false,
35
- type: CarbonChartType.donut,
36
- dataSet: [
37
- {
38
- group: '2V2N 9KYPM version 1',
39
- value: 20000,
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
- height: '400px',
71
- legend: {
72
- truncation: {
73
- type: 'none',
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 = Template.bind({});
80
- DonutCentered.args = {
81
- isInverse: false,
82
- type: CarbonChartType.donut,
83
- dataSet: [
84
- {
85
- group: '2V2N 9KYPM version 1',
86
- value: 20000,
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
- donut: {
119
- center: {
120
- label: 'Browsers',
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
- alignment: 'center',
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 = Template.bind({});
129
- DonutValueMapsToCount.args = {
130
- isInverse: false,
131
- type: CarbonChartType.donut,
132
- dataSet: [
133
- {
134
- group: '2V2N 9KYPM version 1',
135
- count: 28000,
136
- },
137
- {
138
- group: 'L22I P66EP L22I P66EP L22I P66EP',
139
- count: 65000,
140
- },
141
- {
142
- group: 'JQAI 2M4L1',
143
- count: 75000,
144
- },
145
- {
146
- group: 'J9DZ F37AP',
147
- count: 3200,
148
- },
149
- {
150
- group: 'YEL48 Q6XK YEL48',
151
- count: 15000,
152
- },
153
- {
154
- group: 'Misc',
155
- count: 25000,
156
- },
157
- ],
158
- options: {
159
- title: 'Donut (value maps to count)',
160
- resizable: true,
161
- pie: {
162
- valueMapsTo: 'count',
163
- },
164
- height: '400px',
165
- legend: {
166
- truncation: {
167
- type: 'none',
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
- export const DonutEmptyState = Template.bind({});
173
- DonutEmptyState.args = {
174
- isInverse: false,
175
- type: CarbonChartType.donut,
176
- dataSet: [],
177
- options: {
178
- title: 'Donut (empty state)',
179
- resizable: true,
180
- donut: {
181
- center: {
182
- label: 'Browsers',
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
- export const DonutSkeleton = Template.bind({});
189
- DonutSkeleton.args = {
190
- isInverse: false,
191
- type: CarbonChartType.donut,
192
- dataSet: [],
193
- options: {
194
- title: 'Donut (skeleton)',
195
- resizable: true,
196
- donut: {
197
- center: {
198
- label: 'Browsers',
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 { Story, Meta } from '@storybook/react/types-6-0';
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: Story<CarbonChartProps> = args => (
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 = Template.bind({});
33
- GaugeSemicircularDangerStatus.args = {
34
- isInverse: false,
35
- type: CarbonChartType.gauge,
36
- dataSet: [
37
- {
38
- group: 'value',
39
- value: 42,
40
- },
41
- {
42
- group: 'delta',
43
- value: -13.37,
44
- },
45
- ],
46
- options: {
47
- title: 'Gauge semicircular -- danger status',
48
- resizable: true,
49
- height: '250px',
50
- gauge: {
51
- type: 'semi',
52
- status: 'danger',
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 = Template.bind({});
58
- GaugeCircularWarningStatus.args = {
59
- isInverse: false,
60
- type: CarbonChartType.gauge,
61
- dataSet: [
62
- {
63
- group: 'value',
64
- value: 42,
65
- },
66
- {
67
- group: 'delta',
68
- value: -13.37,
69
- },
70
- ],
71
- options: {
72
- title: 'Gauge circular -- warning status',
73
- resizable: true,
74
- height: '250px',
75
- gauge: {
76
- status: 'warning',
77
- type: 'full',
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
  };