-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Integrate Kepler.gl as a new visualization type #6403
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6403 +/- ##
=========================================
- Coverage 65.43% 64.64% -0.8%
=========================================
Files 432 428 -4
Lines 21319 20696 -623
Branches 2347 2291 -56
=========================================
- Hits 13951 13378 -573
+ Misses 7252 7192 -60
- Partials 116 126 +10
Continue to review full report at Codecov.
|
6b4212b
to
0258e50
Compare
Improved the solution to support saving the state properly, using its own redux store, autozoom, readonly and more. |
superset/assets/package.json
Outdated
@@ -81,7 +81,7 @@ | |||
"d3-tip": "^0.9.1", | |||
"datamaps": "^0.5.8", | |||
"datatables.net-bs": "^1.10.15", | |||
"deck.gl": "^5.3.5", | |||
"deck.gl": "^5.3.4", |
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 to align Kepler's deck.gl dep with Superset's. It's important as having 2 versions of deck.gl errors out.
0bc30f9
to
1390e96
Compare
7c76f1f
to
ba783fb
Compare
Accidentally found this PR. Great work! let us know if you need any help on our side. I found your next item is to change the styling. You can follow This issue, it will make overriding style a lot easier! |
@mistercrunch any movement on this in getting to the next version of deck? |
@heshan0131 I missed the notification on your previous comment, but thank you for your note! The main things I had questions around are:
|
@mistercrunch kepler.gl currently doesn't have a prop to listen on Something like: import {KeplerGlSchema} from 'kepler.gl/schemas';
import {taskMiddleware} from 'react-palm/tasks';
let previousValue = null;
const stateChangeMiddleware = store => next => action => {
const returnValue = next(action);
const keplerState = store.getState().keplerGl.map;
const stateToSave = KeplerGlSchema.getConfigToSave(keplerState);
const hash = JSON.stringify(stateToSave);
if (previousValue !== hash) {
// do something here
console.log('kepler.gl state has changed');
previousValue = hash;
}
return returnValue;
};
const middlewares =[taskMiddleware, stateChangeMiddleware];
const enhancers = [applyMiddleware(...middlewares)];
const store = createStore(reducers, {}, compose(...enhancers));
return store; |
Also we don't have a complete light theme yet (also on our todo list) |
@heshan0131 this is super helpful, thanks for the input and the great tool! |
@heshan0131, I made it work! I had to adapt the code a little and rate limit the changes as it made the map interactions sluggish (we update a control onChange and causes a chain of renders). |
Looks like theme support is in a newer version. I have a branch trying to upgrade kepler + deck to latest |
You can try skip using |
Good input, thought we want to capture the viewport in the state, so the rate limiting option seems like like the best option for now. |
@betodealmeida @xtinec @vylc Kepler properly save its state into Superset after the changes I added recently |
Kepler.gl is an amazing geospatial React application. It offers a very well designed user interface to compose geo layers and slice and dice geospatial data. As it turns out, Kepler is designed to be embedded as part of React apps. It took me only a few hours to get to a working prototype. Next steps: * allow to save the state, without the data * restore the state, and merge with the new data * tweak styles, make a light style that looks decent within Superste, Kepler uses stylable components, so that should be somewhat straigthforward
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
@mistercrunch Any ideas when this will make it to Superset? |
It should be easy to re-do this based on the new plugin interface. |
@mistercrunch I still had issues with that. I tried using both kepler and deckgl then I tried replacing deckgl with kepler, these are the errors I get:
What exactly should I use, the README.md of the kepler plugin is a copy paste of the deckgl plugin. |
Kepler.gl is an amazing geospatial React application. It offers a very
well designed user interface to compose geo layers and slice and dice
geospatial data.
As it turns out, Kepler is designed to be embedded as part of React
apps. It took me only a few hours to get to a working prototype.
Next steps: