deck.gl
deck.gl copied to clipboard
[Feat] Applying widget styles on Deck
Target Use Case
Widget theming is currently difficult from the javascript interface since they must be applied to each widget individually. We could utilize Deck's style prop or a new high level prop to conveniently apply style customizations to all widgets.
This would also be a good opportunity to change some special style extracting logic we do in the DeckGL react component. https://github.com/visgl/deck.gl/blob/master/modules/react/src/deckgl.ts#L234
Proposal
Change the behavior of the Deck style prop support nested objects for styling the widget containers. Currently the style prop only applies CSS properties to deck's canvas, which have no effect on widgets. We can leave this existing behavior in place and filter out the nested object before applying the properties.
new Deck({
style: {
backgroundColor: "white",
widgets: {
// your styles here
}
}
});
Regarding the React DeckGL component, we could add an explicit key in style for the react container instead of extracting styles:
<DeckGL
style={{
backgroundColor: "white",
container: {
// your react styles here
}
}}
/>
Open to discussion on if this react behavior should be a breaking change in v9, or if there's a compelling reason to keep it backwards compatible.
Any feedback @ibgreen, @ilyabo, @alasarr, @Pessimistress?