@carbon/charts 0.29.0 → 0.29.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/CHANGELOG.md +8 -0
- package/bundle.js +2 -2
- package/demo/demo-data/bubble.d.ts +24 -0
- package/demo/demo-data/bubble.js +189 -0
- package/demo/demo-data/bubble.js.map +1 -0
- package/demo/demo-data/create-codesandbox.d.ts +30 -0
- package/demo/demo-data/create-codesandbox.js +92 -0
- package/demo/demo-data/create-codesandbox.js.map +1 -0
- package/demo/demo-data/{pie-donut.d.ts → donut.d.ts} +0 -11
- package/demo/demo-data/donut.js +12 -0
- package/demo/demo-data/donut.js.map +1 -0
- package/demo/demo-data/index.d.ts +48 -1
- package/demo/demo-data/index.js +215 -1
- package/demo/demo-data/index.js.map +1 -1
- package/demo/demo-data/line.d.ts +4 -66
- package/demo/demo-data/line.js +78 -183
- package/demo/demo-data/line.js.map +1 -1
- package/demo/demo-data/pie.d.ts +11 -0
- package/demo/demo-data/{pie-donut.js → pie.js} +1 -11
- package/demo/demo-data/pie.js.map +1 -0
- package/demo/demo-data/scatter.d.ts +43 -0
- package/demo/demo-data/scatter.js +94 -0
- package/demo/demo-data/scatter.js.map +1 -0
- package/demo/demo-data/step.d.ts +19 -0
- package/demo/demo-data/step.js +13 -0
- package/demo/demo-data/step.js.map +1 -0
- package/index.js +2 -2
- package/package.json +2 -1
- package/src/charts/bubble.d.ts +6 -0
- package/src/charts/bubble.js +45 -0
- package/src/charts/bubble.js.map +1 -0
- package/src/charts/index.d.ts +1 -0
- package/src/charts/index.js +1 -0
- package/src/charts/index.js.map +1 -1
- package/src/components/axes/axis.js +0 -8
- package/src/components/axes/axis.js.map +1 -1
- package/src/components/graphs/bubble.d.ts +8 -0
- package/src/components/graphs/bubble.js +67 -0
- package/src/components/graphs/bubble.js.map +1 -0
- package/src/components/graphs/scatter.d.ts +2 -0
- package/src/components/graphs/scatter.js +13 -5
- package/src/components/graphs/scatter.js.map +1 -1
- package/src/components/index.d.ts +1 -0
- package/src/components/index.js +1 -0
- package/src/components/index.js.map +1 -1
- package/src/configuration.d.ts +2 -1
- package/src/configuration.js +16 -0
- package/src/configuration.js.map +1 -1
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -2
- package/src/index.js.map +1 -1
- package/src/interfaces/charts.d.ts +19 -0
- package/src/interfaces/charts.js.map +1 -1
- package/src/model.js +1 -1
- package/src/model.js.map +1 -1
- package/src/services/scales-cartesian.d.ts +0 -2
- package/src/services/scales-cartesian.js +10 -9
- package/src/services/scales-cartesian.js.map +1 -1
- package/styles/graphs/_bubble.scss +17 -0
- package/styles/graphs/index.scss +1 -0
- package/styles-g10.css +12 -0
- package/styles-g10.css.map +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g10.min.css.map +1 -1
- package/styles-g100.css +12 -0
- package/styles-g100.css.map +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g100.min.css.map +1 -1
- package/styles-g90.css +12 -0
- package/styles-g90.css.map +1 -1
- package/styles-g90.min.css +1 -1
- package/styles-g90.min.css.map +1 -1
- package/styles.css +12 -0
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/demo/demo-data/pie-donut.js.map +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const bubbleData: {
|
|
2
|
+
labels: string[];
|
|
3
|
+
datasets: {
|
|
4
|
+
label: string;
|
|
5
|
+
data: {
|
|
6
|
+
date: Date;
|
|
7
|
+
value: number;
|
|
8
|
+
radius: number;
|
|
9
|
+
}[];
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
export declare const bubbleOptions: {
|
|
13
|
+
title: string;
|
|
14
|
+
axes: {
|
|
15
|
+
bottom: {
|
|
16
|
+
title: string;
|
|
17
|
+
scaleType: string;
|
|
18
|
+
secondary: boolean;
|
|
19
|
+
};
|
|
20
|
+
left: {
|
|
21
|
+
primary: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export var bubbleData = {
|
|
2
|
+
labels: ["Qty", "More", "Sold", "Restocking", "Misc"],
|
|
3
|
+
datasets: [
|
|
4
|
+
{
|
|
5
|
+
label: "Dataset 1",
|
|
6
|
+
data: [
|
|
7
|
+
{
|
|
8
|
+
date: new Date(2019, 0, 1),
|
|
9
|
+
value: 10000,
|
|
10
|
+
radius: 6
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
date: new Date(2019, 0, 5),
|
|
14
|
+
value: 45000,
|
|
15
|
+
radius: 5
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
date: new Date(2019, 0, 8),
|
|
19
|
+
value: 10000,
|
|
20
|
+
radius: 8
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
date: new Date(2019, 0, 13),
|
|
24
|
+
value: 49213,
|
|
25
|
+
radius: 11
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
date: new Date(2019, 0, 17),
|
|
29
|
+
value: 51213,
|
|
30
|
+
radius: 3
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "Dataset 2",
|
|
36
|
+
data: [
|
|
37
|
+
{
|
|
38
|
+
date: new Date(2019, 0, 2),
|
|
39
|
+
value: 12000,
|
|
40
|
+
radius: 4
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
date: new Date(2019, 0, 6),
|
|
44
|
+
value: 57312,
|
|
45
|
+
radius: 6
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
date: new Date(2019, 0, 8),
|
|
49
|
+
value: 21432,
|
|
50
|
+
radius: 8
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
date: new Date(2019, 0, 15),
|
|
54
|
+
value: 70323,
|
|
55
|
+
radius: 3
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
date: new Date(2019, 0, 19),
|
|
59
|
+
value: 21300,
|
|
60
|
+
radius: 5
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "Dataset 3",
|
|
66
|
+
data: [
|
|
67
|
+
{
|
|
68
|
+
date: new Date(2019, 0, 1),
|
|
69
|
+
value: 50000,
|
|
70
|
+
radius: 5
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
date: new Date(2019, 0, 1),
|
|
74
|
+
value: 15000,
|
|
75
|
+
radius: 3
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
date: new Date(2019, 0, 2),
|
|
79
|
+
value: 20000,
|
|
80
|
+
radius: 8
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
date: new Date(2019, 0, 2),
|
|
84
|
+
value: 39213,
|
|
85
|
+
radius: 4
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
date: new Date(2019, 0, 3),
|
|
89
|
+
value: 61213,
|
|
90
|
+
radius: 3
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
date: new Date(2019, 0, 3),
|
|
94
|
+
value: 50000,
|
|
95
|
+
radius: 5
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
date: new Date(2019, 0, 4),
|
|
99
|
+
value: 15000,
|
|
100
|
+
radius: 3
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
date: new Date(2019, 0, 4),
|
|
104
|
+
value: 20000,
|
|
105
|
+
radius: 2
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
date: new Date(2019, 0, 5),
|
|
109
|
+
value: 39213,
|
|
110
|
+
radius: 4
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
date: new Date(2019, 0, 6),
|
|
114
|
+
value: 61213,
|
|
115
|
+
radius: 3
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "Dataset 4",
|
|
121
|
+
data: [
|
|
122
|
+
{
|
|
123
|
+
date: new Date(2019, 0, 2),
|
|
124
|
+
value: 5000,
|
|
125
|
+
radius: 2
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
date: new Date(2019, 0, 6),
|
|
129
|
+
value: 37312,
|
|
130
|
+
radius: 3
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
date: new Date(2019, 0, 8),
|
|
134
|
+
value: 51432,
|
|
135
|
+
radius: 5
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
date: new Date(2019, 0, 15),
|
|
139
|
+
value: 5000,
|
|
140
|
+
radius: 7
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
date: new Date(2019, 0, 19),
|
|
144
|
+
value: 31300,
|
|
145
|
+
radius: 2
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
date: new Date(2019, 0, 4),
|
|
149
|
+
value: 34242,
|
|
150
|
+
radius: 5
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
date: new Date(2019, 0, 5),
|
|
154
|
+
value: 62324,
|
|
155
|
+
radius: 12
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
date: new Date(2019, 0, 9),
|
|
159
|
+
value: 21321,
|
|
160
|
+
radius: 9
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
date: new Date(2019, 0, 12),
|
|
164
|
+
value: 13421,
|
|
165
|
+
radius: 2
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
date: new Date(2019, 0, 14),
|
|
169
|
+
value: 32523,
|
|
170
|
+
radius: 15
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
};
|
|
176
|
+
export var bubbleOptions = {
|
|
177
|
+
title: "Bubble (time series)",
|
|
178
|
+
axes: {
|
|
179
|
+
bottom: {
|
|
180
|
+
title: "2019 Annual Sales Figures",
|
|
181
|
+
scaleType: "time",
|
|
182
|
+
secondary: true
|
|
183
|
+
},
|
|
184
|
+
left: {
|
|
185
|
+
primary: true
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=../../../demo/demo-data/bubble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubble.js","sourceRoot":"","sources":["bubble.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,UAAU,GAAG;IACzB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC;IACrD,QAAQ,EAAE;QACT;YACC,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE;gBACL;oBACC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC1B,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,CAAC;iBACT;gBACD;oBACC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC1B,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,CAAC;iBACT;gBACD;oBACC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC1B,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,CAAC;iBACT;gBACD;oBACC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3B,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,EAAE;iBACV;gBACD;oBACC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC3B,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,CAAC;iBACT;aACD;SACD;QACD;YACC,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE;gBACL;oBACC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC1B,KAAK,EAAE,KAA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els: [\"Qty\", \"More\", \"Sold\", \"Restocking\", \"Misc\"],\n\tdatasets: [\n\t\t{\n\t\t\tlabel: \"Dataset 1\",\n\t\t\tdata: [\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 1),\n\t\t\t\t\tvalue: 10000,\n\t\t\t\t\tradius: 6\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 5),\n\t\t\t\t\tvalue: 45000,\n\t\t\t\t\tradius: 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 8),\n\t\t\t\t\tvalue: 10000,\n\t\t\t\t\tradius: 8\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 13),\n\t\t\t\t\tvalue: 49213,\n\t\t\t\t\tradius: 11\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 17),\n\t\t\t\t\tvalue: 51213,\n\t\t\t\t\tradius: 3\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tlabel: \"Dataset 2\",\n\t\t\tdata: [\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 2),\n\t\t\t\t\tvalue: 12000,\n\t\t\t\t\tradius: 4\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 6),\n\t\t\t\t\tvalue: 57312,\n\t\t\t\t\tradius: 6\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 8),\n\t\t\t\t\tvalue: 21432,\n\t\t\t\t\tradius: 8\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 15),\n\t\t\t\t\tvalue: 70323,\n\t\t\t\t\tradius: 3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 19),\n\t\t\t\t\tvalue: 21300,\n\t\t\t\t\tradius: 5\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tlabel: \"Dataset 3\",\n\t\t\tdata: [\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 1),\n\t\t\t\t\tvalue: 50000,\n\t\t\t\t\tradius: 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 1),\n\t\t\t\t\tvalue: 15000,\n\t\t\t\t\tradius: 3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 2),\n\t\t\t\t\tvalue: 20000,\n\t\t\t\t\tradius: 8\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 2),\n\t\t\t\t\tvalue: 39213,\n\t\t\t\t\tradius: 4\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 3),\n\t\t\t\t\tvalue: 61213,\n\t\t\t\t\tradius: 3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 3),\n\t\t\t\t\tvalue: 50000,\n\t\t\t\t\tradius: 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 4),\n\t\t\t\t\tvalue: 15000,\n\t\t\t\t\tradius: 3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 4),\n\t\t\t\t\tvalue: 20000,\n\t\t\t\t\tradius: 2\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 5),\n\t\t\t\t\tvalue: 39213,\n\t\t\t\t\tradius: 4\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 6),\n\t\t\t\t\tvalue: 61213,\n\t\t\t\t\tradius: 3\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tlabel: \"Dataset 4\",\n\t\t\tdata: [\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 2),\n\t\t\t\t\tvalue: 5000,\n\t\t\t\t\tradius: 2\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 6),\n\t\t\t\t\tvalue: 37312,\n\t\t\t\t\tradius: 3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 8),\n\t\t\t\t\tvalue: 51432,\n\t\t\t\t\tradius: 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 15),\n\t\t\t\t\tvalue: 5000,\n\t\t\t\t\tradius: 7\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 19),\n\t\t\t\t\tvalue: 31300,\n\t\t\t\t\tradius: 2\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 4),\n\t\t\t\t\tvalue: 34242,\n\t\t\t\t\tradius: 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 5),\n\t\t\t\t\tvalue: 62324,\n\t\t\t\t\tradius: 12\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 9),\n\t\t\t\t\tvalue: 21321,\n\t\t\t\t\tradius: 9\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 12),\n\t\t\t\t\tvalue: 13421,\n\t\t\t\t\tradius: 2\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdate: new Date(2019, 0, 14),\n\t\t\t\t\tvalue: 32523,\n\t\t\t\t\tradius: 15\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n};\n\nexport const bubbleOptions = {\n\ttitle: \"Bubble (time series)\",\n\taxes: {\n\t\tbottom: {\n\t\t\ttitle: \"2019 Annual Sales Figures\",\n\t\t\tscaleType: \"time\",\n\t\t\tsecondary: true\n\t\t},\n\t\tleft: {\n\t\t\tprimary: true\n\t\t}\n\t}\n};\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const createChartSandbox: (chartTemplate: any) => string;
|
|
2
|
+
export declare const createReactChartApp: (demo: any) => {
|
|
3
|
+
"src/index.html": string;
|
|
4
|
+
"src/index.js": string;
|
|
5
|
+
"package.json": {
|
|
6
|
+
dependencies: {
|
|
7
|
+
"@carbon/charts": string;
|
|
8
|
+
"@carbon/charts-react": string;
|
|
9
|
+
d3: string;
|
|
10
|
+
react: string;
|
|
11
|
+
"react-dom": string;
|
|
12
|
+
"react-scripts": string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const createAngularChartApp: (demo: any) => {
|
|
17
|
+
"src/index.html": string;
|
|
18
|
+
"src/main.ts": string;
|
|
19
|
+
"src/app/app.component.html": string;
|
|
20
|
+
"src/app/app.component.ts": string;
|
|
21
|
+
"src/app/app.module.ts": string;
|
|
22
|
+
".angular-cli.json": string;
|
|
23
|
+
"package.json": string;
|
|
24
|
+
};
|
|
25
|
+
export declare const createVueChartApp: (demo: any) => {
|
|
26
|
+
"src/components/chart.vue": string;
|
|
27
|
+
"src/App.vue": string;
|
|
28
|
+
"src/main.js": string;
|
|
29
|
+
"package.json": string;
|
|
30
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { getParameters } from "codesandbox/lib/api/define";
|
|
2
|
+
import { version as libraryVersion } from "../../package.json";
|
|
3
|
+
export var createChartSandbox = function (chartTemplate) {
|
|
4
|
+
var files = {};
|
|
5
|
+
Object.keys(chartTemplate)
|
|
6
|
+
.forEach(function (filePath) { return files[filePath] = { content: chartTemplate[filePath] }; });
|
|
7
|
+
return "https://codesandbox.io/api/v1/sandboxes/define?parameters=" + getParameters({ files: files });
|
|
8
|
+
};
|
|
9
|
+
export var createReactChartApp = function (demo) {
|
|
10
|
+
var chartData = JSON.stringify(demo.data, null, "\t");
|
|
11
|
+
var chartOptions = JSON.stringify(demo.options, null, "\t");
|
|
12
|
+
var chartComponent = demo.chartType.vanilla;
|
|
13
|
+
var indexHtml = "<div id=\"root\"></div>\n ";
|
|
14
|
+
var indexJs = "import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { " + chartComponent + " } from \"@carbon/charts-react\";\nimport \"@carbon/charts/styles.css\";\n// Or\n// import \"@carbon/charts/styles/styles.scss\";\n\nclass App extends React.Component {\n\tstate = {\n\t\tdata: " + chartData + ",\n\t\toptions: " + chartOptions + "\n\t};\n\n\trender = () => (\n\t\t<" + chartComponent + "\n\t\t\tdata={this.state.data}\n\t\t\toptions={this.state.options}>\n\t\t</" + chartComponent + ">\n\t);\n}\nReactDOM.render(<App />, document.getElementById(\"root\"));\n ";
|
|
15
|
+
var packageJson = {
|
|
16
|
+
dependencies: {
|
|
17
|
+
"@carbon/charts": libraryVersion,
|
|
18
|
+
"@carbon/charts-react": libraryVersion,
|
|
19
|
+
d3: "5.12.0",
|
|
20
|
+
react: "16.12.0",
|
|
21
|
+
"react-dom": "16.12.0",
|
|
22
|
+
"react-scripts": "3.0.1"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
"src/index.html": indexHtml,
|
|
27
|
+
"src/index.js": indexJs,
|
|
28
|
+
"package.json": packageJson
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export var createAngularChartApp = function (demo) {
|
|
32
|
+
var chartData = JSON.stringify(demo.data, null, "\t\t");
|
|
33
|
+
var chartOptions = JSON.stringify(demo.options, null, "\t\t");
|
|
34
|
+
var chartComponent = demo.chartType.angular;
|
|
35
|
+
var appComponentHtml = "<" + chartComponent + " [data]=\"data\" [options]=\"options\"></" + chartComponent + ">";
|
|
36
|
+
var appComponentTs = "import { Component } from \"@angular/core\";\n@Component({\n\tselector: \"app-root\",\n\ttemplateUrl: \"./app.component.html\"\n})\nexport class AppComponent {\n\tdata = " + chartData + ";\n\toptions = " + chartOptions + ";\n}";
|
|
37
|
+
var appModule = "import { NgModule } from \"@angular/core\";\nimport { BrowserModule } from \"@angular/platform-browser\";\nimport { ChartsModule } from \"@carbon/charts-angular\";\nimport { AppComponent } from \"./app.component\";\n@NgModule({\n\timports: [BrowserModule, ChartsModule],\n\tdeclarations: [AppComponent],\n\tbootstrap: [AppComponent]\n})\nexport class AppModule {}";
|
|
38
|
+
var indexHtml = "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>Angular</title>\n\t</head>\n\t<body>\n\t\t<app-root></app-root>\n\t</body>\n</html>";
|
|
39
|
+
var mainTs = "import { platformBrowserDynamic } from \"@angular/platform-browser-dynamic\";\nimport { AppModule } from \"./app/app.module\";\nplatformBrowserDynamic()\n\t.bootstrapModule(AppModule)\n\t.catch(err => console.log(err));\n";
|
|
40
|
+
var angularCliJson = "{\n\t\"apps\": [\n\t\t{\n\t\t\t\"root\": \"src\",\n\t\t\t\"outDir\": \"dist\",\n\t\t\t\"assets\": [\"assets\", \"favicon.ico\"],\n\t\t\t\"index\": \"index.html\",\n\t\t\t\"main\": \"main.ts\",\n\t\t\t\"polyfills\": \"polyfills.ts\",\n\t\t\t\"prefix\": \"app\",\n\t\t\t\"styles\": [\"styles.css\"],\n\t\t\t\"scripts\": [],\n\t\t\t\"environmentSource\": \"environments/environment.ts\",\n\t\t\t\"environments\": {\n\t\t\t\t\"dev\": \"environments/environment.ts\",\n\t\t\t\t\"prod\": \"environments/environment.prod.ts\"\n\t\t\t}\n\t\t}\n\t]\n}";
|
|
41
|
+
var packageJson = JSON.stringify({
|
|
42
|
+
dependencies: {
|
|
43
|
+
"@angular/animations": "8.2.14",
|
|
44
|
+
"@angular/common": "8.2.14",
|
|
45
|
+
"@angular/compiler": "8.2.14",
|
|
46
|
+
"@angular/core": "8.2.14",
|
|
47
|
+
"@angular/forms": "8.2.14",
|
|
48
|
+
"@angular/platform-browser": "8.2.14",
|
|
49
|
+
"@angular/platform-browser-dynamic": "8.2.14",
|
|
50
|
+
"@angular/router": "8.2.14",
|
|
51
|
+
"@carbon/charts": libraryVersion,
|
|
52
|
+
"@carbon/charts-angular": libraryVersion,
|
|
53
|
+
"core-js": "3.6.0",
|
|
54
|
+
d3: "5.15.0",
|
|
55
|
+
rxjs: "6.5.3",
|
|
56
|
+
"zone.js": "0.10.2"
|
|
57
|
+
}
|
|
58
|
+
}, null, "\t");
|
|
59
|
+
return {
|
|
60
|
+
"src/index.html": indexHtml,
|
|
61
|
+
"src/main.ts": mainTs,
|
|
62
|
+
"src/app/app.component.html": appComponentHtml,
|
|
63
|
+
"src/app/app.component.ts": appComponentTs,
|
|
64
|
+
"src/app/app.module.ts": appModule,
|
|
65
|
+
".angular-cli.json": angularCliJson,
|
|
66
|
+
"package.json": packageJson
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export var createVueChartApp = function (demo) {
|
|
70
|
+
var chartData = JSON.stringify(demo.data, null, "\t\t");
|
|
71
|
+
var chartOptions = JSON.stringify(demo.options, null, "\t\t");
|
|
72
|
+
var chartComponent = demo.chartType.vue;
|
|
73
|
+
var chartVue = "<script>\nimport Vue from \"vue\";\nimport \"@carbon/charts/styles.css\";\nimport chartsVue from \"@carbon/charts-vue\";\nVue.use(chartsVue);\nexport default {\n\tname: \"Chart\",\n\tcomponents: {},\n\tdata() {\n\t\treturn {\n\t\t\tdata: " + chartData + ",\n\t\t\toptions: " + chartOptions + "\n\t\t};\n\t},\n\ttemplate: \"<" + chartComponent + " :data=\"data\" :options=\"options\"></" + chartComponent + ">\"\n};\n</script>\n ";
|
|
74
|
+
var appVue = "<template>\n\t<div id=\"app\">\n\t\t<Chart/>\n\t</div>\n</template>\n<script>\nimport Chart from \"./components/chart\";\nexport default {\n\tname: \"App\",\n\tcomponents: {\n\t\tChart\n\t}\n};\n</script>\n ";
|
|
75
|
+
var mainJs = "import Vue from \"vue\";\nimport App from \"./App.vue\";\nVue.config.productionTip = false;\nnew Vue({\n\trender: h => h(App)\n}).$mount(\"#app\");\n";
|
|
76
|
+
var packageJson = JSON.stringify({
|
|
77
|
+
dependencies: {
|
|
78
|
+
"@carbon/charts": libraryVersion,
|
|
79
|
+
"@carbon/charts-vue": libraryVersion,
|
|
80
|
+
"@vue/cli-plugin-babel": "4.1.1",
|
|
81
|
+
d3: "5.15.0",
|
|
82
|
+
vue: "^2.6.11"
|
|
83
|
+
}
|
|
84
|
+
}, null, "\t\t");
|
|
85
|
+
return {
|
|
86
|
+
"src/components/chart.vue": chartVue,
|
|
87
|
+
"src/App.vue": appVue,
|
|
88
|
+
"src/main.js": mainJs,
|
|
89
|
+
"package.json": packageJson
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=../../../demo/demo-data/create-codesandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-codesandbox.js","sourceRoot":"","sources":["create-codesandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,aAAkB;IACpD,IAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;SACxB,OAAO,CAAC,UAAA,QAAQ,IAAI,OAAA,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAtD,CAAsD,CAAC,CAAC;IAE9E,OAAO,+DAA6D,aAAa,CAAC,EAAE,KAAK,OAAA,EAAE,CAAG,CAAC;AAChG,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,IAAS;IAC5C,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,IAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IA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,uBAAuB,EAAE,OAAO;YAChC,EAAE,EAAE,QAAQ;YACZ,GAAG,EAAE,SAAS;SACd;KACD,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEjB,OAAO;QACN,0BAA0B,EAAE,QAAQ;QACpC,aAAa,EAAE,MAAM;QACrB,aAAa,EAAE,MAAM;QACrB,cAAc,EAAE,WAAW;KAC3B,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { getParameters } from \"codesandbox/lib/api/define\";\n\nimport { version as libraryVersion } from \"../../package.json\";\n\nexport const createChartSandbox = (chartTemplate: any) => {\n\tconst files = {};\n\n\tObject.keys(chartTemplate)\n\t\t.forEach(filePath => files[filePath] = { content: chartTemplate[filePath] });\n\n\treturn `https://codesandbox.io/api/v1/sandboxes/define?parameters=${getParameters({ files })}`;\n};\n\nexport const createReactChartApp = (demo: any) => {\n\tconst chartData = JSON.stringify(demo.data, null, \"\\t\");\n\tconst chartOptions = JSON.stringify(demo.options, null, \"\\t\");\n\tconst chartComponent = demo.chartType.vanilla;\n\n\tconst indexHtml = `<div id=\"root\"></div>\n `;\n\tconst indexJs =\n\t\t`import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { ${chartComponent} } from \"@carbon/charts-react\";\nimport \"@carbon/charts/styles.css\";\n// Or\n// import \"@carbon/charts/styles/styles.scss\";\n\nclass App extends React.Component {\n\tstate = {\n\t\tdata: ${chartData},\n\t\toptions: ${chartOptions}\n\t};\n\n\trender = () => (\n\t\t<${chartComponent}\n\t\t\tdata={this.state.data}\n\t\t\toptions={this.state.options}>\n\t\t</${chartComponent}>\n\t);\n}\nReactDOM.render(<App />, document.getElementById(\"root\"));\n `;\n\tconst packageJson = {\n\t\tdependencies: {\n\t\t\t\"@carbon/charts\": libraryVersion,\n\t\t\t\"@carbon/charts-react\": libraryVersion,\n\t\t\td3: \"5.12.0\",\n\t\t\treact: \"16.12.0\",\n\t\t\t\"react-dom\": \"16.12.0\",\n\t\t\t\"react-scripts\": \"3.0.1\"\n\t\t}\n\t};\n\n\treturn {\n\t\t\"src/index.html\": indexHtml,\n\t\t\"src/index.js\": indexJs,\n\t\t\"package.json\": packageJson\n\t};\n};\n\nexport const createAngularChartApp = (demo: any) => {\n\tconst chartData = JSON.stringify(demo.data, null, \"\\t\\t\");\n\tconst chartOptions = JSON.stringify(demo.options, null, \"\\t\\t\");\n\tconst chartComponent = demo.chartType.angular;\n\n\tconst appComponentHtml = `<${chartComponent} [data]=\"data\" [options]=\"options\"></${chartComponent}>`;\n\tconst appComponentTs =\n\t\t`import { Component } from \"@angular/core\";\n@Component({\n\tselector: \"app-root\",\n\ttemplateUrl: \"./app.component.html\"\n})\nexport class AppComponent {\n\tdata = ${chartData};\n\toptions = ${chartOptions};\n}`;\n\n\tconst appModule =\n\t\t`import { NgModule } from \"@angular/core\";\nimport { BrowserModule } from \"@angular/platform-browser\";\nimport { ChartsModule } from \"@carbon/charts-angular\";\nimport { AppComponent } from \"./app.component\";\n@NgModule({\n\timports: [BrowserModule, ChartsModule],\n\tdeclarations: [AppComponent],\n\tbootstrap: [AppComponent]\n})\nexport class AppModule {}`;\n\n\tconst indexHtml =\n\t\t`<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<title>Angular</title>\n\t</head>\n\t<body>\n\t\t<app-root></app-root>\n\t</body>\n</html>`;\n\n\tconst mainTs =\n\t\t`import { platformBrowserDynamic } from \"@angular/platform-browser-dynamic\";\nimport { AppModule } from \"./app/app.module\";\nplatformBrowserDynamic()\n\t.bootstrapModule(AppModule)\n\t.catch(err => console.log(err));\n`;\n\n\tconst angularCliJson =\n\t\t`{\n\t\"apps\": [\n\t\t{\n\t\t\t\"root\": \"src\",\n\t\t\t\"outDir\": \"dist\",\n\t\t\t\"assets\": [\"assets\", \"favicon.ico\"],\n\t\t\t\"index\": \"index.html\",\n\t\t\t\"main\": \"main.ts\",\n\t\t\t\"polyfills\": \"polyfills.ts\",\n\t\t\t\"prefix\": \"app\",\n\t\t\t\"styles\": [\"styles.css\"],\n\t\t\t\"scripts\": [],\n\t\t\t\"environmentSource\": \"environments/environment.ts\",\n\t\t\t\"environments\": {\n\t\t\t\t\"dev\": \"environments/environment.ts\",\n\t\t\t\t\"prod\": \"environments/environment.prod.ts\"\n\t\t\t}\n\t\t}\n\t]\n}`;\n\n\tconst packageJson = JSON.stringify({\n\t\tdependencies: {\n\t\t\t\"@angular/animations\": \"8.2.14\",\n\t\t\t\"@angular/common\": \"8.2.14\",\n\t\t\t\"@angular/compiler\": \"8.2.14\",\n\t\t\t\"@angular/core\": \"8.2.14\",\n\t\t\t\"@angular/forms\": \"8.2.14\",\n\t\t\t\"@angular/platform-browser\": \"8.2.14\",\n\t\t\t\"@angular/platform-browser-dynamic\": \"8.2.14\",\n\t\t\t\"@angular/router\": \"8.2.14\",\n\t\t\t\"@carbon/charts\": libraryVersion,\n\t\t\t\"@carbon/charts-angular\": libraryVersion,\n\t\t\t\"core-js\": \"3.6.0\",\n\t\t\td3: \"5.15.0\",\n\t\t\trxjs: \"6.5.3\",\n\t\t\t\"zone.js\": \"0.10.2\"\n\t\t}\n\t}, null, \"\\t\");\n\n\treturn {\n\t\t\"src/index.html\": indexHtml,\n\t\t\"src/main.ts\": mainTs,\n\t\t\"src/app/app.component.html\": appComponentHtml,\n\t\t\"src/app/app.component.ts\": appComponentTs,\n\t\t\"src/app/app.module.ts\": appModule,\n\t\t\".angular-cli.json\": angularCliJson,\n\t\t\"package.json\": packageJson\n\t};\n};\n\nexport const createVueChartApp = (demo: any) => {\n\tconst chartData = JSON.stringify(demo.data, null, \"\\t\\t\");\n\tconst chartOptions = JSON.stringify(demo.options, null, \"\\t\\t\");\n\tconst chartComponent = demo.chartType.vue;\n\n\tconst chartVue =\n`<script>\nimport Vue from \"vue\";\nimport \"@carbon/charts/styles.css\";\nimport chartsVue from \"@carbon/charts-vue\";\nVue.use(chartsVue);\nexport default {\n\tname: \"Chart\",\n\tcomponents: {},\n\tdata() {\n\t\treturn {\n\t\t\tdata: ${chartData},\n\t\t\toptions: ${chartOptions}\n\t\t};\n\t},\n\ttemplate: \"<${chartComponent} :data=\"data\" :options=\"options\"></${chartComponent}>\"\n};\n</script>\n `;\n\n\tconst appVue =\n`<template>\n\t<div id=\"app\">\n\t\t<Chart/>\n\t</div>\n</template>\n<script>\nimport Chart from \"./components/chart\";\nexport default {\n\tname: \"App\",\n\tcomponents: {\n\t\tChart\n\t}\n};\n</script>\n `;\n\n\tconst mainJs =\n`import Vue from \"vue\";\nimport App from \"./App.vue\";\nVue.config.productionTip = false;\nnew Vue({\n\trender: h => h(App)\n}).$mount(\"#app\");\n`;\n\n\tconst packageJson = JSON.stringify({\n\t\tdependencies: {\n\t\t\t\"@carbon/charts\": libraryVersion,\n\t\t\t\"@carbon/charts-vue\": libraryVersion,\n\t\t\t\"@vue/cli-plugin-babel\": \"4.1.1\",\n\t\t\td3: \"5.15.0\",\n\t\t\tvue: \"^2.6.11\"\n\t\t}\n\t}, null, \"\\t\\t\");\n\n\treturn {\n\t\t\"src/components/chart.vue\": chartVue,\n\t\t\"src/App.vue\": appVue,\n\t\t\"src/main.js\": mainJs,\n\t\t\"package.json\": packageJson\n\t};\n};\n"]}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
export declare const pieData: {
|
|
2
|
-
labels: string[];
|
|
3
|
-
datasets: {
|
|
4
|
-
label: string;
|
|
5
|
-
data: number[];
|
|
6
|
-
}[];
|
|
7
|
-
};
|
|
8
|
-
export declare const pieOptions: {
|
|
9
|
-
title: string;
|
|
10
|
-
resizable: boolean;
|
|
11
|
-
};
|
|
12
1
|
export declare const donutData: {
|
|
13
2
|
labels: string[];
|
|
14
3
|
datasets: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"donut.js","sourceRoot":"","sources":["donut.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,CAAC,IAAM,SAAS,GAAG,OAAO,CAAC;AAEjC,MAAM,CAAC,IAAM,YAAY,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,IAAI;IACf,KAAK,EAAE;QACN,MAAM,EAAE;YACP,KAAK,EAAE,UAAU;SACjB;KACD;CACD,CAAC","sourcesContent":["import { pieData } from \"./pie\";\n\nexport const donutData = pieData;\n\nexport const donutOptions = {\n\ttitle: \"Donut\",\n\tresizable: true,\n\tdonut: {\n\t\tcenter: {\n\t\t\tlabel: \"Browsers\"\n\t\t}\n\t}\n};\n"]}
|
|
@@ -1,3 +1,50 @@
|
|
|
1
1
|
export * from "./bar";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./bubble";
|
|
3
|
+
export * from "./donut";
|
|
3
4
|
export * from "./line";
|
|
5
|
+
export * from "./pie";
|
|
6
|
+
export * from "./scatter";
|
|
7
|
+
export * from "./step";
|
|
8
|
+
export declare const chartTypes: {
|
|
9
|
+
SimpleBarChart: {
|
|
10
|
+
vanilla: string;
|
|
11
|
+
angular: string;
|
|
12
|
+
vue: string;
|
|
13
|
+
};
|
|
14
|
+
GroupedBarChart: {
|
|
15
|
+
vanilla: string;
|
|
16
|
+
angular: string;
|
|
17
|
+
vue: string;
|
|
18
|
+
};
|
|
19
|
+
StackedBarChart: {
|
|
20
|
+
vanilla: string;
|
|
21
|
+
angular: string;
|
|
22
|
+
vue: string;
|
|
23
|
+
};
|
|
24
|
+
BubbleChart: {
|
|
25
|
+
vanilla: string;
|
|
26
|
+
angular: string;
|
|
27
|
+
vue: string;
|
|
28
|
+
};
|
|
29
|
+
LineChart: {
|
|
30
|
+
vanilla: string;
|
|
31
|
+
angular: string;
|
|
32
|
+
vue: string;
|
|
33
|
+
};
|
|
34
|
+
ScatterChart: {
|
|
35
|
+
vanilla: string;
|
|
36
|
+
angular: string;
|
|
37
|
+
vue: string;
|
|
38
|
+
};
|
|
39
|
+
PieChart: {
|
|
40
|
+
vanilla: string;
|
|
41
|
+
angular: string;
|
|
42
|
+
vue: string;
|
|
43
|
+
};
|
|
44
|
+
DonutChart: {
|
|
45
|
+
vanilla: string;
|
|
46
|
+
angular: string;
|
|
47
|
+
vue: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export declare const demoGroups: any;
|