-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
152 lines (144 loc) · 5.75 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
/**
* 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 hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
var scatterAttrs = require('../scatter/attributes');
var plotAttrs = require('../../plots/attributes');
var colorAttributes = require('../../components/colorscale/attributes');
var colorbarAttrs = require('../../components/colorbar/attributes');
var dash = require('../../components/drawing/attributes').dash;
var extendFlat = require('../../lib/extend').extendFlat;
var scatterMarkerAttrs = scatterAttrs.marker;
var scatterLineAttrs = scatterAttrs.line;
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
module.exports = {
a: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the quantity of component `a` in each data point.',
'If `a`, `b`, and `c` are all provided, they need not be',
'normalized, only the relative values matter. If only two',
'arrays are provided they must be normalized to match',
'`ternary<i>.sum`.'
].join(' ')
},
b: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the quantity of component `a` in each data point.',
'If `a`, `b`, and `c` are all provided, they need not be',
'normalized, only the relative values matter. If only two',
'arrays are provided they must be normalized to match',
'`ternary<i>.sum`.'
].join(' ')
},
c: {
valType: 'data_array',
editType: 'calc',
description: [
'Sets the quantity of component `a` in each data point.',
'If `a`, `b`, and `c` are all provided, they need not be',
'normalized, only the relative values matter. If only two',
'arrays are provided they must be normalized to match',
'`ternary<i>.sum`.'
].join(' ')
},
sum: {
valType: 'number',
role: 'info',
dflt: 0,
min: 0,
editType: 'calc',
description: [
'The number each triplet should sum to,',
'if only two of `a`, `b`, and `c` are provided.',
'This overrides `ternary<i>.sum` to normalize this specific',
'trace, but does not affect the values displayed on the axes.',
'0 (or missing) means to use ternary<i>.sum'
].join(' ')
},
mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),
text: extendFlat({}, scatterAttrs.text, {
description: [
'Sets text elements associated with each (a,b,c) point.',
'If a single string, the same string appears over',
'all the data points.',
'If an array of strings, the items are mapped in order to the',
'the data points in (a,b,c).',
'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
'these elements will be seen in the hover labels.'
].join(' ')
}),
hovertext: extendFlat({}, scatterAttrs.hovertext, {
description: [
'Sets hover text elements associated with each (a,b,c) point.',
'If a single string, the same string appears over',
'all the data points.',
'If an array of strings, the items are mapped in order to the',
'the data points in (a,b,c).',
'To be seen, trace `hoverinfo` must contain a *text* flag.'
].join(' ')
}),
line: {
color: scatterLineAttrs.color,
width: scatterLineAttrs.width,
dash: dash,
shape: extendFlat({}, scatterLineAttrs.shape,
{values: ['linear', 'spline']}),
smoothing: scatterLineAttrs.smoothing,
editType: 'calc'
},
connectgaps: scatterAttrs.connectgaps,
cliponaxis: scatterAttrs.cliponaxis,
fill: extendFlat({}, scatterAttrs.fill, {
values: ['none', 'toself', 'tonext'],
dflt: 'none',
description: [
'Sets the area to fill with a solid color.',
'Use with `fillcolor` if not *none*.',
'scatterternary has a subset of the options available to scatter.',
'*toself* connects the endpoints of the trace (or each segment',
'of the trace if it has gaps) into a closed shape.',
'*tonext* fills the space between two traces if one completely',
'encloses the other (eg consecutive contour lines), and behaves like',
'*toself* if there is no trace before it. *tonext* should not be',
'used if one trace does not enclose the other.'
].join(' ')
}),
fillcolor: scatterAttrs.fillcolor,
marker: extendFlat({
symbol: scatterMarkerAttrs.symbol,
opacity: scatterMarkerAttrs.opacity,
maxdisplayed: scatterMarkerAttrs.maxdisplayed,
size: scatterMarkerAttrs.size,
sizeref: scatterMarkerAttrs.sizeref,
sizemin: scatterMarkerAttrs.sizemin,
sizemode: scatterMarkerAttrs.sizemode,
line: extendFlat({
width: scatterMarkerLineAttrs.width,
editType: 'calc'
},
colorAttributes('marker.line')
),
gradient: scatterMarkerAttrs.gradient,
editType: 'calc'
}, colorAttributes('marker'), {
colorbar: colorbarAttrs
}),
textfont: scatterAttrs.textfont,
textposition: scatterAttrs.textposition,
selected: scatterAttrs.selected,
unselected: scatterAttrs.unselected,
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
flags: ['a', 'b', 'c', 'text', 'name']
}),
hoveron: scatterAttrs.hoveron,
hovertemplate: hovertemplateAttrs(),
};