You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2017/11/07 21:34:34 UTC

[GitHub] graceguo-supercat closed pull request #3793: Adding back iso and correctly filtering iso from contrib total

graceguo-supercat closed pull request #3793: Adding back iso and correctly filtering iso from contrib total
URL: https://github.com/apache/incubator-superset/pull/3793
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/visualizations/time_table.jsx b/superset/assets/visualizations/time_table.jsx
index 553310892e..42e929e331 100644
--- a/superset/assets/visualizations/time_table.jsx
+++ b/superset/assets/visualizations/time_table.jsx
@@ -38,7 +38,7 @@ function viz(slice, payload) {
   slice.container.css('height', slice.height());
   const records = payload.data.records;
   const fd = payload.form_data;
-  const data = Object.keys(records).sort().map(iso => ({ ...records[iso] }));
+  const data = Object.keys(records).sort().map(iso => ({ ...records[iso], iso }));
   const reversedData = [...data].reverse();
   const metricMap = {};
   slice.datasource.metrics.forEach((m) => {
@@ -140,7 +140,7 @@ function viz(slice, payload) {
         } else if (c.colType === 'contrib') {
           // contribution to column total
           v = recent / Object.keys(reversedData[0])
-          .map(k => reversedData[0][k])
+          .map(k => k !== 'iso' ? reversedData[0][k] : null)
           .reduce((a, b) => a + b);
         } else if (c.colType === 'avg') {
           // Average over the last {timeLag}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services