-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathlayout_attributes.js
168 lines (156 loc) · 4.93 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
161
162
163
164
165
166
167
168
/**
* 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 gl3dAxisAttrs = require('./axis_attributes');
var domainAttrs = require('../../domain').attributes;
var extendFlat = require('../../../lib/extend').extendFlat;
var counterRegex = require('../../../lib').counterRegex;
function makeCameraVector(x, y, z) {
return {
x: {
valType: 'number',
role: 'info',
dflt: x,
editType: 'camera'
},
y: {
valType: 'number',
role: 'info',
dflt: y,
editType: 'camera'
},
z: {
valType: 'number',
role: 'info',
dflt: z,
editType: 'camera'
},
editType: 'camera'
};
}
module.exports = {
_arrayAttrRegexps: [counterRegex('scene', '.annotations', true)],
bgcolor: {
valType: 'color',
role: 'style',
dflt: 'rgba(0,0,0,0)',
editType: 'plot'
},
camera: {
up: extendFlat(makeCameraVector(0, 0, 1), {
description: [
'Sets the (x,y,z) components of the \'up\' camera vector.',
'This vector determines the up direction of this scene',
'with respect to the page.',
'The default is *{x: 0, y: 0, z: 1}* which means that',
'the z axis points up.'
].join(' ')
}),
center: extendFlat(makeCameraVector(0, 0, 0), {
description: [
'Sets the (x,y,z) components of the \'center\' camera vector',
'This vector determines the translation (x,y,z) space',
'about the center of this scene.',
'By default, there is no such translation.'
].join(' ')
}),
eye: extendFlat(makeCameraVector(1.25, 1.25, 1.25), {
description: [
'Sets the (x,y,z) components of the \'eye\' camera vector.',
'This vector determines the view point about the origin',
'of this scene.'
].join(' ')
}),
editType: 'camera'
},
domain: domainAttrs({name: 'scene', editType: 'plot'}),
aspectmode: {
valType: 'enumerated',
role: 'info',
values: ['auto', 'cube', 'data', 'manual'],
dflt: 'auto',
editType: 'plot',
impliedEdits: {
'aspectratio.x': undefined,
'aspectratio.y': undefined,
'aspectratio.z': undefined
},
description: [
'If *cube*, this scene\'s axes are drawn as a cube,',
'regardless of the axes\' ranges.',
'If *data*, this scene\'s axes are drawn',
'in proportion with the axes\' ranges.',
'If *manual*, this scene\'s axes are drawn',
'in proportion with the input of *aspectratio*',
'(the default behavior if *aspectratio* is provided).',
'If *auto*, this scene\'s axes are drawn',
'using the results of *data* except when one axis',
'is more than four times the size of the two others,',
'where in that case the results of *cube* are used.'
].join(' ')
},
aspectratio: { // must be positive (0's are coerced to 1)
x: {
valType: 'number',
role: 'info',
min: 0,
editType: 'plot',
impliedEdits: {'^aspectmode': 'manual'}
},
y: {
valType: 'number',
role: 'info',
min: 0,
editType: 'plot',
impliedEdits: {'^aspectmode': 'manual'}
},
z: {
valType: 'number',
role: 'info',
min: 0,
editType: 'plot',
impliedEdits: {'^aspectmode': 'manual'}
},
editType: 'plot',
impliedEdits: {aspectmode: 'manual'},
description: [
'Sets this scene\'s axis aspectratio.'
].join(' ')
},
xaxis: gl3dAxisAttrs,
yaxis: gl3dAxisAttrs,
zaxis: gl3dAxisAttrs,
dragmode: {
valType: 'enumerated',
role: 'info',
values: ['orbit', 'turntable', 'zoom', 'pan', false],
editType: 'plot',
description: [
'Determines the mode of drag interactions for this scene.'
].join(' ')
},
hovermode: {
valType: 'enumerated',
role: 'info',
values: ['closest', false],
dflt: 'closest',
editType: 'modebar',
description: [
'Determines the mode of hover interactions for this scene.'
].join(' ')
},
editType: 'plot',
_deprecated: {
cameraposition: {
valType: 'info_array',
role: 'info',
editType: 'camera',
description: 'Obsolete. Use `camera` instead.'
}
}
};