Skip to content

Commit 672dea3

Browse files
committed
validate mock, update baseline and refactor
1 parent a34a622 commit 672dea3

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/traces/scattermapbox/convert.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,16 @@ function isBADNUM(lonlat) {
355355
return lonlat[0] === BADNUM;
356356
}
357357

358-
function arrayifyAttribute(attribute, step) {
358+
function arrayifyAttribute(values, step) {
359359
var newAttribute;
360-
if(Lib.isArrayOrTypedArray(attribute) && Lib.isArrayOrTypedArray(step)) {
361-
newAttribute = ['step', ['get', 'point_count'], attribute[0]];
362-
for(var idx = 1; idx < attribute.length; idx++) {
363-
newAttribute.push(step[idx - 1], attribute[idx]);
360+
if(Lib.isArrayOrTypedArray(values) && Lib.isArrayOrTypedArray(step)) {
361+
newAttribute = ['step', ['get', 'point_count'], values[0]];
362+
363+
for(var idx = 1; idx < values.length; idx++) {
364+
newAttribute.push(step[idx - 1], values[idx]);
364365
}
365366
} else {
366-
newAttribute = attribute;
367+
newAttribute = values;
367368
}
368369
return newAttribute;
369370
}
-3.41 KB
Loading

test/image/mocks/mapbox_scattercluster.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"cluster": {
1414
"enabled": true,
15-
"radius": 20,
15+
"size": 20,
1616
"color": "yellow"
1717
},
1818
"lon": [
@@ -55,14 +55,14 @@
5555
{
5656
"type": "scattermapbox",
5757
"subplot": "mapbox2",
58-
"name": "20 (40)",
58+
"name": "20 (10)",
5959
"mode": "markers",
6060
"marker": {
6161
"size": 20
6262
},
6363
"cluster": {
6464
"enabled": true,
65-
"radius": 40
65+
"size": 10
6666
},
6767
"lon": [
6868
-73.56,
@@ -104,14 +104,14 @@
104104
{
105105
"type": "scattermapbox",
106106
"subplot": "mapbox3",
107-
"name": "40 (20)",
107+
"name": "10 (20)",
108108
"mode": "markers",
109109
"marker": {
110-
"size": 40
110+
"size": 10
111111
},
112112
"cluster": {
113113
"enabled": true,
114-
"radius": 20
114+
"size": 20
115115
},
116116
"lon": [
117117
-73.56,
@@ -153,14 +153,14 @@
153153
{
154154
"type": "scattermapbox",
155155
"subplot": "mapbox4",
156-
"name": "40 (40)",
156+
"name": "10 (10)",
157157
"mode": "markers",
158158
"marker": {
159-
"size": 40
159+
"size": 10
160160
},
161161
"cluster": {
162162
"enabled": true,
163-
"radius": 40
163+
"size": 10
164164
},
165165
"lon": [
166166
-73.56,

0 commit comments

Comments
 (0)