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

Add radio options to ensure that gamma and palette are not set at the same time #2044

Merged
merged 16 commits into from
Jul 28, 2024

Conversation

sufyanAbbasi
Copy link
Collaborator

@sufyanAbbasi sufyanAbbasi commented Jun 14, 2024

  • The EE API disallows setting the gamma and palette vis_params at the same time. To account for this on the Code Editor, we use radio options, which is also disabled when the RGB band selector is selected.

  • I emulated this behavior such that when the 1 band option is set, we get both gamma and palette options, but when in rgb bands are selected, only the gamma slider is set.

  • I also made sure that the palette and gamma options are persistent between options clicked.

  • Also gamma and palette params passed into add_layer are also reflected.

  • TODO: Add unit tests

  • Tested on jupyter-lab locally and Colab: https://colab.research.google.com/drive/1Y_3iZp7FREo_hLsqycaaTvnM7xBjIBeq?usp=sharing

image

Screenshot 2024-06-13 at 7 46 31 PM Screenshot 2024-06-13 at 7 46 47 PM Screenshot 2024-06-13 at 7 46 58 PM Screenshot 2024-06-13 at 7 47 06 PM

Copy link
Collaborator

@naschmitz naschmitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Could you add some unit tests?

@giswqs giswqs merged commit 3643e9c into gee-community:master Jul 28, 2024
14 checks passed
@naschmitz naschmitz deleted the persist-viz-params branch July 31, 2024 19:32
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.

3 participants