@@ -60,7 +60,8 @@ public void execute() {
60
60
//Scatterchart settings
61
61
private static int DYGRAPHOFFSET = 31 ;
62
62
protected double max_value ;
63
- protected String color ;
63
+ protected String [] color ;
64
+
64
65
protected String gene_marker_color ;
65
66
protected int pointSize =2 ;
66
67
protected int scatterChartHeight =200 ;
@@ -111,7 +112,8 @@ public void setSize(String width,String height ) {
111
112
scatterChart .setSize (width , height );
112
113
}
113
114
114
- public GWASGeneViewer (String chromosome ,String color ,String gene_marker_color ,DataSource datasource ) {
115
+ public GWASGeneViewer (String chromosome ,String [] color ,String gene_marker_color ,DataSource datasource ) {
116
+
115
117
this .chromosome = chromosome ;
116
118
this .color = color ;
117
119
//this.width=width;
@@ -330,7 +332,7 @@ protected Options setOptions(Dygraphs.Options options){
330
332
options .setAxisLabelFontSize (11 );
331
333
options .setValueRange (0 ,(int )maxValue + 2 );
332
334
options .setyAxisLabelWidth (20 );
333
- options .setColors (new String [] { color } );
335
+ options .setColors (color );
334
336
options .setMinimumDistanceForHighlight (10 );
335
337
options .setIncludeYPositionForHightlight (true );
336
338
options .setDateWindow (viewStart , viewEnd );
@@ -358,7 +360,7 @@ public void setChromosome(String chromosome) {
358
360
this .chromosome = chromosome ;
359
361
}
360
362
361
- public void setColor (String color ) {
363
+ public void setColor (String [] color ) {
362
364
this .color = color ;
363
365
}
364
366
@@ -440,6 +442,10 @@ public static Selection getTopSNP(DataTable data) {
440
442
return selection ;
441
443
}
442
444
445
+ public void setScatterChartVisibilityForSeries (int id ,boolean isVisible ) {
446
+ scatterChart .setVisibility (id , isVisible );
447
+ }
448
+
443
449
public Selection getTopSNP () {
444
450
if (dataTable == null )
445
451
return null ;
@@ -473,4 +479,9 @@ private void scheduledLayout() {
473
479
Scheduler .get ().scheduleDeferred (layoutCmd );
474
480
}
475
481
}
482
+
483
+ public void destroy () {
484
+ scatterChart .destroy ();
485
+ geneViewer .destroy ();
486
+ }
476
487
}
0 commit comments