Skip to content
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

Workaround for pydeck magic/array handling #97

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

kylebarron
Copy link
Contributor

By default Pydeck does special handling for prop inputs. This means that pydeck 0.4.0 can't pass an array of strings to the JS layer without them being considered a function.

This is a workaround "hack" that binds selected layer properties directly to the Layer instance instead of passing those properties as kwargs (keyword arguments) to the pydeck.Layer constructor. This bypasses Pydeck's magic handling of prop inputs.

It works because when Pydeck serializes the layer, it calls vars(layer), which assembles the layer's attributes in a dict.

Ref visgl/deck.gl#4897

@kylebarron kylebarron merged commit 9b2fddf into master Aug 27, 2020
@kylebarron kylebarron deleted the kyle/pydeck-magic-workaround branch August 27, 2020 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants