Skip to content

Commit

Permalink
#7625 fix python NanoPlot problems (#7663)
Browse files Browse the repository at this point in the history
* #7625 handle single point correctly

* #7625 fixed num to string conversion for nanoplot elements coordinates

* #7625 fix python NanoPlot problems

* #7625 fix

* #7625 CR fix
  • Loading branch information
piorek authored and LeeTZ committed Jul 23, 2018
1 parent e4804ef commit 7ccb4e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
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

0 comments on commit 7ccb4e8

Please sign in to comment.