hughhhh commented on a change in pull request #4096: Multi layers DECK.GL 
visualization
URL: 
https://github.com/apache/incubator-superset/pull/4096#discussion_r158728276
 
 

 ##########
 File path: superset/viz.py
 ##########
 @@ -1768,6 +1770,35 @@ def get_data(self, df):
         }
 
 
+class DeckGLMultiLayer(BaseViz):
+
+    """Pile on multiple DeckGL layers"""
+
+    viz_type = 'deck_multi'
+    verbose_name = _('Deck.gl - Multiple Layers')
+
+    is_timeseries = False
+    credits = '<a href="https://uber.github.io/deck.gl/";>deck.gl</a>'
+
+    def query_obj(self):
+        return None
+
+    def get_data(self, df):
+        fd = self.form_data
+        # Late imports to avoid circular import issues
+        from superset.models.core import Slice
+        from superset import db
+        slice_ids = fd.get('deck_slices')
+        slices = db.session.query(Slice).filter(Slice.id.in_(slice_ids)).all()
+        data = []
+        for slc in slices:
 
 Review comment:
   nit: `data = [slc for slc in slices]`
   I would even put the `[slc for slc in slices]` in the actual return statement
   ```
   return {
      'mapboxApiKey': config.get('MAPBOX_API_KEY'),
      'slices': [slc for slc in slices]
   }
   
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to