Bokeh Joystick Widget
This is a custom widget for the Python Bokeh library that allows you to control a joystick via mouse drags or touch gestures.
The widget has x and y properties that are updated as the joystick is moved. The x and y properties are in the range -100 to 100.
The widget is derived from https://github.com/bobboteck/JoyStick/.
Setup
Install with pip:
pip install bokeh-joystick-widget
Or poetry:
poetry add bokeh-joystick-widget
Usage
In your bokeh app, you can use the joystick widget like this:
from bokeh_joystick_widget import JoystickWidget
:
# some plot
:
joystick = JoystickWidget()
joystick.on_change("position", lambda attr, old, new: print(f'x: {new["x"]}, y: {new["y"]}'))
:
:
show(column(joystick, plot))
Examples
There are 3 examples:
- examples/static_joystick_example.py - show a column with a plot and the joystick, then exit.
- examples/console_joystick_example.py - show a plot and the joystick in a bokeh server app. Callbacks from the front end drive console logs of the joystick position.
- examples/bigger_joystick.py - Scale the size of the rendered joystick.
Screenshots
Output data:
Roadmap
- Get the example JS demo widget/bokeh model to work - whatever that widget is. - done
- Figure out how to get values back to the python end with it. - done
- Figure out how to swap their control for the joystick (however hacky) - done
- Note - this is a TS file from the original, adapted here. The DOM element change is important.
- Figure out how to make that tidier. - done
- Figure out how to publish to PyPi (alpha) and test in a pip installed test. - done
Metadata
Release files for bokeh-joystick-widget 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bokeh_joystick_widget-0.3.3.tar.gz | 8.3 kB | Without provenance | Details for bokeh_joystick_widget-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bokeh_joystick_widget-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for bokeh_joystick_widget-0.3.3-py3-none-any.whl |
Total release size: 17.4 kB
Release files / bokeh_joystick_widget-0.3.3.tar.gz
| Download URL | bokeh_joystick_widget-0.3.3.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ca710c56c54440c2271ea519fa60b939d78c40f38a9b2f82baaec5884d5b94c
|
|
BLAKE2b-256 checksum How to use checksums |
7e699cd52182997a17e8e7fd3dcd7514e8bed7e7e9821e614303194889f0ff04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.18 Darwin/21.6.0
|
Release files / bokeh_joystick_widget-0.3.3-py3-none-any.whl
| Download URL | bokeh_joystick_widget-0.3.3-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6857b969e2b57afda1b7e243061f8944278414ce85f787167f6ee9eb7976e7a5
|
|
BLAKE2b-256 checksum How to use checksums |
b39b60cd745ae8829f40c10e0dcdacc380f3d4d0700cf6fc8d557a3714c21601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.18 Darwin/21.6.0
|
Security for bokeh-joystick-widget 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.