|
| 1 | +/** |
| 2 | +* Copyright 2012-2017, 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 annAttrs = require('../../components/annotations/attributes'); |
| 12 | +var extendFlat = require('../../lib/extend').extendFlat; |
| 13 | +var overrideAll = require('../../plot_api/edit_types').overrideAll; |
| 14 | + |
| 15 | +module.exports = overrideAll({ |
| 16 | + domain: { |
| 17 | + x: { |
| 18 | + valType: 'info_array', |
| 19 | + role: 'info', |
| 20 | + items: [ |
| 21 | + {valType: 'number', min: 0, max: 1}, |
| 22 | + {valType: 'number', min: 0, max: 1} |
| 23 | + ], |
| 24 | + dflt: [0, 1], |
| 25 | + description: [ |
| 26 | + 'Sets the horizontal domain of this `table` trace', |
| 27 | + '(in plot fraction).' |
| 28 | + ].join(' ') |
| 29 | + }, |
| 30 | + y: { |
| 31 | + valType: 'info_array', |
| 32 | + role: 'info', |
| 33 | + items: [ |
| 34 | + {valType: 'number', min: 0, max: 1}, |
| 35 | + {valType: 'number', min: 0, max: 1} |
| 36 | + ], |
| 37 | + dflt: [0, 1], |
| 38 | + description: [ |
| 39 | + 'Sets the vertical domain of this `table` trace', |
| 40 | + '(in plot fraction).' |
| 41 | + ].join(' ') |
| 42 | + } |
| 43 | + }, |
| 44 | + |
| 45 | + columnwidth: { |
| 46 | + valType: 'number', |
| 47 | + arrayOk: true, |
| 48 | + dflt: null, |
| 49 | + role: 'style', |
| 50 | + description: 'The width of cells.' |
| 51 | + }, |
| 52 | + |
| 53 | + columnorder: { |
| 54 | + valType: 'data_array', |
| 55 | + role: 'info', |
| 56 | + description: [ |
| 57 | + 'Specifies the rendered order of the data columns; for example, a value `2` at position `0`', |
| 58 | + 'means that column index `0` in the data will be rendered as the', |
| 59 | + 'third column, as columns have an index base of zero.' |
| 60 | + ].join(' ') |
| 61 | + }, |
| 62 | + |
| 63 | + header: { |
| 64 | + |
| 65 | + values: { |
| 66 | + valType: 'data_array', |
| 67 | + role: 'info', |
| 68 | + dflt: [], |
| 69 | + description: [ |
| 70 | + 'Header cell values. `values[m][n]` represents the value of the `n`th point in column `m`,', |
| 71 | + 'therefore the `values[m]` vector length for all columns must be the same (longer vectors', |
| 72 | + 'will be truncated). Each value must be a finite number or a string.' |
| 73 | + ].join(' ') |
| 74 | + }, |
| 75 | + |
| 76 | + format: { |
| 77 | + valType: 'data_array', |
| 78 | + role: 'info', |
| 79 | + dflt: [], |
| 80 | + description: [ |
| 81 | + 'Sets the cell value formatting rule using d3 formatting mini-language', |
| 82 | + 'which is similar to those of Python. See', |
| 83 | + 'https://github.com/d3/d3-format/blob/master/README.md#locale_format' |
| 84 | + ].join(' ') |
| 85 | + }, |
| 86 | + |
| 87 | + prefix: { |
| 88 | + valType: 'string', |
| 89 | + arrayOk: true, |
| 90 | + dflt: null, |
| 91 | + role: 'style', |
| 92 | + description: 'Prefix for cell values.' |
| 93 | + }, |
| 94 | + |
| 95 | + suffix: { |
| 96 | + valType: 'string', |
| 97 | + arrayOk: true, |
| 98 | + dflt: null, |
| 99 | + role: 'style', |
| 100 | + description: 'Suffix for cell values.' |
| 101 | + }, |
| 102 | + |
| 103 | + height: { |
| 104 | + valType: 'number', |
| 105 | + dflt: 28, |
| 106 | + role: 'style', |
| 107 | + description: 'The height of cells.' |
| 108 | + }, |
| 109 | + |
| 110 | + align: extendFlat({}, annAttrs.align, {arrayOk: true}), |
| 111 | + |
| 112 | + line: { |
| 113 | + width: { |
| 114 | + valType: 'number', |
| 115 | + arrayOk: true, |
| 116 | + role: 'style' |
| 117 | + }, |
| 118 | + color: { |
| 119 | + valType: 'color', |
| 120 | + arrayOk: true, |
| 121 | + role: 'style' |
| 122 | + } |
| 123 | + }, |
| 124 | + |
| 125 | + fill: { |
| 126 | + color: { |
| 127 | + valType: 'color', |
| 128 | + arrayOk: true, |
| 129 | + dflt: 'white', |
| 130 | + role: 'style', |
| 131 | + description: [ |
| 132 | + 'Sets the cell fill color. It accepts either a specific color', |
| 133 | + ' or an array of colors.' |
| 134 | + ].join('') |
| 135 | + } |
| 136 | + }, |
| 137 | + |
| 138 | + font: { |
| 139 | + family: { |
| 140 | + valType: 'string', |
| 141 | + arrayOk: true, |
| 142 | + role: 'style', |
| 143 | + noBlank: true, |
| 144 | + strict: true, |
| 145 | + description: [ |
| 146 | + 'HTML font family - the typeface that will be applied by the web browser.', |
| 147 | + 'The web browser will only be able to apply a font if it is available on the system', |
| 148 | + 'which it operates. Provide multiple font families, separated by commas, to indicate', |
| 149 | + 'the preference in which to apply fonts if they aren\'t available on the system.', |
| 150 | + 'The plotly service (at https://plot.ly or on-premise) generates images on a server,', |
| 151 | + 'where only a select number of', |
| 152 | + 'fonts are installed and supported.', |
| 153 | + 'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,', |
| 154 | + '*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,', |
| 155 | + '*PT Sans Narrow*, *Raleway*, *Times New Roman*.' |
| 156 | + ].join(' ') |
| 157 | + }, |
| 158 | + size: { |
| 159 | + valType: 'number', |
| 160 | + arrayOk: true, |
| 161 | + role: 'style' |
| 162 | + }, |
| 163 | + color: { |
| 164 | + valType: 'color', |
| 165 | + arrayOk: true, |
| 166 | + role: 'style' |
| 167 | + } |
| 168 | + } |
| 169 | + }, |
| 170 | + |
| 171 | + cells: { |
| 172 | + |
| 173 | + values: { |
| 174 | + valType: 'data_array', |
| 175 | + role: 'info', |
| 176 | + dflt: [], |
| 177 | + description: [ |
| 178 | + 'Cell values. `values[m][n]` represents the value of the `n`th point in column `m`,', |
| 179 | + 'therefore the `values[m]` vector length for all columns must be the same (longer vectors', |
| 180 | + 'will be truncated). Each value must be a finite number or a string.' |
| 181 | + ].join(' ') |
| 182 | + }, |
| 183 | + |
| 184 | + format: { |
| 185 | + valType: 'data_array', |
| 186 | + role: 'info', |
| 187 | + dflt: [], |
| 188 | + description: [ |
| 189 | + 'Sets the cell value formatting rule using d3 formatting mini-language', |
| 190 | + 'which is similar to those of Python. See', |
| 191 | + 'https://github.com/d3/d3-format/blob/master/README.md#locale_format' |
| 192 | + ].join(' ') |
| 193 | + }, |
| 194 | + |
| 195 | + prefix: { |
| 196 | + valType: 'string', |
| 197 | + arrayOk: true, |
| 198 | + dflt: null, |
| 199 | + role: 'style', |
| 200 | + description: 'Prefix for cell values.' |
| 201 | + }, |
| 202 | + |
| 203 | + suffix: { |
| 204 | + valType: 'string', |
| 205 | + arrayOk: true, |
| 206 | + dflt: null, |
| 207 | + role: 'style', |
| 208 | + description: 'Suffix for cell values.' |
| 209 | + }, |
| 210 | + |
| 211 | + height: { |
| 212 | + valType: 'number', |
| 213 | + dflt: 20, |
| 214 | + role: 'style', |
| 215 | + description: 'The height of cells.' |
| 216 | + }, |
| 217 | + |
| 218 | + align: extendFlat({}, annAttrs.align, {arrayOk: true}), |
| 219 | + |
| 220 | + line: { |
| 221 | + width: { |
| 222 | + valType: 'number', |
| 223 | + arrayOk: true, |
| 224 | + role: 'style' |
| 225 | + }, |
| 226 | + color: { |
| 227 | + valType: 'color', |
| 228 | + arrayOk: true, |
| 229 | + role: 'style' |
| 230 | + } |
| 231 | + }, |
| 232 | + |
| 233 | + fill: { |
| 234 | + color: { |
| 235 | + valType: 'color', |
| 236 | + arrayOk: true, |
| 237 | + role: 'style', |
| 238 | + dflt: 'white', |
| 239 | + description: [ |
| 240 | + 'Sets the cell fill color. It accepts either a specific color', |
| 241 | + ' or an array of colors.' |
| 242 | + ].join('') |
| 243 | + } |
| 244 | + }, |
| 245 | + |
| 246 | + font: { |
| 247 | + family: { |
| 248 | + valType: 'string', |
| 249 | + arrayOk: true, |
| 250 | + role: 'style', |
| 251 | + noBlank: true, |
| 252 | + strict: true, |
| 253 | + description: [ |
| 254 | + 'HTML font family - the typeface that will be applied by the web browser.', |
| 255 | + 'The web browser will only be able to apply a font if it is available on the system', |
| 256 | + 'which it operates. Provide multiple font families, separated by commas, to indicate', |
| 257 | + 'the preference in which to apply fonts if they aren\'t available on the system.', |
| 258 | + 'The plotly service (at https://plot.ly or on-premise) generates images on a server,', |
| 259 | + 'where only a select number of', |
| 260 | + 'fonts are installed and supported.', |
| 261 | + 'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,', |
| 262 | + '*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,', |
| 263 | + '*PT Sans Narrow*, *Raleway*, *Times New Roman*.' |
| 264 | + ].join(' ') |
| 265 | + }, |
| 266 | + size: { |
| 267 | + valType: 'number', |
| 268 | + arrayOk: true, |
| 269 | + role: 'style' |
| 270 | + }, |
| 271 | + color: { |
| 272 | + valType: 'color', |
| 273 | + arrayOk: true, |
| 274 | + role: 'style' |
| 275 | + } |
| 276 | + } |
| 277 | + } |
| 278 | +}, 'calc', 'from-root'); |
0 commit comments