-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathattributes.js
More file actions
171 lines (159 loc) · 4.55 KB
/
attributes.js
File metadata and controls
171 lines (159 loc) · 4.55 KB
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
'use strict';
var fontAttrs = require('../../plots/font_attributes');
var colorAttrs = require('../color/attributes');
module.exports = {
// not really a 'subplot' attribute container,
// but this is the flag we use to denote attributes that
// support colorlegend, colorlegend2, colorlegend3, ... counters
_isSubplotObj: true,
visible: {
valType: 'boolean',
dflt: true,
editType: 'legend',
description: 'Determines whether this color legend is visible.'
},
title: {
text: {
valType: 'string',
dflt: '',
editType: 'legend',
description: 'Sets the title of the color legend.'
},
font: fontAttrs({
editType: 'legend',
description: 'Sets the font for the color legend title.'
}),
side: {
valType: 'enumerated',
values: ['top', 'left', 'right'],
dflt: 'top',
editType: 'legend',
description: 'Determines the location of the legend title.'
},
editType: 'legend'
},
// Positioning (same pattern as legend)
x: {
valType: 'number',
dflt: 1.02,
editType: 'legend',
description: 'Sets the x position with respect to `xref`.'
},
xref: {
valType: 'enumerated',
values: ['container', 'paper'],
dflt: 'paper',
editType: 'legend',
description: 'Sets the container `x` refers to.'
},
xanchor: {
valType: 'enumerated',
values: ['auto', 'left', 'center', 'right'],
dflt: 'left',
editType: 'legend',
description: 'Sets the horizontal anchor.'
},
y: {
valType: 'number',
dflt: 1,
editType: 'legend',
description: 'Sets the y position with respect to `yref`.'
},
yref: {
valType: 'enumerated',
values: ['container', 'paper'],
dflt: 'paper',
editType: 'legend',
description: 'Sets the container `y` refers to.'
},
yanchor: {
valType: 'enumerated',
values: ['auto', 'top', 'middle', 'bottom'],
dflt: 'auto',
editType: 'legend',
description: 'Sets the vertical anchor.'
},
// Styling
bgcolor: {
valType: 'color',
editType: 'legend',
description: 'Sets the background color.'
},
bordercolor: {
valType: 'color',
dflt: colorAttrs.defaultLine,
editType: 'legend',
description: 'Sets the border color.'
},
borderwidth: {
valType: 'number',
min: 0,
dflt: 0,
editType: 'legend',
description: 'Sets the border width.'
},
font: fontAttrs({
editType: 'legend',
description: 'Sets the font for legend item text.'
}),
// Orientation
orientation: {
valType: 'enumerated',
values: ['v', 'h'],
dflt: 'v',
editType: 'legend',
description: 'Sets the orientation of the legend items.'
},
// Item sizing
itemsizing: {
valType: 'enumerated',
values: ['trace', 'constant'],
dflt: 'constant',
editType: 'legend',
description: [
'Determines if legend items symbols scale with their corresponding data values',
'or remain constant.'
].join(' ')
},
itemwidth: {
valType: 'number',
min: 30,
dflt: 30,
editType: 'legend',
description: 'Sets the width of the legend item symbols.'
},
// Behavior
itemclick: {
valType: 'enumerated',
values: ['toggle', 'toggleothers', false],
dflt: 'toggle',
editType: 'legend',
description: 'Determines the behavior on legend item click.'
},
itemdoubleclick: {
valType: 'enumerated',
values: ['toggle', 'toggleothers', false],
dflt: 'toggleothers',
editType: 'legend',
description: 'Determines the behavior on legend item double-click.'
},
// Continuous data binning
binning: {
valType: 'enumerated',
values: ['auto', 'discrete'],
dflt: 'auto',
editType: 'calc',
description: [
'For numeric color data, *auto* creates bins while',
'*discrete* treats each unique value as a category.'
].join(' ')
},
nbins: {
valType: 'integer',
min: 1,
dflt: 5,
editType: 'calc',
description: 'Sets the number of bins for continuous data when binning is *auto*.'
},
editType: 'legend'
};