-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
144 lines (130 loc) · 4.57 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
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
/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var plotAttrs = require('../../plots/attributes');
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
var domainAttrs = require('../../plots/domain').attributes;
var pieAttrs = require('../pie/attributes');
var extendFlat = require('../../lib/extend').extendFlat;
module.exports = {
labels: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the labels of each of the sunburst sectors.'
].join(' ')
},
parents: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the parent sectors for each of the sunburst sectors.',
'Empty string items \'\' are understood to reference',
'the root node in the hierarchy.',
'If `ids` is filled, `parents` items are understood to be "ids" themselves.',
'When `ids` is not set, plotly attempts to find matching items in `labels`,',
'but beware they must be unique.'
].join(' ')
},
values: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the values associated with each of the sunburst sectors.',
'Use with `branchvalues` to determine how the values are summed.'
].join(' ')
},
branchvalues: {
valType: 'enumerated',
values: ['remainder', 'total'],
dflt: 'remainder',
editType: 'calc',
role: 'info',
description: [
'Determines how the items in `values` are summed.',
'When set to *total*, items in `values` are taken to be value of all its descendants.',
'When set to *remainder*, items in `values` corresponding to the root and the branches sectors',
'are taken to be the extra part not part of the sum of the values at their leaves.'
].join(' ')
},
level: {
valType: 'any',
editType: 'plot',
anim: true,
role: 'info',
description: [
'Sets the level from which this sunburst trace hierarchy is rendered.',
'Set `level` to `\'\'` to start the sunburst from the root node in the hierarchy.',
'Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching',
'item in `labels`.'
].join(' ')
},
maxdepth: {
valType: 'integer',
editType: 'plot',
role: 'info',
dflt: -1,
description: [
'Sets the number of rendered sunburst rings from any given `level`.',
'Set `maxdepth` to *-1* to render all the levels in the hierarchy.'
].join(' ')
},
marker: {
colors: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the color of each sector of this sunburst chart.',
'If not specified, the default trace color set is used',
'to pick the sector colors.'
].join(' ')
},
// colorinheritance: {
// valType: 'enumerated',
// values: ['per-branch', 'per-label', false]
// },
line: {
color: extendFlat({}, pieAttrs.marker.line.color, {
dflt: null,
description: [
'Sets the color of the line enclosing each sector.',
'Defaults to the `paper_bgcolor` value.'
].join(' ')
}),
width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}),
editType: 'calc'
},
editType: 'calc'
},
leaf: {
opacity: {
valType: 'number',
editType: 'style',
role: 'style',
min: 0,
max: 1,
dflt: 0.7,
description: 'Sets the opacity of the leaves.'
},
editType: 'plot'
},
text: pieAttrs.text,
textinfo: extendFlat({}, pieAttrs.textinfo, {
editType: 'plot',
flags: ['label', 'text', 'value']
}),
textfont: pieAttrs.textfont,
hovertext: pieAttrs.hovertext,
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
flags: ['label', 'text', 'value', 'name']
}),
hovertemplate: hovertemplateAttrs(),
insidetextfont: pieAttrs.insidetextfont,
outsidetextfont: pieAttrs.outsidetextfont,
domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})
};