8
8
9
9
'use strict' ;
10
10
11
- var createScatterPlot = require ( 'gl-scatter3d' ) ;
12
11
var conePlot = require ( 'gl-cone3d' ) ;
13
12
var createConeMesh = require ( 'gl-cone3d' ) . createConeMesh ;
14
13
@@ -19,14 +18,13 @@ function Cone(scene, uid) {
19
18
this . scene = scene ;
20
19
this . uid = uid ;
21
20
this . mesh = null ;
22
- this . pts = null ;
23
21
this . data = null ;
24
22
}
25
23
26
24
var proto = Cone . prototype ;
27
25
28
26
proto . handlePick = function ( selection ) {
29
- if ( selection . object === this . pts ) {
27
+ if ( selection . object === this . mesh ) {
30
28
var selectIndex = selection . index = selection . data . index ;
31
29
var xx = this . data . x [ selectIndex ] ;
32
30
var yy = this . data . y [ selectIndex ] ;
@@ -96,8 +94,6 @@ function convert(scene, trace) {
96
94
97
95
var meshData = conePlot ( coneOpts ) ;
98
96
99
- // stash positions for gl-scatter3d 'hover' trace
100
- meshData . _pts = coneOpts . positions ;
101
97
102
98
// pass gl-mesh3d lighting attributes
103
99
meshData . lightPosition = [ trace . lightposition . x , trace . lightposition . y , trace . lightposition . z ] ;
@@ -119,14 +115,10 @@ proto.update = function(data) {
119
115
this . data = data ;
120
116
121
117
var meshData = convert ( this . scene , data ) ;
122
-
123
118
this . mesh . update ( meshData ) ;
124
- this . pts . update ( { position : meshData . _pts } ) ;
125
119
} ;
126
120
127
121
proto . dispose = function ( ) {
128
- this . scene . glplot . remove ( this . pts ) ;
129
- this . pts . dispose ( ) ;
130
122
this . scene . glplot . remove ( this . mesh ) ;
131
123
this . mesh . dispose ( ) ;
132
124
} ;
@@ -137,21 +129,11 @@ function createConeTrace(scene, data) {
137
129
var meshData = convert ( scene , data ) ;
138
130
var mesh = createConeMesh ( gl , meshData ) ;
139
131
140
- var pts = createScatterPlot ( {
141
- gl : gl ,
142
- position : meshData . _pts ,
143
- project : false ,
144
- opacity : 0
145
- } ) ;
146
-
147
132
var cone = new Cone ( scene , data . uid ) ;
148
133
cone . mesh = mesh ;
149
- cone . pts = pts ;
150
134
cone . data = data ;
151
135
mesh . _trace = cone ;
152
- pts . _trace = cone ;
153
136
154
- scene . glplot . add ( pts ) ;
155
137
scene . glplot . add ( mesh ) ;
156
138
157
139
return cone ;
0 commit comments