|
26 | 26 | import com.google.gwt.uibinder.client.UiBinder;
|
27 | 27 | import com.google.gwt.user.client.ui.Composite;
|
28 | 28 | import com.google.gwt.user.client.ui.HTMLPanel;
|
| 29 | +import com.google.gwt.user.client.ui.RequiresResize; |
29 | 30 | import com.google.gwt.user.client.ui.Widget;
|
30 | 31 | import com.google.gwt.uibinder.client.UiField;
|
31 | 32 | import com.google.gwt.user.client.ui.Label;
|
32 | 33 | import com.google.gwt.visualization.client.DataTable;
|
33 | 34 | import com.google.gwt.visualization.client.Selection;
|
34 | 35 |
|
35 |
| -public class GWASGeneViewer extends Composite { |
| 36 | +public class GWASGeneViewer extends Composite implements RequiresResize{ |
36 | 37 |
|
37 | 38 | private static ScatterGenomeChartUiBinder uiBinder = GWT
|
38 | 39 | .create(ScatterGenomeChartUiBinder.class);
|
@@ -69,7 +70,7 @@ interface ScatterGenomeChartUiBinder extends UiBinder<Widget, GWASGeneViewer> {
|
69 | 70 | //General settings
|
70 | 71 | protected String chromosome;
|
71 | 72 | protected int width = 1000;
|
72 |
| - protected int geneViewerHeight = 200; |
| 73 | + protected int geneViewerHeight = 300; |
73 | 74 | protected DataSource datasource = null;
|
74 | 75 | protected int viewStart = 0;
|
75 | 76 | protected int viewEnd = 0;
|
@@ -183,8 +184,8 @@ public void onZoom(ZoomEvent event) {
|
183 | 184 | {
|
184 | 185 | if (event.maxX - event.minX<= minZoomLevelForGenomeView)
|
185 | 186 | {
|
186 |
| - geneViewer.updateZoom(event.minX, event.maxX); |
187 | 187 | toggleGenomeViewVisible(true);
|
| 188 | + geneViewer.updateZoom(event.minX, event.maxX); |
188 | 189 | }
|
189 | 190 | else
|
190 | 191 | toggleGenomeViewVisible(false);
|
@@ -307,7 +308,12 @@ protected Options setOptions(Dygraphs.Options options){
|
307 | 308 |
|
308 | 309 |
|
309 | 310 | public void toggleGenomeViewVisible(boolean visible) {
|
310 |
| - geneViewerContainer.setVisible(visible); |
| 311 | + //geneViewerContainer.setVisible(visible); |
| 312 | + geneViewer.setVisible(visible); |
| 313 | + if (visible) { |
| 314 | + geneViewer.setSize(width - DYGRAPHOFFSET, geneViewerHeight); |
| 315 | + geneViewer.onResize(); |
| 316 | + } |
311 | 317 | }
|
312 | 318 |
|
313 | 319 | public void setMinZoomLevelForGenomeView(Integer minZoomLevelForGenomeView) {
|
@@ -405,4 +411,10 @@ public Selection getTopSNP() {
|
405 | 411 | return null;
|
406 | 412 | return getTopSNP(dataTable);
|
407 | 413 | }
|
| 414 | + |
| 415 | + @Override |
| 416 | + public void onResize() { |
| 417 | + geneViewer.onResize(); |
| 418 | + scatterChart.onResize(); |
| 419 | + } |
408 | 420 | }
|
0 commit comments