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: Add 'show/hide totals' option to pivot table vis (#3101)
Date Wed, 26 Jul 2017 04:11:41 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 4268513  Add 'show/hide totals' option to pivot table vis (#3101)
4268513 is described below

commit 426851365349523cf10930c5d3be834228019a8b
Author: Rich @ RadICS <rich@radics.co.uk>
AuthorDate: Wed Jul 26 06:11:38 2017 +0200

    Add 'show/hide totals' option to pivot table vis (#3101)
---
 superset/assets/javascripts/explore/stores/controls.jsx | 8 ++++++++
 superset/assets/javascripts/explore/stores/visTypes.js  | 2 +-
 superset/viz.py                                         | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/superset/assets/javascripts/explore/stores/controls.jsx b/superset/assets/javascripts/explore/stores/controls.jsx
index 1fdf868..03d1fbd 100644
--- a/superset/assets/javascripts/explore/stores/controls.jsx
+++ b/superset/assets/javascripts/explore/stores/controls.jsx
@@ -218,6 +218,14 @@ export const controls = {
     description: null,
   },
 
+  pivot_margins: {
+    type: 'CheckboxControl',
+    label: 'Show totals',
+    renderTrigger: false,
+    default: true,
+    description: 'Display total row/column',
+  },
+
   show_markers: {
     type: 'CheckboxControl',
     label: 'Show Markers',
diff --git a/superset/assets/javascripts/explore/stores/visTypes.js b/superset/assets/javascripts/explore/stores/visTypes.js
index 7d3f262..7291286 100644
--- a/superset/assets/javascripts/explore/stores/visTypes.js
+++ b/superset/assets/javascripts/explore/stores/visTypes.js
@@ -337,7 +337,7 @@ export const visTypes = {
         controlSetRows: [
           ['groupby', 'columns'],
           ['metrics', 'pandas_aggfunc'],
-          ['number_format'],
+          ['number_format', 'pivot_margins'],
         ],
       },
     ],
diff --git a/superset/viz.py b/superset/viz.py
index 1ae42b3..6778c35 100755
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -394,7 +394,7 @@ class PivotTableViz(BaseViz):
             columns=self.form_data.get('columns'),
             values=self.form_data.get('metrics'),
             aggfunc=self.form_data.get('pandas_aggfunc'),
-            margins=True,
+            margins=self.form_data.get('pivot_margins'),
         )
         return dict(
             columns=list(df.columns),

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

Mime
View raw message