From 03c50fb597a0412ac41abc9478c2be34c50c48d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pior?= Date: Fri, 6 Jul 2018 13:46:45 +0200 Subject: [PATCH] #7625 fix python NanoPlot problems --- beakerx/beakerx/plot/chart.py | 2 +- js/notebook/src/plot/plotUtils.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/beakerx/beakerx/plot/chart.py b/beakerx/beakerx/plot/chart.py index e5cf52ca69..354a8d73cf 100644 --- a/beakerx/beakerx/plot/chart.py +++ b/beakerx/beakerx/plot/chart.py @@ -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 diff --git a/js/notebook/src/plot/plotUtils.js b/js/notebook/src/plot/plotUtils.js index cb63ad31e1..ace31a9439 100644 --- a/js/notebook/src/plot/plotUtils.js +++ b/js/notebook/src/plot/plotUtils.js @@ -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) { @@ -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)) {