Skip to content
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

Merged
merged 8 commits into from
Dec 22, 2017
Merged

[geo] Added DeckGL GeoJson layer #4097

merged 8 commits into from
Dec 22, 2017

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Dec 20, 2017

Added DeckGLs GeoJson layer as a new visualization type. Added controls for setting fillColor, strokeColor, and Point Radius Scale

Features in this PR:

  • Mapping color fields in geojson.propertiesobject to DeckGL layer
  • Ability to overwrite geojson.properties from controls by setting the opacity(alpha) of the control = 0

@mistercrunch

Copy link
Member

@mistercrunch mistercrunch left a 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'],
Copy link
Member

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],
Copy link
Member

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'),
Copy link
Member

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'),
Copy link
Member

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

df = pd.read_json(f)
df['features'] = df.features.map(json.dumps)


Copy link
Member

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: {
Copy link
Member

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.

@hughhhh
Copy link
Member Author

hughhhh commented Dec 22, 2017

The color picker is pretty slow when rendering the change to the canvas. We can do the following:

  • Move the property mapping into the python layer to improve performance
  • Add some loader specifically for these color picker controls

deckgl_geojson_picker

@mistercrunch
Copy link
Member

I think it's a solid start. We can optimize for larger objects later on.

@mistercrunch mistercrunch merged commit f905726 into apache:master Dec 22, 2017
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* 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
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* 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
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.23.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.23.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants