Skip to content

Commit fb0ff70

Browse files
authored
Merge pull request #1168 from monfera/scattergl-with-one-datapoint
Fixing the non-fancy scattergl 'single data point' infinite loop
2 parents 5971c16 + 94f4d5f commit fb0ff70

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/traces/scattergl/convert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ proto.update = function(options) {
272272
// also, there are quite a few differences
273273
function allFastTypesLikely(a) {
274274
var len = a.length,
275-
inc = Math.max(0, (len - 1) / Math.min(Math.max(len, 1), 1000)),
275+
inc = Math.max(1, (len - 1) / Math.min(Math.max(len, 1), 1000)),
276276
ai;
277277

278278
for(var i = 0; i < len; i += inc) {
Loading

test/image/mocks/gl2d_scatter-colorscale-colorbar.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@
134134
],
135135
"type": "scattergl",
136136
"mode": "markers"
137+
},
138+
{
139+
"x": [20],
140+
"y": [5.5],
141+
"marker": {
142+
"size": 20
143+
},
144+
"type": "scattergl",
145+
"mode": "markers"
137146
}
138147
],
139148
"layout": {
@@ -152,7 +161,7 @@
152161
4,
153162
6
154163
],
155-
"autorange": true
164+
"autorange": false
156165
},
157166
"height": 598,
158167
"width": 1080,

0 commit comments

Comments
 (0)