@@ -112,7 +112,6 @@ public enum SHOW_RANGE_SELECTOR {None,Bottom,Top};
112
112
protected DataTable stackableGenomeStatsCache = null ;
113
113
protected HashMap <GenomeStat ,DataTable > nonstackableGenomeStatsCache = new HashMap <GenomeStat ,DataTable >();
114
114
protected Dygraphs .Options options = Dygraphs .Options .create ();
115
- protected DataTable statisticsDataTable ;
116
115
protected int width_offset = 31 ;
117
116
118
117
private final ScheduledCommand layoutCmd = new ScheduledCommand () {
@@ -194,6 +193,8 @@ public void setViewRegion(int start, int end) {
194
193
this .viewEnd = end ;
195
194
if (processing .isLoaded ()) {
196
195
processing .getInstance ().setViewRegion (start , end );
196
+ if (showStatsBand )
197
+ drawStatistics ();
197
198
}
198
199
}
199
200
@@ -213,7 +214,14 @@ public void setRangeSelectorPosition(SHOW_RANGE_SELECTOR show_range_selector) {
213
214
214
215
215
216
public void setChromosome (String chromosome ) {
217
+ boolean redrawStats = false ;
218
+ if (chromosome != null && !chromosome .equals (this .chromosome ))
219
+ redrawStats = true ;
216
220
this .chromosome = chromosome ;
221
+ if (redrawStats ) {
222
+ clearGenomeStatsCache ();
223
+ loadAndDisplayGenomeStats (true );
224
+ }
217
225
}
218
226
219
227
public void updateZoom (Integer start ,Integer end ) {
@@ -756,4 +764,9 @@ private void scheduledLayout() {
756
764
Scheduler .get ().scheduleDeferred (layoutCmd );
757
765
}
758
766
}
767
+
768
+ private void clearGenomeStatsCache () {
769
+ stackableGenomeStatsCache = null ;
770
+ nonstackableGenomeStatsCache .clear ();
771
+ }
759
772
}
0 commit comments