-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
143 lines (135 loc) · 4.05 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
/**
* Copyright 2012-2018, 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 fontAttrs = require('../../plots/font_attributes');
var colorAttrs = require('../color/attributes');
module.exports = {
bgcolor: {
valType: 'color',
role: 'style',
editType: 'legend',
description: 'Sets the legend background color.'
},
bordercolor: {
valType: 'color',
dflt: colorAttrs.defaultLine,
role: 'style',
editType: 'legend',
description: 'Sets the color of the border enclosing the legend.'
},
borderwidth: {
valType: 'number',
min: 0,
dflt: 0,
role: 'style',
editType: 'legend',
description: 'Sets the width (in px) of the border enclosing the legend.'
},
font: fontAttrs({
editType: 'legend',
description: 'Sets the font used to text the legend items.'
}),
orientation: {
valType: 'enumerated',
values: ['v', 'h'],
dflt: 'v',
role: 'info',
editType: 'legend',
description: 'Sets the orientation of the legend.'
},
traceorder: {
valType: 'flaglist',
flags: ['reversed', 'grouped'],
extras: ['normal'],
role: 'style',
editType: 'legend',
description: [
'Determines the order at which the legend items are displayed.',
'If *normal*, the items are displayed top-to-bottom in the same',
'order as the input data.',
'If *reversed*, the items are displayed in the opposite order',
'as *normal*.',
'If *grouped*, the items are displayed in groups',
'(when a trace `legendgroup` is provided).',
'if *grouped+reversed*, the items are displayed in the opposite order',
'as *grouped*.'
].join(' ')
},
tracegroupgap: {
valType: 'number',
min: 0,
dflt: 10,
role: 'style',
editType: 'legend',
description: [
'Sets the amount of vertical space (in px) between legend groups.'
].join(' ')
},
x: {
valType: 'number',
min: -2,
max: 3,
dflt: 1.02,
role: 'style',
editType: 'legend',
description: 'Sets the x position (in normalized coordinates) of the legend.'
},
xanchor: {
valType: 'enumerated',
values: ['auto', 'left', 'center', 'right'],
dflt: 'left',
role: 'info',
editType: 'legend',
description: [
'Sets the legend\'s horizontal position anchor.',
'This anchor binds the `x` position to the *left*, *center*',
'or *right* of the legend.'
].join(' ')
},
y: {
valType: 'number',
min: -2,
max: 3,
dflt: 1,
role: 'style',
editType: 'legend',
description: 'Sets the y position (in normalized coordinates) of the legend.'
},
yanchor: {
valType: 'enumerated',
values: ['auto', 'top', 'middle', 'bottom'],
dflt: 'auto',
role: 'info',
editType: 'legend',
description: [
'Sets the legend\'s vertical position anchor',
'This anchor binds the `y` position to the *top*, *middle*',
'or *bottom* of the legend.'
].join(' ')
},
uirevision: {
valType: 'any',
role: 'info',
editType: 'none',
description: [
'Controls persistence of legend-driven changes in trace and pie label',
'visibility. Defaults to `layout.uirevision`.'
].join(' ')
},
valign: {
valType: 'enumerated',
values: ['top', 'middle', 'bottom'],
dflt: 'middle',
role: 'style',
editType: 'legend',
description: [
'Sets the vertical alignment of the symbols with respect to their associated text.',
].join(' ')
},
editType: 'legend'
};