[Bug] pydeck get_fill_color expression parser only if first element is str
Open
@ajduberstein is already working on this.
Since Apr 20, 2022.
bug
pydeck
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Description
I can use pydeck get_fill_color expression parser only if the first element is str type.
get_fill_color=["lng > 0 ? 255 : 88", "lng > 0 ? 255 : 88", "lng > 0 ? 255 : 88"], -> OK
get_fill_color=["255", "lng > 0 ? 255 : 88", "lng > 0 ? 255 : 88"], -> OK
get_fill_color=[255, "lng > 0 ? 255 : 88", "lng > 0 ? 255 : 88"], -> Not OK
Flavors
- React
- Python/Jupyter notebook
- MapboxLayer
- GoogleMapsOverlay
- CartoLayer
- DeckLayer/DeckRenderer for ArcGIS
Expected Behavior
get_fill_color to parse other elements when mix of str and int
Steps to Reproduce
# this works
layer = pdk.Layer(
"ScatterplotLayer",
UK_ACCIDENTS_DATA,
get_position=["lng", "lat"],
auto_highlight=True,
get_radius=1000,
get_fill_color=['255', "lng > 0 ? 255 : 88", "lng > 0 ? 255 : 88"],
pickable=True,
)
# this shows all red
layer = pdk.Layer(
"ScatterplotLayer",
UK_ACCIDENTS_DATA,
get_position=["lng", "lat"],
auto_highlight=True,
get_radius=1000,
get_fill_color=[255, '255', '255'],
pickable=True,
)
Environment
- Framework version: 0.7.1
- Browser: Chrome
- OS: Win10
Logs
no messages
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.