- Notifications
You must be signed in to change notification settings - Fork0
A versatile slider with fine-tuned control, adjustable precision, and direct text input for exact values.
License
panel-extensions/panel-precision-slider
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A versatile slider with fine-tuned control, adjustable precision, and direct text input for exact values.
- Toggle Between Slider and Input: Switch between a slider and a direct input field for value selection.
- Adjustable Step Size: Show or hide the step size adjustment slider to control the precision of the value.
- Customizable Icons: Use toggle icons to enhance the user interface for swapping views and showing steps.
This project isin its early stages, so if you find a version that suits your needs, it’s recommended topin your version, as updates may introduce changes.
Install it viapip:
pip install panel-precision-slider
importpanel_precision_slider
git clone https://github.com/panel-extensions/panel-precision-slidercd panel-precision-sliderFor a simple setup useuv:
uv venvsource .venv/bin/activate# on linux. Similar commands for windows and osxuv pip install -e .[dev]pre-commit run installpytest tests
For the full Github Actions setup usepixi:
pixi run pre-commit-installpixi run postinstallpixi runtestThis repository is based oncopier-template-panel-extension (you can create your own Panel extension with it)!
ThePrecisionSlider is a custom Panel component that provides a synchronized slider and input field for selecting numerical values with adjustable precision. Users can toggle between a slider and a direct input field, as well as show or hide the step size adjustment.
importpanelaspnfrompanel_precision_sliderimportPrecisionSliderpn.extension()# Instantiate the PrecisionSliderprecision_slider=PrecisionSlider(value=5,min=0,max=10,step=0.1,show_step=True,swap=False)# Display the sliderprecision_slider
You can integratePrecisionSlider with other Panel widgets and layouts to build interactive dashboards.
importpanelaspnimportnumpyasnpimportholoviewsashvfrompanel_precision_sliderimportPrecisionSliderhv.extension('bokeh')pn.extension()defsine_wave(frequency):x=np.linspace(0,10,500)y=np.sin(2*np.pi*frequency*x)returnhv.Curve((x,y),'x','sin(2πfx)')precision_slider=PrecisionSlider(name="Select Value",value=2.5,min=0,max=5,step=0.05)sine_plot=pn.bind(sine_wave,precision_slider.param.value)layout=pn.Column("### Precision Slider Example",precision_slider,sine_plot)layout.servable()
Note:copier will showConflict for files with manual changes during an update. This is normal. As long as there are no merge conflict markers, all patches applied cleanly.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature. - Make your changes and commit them:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/YourFeature. - Open a pull request.
Please ensure your code adheres to the project's coding standards and passes all tests.
About
A versatile slider with fine-tuned control, adjustable precision, and direct text input for exact values.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.
