forked from plotly/plotly.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattributes.js
114 lines (97 loc) · 3.6 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
/**
* Copyright 2012-2017, 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 scatterGeoAttrs = require('../scattergeo/attributes');
var scatterAttrs = require('../scatter/attributes');
var mapboxAttrs = require('../../plots/mapbox/layout_attributes');
var plotAttrs = require('../../plots/attributes');
var colorbarAttrs = require('../../components/colorbar/attributes');
var extendFlat = require('../../lib/extend').extendFlat;
var lineAttrs = scatterGeoAttrs.line;
var markerAttrs = scatterGeoAttrs.marker;
module.exports = {
lon: scatterGeoAttrs.lon,
lat: scatterGeoAttrs.lat,
// locations
// locationmode
mode: extendFlat({}, scatterAttrs.mode, {
dflt: 'markers',
description: [
'Determines the drawing mode for this scatter trace.',
'If the provided `mode` includes *text* then the `text` elements',
'appear at the coordinates. Otherwise, the `text` elements',
'appear on hover.'
].join(' ')
}),
text: extendFlat({}, scatterAttrs.text, {
description: [
'Sets text elements associated with each (lon,lat) pair',
'If a single string, the same string appears over',
'all the data points.',
'If an array of string, the items are mapped in order to the',
'this trace\'s (lon,lat) coordinates.',
'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 (lon,lat) pair',
'If a single string, the same string appears over',
'all the data points.',
'If an array of string, the items are mapped in order to the',
'this trace\'s (lon,lat) coordinates.',
'To be seen, trace `hoverinfo` must contain a *text* flag.'
].join(' ')
}),
line: {
color: lineAttrs.color,
width: lineAttrs.width
// TODO
// dash: dash
},
connectgaps: scatterAttrs.connectgaps,
marker: {
symbol: {
valType: 'string',
dflt: 'circle',
role: 'style',
arrayOk: true,
description: [
'Sets the marker symbol.',
'Full list: https://www.mapbox.com/maki-icons/',
'Note that the array `marker.color` and `marker.size`',
'are only available for *circle* symbols.'
].join(' ')
},
opacity: extendFlat({}, markerAttrs.opacity, {
arrayOk: false
}),
size: markerAttrs.size,
sizeref: markerAttrs.sizeref,
sizemin: markerAttrs.sizemin,
sizemode: markerAttrs.sizemode,
color: markerAttrs.color,
colorscale: markerAttrs.colorscale,
cauto: markerAttrs.cauto,
cmax: markerAttrs.cmax,
cmin: markerAttrs.cmin,
autocolorscale: markerAttrs.autocolorscale,
reversescale: markerAttrs.reversescale,
showscale: markerAttrs.showscale,
colorbar: colorbarAttrs
// line
},
fill: scatterGeoAttrs.fill,
fillcolor: scatterAttrs.fillcolor,
textfont: mapboxAttrs.layers.symbol.textfont,
textposition: mapboxAttrs.layers.symbol.textposition,
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
flags: ['lon', 'lat', 'text', 'name']
}),
};