@@ -8,77 +8,36 @@ import {
88import { ChartProperty } from '../../../types'
99
1010const props : ChartProperty [ ] = [
11- /*
1211 {
1312 key : 'data' ,
1413 group : 'Base' ,
15- type: 'object []',
14+ type : 'number[] []' ,
1615 required : true ,
1716 help : 'Chart data.' ,
1817 description : `
19- Here is what the data for a single chart with 2 bars would look like:
20-
21- \`\`\`
22- [
23- {
24- id: 'Fruits',
25- data: [{ x: 'Apples', y: 32 }]
26- },
27- {
28- id: 'Vegetables',
29- data: [{ x: 'Eggplants', y: 27 }]
30- }
31- ]
32- \`\`\`
33-
34- You can add several metrics per group:
35-
36- \`\`\`
37- [
38- {
39- id: 'Fruits',
40- data: [
41- { x: 'Apples', y: 32 },
42- { x: 'Mangoes', y: 15 }
43- ]
44- },
45- {
46- id: 'Vegetables',
47- data: [
48- { x: 'Eggplants', y: 27 },
49- { x: 'Avocados', y: 34 }
50- ]
51- }
52- ]
53- \`\`\`
54-
55- When a bar is computed, the \`id\` is going to be added
56- as the \`groupId\`, \`x\` as the \`category\` and \`y\`
57- as the value, for example the first bar for the number of Apples
58- in the Fruits group would be:
59-
60- \`\`\`
61- {
62- groupId: 'Fruits',
63- category: 'Apples',
64- value: 32
65- }
66- \`\`\`
67-
68- You might read those values when adding an \`onClick\` handler
69- for example, or when customizing the tooltip.
18+ Please note that the number of rows should match the length
19+ of \`yRange\` and each row number of columns should match
20+ the length of \`xRange\`.
7021 ` ,
7122 flavors : [ 'svg' ] ,
7223 } ,
7324 {
74- key: 'maxValue ',
25+ key : 'xRange ' ,
7526 group : 'Base' ,
76- type: `'auto' | number` ,
77- required: false ,
78- help: `If 'auto', the max value is derived from the data, otherwise use a static value.` ,
27+ type : 'string[]' ,
28+ required : true ,
29+ help : 'X range.' ,
7930 flavors : [ 'svg' ] ,
80- defaultValue: svgDefaultProps.maxValue,
8131 } ,
32+ {
33+ key : 'yRange' ,
34+ group : 'Base' ,
35+ type : 'string[]' ,
36+ required : true ,
37+ help : 'Y range.' ,
38+ flavors : [ 'svg' ] ,
39+ } ,
40+ /*
8241 {
8342 key: 'valueFormat',
8443 group: 'Base',
@@ -356,12 +315,42 @@ const props: ChartProperty[] = [
356315 undefined ,
357316 'Optional motion config override for blank cells.'
358317 ) ,
318+ {
319+ key : 'blankCellsStaggeredDelay' ,
320+ group : 'Motion' ,
321+ type : 'number' ,
322+ required : false ,
323+ help : 'Control the delay between each blank cell transition.' ,
324+ flavors : [ 'svg' ] ,
325+ defaultValue : svgDefaultProps . blankCellsStaggeredDelay ,
326+ controlType : 'range' ,
327+ controlOptions : {
328+ min : 0 ,
329+ max : 20 ,
330+ unit : 'ms' ,
331+ } ,
332+ } ,
359333 motionConfigProperty (
360334 'valueCellsMotionConfig' ,
361335 [ 'svg' ] ,
362336 undefined ,
363337 'Optional motion config override for value cells.'
364338 ) ,
339+ {
340+ key : 'valueCellsStaggeredDelay' ,
341+ group : 'Motion' ,
342+ type : 'number' ,
343+ required : false ,
344+ help : 'Control the delay between each value cell transition.' ,
345+ flavors : [ 'svg' ] ,
346+ defaultValue : svgDefaultProps . valueCellsStaggeredDelay ,
347+ controlType : 'range' ,
348+ controlOptions : {
349+ min : 0 ,
350+ max : 20 ,
351+ unit : 'ms' ,
352+ } ,
353+ } ,
365354]
366355
367356export const groups = groupProperties ( props )
0 commit comments