|
| 1 | +/** |
| 2 | +* Copyright 2012-2016, Plotly, Inc. |
| 3 | +* All rights reserved. |
| 4 | +* |
| 5 | +* This source code is licensed under the MIT license found in the |
| 6 | +* LICENSE file in the root directory of this source tree. |
| 7 | +*/ |
| 8 | + |
| 9 | +'use strict'; |
| 10 | + |
| 11 | +var cartesianConstants = require('../../plots/cartesian/constants'); |
| 12 | + |
| 13 | + |
| 14 | +module.exports = { |
| 15 | + _isLinkedToArray: true, |
| 16 | + |
| 17 | + source: { |
| 18 | + valType: 'string', |
| 19 | + role: 'info', |
| 20 | + description: [ |
| 21 | + 'Specifies the URL of the image to be used.', |
| 22 | + 'The URL must be accessible from the domain where the', |
| 23 | + 'plot code is run, and can be either relative or absolute.' |
| 24 | + |
| 25 | + ].join(' ') |
| 26 | + }, |
| 27 | + |
| 28 | + layer: { |
| 29 | + valType: 'enumerated', |
| 30 | + values: ['below', 'above'], |
| 31 | + dflt: 'above', |
| 32 | + role: 'info', |
| 33 | + description: [ |
| 34 | + 'Specifies whether images are drawn below or above traces.', |
| 35 | + 'When `xref` and `yref` are both set to `paper`,', |
| 36 | + 'image is drawn below the entire plot area.' |
| 37 | + ].join(' ') |
| 38 | + }, |
| 39 | + |
| 40 | + width: { |
| 41 | + valType: 'number', |
| 42 | + role: 'info', |
| 43 | + dflt: 0, |
| 44 | + description: [ |
| 45 | + 'Sets the image container width.', |
| 46 | + 'The image will be sized based on the `position` value.', |
| 47 | + 'When `xref` is set to `paper`, units are sized relative', |
| 48 | + 'to the plot width.' |
| 49 | + ].join(' ') |
| 50 | + }, |
| 51 | + |
| 52 | + height: { |
| 53 | + valType: 'number', |
| 54 | + role: 'info', |
| 55 | + dflt: 0, |
| 56 | + description: [ |
| 57 | + 'Sets the image container height.', |
| 58 | + 'The image will be sized based on the `position` value.', |
| 59 | + 'When `yref` is set to `paper`, units are sized relative', |
| 60 | + 'to the plot height.' |
| 61 | + ].join(' ') |
| 62 | + }, |
| 63 | + |
| 64 | + sizing: { |
| 65 | + valType: 'enumerated', |
| 66 | + values: ['fill', 'contain', 'stretch'], |
| 67 | + dflt: 'contain', |
| 68 | + role: 'info', |
| 69 | + description: [ |
| 70 | + 'Specifies which dimension of the image to constrain.' |
| 71 | + ].join(' ') |
| 72 | + }, |
| 73 | + |
| 74 | + opacity: { |
| 75 | + valType: 'number', |
| 76 | + role: 'info', |
| 77 | + min: 0, |
| 78 | + max: 1, |
| 79 | + dflt: 1, |
| 80 | + description: 'Sets the opacity of the image.' |
| 81 | + }, |
| 82 | + |
| 83 | + x: { |
| 84 | + valType: 'number', |
| 85 | + role: 'info', |
| 86 | + dflt: 0, |
| 87 | + description: [ |
| 88 | + 'Sets the image\'s x position.', |
| 89 | + 'When `xref` is set to `paper`, units are sized relative', |
| 90 | + 'to the plot height.', |
| 91 | + 'See `xref` for more info' |
| 92 | + ].join(' ') |
| 93 | + }, |
| 94 | + |
| 95 | + y: { |
| 96 | + valType: 'number', |
| 97 | + role: 'info', |
| 98 | + dflt: 0, |
| 99 | + description: [ |
| 100 | + 'Sets the image\'s y position.', |
| 101 | + 'When `yref` is set to `paper`, units are sized relative', |
| 102 | + 'to the plot height.', |
| 103 | + 'See `yref` for more info' |
| 104 | + ].join(' ') |
| 105 | + }, |
| 106 | + |
| 107 | + xanchor: { |
| 108 | + valType: 'enumerated', |
| 109 | + values: ['left', 'center', 'right'], |
| 110 | + dflt: 'left', |
| 111 | + role: 'info', |
| 112 | + description: 'Sets the anchor for the x position' |
| 113 | + }, |
| 114 | + |
| 115 | + yanchor: { |
| 116 | + valType: 'enumerated', |
| 117 | + values: ['top', 'middle', 'bottom'], |
| 118 | + dflt: 'top', |
| 119 | + role: 'info', |
| 120 | + description: 'Sets the anchor for the y position.' |
| 121 | + }, |
| 122 | + |
| 123 | + xref: { |
| 124 | + valType: 'enumerated', |
| 125 | + values: [ |
| 126 | + 'paper', |
| 127 | + cartesianConstants.idRegex.x.toString() |
| 128 | + ], |
| 129 | + dflt: 'paper', |
| 130 | + role: 'info', |
| 131 | + description: [ |
| 132 | + 'Sets the images\'s x coordinate axis.', |
| 133 | + 'If set to a x axis id (e.g. *x* or *x2*), the `x` position', |
| 134 | + 'refers to an x data coordinate', |
| 135 | + 'If set to *paper*, the `x` position refers to the distance from', |
| 136 | + 'the left of plot in normalized coordinates', |
| 137 | + 'where *0* (*1*) corresponds to the left (right).' |
| 138 | + ].join(' ') |
| 139 | + }, |
| 140 | + |
| 141 | + yref: { |
| 142 | + valType: 'enumerated', |
| 143 | + values: [ |
| 144 | + 'paper', |
| 145 | + cartesianConstants.idRegex.y.toString() |
| 146 | + ], |
| 147 | + dflt: 'paper', |
| 148 | + role: 'info', |
| 149 | + description: [ |
| 150 | + 'Sets the images\'s y coordinate axis.', |
| 151 | + 'If set to a y axis id (e.g. *y* or *y2*), the `y` position', |
| 152 | + 'refers to a y data coordinate.', |
| 153 | + 'If set to *paper*, the `y` position refers to the distance from', |
| 154 | + 'the bottom of the plot in normalized coordinates', |
| 155 | + 'where *0* (*1*) corresponds to the bottom (top).' |
| 156 | + ].join(' ') |
| 157 | + } |
| 158 | +}; |
0 commit comments