-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
80 lines (72 loc) · 3.04 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
/**
* Copyright 2012-2020, 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 histogramAttrs = require('../histogram/attributes');
var makeBinAttrs = require('../histogram/bin_attributes');
var heatmapAttrs = require('../heatmap/attributes');
var baseAttrs = require('../../plots/attributes');
var hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;
var colorScaleAttrs = require('../../components/colorscale/attributes');
var extendFlat = require('../../lib/extend').extendFlat;
module.exports = extendFlat(
{
x: histogramAttrs.x,
y: histogramAttrs.y,
z: {
valType: 'data_array',
editType: 'calc',
description: 'Sets the aggregation data.'
},
marker: {
color: {
valType: 'data_array',
editType: 'calc',
description: 'Sets the aggregation data.'
},
editType: 'calc'
},
histnorm: histogramAttrs.histnorm,
histfunc: histogramAttrs.histfunc,
nbinsx: histogramAttrs.nbinsx,
xbins: makeBinAttrs('x'),
nbinsy: histogramAttrs.nbinsy,
ybins: makeBinAttrs('y'),
autobinx: histogramAttrs.autobinx,
autobiny: histogramAttrs.autobiny,
bingroup: extendFlat({}, histogramAttrs.bingroup, {
description: [
'Set the `xbingroup` and `ybingroup` default prefix',
'For example, setting a `bingroup` of *1* on two histogram2d traces',
'will make them their x-bins and y-bins match separately.'
].join(' ')
}),
xbingroup: extendFlat({}, histogramAttrs.bingroup, {
description: [
'Set a group of histogram traces which will have compatible x-bin settings.',
'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
'(on axes of the same axis type) can have compatible x-bin settings.',
'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
].join(' ')
}),
ybingroup: extendFlat({}, histogramAttrs.bingroup, {
description: [
'Set a group of histogram traces which will have compatible y-bin settings.',
'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
'(on axes of the same axis type) can have compatible y-bin settings.',
'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
].join(' ')
}),
xgap: heatmapAttrs.xgap,
ygap: heatmapAttrs.ygap,
zsmooth: heatmapAttrs.zsmooth,
zhoverformat: heatmapAttrs.zhoverformat,
hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
},
colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
);