Skip to content

Commit 7e7e217

Browse files
committed
scatterternary attributes first cut
1 parent 2595731 commit 7e7e217

File tree

2 files changed

+122
-1
lines changed

2 files changed

+122
-1
lines changed

src/traces/scattergeo/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = {
4747
mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),
4848
text: extendFlat({}, scatterAttrs.text, {
4949
description: [
50-
'Sets text elements associated with each (lon,lat) pair.',
50+
'Sets text elements associated with each (lon,lat) pair',
5151
'or item in `locations`.',
5252
'If a single string, the same string appears over',
5353
'all the data points.',
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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 scatterAttrs = require('../scatter/attributes');
12+
var plotAttrs = require('../../plots/attributes');
13+
var extendFlat = require('../../lib/extend').extendFlat;
14+
15+
var scatterMarkerAttrs = scatterAttrs.marker,
16+
scatterLineAttrs = scatterAttrs.line,
17+
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
18+
19+
20+
module.exports = {
21+
a: {
22+
valType: 'data_array',
23+
description: [
24+
'Sets the quantity of component `a` in each data point.',
25+
'If `a`, `b`, and `c` are all provided, they need not be',
26+
'normalized, only the relative values matter. If only two',
27+
'arrays are provided they must be normalized to match',
28+
'`ternary<i>.sum`.'
29+
].join(' ')
30+
},
31+
b: {
32+
valType: 'data_array',
33+
description: [
34+
'Sets the quantity of component `a` in each data point.',
35+
'If `a`, `b`, and `c` are all provided, they need not be',
36+
'normalized, only the relative values matter. If only two',
37+
'arrays are provided they must be normalized to match',
38+
'`ternary(i).sum`.'
39+
].join(' ')
40+
},
41+
c: {
42+
valType: 'data_array',
43+
description: [
44+
'Sets the quantity of component `a` in each data point.',
45+
'If `a`, `b`, and `c` are all provided, they need not be',
46+
'normalized, only the relative values matter. If only two',
47+
'arrays are provided they must be normalized to match',
48+
'`ternary<i>.sum`.'
49+
].join(' ')
50+
},
51+
sum: {
52+
valType: 'number',
53+
role: 'info',
54+
dflt: 1,
55+
min: 0,
56+
description: [
57+
'The number each triplet should sum to,',
58+
'if only two of `a`, `b`, and `c` are provided.',
59+
'This overrides `ternary<i>.sum` to normalize this specific',
60+
'trace, but does not affect the values displayed on the axes.'
61+
].join(' ')
62+
},
63+
mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),
64+
text: extendFlat({}, scatterAttrs.text, {
65+
description: [
66+
'Sets text elements associated with each (a,b,c) point.',
67+
'If a single string, the same string appears over',
68+
'all the data points.',
69+
'If an array of string, the items are mapped in order to the',
70+
'this trace\'s (a,b,c) coordinates.'
71+
].join(' ')
72+
}),
73+
line: {
74+
color: scatterLineAttrs.color,
75+
width: scatterLineAttrs.width,
76+
dash: scatterLineAttrs.dash,
77+
shape: extendFlat({}, scatterLineAttrs.shape,
78+
{values: ['linear', 'spline']}),
79+
smoothing: scatterLineAttrs.smoothing
80+
},
81+
connectgaps: scatterAttrs.connectgaps,
82+
fill: extendFlat({}, scatterAttrs.fill, {
83+
values: ['none', 'tozeroa', 'tozerob', 'tozeroc',
84+
'tonexta', 'tonextb', 'tonextc']
85+
}),
86+
fillcolor: scatterAttrs.fillcolor,
87+
marker: {
88+
symbol: scatterMarkerAttrs.symbol,
89+
opacity: scatterMarkerAttrs.opacity,
90+
size: scatterMarkerAttrs.size,
91+
sizeref: scatterMarkerAttrs.sizeref,
92+
sizemin: scatterMarkerAttrs.sizemin,
93+
sizemode: scatterMarkerAttrs.sizemode,
94+
color: scatterMarkerAttrs.color,
95+
colorscale: scatterMarkerAttrs.colorscale,
96+
cauto: scatterMarkerAttrs.cauto,
97+
cmax: scatterMarkerAttrs.cmax,
98+
cmin: scatterMarkerAttrs.cmin,
99+
autocolorscale: scatterMarkerAttrs.autocolorscale,
100+
reversescale: scatterMarkerAttrs.reversescale,
101+
showscale: scatterMarkerAttrs.showscale,
102+
line: {
103+
color: scatterMarkerLineAttrs.color,
104+
width: scatterMarkerLineAttrs.width,
105+
colorscale: scatterMarkerLineAttrs.colorscale,
106+
cauto: scatterMarkerLineAttrs.cauto,
107+
cmax: scatterMarkerLineAttrs.cmax,
108+
cmin: scatterMarkerLineAttrs.cmin,
109+
autocolorscale: scatterMarkerLineAttrs.autocolorscale,
110+
reversescale: scatterMarkerLineAttrs.reversescale
111+
}
112+
},
113+
textfont: scatterAttrs.textfont,
114+
textposition: scatterAttrs.textposition,
115+
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
116+
flags: ['a', 'b', 'c', 'text', 'name']
117+
}),
118+
_nestedModules: {
119+
'marker.colorbar': 'Colorbar'
120+
}
121+
};

0 commit comments

Comments
 (0)