-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[geo] Added DeckGL GeoJson layer #4097
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a bit of work to do here, mostly just around the color precedence rules.
label: t('Query'), | ||
expanded: true, | ||
controlSetRows: [ | ||
['geojson'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can fit those 2 controls on the same row here
{ | ||
label: t('GeoJson Settings'), | ||
controlSetRows: [ | ||
['fill_color_picker', null], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fit 2 color pickers on one row
@@ -143,6 +143,22 @@ export const controls = { | |||
renderTrigger: true, | |||
}, | |||
|
|||
fill_color_picker: { | |||
label: t('Fill Color'), | |||
description: t('Use to set fill color of geojson'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- t(' Set the opacity to 0 if you do not want to override the color specified in the GeoJSON')
|
||
stroke_color_picker: { | ||
label: t('Stroke Color'), | ||
description: t('Use to set stroke color of geojson'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- t(' Set the opacity to 0 if you do not want to override the color specified in the GeoJSON')
superset/data/__init__.py
Outdated
df = pd.read_json(f) | ||
df['features'] = df.features.map(json.dumps) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one empty line is enough
const sc = fd.stroke_color_picker; | ||
const data = payload.data.geojson.features.map(d => ({ | ||
...d, | ||
properties: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will fully override properties ind d
which is not what we want. We should enforce the precedence rule here.
I think it's a solid start. We can optimize for larger objects later on. |
* added deckgl geojson layer * linting * fixed comments * addressed comments * added override with controls.color_picker > 0 * set var properly * set colors if property doesnt exist at all * refacator on property mapping
* added deckgl geojson layer * linting * fixed comments * addressed comments * added override with controls.color_picker > 0 * set var properly * set colors if property doesnt exist at all * refacator on property mapping
Added DeckGLs GeoJson layer as a new visualization type. Added controls for setting
fillColor
,strokeColor
, andPoint Radius Scale
Features in this PR:
geojson.properties
object to DeckGL layergeojson.properties
from controls by setting the opacity(alpha) of the control = 0@mistercrunch