Fix deck.gl sample charts with js (#7749)

* Fix js_data_mutator

* Remove redundant line change

* Add missing line changes
This commit is contained in:
Ville Brofeldt 2019-06-24 01:53:26 +03:00 committed by Maxime Beauchemin
parent 9c0c16c71b
commit 1df4fa26c2
1 changed files with 9 additions and 6 deletions

View File

@ -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': '',