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 2018/01/25 00:26:35 UTC

[GitHub] mistercrunch closed pull request #4270: deck_multi to pass down filters to layers

mistercrunch closed pull request #4270: deck_multi to pass down filters to layers
URL: https://github.com/apache/incubator-superset/pull/4270
 
 
   

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/deckgl/multi.jsx b/superset/assets/visualizations/deckgl/multi.jsx
index 63f1a88011..a1bac28903 100644
--- a/superset/assets/visualizations/deckgl/multi.jsx
+++ b/superset/assets/visualizations/deckgl/multi.jsx
@@ -32,11 +32,26 @@ function deckMulti(slice, payload, setControlValue) {
   };
   render();
   payload.data.slices.forEach((subslice) => {
-    const url = getExploreUrl(subslice.form_data, 'json');
+    // Filters applied to multi_deck are passed down to underlying charts
+    // note that dashboard contextual information (filter_immune_slices and such) aren't
+    // taken into consideration here
+    let filters = subslice.form_data.filters.concat(fd.filters);
+    if (fd.extra_filters) {
+      filters = filters.concat(fd.extra_filters);
+    }
+    const subsliceCopy = {
+      ...subslice,
+      form_data: {
+        ...subslice.form_data,
+        filters,
+      },
+    };
+
+    const url = getExploreUrl(subsliceCopy.form_data, 'json');
     $.get(url, (data) => {
       // Late import to avoid circular deps
-      const layer = layerGenerators[subslice.form_data.viz_type](subslice.form_data, data);
-      slice.subSlicesLayers[subslice.slice_id] = layer; // eslint-disable-line no-param-reassign
+      const layer = layerGenerators[subsliceCopy.form_data.viz_type](subsliceCopy.form_data, data);
+      slice.subSlicesLayers[subsliceCopy.slice_id] = layer; // eslint-disable-line no-param-reassign
       render();
     });
   });


 

----------------------------------------------------------------
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