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

Problem customizing RegionPicker component #104

Open
Jakidxav opened this issue Jan 19, 2024 · 1 comment
Open

Problem customizing RegionPicker component #104

Jakidxav opened this issue Jan 19, 2024 · 1 comment

Comments

@Jakidxav
Copy link

I am having trouble customizing the <RegionPicker /> component. I want to create a <RegionPicker /> with a set radius without the floating handle, similar to the look and functionality of the region picker in the ncview-js package. I feel like this should be as easy as setting the FLOATING_HANDLE variable to False before it gets read into the <CircleRenderer /> component, but I am having trouble mixing pre-built components from imports ('@carbonplan/components') and customizing them from src/.

simplified_region_picker

I want to be able to see the value (or average value) of the <Raster /> component within particular cells at a given resolution (~1km, in my case). However, this is problematic when the minRadius prop is quite small, where the floating handle blocks grabbing and moving the <RegionPicker />. I experimented with creating a <RegionPicker /> with a set radius (minRadius = maxRadius), but didn't have any luck there, either, as the floating handle just spins around the central point without moving at lower resolutions.

default_region_picker region_picker_close_up

Would the dev team consider adding in the ability to remove the floating handle portion of the <RegionPicker /> via a prop in the future?

@katamartin
Copy link
Member

Hey @Jakidxav thanks for issue and sorry for the delay!

You are right that the floating handle is always rendered, and it looks like this is controlled by this constant. It should be relatively straightforward to convert that constant into a prop passed down to the CircleRenderer component, but we would need to test this. We don't have capacity to implement ourselves right now, but could definitely review a PR if you have the time and are still interested in this feature!

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

No branches or pull requests

2 participants