Skip to content

Commit

Permalink
Make touch example work (jupyter-widgets-contrib#281)
Browse files Browse the repository at this point in the history
* make touch example work

* Linters

Co-authored-by: martinRenou <[email protected]>
  • Loading branch information
haesleinhuepf and martinRenou authored Aug 25, 2022
1 parent e28422e commit 4f1fe13
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
32 changes: 12 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
# -*- coding: utf-8 -*-
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'jupyterlite_sphinx'
]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "jupyterlite_sphinx"]

jupyterlite_config = "jupyterlite_config.json"
jupyterlite_dir = "."

master_doc = 'index'
source_suffix = '.rst'
master_doc = "index"
source_suffix = ".rst"

# General information about the project.
project = 'ipycanvas'
author = 'Martin Renou'
project = "ipycanvas"
author = "Martin Renou"

exclude_patterns = []
highlight_language = 'python'
pygments_style = 'sphinx'
highlight_language = "python"
pygments_style = "sphinx"

# Output file base name for HTML help builder.
html_logo = "./images/ipycanvas_logo.svg"
html_favicon = "./images/ipycanvas_logo.ico"
html_theme = "pydata_sphinx_theme"
htmlhelp_basename = 'ipycanvasdoc'
htmlhelp_basename = "ipycanvasdoc"

html_theme_options = dict(
github_url='https://github.com/martinRenou/ipycanvas'
)
html_theme_options = dict(github_url="https://github.com/martinRenou/ipycanvas")

html_static_path = ['_static']
html_static_path = ["_static"]

html_css_files = [
'custom.css'
]
html_css_files = ["custom.css"]

autodoc_member_order = 'bysource'
autodoc_member_order = "bysource"
9 changes: 8 additions & 1 deletion docs/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ Those methods take a callback function as single argument, this callback functio

.. code-block:: python
import math
out = Output()
@out.capture()
def handle_touch_move(fingers_locations):
# Draw circles where fingers are located
for finger_location in fingers_locations:
canvas.fill_arc(finger_location[0], finger_location[1], 6, 0, 2 * pi)
canvas.fill_arc(finger_location[0], finger_location[1], 6, 0, 2 * math.pi)
canvas.on_touch_move(handle_touch_move)
display(out)
.. note::
Please open an issue or a Pull Request if you want more events to be supported by ipycanvas
Expand Down

0 comments on commit 4f1fe13

Please sign in to comment.