Skip to content

Commit

Permalink
#7625 fix python NanoPlot problems
Browse files Browse the repository at this point in the history
  • Loading branch information
piorek committed Jul 6, 2018
1 parent 23b77f8 commit 03c50fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion beakerx/beakerx/plot/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ def __init__(self, **kwargs):

def add(self, item):
super(NanoPlot, self).add(item)
converted = []
for l in self.chart.graphics_list:
converted = []
for x in l.x:
converted.append(str(x))
l.x = converted
Expand Down
8 changes: 5 additions & 3 deletions js/notebook/src/plot/plotUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ define([
datarange.xl = datarange.xr - 1;
} else if (datarange.xr === -Infinity && datarange.xl !== Infinity) {
datarange.xr = datarange.xl + 1;
} else if (visibleItem === 0 || visibleItem === 1 || datarange.xl === Infinity) {
} else if (visibleItem === 0 || datarange.xl === Infinity) {
datarange.xl = 0;
datarange.xr = 1;
} else if (datarange.xl > datarange.xr) {
Expand All @@ -218,10 +218,12 @@ define([

var self = this;
var increaseRange = function(value) {
return self.plus(value, self.div((value || 1), 10));
var v = self.eq(value, 0) ? 1 : value || 1;
return self.plus(value, self.div(v, 10));
};
var decreaseRange = function(value){
return self.minus(value, self.div((value || 1), 10));
var v = self.eq(value, 0) ? 1 : value || 1;
return self.minus(value, self.div(v, 10));
};

if (this.eq(datarange.xl, datarange.xr)) {
Expand Down

0 comments on commit 03c50fb

Please sign in to comment.