Skip to content

Commit 4f1fe13

Browse files
Make touch example work (#281)
* make touch example work * Linters Co-authored-by: martinRenou <[email protected]>
1 parent e28422e commit 4f1fe13

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

docs/conf.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
# -*- coding: utf-8 -*-
2-
extensions = [
3-
'sphinx.ext.autodoc',
4-
'sphinx.ext.napoleon',
5-
'jupyterlite_sphinx'
6-
]
2+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "jupyterlite_sphinx"]
73

84
jupyterlite_config = "jupyterlite_config.json"
95
jupyterlite_dir = "."
106

11-
master_doc = 'index'
12-
source_suffix = '.rst'
7+
master_doc = "index"
8+
source_suffix = ".rst"
139

1410
# General information about the project.
15-
project = 'ipycanvas'
16-
author = 'Martin Renou'
11+
project = "ipycanvas"
12+
author = "Martin Renou"
1713

1814
exclude_patterns = []
19-
highlight_language = 'python'
20-
pygments_style = 'sphinx'
15+
highlight_language = "python"
16+
pygments_style = "sphinx"
2117

2218
# Output file base name for HTML help builder.
2319
html_logo = "./images/ipycanvas_logo.svg"
2420
html_favicon = "./images/ipycanvas_logo.ico"
2521
html_theme = "pydata_sphinx_theme"
26-
htmlhelp_basename = 'ipycanvasdoc'
22+
htmlhelp_basename = "ipycanvasdoc"
2723

28-
html_theme_options = dict(
29-
github_url='https://github.com/martinRenou/ipycanvas'
30-
)
24+
html_theme_options = dict(github_url="https://github.com/martinRenou/ipycanvas")
3125

32-
html_static_path = ['_static']
26+
html_static_path = ["_static"]
3327

34-
html_css_files = [
35-
'custom.css'
36-
]
28+
html_css_files = ["custom.css"]
3729

38-
autodoc_member_order = 'bysource'
30+
autodoc_member_order = "bysource"

docs/events.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ Those methods take a callback function as single argument, this callback functio
4141

4242
.. code-block:: python
4343
44+
import math
45+
46+
out = Output()
47+
48+
49+
@out.capture()
4450
def handle_touch_move(fingers_locations):
4551
# Draw circles where fingers are located
4652
for finger_location in fingers_locations:
47-
canvas.fill_arc(finger_location[0], finger_location[1], 6, 0, 2 * pi)
53+
canvas.fill_arc(finger_location[0], finger_location[1], 6, 0, 2 * math.pi)
4854
4955
5056
canvas.on_touch_move(handle_touch_move)
57+
display(out)
5158
5259
.. note::
5360
Please open an issue or a Pull Request if you want more events to be supported by ipycanvas

0 commit comments

Comments
 (0)