Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7625 fix python NanoPlot problems #7663

Merged
merged 9 commits into from
Jul 23, 2018
10 changes: 7 additions & 3 deletions beakerx/beakerx/plot/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,15 @@ def __init__(self, **kwargs):

def add(self, item):
super(NanoPlot, self).add(item)
converted = []
for l in self.chart.graphics_list:
convertedx = []
convertedy = []
for x in l.x:
converted.append(str(x))
l.x = converted
convertedx.append(str(x))
l.x = convertedx
for y in l.y:
convertedy.append(str(y))
l.y = convertedy
self.model = self.chart.transform()
return self

Expand Down
6 changes: 4 additions & 2 deletions js/notebook/src/plot/plotUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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