To sketch high performing, interactive visualizations running in the browser and drawing inspiration from p5js
Project description
✏ ️ Panel Sketch
THIS IS PRE APLHA SOFTWARE AND YOU CANNOT EXPECT IT TO WORK.
The purpose of the panel-sketch
package is to make it easy for Pythonistas to quickly sketch interactive visualizations and other applications running in
- the browser. Potentially without a Python backend
- the Jupyter Notebook.
- your favorite editor or IDE.
It is heavily inspired by p5js, p5js sketches and pyp5js but not limited to the p5js universe. You can also think of it as a Code Sandbox or JS Fiddle but for #Python 🐍.
Check out the panel-sketch
examples on Binder
Jupyter Notebook | Jupyter Labs | Panel Apps |
---|---|---|
THE PANEL APPS LINK IS CURRENTLY NOT WORKING. FORM THE JUPYTER LAB ON BINDER YOU CAN START IT MANUALLY IN A TERMINAL USING
panel serve examples/pyp5js/gallery/gallery.py --static-dirs transcrypt=panel_sketch/sketch_compiler/assets/js/transcrypt/ --port=5007 --allow-websocket-origin=hub.gke2.mybinder.org
and open a link similar to https://hub.gke2.mybinder.org/user/marcskovmadsen-panel-sketch-zods9e4k/proxy/5007/gallery
.
It leverages Python
to Javascript
technologies. Currently Pyodide but potentially also Transcrypt, Brython or similar in the future.
License
The panel-sketch
python package and repository is open source and free to use (MIT License).
Installation
With pip
pip install panel-sketch
Usage
import panel_sketch as ps
import panel as pn
pn.extension('Sketch')
src = "https://github.com/holoviz/panel/raw/master/doc/_static/logo_stacked.png"
image_style = "height:95%;cursor: pointer;border: 1px solid #ddd;border-radius: 4px;padding: 5px;"
image_html = f"<img class='image-button' src='{src}' style='{image_style}'>"
sketch = Sketch(value=image_html, height=100, width=100)
pn.Column(sketch, pn.Param(sketch, parameters=["clicks"])).servable()
Reference Guides
Examples
Coming up
Additional Resources
You can find more inspiration via the links below.
Roadmap
When I get the time I would like to
- Support Transcrypt for compiling
- Support alternatives to p5js like three.js
- Support extensions to p5js like m5.js
- Add badges for 100% test coverage etc.
- Distribute as conda package
Change Log
- 20210410: First Release to PyPi.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for panel_sketch-20210411.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 285a071ea0d51f4488a45e63c4e889a06c023ec1266ae09e7b237db7a14f0d9c |
|
MD5 | e88604a8d77a93364c4b5d2f6f241709 |
|
BLAKE2b-256 | 573818e1664f907e553af2138d3dbf2848a919fec181f3e785eeb2c6b8900b43 |