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/12/28 20:51:20 UTC

[GitHub] mistercrunch commented on a change in pull request #4134: [Geo] Added DeckGL Arc Layer

mistercrunch commented on a change in pull request #4134: [Geo] Added DeckGL Arc Layer
URL: https://github.com/apache/incubator-superset/pull/4134#discussion_r158984268
 
 

 ##########
 File path: superset/viz.py
 ##########
 @@ -1998,6 +2000,42 @@ def get_data(self, df):
         }
 
 
+class DeckArc(BaseDeckGLViz):
+
+    """deck.gl's Arc Layer"""
+
+    viz_type = 'deck_arc'
+    verbose_name = _('Deck.gl - Arc')
+
+    def query_obj(self):
+        d = super(DeckArc, self).query_obj()
+        from pprint import pprint
+        pprint(d)
+        return d
+
+    def get_data(self, df):
+        fd = self.form_data
+        start_lat = df[fd.get('start_spatial').get('latCol')]
+        start_lon = df[fd.get('start_spatial').get('lonCol')]
+        end_lat = df[fd.get('end_spatial').get('latCol')]
+        end_lon = df[fd.get('end_spatial').get('lonCol')]
+        source_pos = list(zip(start_lon, start_lat))
+        target_pos = list(zip(end_lon, end_lat))
+
+        data = []
+        for pos in list(zip(source_pos, target_pos)):
+            data.append({
+                         'sourcePosition': pos[0],
+                         'targetPosition': pos[1],
+                         'color': [255, 0, 0],
 
 Review comment:
   always red? Let's use the color picker here and perhaps do this on the client side so it can take effect without re-running a query.

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