@@ -212,7 +212,7 @@ proto.update = function(data) {
212
212
connectGaps : data . connectgaps
213
213
} ;
214
214
215
- if ( this . mode . indexOf ( 'lines' ) !== - 1 ) {
215
+ if ( false && this . mode . indexOf ( 'lines' ) !== - 1 ) {
216
216
if ( this . linePlot ) this . linePlot . update ( lineOptions ) ;
217
217
else {
218
218
this . linePlot = createLinePlot ( lineOptions ) ;
@@ -241,7 +241,7 @@ proto.update = function(data) {
241
241
projectOpacity : options . projectOpacity
242
242
} ;
243
243
244
- if ( this . mode . indexOf ( 'markers' ) !== - 1 ) {
244
+ if ( false && this . mode . indexOf ( 'markers' ) !== - 1 ) {
245
245
if ( this . scatterPlot ) this . scatterPlot . update ( scatterOptions ) ;
246
246
else {
247
247
this . scatterPlot = createScatterPlot ( scatterOptions ) ;
@@ -285,7 +285,7 @@ proto.update = function(data) {
285
285
}
286
286
287
287
if ( true ) {
288
- var delaunayOptions = calculateMesh ( this . data . x , this . data . y , this . data . z , options . lineColor , options . scatterColor , this . scene . dataScale ) ;
288
+ var delaunayOptions = calculateMesh ( this . data . x , this . data . y , this . data . z , options . lineWidth , options . lineColor , options . scatterSize , options . scatterColor , this . scene . dataScale ) ;
289
289
if ( this . delaunayMesh ) {
290
290
this . delaunayMesh . update ( delaunayOptions ) ;
291
291
} else {
@@ -324,7 +324,7 @@ function createLineWithMarkers(scene, data) {
324
324
325
325
module . exports = createLineWithMarkers ;
326
326
327
- function calculateMesh ( inputX , inputY , inputZ , inputC , inputMC , scalingFactor ) {
327
+ function calculateMesh ( inputX , inputY , inputZ , inputW , inputC , inputMW , inputMC , scalingFactor ) {
328
328
329
329
function addVertex ( X , Y , Z , x , y , z ) {
330
330
X . push ( x ) ;
@@ -837,11 +837,13 @@ function calculateMesh(inputX, inputY, inputZ, inputC, inputMC, scalingFactor) {
837
837
838
838
var p = makeCircularSampleModel ( ) ;
839
839
840
+ var scaler = 0.01 ;
841
+
840
842
p = {
841
843
x : inputX ,
842
844
y : inputY ,
843
845
z : inputZ ,
844
- r : inputX . map ( function ( d ) { return 0.05 } ) ,
846
+ r : Array . isArray ( inputW ) ? inputW * scaler : inputX . map ( function ( ) { return inputW * scaler } ) ,
845
847
c : inputC
846
848
}
847
849
@@ -854,21 +856,27 @@ function calculateMesh(inputX, inputY, inputZ, inputC, inputMC, scalingFactor) {
854
856
} ;
855
857
856
858
var upsamplingFactor = 100 ; // convert every original point to as many upsampled points
857
- for ( n = 0 ; n < p . x . length - 3 ; n ++ ) {
859
+ var n0 , n1 , n2 , n3 ;
860
+ for ( n = 0 ; n < p . x . length - 1 ; n ++ ) {
858
861
859
862
for ( var m = 0 ; m < upsamplingFactor ; m ++ ) {
860
863
861
864
c1 = m / upsamplingFactor ;
862
865
c2 = ( upsamplingFactor - m ) / upsamplingFactor ;
863
866
867
+ n0 = ( n - 1 + p . x . length ) % p . x . length ;
868
+ n1 = n ;
869
+ n2 = ( n + 1 ) % p . x . length ;
870
+ n3 = ( n + 2 ) % p . x . length ;
871
+
864
872
var xyzrf = catmullRom (
865
- [ p . x [ n ] , p . x [ n + 1 ] , p . x [ n + 2 ] , p . x [ n + 3 ] ] ,
866
- [ p . y [ n ] , p . y [ n + 1 ] , p . y [ n + 2 ] , p . y [ n + 3 ] ] ,
867
- [ p . z [ n ] , p . z [ n + 1 ] , p . z [ n + 2 ] , p . z [ n + 3 ] ] ,
868
- [ p . r [ n ] , p . r [ n + 1 ] , p . r [ n + 2 ] , p . r [ n + 3 ] ] ,
869
- [ p . c [ n ] [ 0 ] , p . c [ n + 1 ] [ 0 ] , p . c [ n + 2 ] [ 0 ] , p . c [ n + 3 ] [ 0 ] ] ,
870
- [ p . c [ n ] [ 1 ] , p . c [ n + 1 ] [ 1 ] , p . c [ n + 2 ] [ 1 ] , p . c [ n + 3 ] [ 1 ] ] ,
871
- [ p . c [ n ] [ 2 ] , p . c [ n + 1 ] [ 2 ] , p . c [ n + 2 ] [ 2 ] , p . c [ n + 3 ] [ 2 ] ] ,
873
+ [ p . x [ n0 ] , p . x [ n1 ] , p . x [ n2 ] , p . x [ n3 ] ] ,
874
+ [ p . y [ n0 ] , p . y [ n1 ] , p . y [ n2 ] , p . y [ n3 ] ] ,
875
+ [ p . z [ n0 ] , p . z [ n1 ] , p . z [ n2 ] , p . z [ n3 ] ] ,
876
+ [ p . r [ n0 ] , p . r [ n1 ] , p . r [ n2 ] , p . r [ n3 ] ] ,
877
+ [ p . c [ n0 ] [ 0 ] , p . c [ n1 ] [ 0 ] , p . c [ n2 ] [ 0 ] , p . c [ n3 ] [ 0 ] ] ,
878
+ [ p . c [ n0 ] [ 1 ] , p . c [ n1 ] [ 1 ] , p . c [ n2 ] [ 1 ] , p . c [ n3 ] [ 1 ] ] ,
879
+ [ p . c [ n0 ] [ 2 ] , p . c [ n1 ] [ 2 ] , p . c [ n2 ] [ 2 ] , p . c [ n3 ] [ 2 ] ] ,
872
880
c1 ) ;
873
881
874
882
rp . x . push ( xyzrf [ 0 ] ) ;
@@ -914,7 +922,7 @@ function calculateMesh(inputX, inputY, inputZ, inputC, inputMC, scalingFactor) {
914
922
}
915
923
916
924
for ( n = 0 ; n < p . x . length ; n ++ ) {
917
- index = addPointMarker ( unitSphere , p . x [ n ] , p . y [ n ] , p . z [ n ] , inputMC [ n ] , 0.1 , index , X , Y , Z , I , J , K , F ) ;
925
+ index = addPointMarker ( unitSphere , p . x [ n ] , p . y [ n ] , p . z [ n ] , inputMC [ n ] , scaler / 2 * ( Array . isArray ( inputMW ) ? inputMW [ n ] : inputMW ) , index , X , Y , Z , I , J , K , F ) ;
918
926
}
919
927
920
928
return {
0 commit comments