-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
100 lines (79 loc) · 3.08 KB
/
attributes.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
'use strict';
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
var texttemplateAttrs = require('../../plots/template_attributes').texttemplateAttrs;
var colorScaleAttrs = require('../../components/colorscale/attributes');
var domainAttrs = require('../../plots/domain').attributes;
var pieAttrs = require('../pie/attributes');
var sunburstAttrs = require('../sunburst/attributes');
var treemapAttrs = require('../treemap/attributes');
var constants = require('../treemap/constants');
var extendFlat = require('../../lib/extend').extendFlat;
module.exports = {
labels: sunburstAttrs.labels,
parents: sunburstAttrs.parents,
values: sunburstAttrs.values,
branchvalues: sunburstAttrs.branchvalues,
count: sunburstAttrs.count,
level: sunburstAttrs.level,
maxdepth: sunburstAttrs.maxdepth,
tiling: {
orientation: {
valType: 'enumerated',
values: ['v', 'h'],
dflt: 'h',
editType: 'plot',
description: [
'When set in conjunction with `tiling.flip`, determines on',
'which side the root nodes are drawn in the chart. If',
'`tiling.orientation` is *v* and `tiling.flip` is **, the root',
'nodes appear at the top. If `tiling.orientation` is *v* and',
'`tiling.flip` is *y*, the root nodes appear at the bottom. If',
'`tiling.orientation` is *h* and `tiling.flip` is **, the',
'root nodes appear at the left. If `tiling.orientation` is *h*',
'and `tiling.flip` is *x*, the root nodes appear at the right.',
].join(' ')
},
flip: treemapAttrs.tiling.flip,
pad: {
valType: 'number',
min: 0,
dflt: 0,
editType: 'plot',
description: [
'Sets the inner padding (in px).'
].join(' ')
},
editType: 'calc',
},
marker: extendFlat({
colors: sunburstAttrs.marker.colors,
line: sunburstAttrs.marker.line,
cornerradius: treemapAttrs.marker.cornerradius,
editType: 'calc'
},
colorScaleAttrs('marker', {
colorAttr: 'colors',
anim: false // TODO: set to anim: true?
})
),
leaf: sunburstAttrs.leaf,
pathbar: treemapAttrs.pathbar,
text: pieAttrs.text,
textinfo: sunburstAttrs.textinfo,
// TODO: incorporate `label` and `value` in the eventData
texttemplate: texttemplateAttrs({editType: 'plot'}, {
keys: constants.eventDataKeys.concat(['label', 'value'])
}),
hovertext: pieAttrs.hovertext,
hoverinfo: sunburstAttrs.hoverinfo,
hovertemplate: hovertemplateAttrs({}, {
keys: constants.eventDataKeys
}),
textfont: pieAttrs.textfont,
insidetextfont: pieAttrs.insidetextfont,
outsidetextfont: treemapAttrs.outsidetextfont,
textposition: treemapAttrs.textposition,
sort: pieAttrs.sort,
root: sunburstAttrs.root,
domain: domainAttrs({name: 'icicle', trace: true, editType: 'calc'}),
};