mistercrunch commented on a change in pull request #4068: [geo] Add Deckgl 
GeoJson layer
URL: 
https://github.com/apache/incubator-superset/pull/4068#discussion_r157837610
 
 

 ##########
 File path: superset/assets/visualizations/deckgl/geojson.jsx
 ##########
 @@ -0,0 +1,43 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import { GeoJsonLayer } from 'deck.gl';
+
+import DeckGLContainer from './DeckGLContainer';
+
+function DeckGeoJsonLayer(slice, payload, setControlValue) {
+  const fd = slice.formData;
+  const c = fd.color_picker;
+  const data = payload.data.geojson.features.map(d => ({
+    ...d,
+    properties: {
+      fillColor: [c.r, c.g, c.b, 255 * c.a],
 
 Review comment:
   I still feel like there should be a way to not override the color defined in 
the GeoJSON (if any). We need better mapping and precedence rules here.
   
   First, a mapping from the spec to deck.gl's supported props.
   
   Then, clearable colorpickers (we could use opacity=0 as a hint to not 
override, opacity=0 could be the default), only if opacity!=0 do we override 
the GeoJSON provided colors.
   
   As a last resort, we should have a color if opacity=0 and color isn't 
defined in the geojson.
   
   All of this should be made clear in the controls tooltip.
   
   This is hard to model, let's chat about it.

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