From 08a109972cf491079c224dfc8b17ca183454bcf1 Mon Sep 17 00:00:00 2001 From: Daniel Cruz Date: Thu, 20 Oct 2016 16:16:38 -0700 Subject: [PATCH 1/3] Fix bar value markers --- caravel/assets/visualizations/nvd3_vis.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/caravel/assets/visualizations/nvd3_vis.js b/caravel/assets/visualizations/nvd3_vis.js index 1cef68bf20e0a..aaab2347028e8 100644 --- a/caravel/assets/visualizations/nvd3_vis.js +++ b/caravel/assets/visualizations/nvd3_vis.js @@ -8,7 +8,6 @@ const nv = require('nvd3'); require('../node_modules/nvd3/build/nv.d3.min.css'); require('./nvd3_vis.css'); -const minBarWidth = 15; const animationTime = 1000; const addTotalBarValues = function (containerId, chart, data, stacked) { @@ -43,10 +42,11 @@ const addTotalBarValues = function (containerId, chart, data, stacked) { const xPos = parseFloat(rectObj.attr('x')); const rectWidth = parseFloat(rectObj.attr('width')); const t = groupLabels.append('text') - .attr('x', xPos) // rough position first, fine tune later - .attr('y', yPos - 5) + .attr('x', xPos + 5) // rough position first, fine tune later + .attr('y', yPos) + .style('font-size', '10px') .text(format(stacked ? totalStackedValues[index] : d.y)) - .attr('transform', transformAttr) + .attr('transform', transformAttr + 'rotate(-45,' + xPos + ',' + yPos +')') .attr('class', 'bar-chart-label'); const labelWidth = t.node().getBBox().width; t.attr('x', xPos + rectWidth / 2 - labelWidth / 2); // fine tune @@ -239,11 +239,15 @@ function nvd3Vis(slice) { const barchartWidth = function () { let bars; + let minBarWidth = 0; if (fd.bar_stacked) { bars = d3.max(payload.data, function (d) { return d.values.length; }); } else { bars = d3.sum(payload.data, function (d) { return d.values.length; }); } + if (fd.show_bar_value) { + minBarWidth = 10; + } if (bars * minBarWidth > width) { return bars * minBarWidth; } From 204332c449fb9eb084734f7f3c85cf94c264b7d5 Mon Sep 17 00:00:00 2001 From: Daniel Cruz Date: Thu, 20 Oct 2016 16:28:24 -0700 Subject: [PATCH 2/3] stop and remove pm2 entry during run_prod.sh --- run_prod.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run_prod.sh b/run_prod.sh index 5a48eb2116391..3347ab7bcbeec 100644 --- a/run_prod.sh +++ b/run_prod.sh @@ -1,4 +1,6 @@ #!/usr/bin/bash +/root/node_modules/pm2/bin/pm2 stop caravel +/root/node_modules/pm2/bin/pm2 delete caravel python setup.py develop From 49659d816569dd5a82430d52d3f85adfd023a173 Mon Sep 17 00:00:00 2001 From: Daniel Cruz Date: Fri, 21 Oct 2016 17:49:43 -0700 Subject: [PATCH 3/3] fix csv button --- caravel/viz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caravel/viz.py b/caravel/viz.py index 92d09c8c2c1e1..52f7f8e76885d 100755 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -354,7 +354,7 @@ def json_dumps(self, obj): def data(self): """This is the data object serialized to the js layer""" content = { - 'csv_end*point': self.csv_endpoint, + 'csv_endpoint': self.csv_endpoint, 'form_data': self.form_data, 'json_endpoint': self.json_endpoint, 'standalone_endpoint': self.standalone_endpoint,