-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
129 lines (124 loc) · 4 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
/**
* 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 scatterAttrs = require('../scatter/attributes');
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
var colorscaleAttrs = require('../../components/colorscale/attributes');
var colorbarAttrs = require('../../components/colorbar/attributes');
var extendFlat = require('../../lib/extend').extendFlat;
module.exports = extendFlat({
z: {
valType: 'data_array',
editType: 'calc',
description: 'Sets the z data.'
},
x: extendFlat({}, scatterAttrs.x, {impliedEdits: {xtype: 'array'}}),
x0: extendFlat({}, scatterAttrs.x0, {impliedEdits: {xtype: 'scaled'}}),
dx: extendFlat({}, scatterAttrs.dx, {impliedEdits: {xtype: 'scaled'}}),
y: extendFlat({}, scatterAttrs.y, {impliedEdits: {ytype: 'array'}}),
y0: extendFlat({}, scatterAttrs.y0, {impliedEdits: {ytype: 'scaled'}}),
dy: extendFlat({}, scatterAttrs.dy, {impliedEdits: {ytype: 'scaled'}}),
text: {
valType: 'data_array',
editType: 'calc',
description: 'Sets the text elements associated with each z value.'
},
hovertext: {
valType: 'data_array',
editType: 'calc',
description: 'Same as `text`.'
},
transpose: {
valType: 'boolean',
dflt: false,
role: 'info',
editType: 'calc',
description: 'Transposes the z data.'
},
xtype: {
valType: 'enumerated',
values: ['array', 'scaled'],
role: 'info',
editType: 'calc+clearAxisTypes',
description: [
'If *array*, the heatmap\'s x coordinates are given by *x*',
'(the default behavior when `x` is provided).',
'If *scaled*, the heatmap\'s x coordinates are given by *x0* and *dx*',
'(the default behavior when `x` is not provided).'
].join(' ')
},
ytype: {
valType: 'enumerated',
values: ['array', 'scaled'],
role: 'info',
editType: 'calc+clearAxisTypes',
description: [
'If *array*, the heatmap\'s y coordinates are given by *y*',
'(the default behavior when `y` is provided)',
'If *scaled*, the heatmap\'s y coordinates are given by *y0* and *dy*',
'(the default behavior when `y` is not provided)'
].join(' ')
},
zsmooth: {
valType: 'enumerated',
values: ['fast', 'best', false],
dflt: false,
role: 'style',
editType: 'calc',
description: [
'Picks a smoothing algorithm use to smooth `z` data.'
].join(' ')
},
connectgaps: {
valType: 'boolean',
dflt: false,
role: 'info',
editType: 'calc',
description: [
'Determines whether or not gaps',
'(i.e. {nan} or missing values)',
'in the `z` data are filled in.'
].join(' ')
},
xgap: {
valType: 'number',
dflt: 0,
min: 0,
role: 'style',
editType: 'plot',
description: 'Sets the horizontal gap (in pixels) between bricks.'
},
ygap: {
valType: 'number',
dflt: 0,
min: 0,
role: 'style',
editType: 'plot',
description: 'Sets the vertical gap (in pixels) between bricks.'
},
zhoverformat: {
valType: 'string',
dflt: '',
role: 'style',
editType: 'none',
description: [
'Sets the hover text formatting rule using d3 formatting mini-languages',
'which are very similar to those in Python. See:',
'https://github.com/d3/d3-format/blob/master/README.md#locale_format'
].join(' ')
},
hovertemplate: hovertemplateAttrs()
}, {
transforms: undefined
},
colorscaleAttrs('', {
cLetter: 'z',
autoColorDflt: false
}),
{ colorbar: colorbarAttrs }
);