-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathlayout_attributes.js
160 lines (156 loc) · 6.06 KB
/
layout_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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
* 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 constants = require('./constants');
var fontAttrs = require('../../plots/font_attributes')({
editType: 'none',
description: 'Sets the default hover label font used by all traces on the graph.'
});
fontAttrs.family.dflt = constants.HOVERFONT;
fontAttrs.size.dflt = constants.HOVERFONTSIZE;
module.exports = {
clickmode: {
valType: 'flaglist',
role: 'info',
flags: ['event', 'select'],
dflt: 'event',
editType: 'plot',
extras: ['none'],
description: [
'Determines the mode of single click interactions.',
'*event* is the default value and emits the `plotly_click`',
'event. In addition this mode emits the `plotly_selected` event',
'in drag modes *lasso* and *select*, but with no event data attached',
'(kept for compatibility reasons).',
'The *select* flag enables selecting single',
'data points via click. This mode also supports persistent selections,',
'meaning that pressing Shift while clicking, adds to / subtracts from an',
'existing selection. *select* with `hovermode`: *x* can be confusing, consider',
'explicitly setting `hovermode`: *closest* when using this feature.',
'Selection events are sent accordingly as long as *event* flag is set as well.',
'When the *event* flag is missing, `plotly_click` and `plotly_selected`',
'events are not fired.'
].join(' ')
},
dragmode: {
valType: 'enumerated',
role: 'info',
values: ['zoom', 'pan', 'select', 'lasso', 'orbit', 'turntable', false],
dflt: 'zoom',
editType: 'modebar',
description: [
'Determines the mode of drag interactions.',
'*select* and *lasso* apply only to scatter traces with',
'markers or text. *orbit* and *turntable* apply only to',
'3D scenes.'
].join(' ')
},
hovermode: {
valType: 'enumerated',
role: 'info',
values: ['x', 'y', 'closest', false],
editType: 'modebar',
description: [
'Determines the mode of hover interactions.',
'If `clickmode` includes the *select* flag,',
'`hovermode` defaults to *closest*.',
'If `clickmode` lacks the *select* flag,',
'it defaults to *x* or *y* (depending on the trace\'s',
'`orientation` value) for plots based on',
'cartesian coordinates. For anything else the default',
'value is *closest*.',
].join(' ')
},
hoverdistance: {
valType: 'integer',
min: -1,
dflt: 20,
role: 'info',
editType: 'none',
description: [
'Sets the default distance (in pixels) to look for data',
'to add hover labels (-1 means no cutoff, 0 means no looking for data).',
'This is only a real distance for hovering on point-like objects,',
'like scatter points. For area-like objects (bars, scatter fills, etc)',
'hovering is on inside the area and off outside, but these objects',
'will not supersede hover on point-like objects in case of conflict.'
].join(' ')
},
spikedistance: {
valType: 'integer',
min: -1,
dflt: 20,
role: 'info',
editType: 'none',
description: [
'Sets the default distance (in pixels) to look for data to draw',
'spikelines to (-1 means no cutoff, 0 means no looking for data).',
'As with hoverdistance, distance does not apply to area-like objects.',
'In addition, some objects can be hovered on but will not generate',
'spikelines, such as scatter fills.'
].join(' ')
},
hoverlabel: {
bgcolor: {
valType: 'color',
role: 'style',
editType: 'none',
description: [
'Sets the background color of all hover labels on graph'
].join(' ')
},
bordercolor: {
valType: 'color',
role: 'style',
editType: 'none',
description: [
'Sets the border color of all hover labels on graph.'
].join(' ')
},
font: fontAttrs,
align: {
valType: 'enumerated',
values: ['left', 'right', 'auto'],
dflt: 'auto',
role: 'style',
editType: 'none',
description: [
'Sets the horizontal alignment of the text content within hover label box.',
'Has an effect only if the hover label text spans more two or more lines'
].join(' ')
},
namelength: {
valType: 'integer',
min: -1,
dflt: 15,
role: 'style',
editType: 'none',
description: [
'Sets the default length (in number of characters) of the trace name in',
'the hover labels for all traces. -1 shows the whole name',
'regardless of length. 0-3 shows the first 0-3 characters, and',
'an integer >3 will show the whole name if it is less than that',
'many characters, but if it is longer, will truncate to',
'`namelength - 3` characters and add an ellipsis.'
].join(' ')
},
editType: 'none'
},
selectdirection: {
valType: 'enumerated',
role: 'info',
values: ['h', 'v', 'd', 'any'],
dflt: 'any',
description: [
'When "dragmode" is set to "select", this limits the selection of the drag to',
'horizontal, vertical or diagonal. "h" only allows horizontal selection,',
'"v" only vertical, "d" only diagonal and "any" sets no limit.'
].join(' '),
editType: 'none'
}
};