@@ -137,6 +137,7 @@ function convertPlotlyOptions(scene, data) {
137
137
if ( 'line' in data ) {
138
138
params . lineColor = formatColor ( line , 1 , len ) ;
139
139
params . lineWidth = line . width ;
140
+ params . connectionradius = line . connectionradius ;
140
141
}
141
142
142
143
if ( 'marker' in data ) {
@@ -284,19 +285,13 @@ proto.update = function(data) {
284
285
this . textMarkers = null ;
285
286
}
286
287
287
- if ( true ) {
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
- if ( this . delaunayMesh ) {
290
- this . delaunayMesh . update ( delaunayOptions ) ;
291
- } else {
292
- delaunayOptions . gl = gl ;
293
- this . delaunayMesh = createMesh ( delaunayOptions ) ;
294
- this . scene . glplot . add ( this . delaunayMesh ) ;
295
- }
296
- } else if ( this . delaunayMesh ) {
297
- this . scene . glplot . remove ( this . delaunayMesh ) ;
298
- this . delaunayMesh . dispose ( ) ;
299
- this . delaunayMesh = null ;
288
+ var meshOptions = calculateMesh ( this . data . x , this . data . y , this . data . z , options . connectionradius , options . lineColor , options . scatterSize , options . scatterColor , this . scene . dataScale ) ;
289
+ if ( this . delaunayMesh ) {
290
+ this . delaunayMesh . update ( meshOptions ) ;
291
+ } else {
292
+ meshOptions . gl = gl ;
293
+ this . delaunayMesh = createMesh ( meshOptions ) ;
294
+ this . scene . glplot . add ( this . delaunayMesh ) ;
300
295
}
301
296
302
297
} ;
@@ -322,10 +317,8 @@ function createLineWithMarkers(scene, data) {
322
317
return plot ;
323
318
}
324
319
325
- module . exports = createLineWithMarkers ;
326
-
327
320
function calculateMesh ( inputX , inputY , inputZ , inputW , inputC , inputMW , inputMC , scalingFactor ) {
328
- debugger
321
+
329
322
function addVertex ( X , Y , Z , x , y , z ) {
330
323
X . push ( x ) ;
331
324
Y . push ( y ) ;
@@ -799,51 +792,19 @@ debugger
799
792
return vOffset + mx . length ;
800
793
}
801
794
802
- function colorer ( d ) {
803
- var colorArray = [ d , 0 , 1 - d ] ;
804
- return colorArray ;
805
- }
806
-
807
- function makeCircularSampleModel ( ) {
808
-
809
- var pointCount = 10 ;
810
- var n ;
811
-
812
- var p = {
813
- x : [ ] ,
814
- y : [ ] ,
815
- z : [ ] ,
816
- r : [ ] ,
817
- c : [ ]
818
- }
819
-
820
- for ( n = 0 ; n < pointCount ; n ++ ) {
821
-
822
- p . x . push ( Math . cos ( 10 * n / pointCount ) * 100 ) ;
823
- p . y . push ( Math . sin ( 10 * n / pointCount ) * 100 ) ;
824
- p . z . push ( 1000 * n / pointCount * 0.2 - 100 ) ;
825
- p . r . push ( 5 + 2 * Math . sin ( 1000 * n / pointCount / 20 ) ) ;
826
- p . c . push ( 0.5 + Math . sin ( n * 2 ) / 2 ) ;
827
- }
828
-
829
- return p ;
830
- }
831
-
832
795
var x , y , z ;
833
796
834
797
var index = 0 ;
835
798
836
799
var n , r , r2 , c , c1 , c2 ;
837
800
838
- var p = makeCircularSampleModel ( ) ;
801
+ var scaler = 0.01 ; // fixme figure out something for sensibly calculating dimensions
839
802
840
- var scaler = 0.01 ;
841
-
842
- p = {
803
+ var p = {
843
804
x : inputX ,
844
805
y : inputY ,
845
806
z : inputZ ,
846
- r : Array . isArray ( inputW ) ? inputW * scaler : inputX . map ( function ( ) { return inputW * scaler } ) ,
807
+ r : Array . isArray ( inputW ) ? inputW : inputX . map ( function ( ) { return inputW ; } ) ,
847
808
c : inputC
848
809
}
849
810
@@ -949,3 +910,4 @@ debugger
949
910
}
950
911
}
951
912
913
+ module . exports = createLineWithMarkers ;
0 commit comments