-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat: Add deck.gl Heatmap Visualization #23551
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.
This is really exciting work @Mattc1221 ! I'm marking myself as a reviewer and will do my best to review+test this later this week. |
Hi @villebro I believe this PR should now be ready for review! However, I noticed the tests have not run and I was wondering if I needed to close the PR and open a new one? |
Running the tests... thanks for this PR! I hope to review/test as well in a day or three :) |
Codecov Report
@@ Coverage Diff @@
## master #23551 +/- ##
==========================================
- Coverage 68.23% 68.21% -0.02%
==========================================
Files 1942 1945 +3
Lines 75205 75241 +36
Branches 8145 8150 +5
==========================================
+ Hits 51314 51327 +13
- Misses 21806 21829 +23
Partials 2085 2085
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@rusackas Thanks for re-running the tests :) The failing tests should now be fixed! |
@@ -0,0 +1,82 @@ | |||
/** |
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.
Could you please refactor this file to typescript? I know that the rest of deckgl plugins are written in javascript, but our policy is to create the new files in typescript and SOME day refactor the old js files to ts too 🙂 (correct me if I'm wrong @rusackas)
@@ -0,0 +1,45 @@ | |||
/** |
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.
Same as above - js -> ts 🙏
Awesome first contribution, congrats! I left a comment about refactoring js to ts, but otherwise the code looks great 🎉 |
Thanks for the review @kgabryje 😀I'll update those JavaScript files to typescript sometime tomorrow evening! |
@kgabryje I really appreciate your first review! The changes requests should now be addressed and I would love to get another round of review! |
@Mattc1221 Sorry for the long delay and thank you for implementing the changes 🙂 Will merge as soon as the CI passes |
@Mattc1221 looks like there are some linting issues. |
8974271
to
a700bed
Compare
@kgabryje Thanks again for the review, and I apologize for the delayed response! I've rebased this branch to include the latest changes on the master branch and fixed the linting errors for the failing file |
Hey @kgabryje! could we run the CI tests again? With the latest changes, the tests pass locally and also on my GitHub actions page! ![]() |
@Mattc1221 I started CI and will review today 👍 |
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.
LGTM, really excited to see geospatial heatmaps arrive in Superset 🎉
Hi! This is really cool. Just deployed out and tested and everything looks good with the new heatmap chart type, but just FYI when you try to add the heatmap to the "deck.gl Multiple Layers" chart type it doesn't appear to be working. Wanted to mention this to see if it's a known issue. Thanks again! |
Big thanks to @kgabryje @villebro and @v1bg for reviewing this PR!
This may have been an oversight and may be a missing import in the Multiple Layers chart type. I'll look into this further later this week and open a corresponding issue! |
Awesome, appreciate it @Mattc1221! Great work here 🙏🏾 |
Hi, does this plugin/chart have extraProps enabled for javascript tooltips generator? When I try to use js code to generate tooltpis, I receive a javascript Uncaught TypeError: Cannot read properties of undefined (reading 'extraProps')". |
SUMMARY
Adds the heatmap layer from deck.gl here.
Related SIP: #23553
Rationale:
Superset already has supported functionality for other deck.gl visualization layers (e.g. Arc, Geojson, Grid, Hex, Path, Polygon, Scatter, Screengrid). Since Superset already contains the logic to handle deck.gl layers, it is straightforward and easy to maintain to add new deck.gl layers.
By expanding the range of available deck.gl visualization layers, users will have more options to choose from when creating their visualizations. This will allow them to tailor their visualizations to their specific needs and explore their data in different ways. It will also allow Superset to better compete with other data visualization tools on the market that offer a wider range of visualization options.
Overall, I think adding more deck.gl layers to Superset is a great idea and has the potential to significantly improve the user experience and the insights that users can gain from their data.
Design Decisions
The addition of the Heatmap layer follows the structure of existing deck.gl layers to maintain readability and consistency within the codebase.
Structure:
The directory
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/
contains the front end structure for the heat mapcontrolPanel
configures the form to grab relevant information specified by the user to create and tune the heatmap.Heatmap.jsx
contains functions that define the Heatmap Layer, control the tooltip when hover the chart, and to get relevant dataindex.js
serves as the wrapper for the heatmap component and provides a metadata function to grab information to descrive what this visualization is/doesThe Back End code for this feature follows the back end code for other deck.gl visualizations as well, providing functions to structure queried data for the Heatmap component.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
New visualization recording:
Screen.Recording.2023-04-01.at.9.20.50.PM.mov
TESTING INSTRUCTIONS
Charts
tab at the top of the screen+ Chart
button at the top rightDeck.gl Heatmap
or click on theMap
chart categorydeck.gl Heatmap
and hitCreate New Chart
Longitude & Latitude
field to the correct columnsWeight
functionCreate Chart
ADDITIONAL INFORMATION