@@ -20,18 +20,7 @@ function distinctVals(col) {
2020 return Lib . distinctVals ( col ) . vals ;
2121}
2222
23- function IsosurfaceTrace ( scene , mesh , uid ) {
24- this . scene = scene ;
25- this . uid = uid ;
26- this . mesh = mesh ;
27- this . name = '' ;
28- this . data = null ;
29- this . showContour = false ;
30- }
31-
32- var proto = IsosurfaceTrace . prototype ;
33-
34- function findNearestOnAxis ( w , arr ) {
23+ var findNearestOnAxis = function ( w , arr ) {
3524 for ( var q = arr . length - 1 ; q > 0 ; q -- ) {
3625 var min = Math . min ( arr [ q ] , arr [ q - 1 ] ) ;
3726 var max = Math . max ( arr [ q ] , arr [ q - 1 ] ) ;
@@ -46,8 +35,19 @@ function findNearestOnAxis(w, arr) {
4635 id : 0 ,
4736 distRatio : 0
4837 } ;
38+ } ;
39+
40+ function IsosurfaceTrace ( scene , mesh , uid ) {
41+ this . scene = scene ;
42+ this . uid = uid ;
43+ this . mesh = mesh ;
44+ this . name = '' ;
45+ this . data = null ;
46+ this . showContour = false ;
4947}
5048
49+ var proto = IsosurfaceTrace . prototype ;
50+
5151proto . handlePick = function ( selection ) {
5252 if ( selection . object === this . mesh ) {
5353 var rawId = selection . data . index ;
@@ -87,7 +87,7 @@ proto.update = function(data) {
8787 var scene = this . scene ;
8888 var layout = scene . fullSceneLayout ;
8989
90- this . data = generateIsosurfaceMesh ( data ) ;
90+ this . data = generateIsoMeshes ( data ) ;
9191
9292 // Unpack position data
9393 function toDataCoords ( axis , coord , scale , calendar ) {
@@ -134,7 +134,7 @@ proto.dispose = function() {
134134 this . mesh . dispose ( ) ;
135135} ;
136136
137- function generateIsosurfaceMesh ( data ) {
137+ function generateIsoMeshes ( data ) {
138138 data . _i = [ ] ;
139139 data . _j = [ ] ;
140140 data . _k = [ ] ;
@@ -1035,4 +1035,8 @@ function createIsosurfaceTrace(scene, data) {
10351035 return result ;
10361036}
10371037
1038- module . exports = createIsosurfaceTrace ;
1038+ module . exports = {
1039+ findNearestOnAxis : findNearestOnAxis ,
1040+ generateIsoMeshes : generateIsoMeshes ,
1041+ createIsosurfaceTrace : createIsosurfaceTrace ,
1042+ } ;
0 commit comments