-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
133 lines (125 loc) · 4.01 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
/**
* 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 hovertemplateAttrs = require('../../plots/template_attributes')
.hovertemplateAttrs;
var texttemplateAttrs = require('../../plots/template_attributes')
.texttemplateAttrs;
var scatterGeoAttrs = require('../scattergeo/attributes');
var scatterAttrs = require('../scatter/attributes');
var baseAttrs = require('../../plots/attributes');
var extendFlat = require('../../lib/extend').extendFlat;
var overrideAll = require('../../plot_api/edit_types').overrideAll;
var colorScaleAttrs = require('../../components/colorscale/attributes');
var markerAttrs = scatterGeoAttrs.marker;
module.exports = overrideAll({
lon: scatterGeoAttrs.lon,
lat: scatterGeoAttrs.lat,
cluster: {
maxZoom: {
valType: 'number',
role: 'info',
min: 0,
max: 22,
dflt: 14,
description: 'Sets the maximum zoom level for the cluster.',
},
radius: {
role: 'info',
valType: 'number',
dflt: 50,
description: 'Radius of each cluster when clustering points.',
},
steps: {
role: 'info',
valType: 'number',
arrayOk: true,
dflt: -1,
min: -1,
description: [
'Sets the steps for each cluster.'
].join(' ')
},
stepColors: {
role: 'info',
valType: 'color',
dflt: '#51bbd6',
arrayOk: true,
editType: 'style',
anim: true,
description: [
'Sets the color for each cluster.'
].join(' ')
},
stepSize: {
role: 'info',
valType: 'number',
arrayOk: true,
dflt: 20,
min: 0,
description: [
'Sets the size for each cluster.'
].join(' ')
},
},
mode: extendFlat({}, scatterAttrs.mode, {
dflt: 'markers',
description: [
'Determines the drawing mode for this scatter trace.',
].join(' '),
flags: ['markers'],
}),
texttemplate: texttemplateAttrs(
{ editType: 'plot' },
{
keys: ['lat', 'lon', 'text'],
}
),
hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {
flags: ['lon', 'lat', 'text', 'name'],
}),
hovertemplate: hovertemplateAttrs(),
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(' '),
}),
marker: extendFlat(
{
symbol: {
valType: 'flaglist',
flags: ['circle'],
dflt: 'circle',
role: 'style',
description: ['Sets the marker symbol.'].join(' '),
},
opacity: markerAttrs.opacity,
size: markerAttrs.size,
sizeref: markerAttrs.sizeref,
sizemin: markerAttrs.sizemin,
sizemode: markerAttrs.sizemode
},
colorScaleAttrs('marker')
),
below: {
valType: 'string',
role: 'info',
description: [
'Determines if this scattermapbox trace\'s layers are to be inserted',
'before the layer with the specified ID.',
'By default, scattermapbox layers are inserted',
'above all the base layers.',
'To place the scattermapbox layers above every other layer, set `below` to *\'\'*.'
].join(' ')
},
}, 'calc', 'nested');