You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2019/06/23 22:53:35 UTC

[incubator-superset] branch master updated: Fix deck.gl sample charts with js (#7749)

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 1df4fa2  Fix deck.gl sample charts with js (#7749)
1df4fa2 is described below

commit 1df4fa26c25e63330ec7d8bfc93f1f13a418705f
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Mon Jun 24 01:53:26 2019 +0300

    Fix deck.gl sample charts with js (#7749)
    
    * Fix js_data_mutator
    
    * Remove redundant line change
    
    * Add missing line changes
---
 superset/data/deck.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/superset/data/deck.py b/superset/data/deck.py
index 80e7581..398255c 100644
--- a/superset/data/deck.py
+++ b/superset/data/deck.py
@@ -416,10 +416,11 @@ def load_deck_dash():
             'population',
             'area',
         ],
-        'js_datapoint_mutator':
-            '(d) => {\n    d.elevation = d.extraProps.population/d.extraProps.area/10\n \
-         d.fillColor = [d.extraProps.population/d.extraProps.area/60,140,0]\n \
-         return d;\n}',
+        'js_data_mutator':
+            'data => data.map(d => ({\n'
+            '    ...d,\n'
+            '    elevation: d.extraProps.population/d.extraProps.area/10,\n'
+            '}));',
         'js_tooltip': '',
         'js_onclick_href': '',
         'where': '',
@@ -533,8 +534,10 @@ def load_deck_dash():
         'js_columns': [
             'color',
         ],
-        'js_datapoint_mutator': 'd => {\n    return {\n        ...d,\n        color: \
-            colors.hexToRGB(d.extraProps.color),\n    }\n}',
+        'js_data_mutator': 'data => data.map(d => ({\n'
+                           '    ...d,\n'
+                           '    color: colors.hexToRGB(d.extraProps.color)\n'
+                           '}));',
         'js_tooltip': '',
         'js_onclick_href': '',
         'where': '',