-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcanner.js
361 lines (344 loc) · 9.09 KB
/
canner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
var core = [{
"name": "Xaxis",
"link": "xaxis",
},{
"name": "Yaxis",
"link": "yaxis"
},{
"name": "Grid",
"link": "grid"
},{
"name": "Legend",
"link": "legend"
},{
"name": "Chart",
"link": "chart"
}];
var core_data = core.map(function(c) {
return {
"name": c.name,
"md": "./docs/core/md/" + c.link + ".md"
}
})
core_data.unshift({
"name": "introduction",
"md": "./docs/core/md/README.md"
})
var charts = [{
"name": "Line",
"link": "line",
},{
"name": "Line Multiple",
"link": "line_multi"
},{
"name": "Area",
"link": "area"
},{
"name": "Area Stack",
"link": "area_stack"
},{
"name": "Bar",
"link": "bar"
},{
"name": "Bar Group",
"link": "bar_group"
},{
"name": "Bar Stack",
"link": "bar_stack"
},{
"name": "Scatter",
"link": "scatter"
},{
"name": "Pie",
"link": "pie"
},{
"name": "Donut",
"link": "donut"
}];
var basic_data = charts.map(function(c) {
return {
"name": c.name,
"md": "./docs/basic/md/" + c.link + ".md"
}
})
basic_data.unshift({
"name": "introduction",
"md": "./docs/basic/md/README.md"
})
var brush_charts = [{
"name": "Line",
"link": "line",
},{
"name": "Line Multiple",
"link": "line_multi"
},{
"name": "Area Stack",
"link": "area_stack"
},{
"name": "Bar",
"link": "bar"
},{
"name": "Bar Group",
"link": "bar_group"
},{
"name": "Bar Stack",
"link": "bar_stack"
},{
"name": "Scatter",
"link": "scatter"
}];
var brush_data = brush_charts.map(function(c) {
return {
"name": c.name,
"md": "./docs/brush/md/" + c.link + ".md"
}
})
brush_data.unshift({
"name": "introduction",
"md": "./docs/brush/md/README.md"
})
var tooltip_charts = [{
"name": "Line",
"link": "line",
},{
"name": "Line Multiple",
"link": "line_multi"
},{
"name": "Area Stack",
"link": "area_stack"
},{
"name": "Bar",
"link": "bar"
},{
"name": "Bar Group",
"link": "bar_group"
},{
"name": "Bar Stack",
"link": "bar_stack"
},{
"name": "Scatter",
"link": "scatter"
},{
"name": "pie",
"link": "pie"
}];
var tooltip_data = tooltip_charts.map(function(c) {
return {
"name": c.name,
"md": "./docs/tooltip/md/" + c.link + ".md"
}
})
tooltip_data.unshift({
"name": "introduction",
"md": "./docs/tooltip/md/README.md"
})
var zoom_charts = [{
"name": "Line",
"link": "line",
},{
"name": "Line Multiple",
"link": "line_multi"
},{
"name": "Area Stack",
"link": "area_stack"
},{
"name": "Bar",
"link": "bar"
},{
"name": "Bar Group",
"link": "bar_group"
},{
"name": "Bar Stack",
"link": "bar_stack"
},{
"name": "Scatter",
"link": "scatter"
}];
var zoom_data = zoom_charts.map(function(c) {
return {
"name": c.name,
"md": "./docs/zoom/md/" + c.link + ".md"
}
})
zoom_data.unshift({
"name": "introduction",
"md": "./docs/zoom/md/README.md"
})
module.exports = [{
"layout": "./index.hbs",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js"],
"data": {
"item": "A Javascript Library For Building Composable And Declarative Charts | React-D3",
"logo": "/img/react-d3_2.png",
"slogan": "A Javascript library for building composable and declarative charts",
"description": "A new solution for building reusable components for interactive charts",
"banner-img": "/img/basic/cover.png",
"product": {
"title": "React-d3",
"data": [{
"name": "Features",
"feature": [
{
"name": "<span class=\"glyphicon glyphicon-stats\"></span> High-Level Charts",
"description": "<code>React-d3</code> support high level components which you can install and create a line chart, bar chart, pie chart... etc, within a component."
},
{
"name": "<span class=\"glyphicon glyphicon-refresh\"></span> Flexible & Reusable Components",
"description": "<code>React-d3</code> is a highly module library. You can build new d3 charts using <code>React-d3</code> to create axis using <code>xaxis</code> component, <code>yaxis</code> component, label using <code>label</code> component, legend <code>legend</code> component... etc, in other word, it extends the flexibility of <code>d3</code> library so you can assemble a whole new chart using core components."
},
{
"name": "<span class=\"glyphicon glyphicon-retweet\"></span> Clear Data Flow, and Better Structures",
"description": "<code>React-d3</code> combine the power of <code>d3</code> flexibility and the data flow, structures, components, virtual DOM, and others benefits that <code>react.js</code> provide."
}
]
},{
"name": "Basic Charts",
"demo": [
{
"md": "./intro/demo_dist/demo_chart.md"
},
{
"md": "./intro/demo_dist/demo_brush.md"
},
{
"md": "./intro/demo_dist/demo_zoom.md"
},
{
"md": "./intro/demo_dist/demo_tooltip.md"
}
]
}]
}
}
},{
"layout": "./gallery.hbs",
"filename": "./get_start/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "Getting started react-d3",
"logo": "/img/react-d3_2.png",
"product": {
"title": "react-d3",
"data": [{
"name": "Getting Started",
"md": "./intro/get_start/data_prepare.md"
},{
"name": "Install and setup react-d3 packages",
"md": "./intro/get_start/install_pkg.md"
},{
"name": "Write chart",
"md": "./intro/get_start/write_chart.md"
},{
"name": "Load into your html",
"md": "./intro/get_start/load_html.md"
},{
"name": "Result",
"md": "./intro/get_start/result.md"
},{
"name": "Code on Github",
"md": "./intro/get_start/code.md"
}]
}
}
},{
"layout": "./gallery.hbs",
"filename": "./components/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "react-d3 components",
"logo": "/img/react-d3_2.png",
"product": {
"title": "react-d3",
"data": [{
"name": "Introduction",
"md": "./intro/components/intro.md"
}, {
"name": "react-d3-basic",
"md": "./intro/components/intro_basic.md"
}, {
"name": "react-d3-tooltip",
"md": "./intro/components/intro_tooltip.md"
}, {
"name": "react-d3-zoom",
"md": "./intro/components/intro_zoom.md"
}, {
"name": "react-d3-brush",
"md": "./intro/components/intro_brush.md"
}, {
"name": "react-d3-core",
"md": "./intro/components/intro_core.md"
}]
}
}
},{
"layout": "./gallery.hbs",
"filename": "./docs/basic/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "react-d3-basic",
"logo": "/img/react-d3_2.png",
"product": {
"title": "react-d3",
"data": basic_data
}
}
},{
"layout": "./gallery.hbs",
"filename": "./docs/core/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "react-d3-core",
"logo": "/img/react-d3_2.png",
"product": {
"title": "react-d3",
"data": core_data
}
}
},{
"layout": "./gallery.hbs",
"filename": "./docs/brush/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "react-d3-brush",
"logo": "/img/react-d3_2.png",
"slogan": "react-d3 brush charts",
"description": "Building Brush With Line, bar, Scatter, Area Charts ... with ease.",
"banner-img": "/img/brush/cover.png",
"product": {
"title": "react-d3",
"data": brush_data
}
}
},
{
"layout": "./gallery.hbs",
"filename": "./docs/tooltip/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "react-d3-brush",
"logo": "/img/react-d3_2.png",
"slogan": "react-d3 tooltip charts",
"description": "Building Tooltip With Line, bar, Scatter, Area Charts ... with ease.",
"banner-img": "/img/tooltip/cover.png",
"product": {
"title": "react-d3",
"data": tooltip_data
}
}
},{
"layout": "./gallery.hbs",
"filename": "./docs/zoom/index.html",
"helpers": ["./helper/ifCond.js","./helper/multipleOr.js", './helper/id.js'],
"data": {
"item": "react-d3-brush",
"logo": "/img/react-d3_2.png",
"slogan": "react-d3 zoom charts",
"description": "Building Tooltip With Line, bar, Scatter, Area Charts ... with ease.",
"banner-img": "/img/zoom/cover.png",
"product": {
"title": "react-d3",
"data": zoom_data
}
}
}
]