Skip to content

Commit 05e21cc

Browse files
committed
support for stacked chart and setVisibility added and destroy function added
1 parent cff1587 commit 05e21cc

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/main/java/at/gmi/nordborglab/widgets/gwasgeneviewer/client/GWASGeneViewer.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public void execute() {
6060
//Scatterchart settings
6161
private static int DYGRAPHOFFSET = 31;
6262
protected double max_value;
63-
protected String color;
63+
protected String[] color;
64+
6465
protected String gene_marker_color;
6566
protected int pointSize =2;
6667
protected int scatterChartHeight=200;
@@ -111,7 +112,8 @@ public void setSize(String width,String height ) {
111112
scatterChart.setSize(width, height);
112113
}
113114

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+
115117
this.chromosome = chromosome;
116118
this.color = color;
117119
//this.width=width;
@@ -330,7 +332,7 @@ protected Options setOptions(Dygraphs.Options options){
330332
options.setAxisLabelFontSize(11);
331333
options.setValueRange(0,(int)maxValue + 2);
332334
options.setyAxisLabelWidth(20);
333-
options.setColors(new String[] {color});
335+
options.setColors(color);
334336
options.setMinimumDistanceForHighlight(10);
335337
options.setIncludeYPositionForHightlight(true);
336338
options.setDateWindow(viewStart, viewEnd);
@@ -358,7 +360,7 @@ public void setChromosome(String chromosome) {
358360
this.chromosome = chromosome;
359361
}
360362

361-
public void setColor(String color) {
363+
public void setColor(String[] color) {
362364
this.color = color;
363365
}
364366

@@ -440,6 +442,10 @@ public static Selection getTopSNP(DataTable data) {
440442
return selection;
441443
}
442444

445+
public void setScatterChartVisibilityForSeries(int id,boolean isVisible) {
446+
scatterChart.setVisibility(id, isVisible);
447+
}
448+
443449
public Selection getTopSNP() {
444450
if (dataTable == null)
445451
return null;
@@ -473,4 +479,9 @@ private void scheduledLayout() {
473479
Scheduler.get().scheduleDeferred(layoutCmd);
474480
}
475481
}
482+
483+
public void destroy() {
484+
scatterChart.destroy();
485+
geneViewer.destroy();
486+
}
476487
}

0 commit comments

Comments
 (0)