@react-magma/charts 10.0.0 → 11.0.0-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 +13 -13
- package/dist/charts.js +1 -1
- package/dist/charts.js.map +1 -1
- package/dist/charts.map +1 -1
- package/dist/charts.modern.module.js +1 -1
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +1 -1
- package/dist/charts.umd.js.map +1 -1
- package/dist/components/CarbonChart/CarbonChart.d.ts +10 -1
- package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +3 -0
- package/dist/components/CarbonChart/CarbonChartAreaStacked.stories.d.ts +1 -0
- package/dist/components/CarbonChart/CarbonChartBarGrouped.stories.d.ts +1 -0
- package/dist/components/CarbonChart/CarbonChartBarStacked.stories.d.ts +1 -0
- package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartBullet.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartLine.stories.d.ts +11 -0
- package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartSparkline.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartStep.stories.d.ts +4 -0
- package/package.json +3 -3
- package/src/components/CarbonChart/CarbonChart.tsx +28 -1
- package/src/components/CarbonChart/CarbonChartArea.stories.tsx +272 -0
- package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +152 -0
- package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +124 -0
- package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +125 -0
- package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +274 -0
- package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +606 -0
- package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +89 -0
- package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +1418 -0
- package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +80 -0
- package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +767 -0
- package/src/components/CarbonChart/CarbonChartLine.stories.tsx +1050 -0
- package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +216 -0
- package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +479 -0
- package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +467 -0
- package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +222 -0
- package/src/components/CarbonChart/CarbonChartStep.stories.tsx +173 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Story, Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
4
|
+
import { Card } from 'react-magma-dom';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: CarbonChart,
|
|
8
|
+
title: 'CarbonChart/Step',
|
|
9
|
+
argTypes: {
|
|
10
|
+
isInverse: {
|
|
11
|
+
control: {
|
|
12
|
+
type: 'boolean',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
type: {
|
|
16
|
+
control: {
|
|
17
|
+
type: 'select',
|
|
18
|
+
options: CarbonChartType,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as Meta;
|
|
23
|
+
|
|
24
|
+
const Template: Story<CarbonChartProps> = args => (
|
|
25
|
+
<Card isInverse={args.isInverse} style={{ padding: '12px' }}>
|
|
26
|
+
<CarbonChart {...args} />
|
|
27
|
+
</Card>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const StepTimeSeries = Template.bind({});
|
|
31
|
+
StepTimeSeries.args = {
|
|
32
|
+
isInverse: false,
|
|
33
|
+
type: CarbonChartType.line,
|
|
34
|
+
dataSet: [
|
|
35
|
+
{
|
|
36
|
+
group: 'Dataset 1',
|
|
37
|
+
date: '2018-12-31T23:00:00.000Z',
|
|
38
|
+
value: 50000,
|
|
39
|
+
surplus: 844630247.9315708,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
group: 'Dataset 1',
|
|
43
|
+
date: '2019-01-04T23:00:00.000Z',
|
|
44
|
+
value: 65000,
|
|
45
|
+
surplus: 722253377.7025548,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
group: 'Dataset 1',
|
|
49
|
+
date: '2019-01-07T23:00:00.000Z',
|
|
50
|
+
value: null,
|
|
51
|
+
surplus: 9586.628515900247,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
group: 'Dataset 1',
|
|
55
|
+
date: '2019-01-12T23:00:00.000Z',
|
|
56
|
+
value: 49213,
|
|
57
|
+
surplus: 519710030.3060996,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
group: 'Dataset 1',
|
|
61
|
+
date: '2019-01-16T23:00:00.000Z',
|
|
62
|
+
value: 51213,
|
|
63
|
+
surplus: 964336709.1293422,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
group: 'Dataset 2',
|
|
67
|
+
date: '2019-01-01T23:00:00.000Z',
|
|
68
|
+
value: 0,
|
|
69
|
+
surplus: 24733.73210194359,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
group: 'Dataset 2',
|
|
73
|
+
date: '2019-01-05T23:00:00.000Z',
|
|
74
|
+
value: 57312,
|
|
75
|
+
surplus: 2104847.5679499935,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
group: 'Dataset 2',
|
|
79
|
+
date: '2019-01-07T23:00:00.000Z',
|
|
80
|
+
value: 27432,
|
|
81
|
+
surplus: 632664658.6542752,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
group: 'Dataset 2',
|
|
85
|
+
date: '2019-01-14T23:00:00.000Z',
|
|
86
|
+
value: 70323,
|
|
87
|
+
surplus: 1484604165.9194114,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
group: 'Dataset 2',
|
|
91
|
+
date: '2019-01-18T23:00:00.000Z',
|
|
92
|
+
value: 21300,
|
|
93
|
+
surplus: 228423489.25766274,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
group: 'Dataset 3',
|
|
97
|
+
date: '2018-12-31T23:00:00.000Z',
|
|
98
|
+
value: 40000,
|
|
99
|
+
surplus: 634264360.9426379,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
group: 'Dataset 3',
|
|
103
|
+
date: '2019-01-04T23:00:00.000Z',
|
|
104
|
+
value: null,
|
|
105
|
+
surplus: 781.4728603674881,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
group: 'Dataset 3',
|
|
109
|
+
date: '2019-01-07T23:00:00.000Z',
|
|
110
|
+
value: 18000,
|
|
111
|
+
surplus: 210741530.6295638,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
group: 'Dataset 3',
|
|
115
|
+
date: '2019-01-12T23:00:00.000Z',
|
|
116
|
+
value: 39213,
|
|
117
|
+
surplus: 135260712.71714658,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
group: 'Dataset 3',
|
|
121
|
+
date: '2019-01-16T23:00:00.000Z',
|
|
122
|
+
value: 61213,
|
|
123
|
+
surplus: 313154331.2033775,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
group: 'Dataset 4',
|
|
127
|
+
date: '2019-01-01T23:00:00.000Z',
|
|
128
|
+
value: 20000,
|
|
129
|
+
surplus: 450715657.7789645,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
group: 'Dataset 4',
|
|
133
|
+
date: '2019-01-05T23:00:00.000Z',
|
|
134
|
+
value: 37312,
|
|
135
|
+
surplus: 60444212.38584305,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
group: 'Dataset 4',
|
|
139
|
+
date: '2019-01-07T23:00:00.000Z',
|
|
140
|
+
value: 51432,
|
|
141
|
+
surplus: 1007946419.445114,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
group: 'Dataset 4',
|
|
145
|
+
date: '2019-01-14T23:00:00.000Z',
|
|
146
|
+
value: 25332,
|
|
147
|
+
surplus: 281099594.1962531,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
group: 'Dataset 4',
|
|
151
|
+
date: '2019-01-18T23:00:00.000Z',
|
|
152
|
+
value: null,
|
|
153
|
+
surplus: 1928.4268222770295,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
options: {
|
|
157
|
+
title: 'Step (time series)',
|
|
158
|
+
axes: {
|
|
159
|
+
bottom: {
|
|
160
|
+
title: '2019 Annual Sales Figures',
|
|
161
|
+
mapsTo: 'date',
|
|
162
|
+
scaleType: 'time',
|
|
163
|
+
},
|
|
164
|
+
left: {
|
|
165
|
+
mapsTo: 'value',
|
|
166
|
+
title: 'Conversion rate',
|
|
167
|
+
scaleType: 'linear',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
curve: 'curveStepAfter',
|
|
171
|
+
height: '400px',
|
|
172
|
+
},
|
|
173
|
+
};
|