@@ -43,6 +43,7 @@ function calc(gd, trace) {
4343 var ya = AxisIDs . getFromId ( gd , trace . yaxis ) ;
4444 var subplot = fullLayout . _plots [ trace . xaxis + trace . yaxis ] ;
4545 var len = trace . _length ;
46+ var hasTooManyPoints = len >= TOO_MANY_POINTS ;
4647 var len2 = len * 2 ;
4748 var stash = { } ;
4849 var i , xx , yy ;
@@ -73,7 +74,7 @@ function calc(gd, trace) {
7374
7475 // we don't build a tree for log axes since it takes long to convert log2px
7576 // and it is also
76- if ( xa . type !== 'log' && ya . type !== 'log' ) {
77+ if ( hasTooManyPoints && ( xa . type !== 'log' && ya . type !== 'log' ) ) {
7778 // FIXME: delegate this to webworker
7879 stash . tree = cluster ( positions ) ;
7980 } else {
@@ -93,7 +94,7 @@ function calc(gd, trace) {
9394 // use average marker size instead to speed things up.
9495 setFirstScatter ( fullLayout , trace ) ;
9596 var ppad ;
96- if ( len < TOO_MANY_POINTS ) {
97+ if ( ! hasTooManyPoints ) {
9798 ppad = calcMarkerSize ( trace , len ) ;
9899 } else if ( opts . marker ) {
99100 ppad = 2 * ( opts . marker . sizeAvg || Math . max ( opts . marker . size , 3 ) ) ;
@@ -111,8 +112,8 @@ function calc(gd, trace) {
111112
112113 // FIXME: organize it in a more appropriate manner, probably in sceneOptions
113114 // 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 ;
116117 }
117118
118119 // save scene opts batch
0 commit comments