<commit_before># Jupyter Canvas Widget

**This is very much a work in progress!**

There already exists a Jupyter Image Widget that works just fine, so make another one?  The image
widget that provided by [ipywidgets]() takes of the tricky work involving transfering compressed
image data from the backend to the frontend.  But it leaves it to the using to handle converting an
array of image data into a sequence of compressed image bytes.  It also doesn't readily support
mouse events via Python callback functions.

And that's where this project comes in.  Jupyter Canvas Widget uses the HTML5 Canvas element
instead of the Image element.  The Canvas element inherently supports mouse events and this widget
passes them along to the Python backend.  This makes it very easy for the user to create
interactive Notebook applications that can respond to mouse motion, click, and wheel events via
Python callback functions.


## Features

- Accept image data from Numpy arrays or URLs
- Support Python callback functions for front-end mouse events
- Support Canvas affine transform operations (work in progress)
- Widget properties `width` and `height` allow for direct manipulation displayed image size,
  independent of source data size
- Leverage Jupyter ipywidgets native support for transfering binary data between backend and
  frontend (no more encode-64)
-

# Work-in-Progress

In the near-term I simply want a robust tool for displaying images from numpy data arrays.  This
will require the following functionality:<commit_msg>update notes<commit_after># Jupyter Canvas Widget

**This is very much a work in progress!**

There already exists a Jupyter Image Widget ([ipywidgets](https://github.com/jupyter-widgets/ipywidgets)),
so make another one?  That widget takes care of the tricky work involving transfering compressed
image data from the backend to the frontend.  But it leaves it to the user to handle converting an
array of image data into a sequence of compressed image bytes.  It also doesn't readily support
mouse events via Python callback functions.

And that's where this project comes in.  Jupyter Canvas Widget uses the HTML5 Canvas element
instead of the Image element.  The Canvas element inherently supports mouse events and this widget
passes them along to the Python backend.  This makes it very easy for the user to create
interactive Notebook applications that can respond to mouse motion, click, and wheel events via
Python callback functions.


## Features

- Accept image data from Numpy arrays or URLs
- Support Python callback functions for front-end mouse events
- Support Canvas affine transform operations (work in progress)
- Widget properties `width` and `height` allow for direct manipulation displayed image size,
  independent of source data size
- Leverage Jupyter ipywidgets native support for transfering binary data between backend and
  frontend (no more encode-64)

# Work-in-Progress

In the near-term I simply want a robust tool for displaying images from numpy data arrays.  This
will require the following functionality:
{'fraction_non_alphanumeric': 0.03577235772357724, 'fraction_numerical': 0.001951219512195122, 'mean_word_length': 4.6440366972477065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3413858', 'n_tokens_mistral': 753, 'n_tokens_neox': 725, 'n_words': 449}