-
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
[SIP-5] Remove references to slice from all deck.gl components. #6039
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6039 +/- ##
=======================================
Coverage 77.59% 77.59%
=======================================
Files 47 47
Lines 9496 9496
=======================================
Hits 7368 7368
Misses 2128 2128 Continue to review full report at Codecov.
|
Could somebody take a look at this one, please? |
document.getElementById(slice.containerId), | ||
); | ||
} | ||
|
||
module.exports = { |
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.
curious if this works with export default { ... }
syntax (I think maybe would need to update the vis index/promise file, nbd if you don't want to do that in this PR)
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 LGTM with some comments that might be out of scope.
@mistercrunch @betodealmeida do you want to take a look since you're more familiar with this code?
I am hoping to merge this one to unblock the embeddable chart works. @betodealmeida @mistercrunch if you have any comment or concern, could you let me know by EOD, please? Otherwise I will assume it is good to proceed. |
gonna merge since we haven't heard anything. |
…he#6039) * start removing slice. * migrate arc * refactor arc * refactor path * refactor deck polygon * remove commented code * refactor factory function * refactor grid * refactor hex * refactor polygon * refactor scatter * refactor geojson * refactor screengrid * remove unnecessary nesting * add proptypes * add proptypes * refactor deck.gl Multi * fix lint * Use export syntax instead of module.exports
Decouple all visualization components from the parent container (Currently passed in as
slice
). This is the last part of SIP-5 #5680 and is important to unblock the work on chart plugin system.This PR is slightly different from other SIP-5 PRs because those also decouple visualization code from
formData
, but for this PR, I am leavingformData
as-is.Also, create utility function
createAdaptor
particularly for deck.gl components. This function handles extracting the necessary fields fromslice
, then calls ReactDOM and render the given React Component onto the target DOM element, passing it the transformedprops
.Most of deck.gl components have lots of similarity and most can be defined by 3 factors:
getLayer
functiongetPoints
functionDeckGLContainer
orCategoricalDeckGLContainer
so I create two factory functions in
factory.jsx
that create a React component givengetLayer
andgetPoints
. Seearc.jsx
for example of how the code was simplified.The two exceptions are
ScreenGrid
andGeoJson
that are different.I have verified with example data and they are working.
@betodealmeida @mistercrunch @xtinec @williaster @conglei