superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Fxing bug in label generation for multiple groupbys (#3594)
Date Wed, 04 Oct 2017 16:40:34 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 15ecdeb  Fxing bug in label generation for multiple groupbys (#3594)
15ecdeb is described below

commit 15ecdeb3ba4eba7c13c88edfb197f255803cac89
Author: fabianmenges <fabianmenges@users.noreply.github.com>
AuthorDate: Wed Oct 4 12:40:30 2017 -0400

    Fxing bug in label generation for multiple groupbys (#3594)
---
 superset/assets/visualizations/nvd3_vis.js | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/superset/assets/visualizations/nvd3_vis.js b/superset/assets/visualizations/nvd3_vis.js
index 1353968..681ceae 100644
--- a/superset/assets/visualizations/nvd3_vis.js
+++ b/superset/assets/visualizations/nvd3_vis.js
@@ -77,17 +77,16 @@ function getMaxLabelSize(container, axisClass) {
 /* eslint-disable camelcase */
 function formatLabel(column, verbose_map) {
   let label;
-  if (verbose_map) {
-    if (Array.isArray(column) && column.length) {
-      label = verbose_map[column[0]];
-      if (column.length > 1) {
-        label += `, ${column.slice(1).join(', ')}`;
-      }
-    } else {
-      label = verbose_map[column];
+  if (Array.isArray(column) && column.length) {
+    label = verbose_map[column[0]] || column[0];
+    if (column.length > 1) {
+      label += ', ';
     }
+    label += column.slice(1).join(', ');
+  } else {
+    label = verbose_map[column] || column;
   }
-  return label || column;
+  return label;
 }
 /* eslint-enable camelcase */
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message