Skip to content

auto connect a ipywidget slider to a linear and linear region selector #298

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

Merged
merged 5 commits into from
Sep 11, 2023

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Sep 7, 2023

implements #297 for int and float sliders

@minel-arinel

Usage:

# make ipywidget
ipywidget_slider = IntSlider(min=0, max=100, description="slider")

# connect to selector
selector.add_ipywidget_handler(ipywidget_slider)

@kushalkolar kushalkolar requested a review from clewis7 September 7, 2023 17:41
@kushalkolar
Copy link
Member Author

ipywidget -> selector is working well, selector -> ipywidget is not working well if the step size is not 1, it's wonky and jumpy

@kushalkolar
Copy link
Member Author

ok this works now, made an attr _moving for BaseSelector :D

@kushalkolar
Copy link
Member Author

Implemented for LinearRegionSelector as well, and made limits a settable proprety for both LinearRegionSelector and LinearSelector.

@clewis7 will merge after your review

linear-2023-09-09_20.46.01.mp4
linear_region-2023-09-09_20.47.01.mp4

Copy link
Member

@clewis7 clewis7 left a comment

Choose a reason for hiding this comment

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

mostly looks good to me, I think just some more code comments would be helpful for understanding what is going on

From what I see, and correct me if I am wrong...

A user will create an ipywidget slider and then can add this to a linear selector using the "add" method; internally you set up the widget to have bidirectional linkage with the associated linear selector

A given selector looks like it can have more than one associated ipywidget, which are managed by a private list

@kushalkolar kushalkolar merged commit 2b97c9d into master Sep 11, 2023
@kushalkolar kushalkolar changed the title auto connect a ipywidget slider to a linear selector auto connect a ipywidget slider to a linear and linear region selector Sep 11, 2023
@kushalkolar
Copy link
Member Author

A user will create an ipywidget slider and then can add this to a linear selector using the "add" method; internally you set up the widget to have bidirectional linkage with the associated linear selector

Yes, they add a handler.

A given selector looks like it can have more than one associated ipywidget, which are managed by a private list

yes

@kushalkolar kushalkolar deleted the linear-selector-widget-connect branch September 21, 2023 00: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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy