-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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 Contour Layer #24154
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24154 +/- ##
==========================================
- Coverage 69.08% 68.95% -0.13%
==========================================
Files 1906 1913 +7
Lines 74159 74333 +174
Branches 8161 8196 +35
==========================================
+ Hits 51235 51260 +25
- Misses 20805 20954 +149
Partials 2119 2119
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 |
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx
Outdated
Show resolved
Hide resolved
Thanks @kgabryje for the detailed review, I believe I've addressed all of your comments!
You should now be able to change isobands to isolines, the Save button closes the form, I've added some validation messages and disabled saving when the lower threshold is greater than or equal to the upper threshold. The tooltip should now appear with the lat/long coordinates as well as the threshold for whatever contour the mouse is hovering. Screen.Recording.2023-08-25.at.2.05.36.AM.movNote: I will re-request review once all tests are passing! |
Thanks for updates @Mattc1221! 1 last thing - for some reason, the inputs unfocus after typing 1 character, which makes typing more than 1 digit difficult. I didn't notice that happening before the latest changes Screen.Recording.2023-08-28.at.13.18.56.mov |
@kgabryje I'm sorry about the delay! The last comment on the unfocusing issues should now be fixed. I had pulled out the tabs sections into functions within the component. This was causing them to get re-rendered on every change and thus lose focus. I've put them inside of the return statement of the surrounding component and that seems to have fixed the issue Screen.Recording.2023-09-28.at.10.44.51.PM.mov |
@villebro @kgabryje @rusackas @justinpark @michael-s-molina I was wondering if one of you could take a final pass through this PR. All of the previous comments have been addressed and the PR should be ready to go. |
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! Thank you @Mattc1221 for the hard work... and patience 😄
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
Adds the Contour Layer from deck.gl here
Related SIP: #23553
Design Decisions:
The addition of the Contour 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/Contour/
contains the Front end structure for the contour layer visualization.controlPanel
configures the form to grab relevant information specified by the user to create and tune the contour layer.Contour.tsx
contains the functions that define the Contour Layer and get relevant data.index.ts
serves as the wrapper for the contour component and provides a metadata function to grab information to describe what this visualization is/does.The contour layer requires a unique input of "contours". Contours are defined as either
Isolines
orIsobands
(more information here).Isolines
require three fields,threshold
,color
,strokeWidth
.threshold
defines a value to separate aggregated values on the Map.strokeWidth
defines the width of the line in pixels that separates these values.color
is just the color of that line.Isobands
are similar toIsolines
, except thethreshold
takes 2 values to create polygons on the map instead of lines.To account for this unique structure, I added a new control panel input component:
The added files for this input component are located under
superset-frontend/src/explore/components/controls/ContourControl/
:types.ts
contains all the types needed for this new component.index.tsx
controls the stateful variables that control adding/editing/removing contours.ContourOption.tsx
displays added contours and an appropriate tooltip.ContourPopoverControl.tsx
defines a popup with appropriate inputs for creating/editing anisoline
andisoband
.ContourPopoverTrigger.tsx
wraps theContourPopoverControl
and controls when it is displayed.The 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-05-20.at.11.50.42.PM.mov
Changing order of contours
Screen.Recording.2023-05-21.at.12.11.38.AM.mov
TESTING INSTRUCTIONS
Set up
Charts
tab at the top of the screen+ Chart
button at the top rightDeck.gl Contour
or click on theMap
chart categorydeck.gl Contour
and hitCreate New Chart
Longitude & Latitude
field to the correct columnsWeight
functionCreate Chart
Cell Size
parameter is not large enough. For example, using theflights
dataset, you should increaseCell Size
to 50000.Check that the following cause an immediate update
Cell Size
controlClick to add new contour
Click to add new contour
Other Checks:
ADDITIONAL INFORMATION