88
99'use strict' ;
1010
11- var createScatterPlot = require ( 'gl-scatter3d' ) ;
1211var conePlot = require ( 'gl-cone3d' ) ;
1312var createConeMesh = require ( 'gl-cone3d' ) . createConeMesh ;
1413
@@ -19,14 +18,13 @@ function Cone(scene, uid) {
1918 this . scene = scene ;
2019 this . uid = uid ;
2120 this . mesh = null ;
22- this . pts = null ;
2321 this . data = null ;
2422}
2523
2624var proto = Cone . prototype ;
2725
2826proto . handlePick = function ( selection ) {
29- if ( selection . object === this . pts ) {
27+ if ( selection . object === this . mesh ) {
3028 var selectIndex = selection . index = selection . data . index ;
3129 var xx = this . data . x [ selectIndex ] ;
3230 var yy = this . data . y [ selectIndex ] ;
@@ -96,8 +94,6 @@ function convert(scene, trace) {
9694
9795 var meshData = conePlot ( coneOpts ) ;
9896
99- // stash positions for gl-scatter3d 'hover' trace
100- meshData . _pts = coneOpts . positions ;
10197
10298 // pass gl-mesh3d lighting attributes
10399 meshData . lightPosition = [ trace . lightposition . x , trace . lightposition . y , trace . lightposition . z ] ;
@@ -119,14 +115,10 @@ proto.update = function(data) {
119115 this . data = data ;
120116
121117 var meshData = convert ( this . scene , data ) ;
122-
123118 this . mesh . update ( meshData ) ;
124- this . pts . update ( { position : meshData . _pts } ) ;
125119} ;
126120
127121proto . dispose = function ( ) {
128- this . scene . glplot . remove ( this . pts ) ;
129- this . pts . dispose ( ) ;
130122 this . scene . glplot . remove ( this . mesh ) ;
131123 this . mesh . dispose ( ) ;
132124} ;
@@ -137,21 +129,11 @@ function createConeTrace(scene, data) {
137129 var meshData = convert ( scene , data ) ;
138130 var mesh = createConeMesh ( gl , meshData ) ;
139131
140- var pts = createScatterPlot ( {
141- gl : gl ,
142- position : meshData . _pts ,
143- project : false ,
144- opacity : 0
145- } ) ;
146-
147132 var cone = new Cone ( scene , data . uid ) ;
148133 cone . mesh = mesh ;
149- cone . pts = pts ;
150134 cone . data = data ;
151135 mesh . _trace = cone ;
152- pts . _trace = cone ;
153136
154- scene . glplot . add ( pts ) ;
155137 scene . glplot . add ( mesh ) ;
156138
157139 return cone ;
0 commit comments