-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
167 lines (149 loc) · 4.52 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
* Copyright 2012-2016, 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 cartesianConstants = require('../../plots/cartesian/constants');
module.exports = {
_isLinkedToArray: 'image',
visible: {
valType: 'boolean',
role: 'info',
dflt: true,
description: [
'Determines whether or not this image is visible.'
].join(' ')
},
source: {
valType: 'string',
role: 'info',
description: [
'Specifies the URL of the image to be used.',
'The URL must be accessible from the domain where the',
'plot code is run, and can be either relative or absolute.'
].join(' ')
},
layer: {
valType: 'enumerated',
values: ['below', 'above'],
dflt: 'above',
role: 'info',
description: [
'Specifies whether images are drawn below or above traces.',
'When `xref` and `yref` are both set to `paper`,',
'image is drawn below the entire plot area.'
].join(' ')
},
sizex: {
valType: 'number',
role: 'info',
dflt: 0,
description: [
'Sets the image container size horizontally.',
'The image will be sized based on the `position` value.',
'When `xref` is set to `paper`, units are sized relative',
'to the plot width.'
].join(' ')
},
sizey: {
valType: 'number',
role: 'info',
dflt: 0,
description: [
'Sets the image container size vertically.',
'The image will be sized based on the `position` value.',
'When `yref` is set to `paper`, units are sized relative',
'to the plot height.'
].join(' ')
},
sizing: {
valType: 'enumerated',
values: ['fill', 'contain', 'stretch'],
dflt: 'contain',
role: 'info',
description: [
'Specifies which dimension of the image to constrain.'
].join(' ')
},
opacity: {
valType: 'number',
role: 'info',
min: 0,
max: 1,
dflt: 1,
description: 'Sets the opacity of the image.'
},
x: {
valType: 'any',
role: 'info',
dflt: 0,
description: [
'Sets the image\'s x position.',
'When `xref` is set to `paper`, units are sized relative',
'to the plot height.',
'See `xref` for more info'
].join(' ')
},
y: {
valType: 'any',
role: 'info',
dflt: 0,
description: [
'Sets the image\'s y position.',
'When `yref` is set to `paper`, units are sized relative',
'to the plot height.',
'See `yref` for more info'
].join(' ')
},
xanchor: {
valType: 'enumerated',
values: ['left', 'center', 'right'],
dflt: 'left',
role: 'info',
description: 'Sets the anchor for the x position'
},
yanchor: {
valType: 'enumerated',
values: ['top', 'middle', 'bottom'],
dflt: 'top',
role: 'info',
description: 'Sets the anchor for the y position.'
},
xref: {
valType: 'enumerated',
values: [
'paper',
cartesianConstants.idRegex.x.toString()
],
dflt: 'paper',
role: 'info',
description: [
'Sets the images\'s x coordinate axis.',
'If set to a x axis id (e.g. *x* or *x2*), the `x` position',
'refers to an x data coordinate',
'If set to *paper*, the `x` position refers to the distance from',
'the left of plot in normalized coordinates',
'where *0* (*1*) corresponds to the left (right).'
].join(' ')
},
yref: {
valType: 'enumerated',
values: [
'paper',
cartesianConstants.idRegex.y.toString()
],
dflt: 'paper',
role: 'info',
description: [
'Sets the images\'s y coordinate axis.',
'If set to a y axis id (e.g. *y* or *y2*), the `y` position',
'refers to a y data coordinate.',
'If set to *paper*, the `y` position refers to the distance from',
'the bottom of the plot in normalized coordinates',
'where *0* (*1*) corresponds to the bottom (top).'
].join(' ')
}
};