Skip to content

Commit

Permalink
#29 better handling of timeline extremes
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Oct 29, 2015
1 parent 7e4ec33 commit 089d4a5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
8 changes: 6 additions & 2 deletions build/release/joola.js
Original file line number Diff line number Diff line change
Expand Up @@ -44688,16 +44688,20 @@ var Timeline = module.exports = function (options, callback) {

extremes_0 = self.chart.yAxis[0].getExtremes();
extremes_0.min = 0;
if (extremes_0.dataMin < 0)
if (extremes_0.dataMin < 0)
extremes_0.min = extremes_0.dataMin;

extremes_0.max = extremes_0.dataMax * 1.1;
if (extremes_0.dataMin === 0 && extremes_0.dataMax === 0) {
extremes_0.min = 0;
extremes_0.max = 1;
}
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
if (self.last_extremes_0)
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);
else
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);

self.last_extremes_0 = extremes_0;
if (self.chart.yAxis.length > 1) {
extremes_1 = self.chart.yAxis[1].getExtremes();
Expand Down
4 changes: 2 additions & 2 deletions build/release/joola.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/release/joola.min.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions build/release/joola.shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -41090,16 +41090,20 @@ var Timeline = module.exports = function (options, callback) {

extremes_0 = self.chart.yAxis[0].getExtremes();
extremes_0.min = 0;
if (extremes_0.dataMin < 0)
if (extremes_0.dataMin < 0)
extremes_0.min = extremes_0.dataMin;

extremes_0.max = extremes_0.dataMax * 1.1;
if (extremes_0.dataMin === 0 && extremes_0.dataMax === 0) {
extremes_0.min = 0;
extremes_0.max = 1;
}
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
if (self.last_extremes_0)
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);
else
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);

self.last_extremes_0 = extremes_0;
if (self.chart.yAxis.length > 1) {
extremes_1 = self.chart.yAxis[1].getExtremes();
Expand Down
8 changes: 6 additions & 2 deletions build/temp/joola.js
Original file line number Diff line number Diff line change
Expand Up @@ -41090,16 +41090,20 @@ var Timeline = module.exports = function (options, callback) {

extremes_0 = self.chart.yAxis[0].getExtremes();
extremes_0.min = 0;
if (extremes_0.dataMin < 0)
if (extremes_0.dataMin < 0)
extremes_0.min = extremes_0.dataMin;

extremes_0.max = extremes_0.dataMax * 1.1;
if (extremes_0.dataMin === 0 && extremes_0.dataMax === 0) {
extremes_0.min = 0;
extremes_0.max = 1;
}
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
if (self.last_extremes_0)
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);
else
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);

self.last_extremes_0 = extremes_0;
if (self.chart.yAxis.length > 1) {
extremes_1 = self.chart.yAxis[1].getExtremes();
Expand Down
8 changes: 6 additions & 2 deletions src/lib/viz/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,20 @@ var Timeline = module.exports = function (options, callback) {

extremes_0 = self.chart.yAxis[0].getExtremes();
extremes_0.min = 0;
if (extremes_0.dataMin < 0)
if (extremes_0.dataMin < 0)
extremes_0.min = extremes_0.dataMin;

extremes_0.max = extremes_0.dataMax * 1.1;
if (extremes_0.dataMin === 0 && extremes_0.dataMax === 0) {
extremes_0.min = 0;
extremes_0.max = 1;
}
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
if (self.last_extremes_0)
if (self.last_extremes_0.min !== extremes_0.min || self.last_extremes_0.max !== extremes_0.max)
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);
else
self.chart.yAxis[0].setExtremes(extremes_0.min, extremes_0.max, false, false);

self.last_extremes_0 = extremes_0;
if (self.chart.yAxis.length > 1) {
extremes_1 = self.chart.yAxis[1].getExtremes();
Expand Down

0 comments on commit 089d4a5

Please sign in to comment.