From d2e1919b2cb9221f34fe2a3b850958dbb9ec00fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pior?= Date: Wed, 4 Jul 2018 15:03:09 +0200 Subject: [PATCH 1/5] #7625 handle single point correctly --- js/notebook/src/plot/plotUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/notebook/src/plot/plotUtils.js b/js/notebook/src/plot/plotUtils.js index 28fac31448..cb63ad31e1 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 || datarange.xl === Infinity) { + } else if (visibleItem === 0 || visibleItem === 1 || datarange.xl === Infinity) { datarange.xl = 0; datarange.xr = 1; } else if (datarange.xl > datarange.xr) { From 97bbadb82742d435bc0c7bc87af367664920e35b Mon Sep 17 00:00:00 2001 From: Lukasz Mitusinski Date: Wed, 4 Jul 2018 16:21:23 +0200 Subject: [PATCH 2/5] #7625 fixed num to string conversion for nanoplot elements coordinates --- beakerx/beakerx/plot/chart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beakerx/beakerx/plot/chart.py b/beakerx/beakerx/plot/chart.py index 354a8d73cf..e5cf52ca69 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 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 3/5] #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)) { From 3c622ce3e6c50356f4ea7e8cc1df2afab99d4cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pior?= Date: Thu, 19 Jul 2018 14:41:34 +0200 Subject: [PATCH 4/5] #7625 fix --- beakerx/beakerx/plot/chart.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/beakerx/beakerx/plot/chart.py b/beakerx/beakerx/plot/chart.py index 354a8d73cf..ab1e238b74 100644 --- a/beakerx/beakerx/plot/chart.py +++ b/beakerx/beakerx/plot/chart.py @@ -442,11 +442,15 @@ def __init__(self, **kwargs): def add(self, item): super(NanoPlot, self).add(item) - converted = [] + convertedx = [] + convertedy = [] for l in self.chart.graphics_list: 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 From a89679d56ce0616cdbc574188b6ebfefbcc880fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pior?= Date: Thu, 19 Jul 2018 15:05:03 +0200 Subject: [PATCH 5/5] #7625 CR fix --- beakerx/beakerx/plot/chart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beakerx/beakerx/plot/chart.py b/beakerx/beakerx/plot/chart.py index ab1e238b74..0ef69bdbee 100644 --- a/beakerx/beakerx/plot/chart.py +++ b/beakerx/beakerx/plot/chart.py @@ -442,9 +442,9 @@ def __init__(self, **kwargs): def add(self, item): super(NanoPlot, self).add(item) - convertedx = [] - convertedy = [] for l in self.chart.graphics_list: + convertedx = [] + convertedy = [] for x in l.x: convertedx.append(str(x)) l.x = convertedx