@@ -43,6 +43,7 @@ function calc(gd, trace) {
43
43
var ya = AxisIDs . getFromId ( gd , trace . yaxis ) ;
44
44
var subplot = fullLayout . _plots [ trace . xaxis + trace . yaxis ] ;
45
45
var len = trace . _length ;
46
+ var hasTooManyPoints = len >= TOO_MANY_POINTS ;
46
47
var len2 = len * 2 ;
47
48
var stash = { } ;
48
49
var i , xx , yy ;
@@ -73,7 +74,7 @@ function calc(gd, trace) {
73
74
74
75
// we don't build a tree for log axes since it takes long to convert log2px
75
76
// and it is also
76
- if ( xa . type !== 'log' && ya . type !== 'log' ) {
77
+ if ( hasTooManyPoints && ( xa . type !== 'log' && ya . type !== 'log' ) ) {
77
78
// FIXME: delegate this to webworker
78
79
stash . tree = cluster ( positions ) ;
79
80
} else {
@@ -93,7 +94,7 @@ function calc(gd, trace) {
93
94
// use average marker size instead to speed things up.
94
95
setFirstScatter ( fullLayout , trace ) ;
95
96
var ppad ;
96
- if ( len < TOO_MANY_POINTS ) {
97
+ if ( ! hasTooManyPoints ) {
97
98
ppad = calcMarkerSize ( trace , len ) ;
98
99
} else if ( opts . marker ) {
99
100
ppad = 2 * ( opts . marker . sizeAvg || Math . max ( opts . marker . size , 3 ) ) ;
@@ -111,8 +112,8 @@ function calc(gd, trace) {
111
112
112
113
// FIXME: organize it in a more appropriate manner, probably in sceneOptions
113
114
// put point-cluster instance for optimized regl calc
114
- if ( opts . marker && len >= TOO_MANY_POINTS ) {
115
- opts . marker . cluster = stash . tree ;
115
+ if ( opts . marker ) {
116
+ opts . marker . snap = stash . tree || TOO_MANY_POINTS ;
116
117
}
117
118
118
119
// save scene opts batch
0 commit comments