Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit be6a8ea

Browse filesBrowse files
committed
guide updates
1 parent 33eda1e commit be6a8ea
Copy full SHA for be6a8ea

File tree

2 files changed

+53
-3
lines changed
Filter options

2 files changed

+53
-3
lines changed

‎docs/source/conf.py

Copy file name to clipboardExpand all lines: docs/source/conf.py
+51-3Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22
#
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
import os
7+
8+
# need to force offscreen rendering before importing fpl
9+
# otherwise fpl tries to select glfw canvas
10+
os.environ["WGPU_FORCE_OFFSCREEN"] = "1"
11+
512
import fastplotlib
13+
from pygfx.utils.gallery_scraper import find_examples_for_gallery
14+
from pathlib import Path
15+
import sys
16+
from sphinx_gallery.sorting import ExplicitOrder
17+
import imageio.v3 as iio
18+
19+
ROOT_DIR = Path(__file__).parents[1].parents[0] # repo root
20+
EXAMPLES_DIR = Path.joinpath(ROOT_DIR, "examples", "desktop")
21+
22+
sys.path.insert(0, str(ROOT_DIR))
623

724
# -- Project information -----------------------------------------------------
825
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
@@ -23,9 +40,40 @@
2340
"sphinx.ext.viewcode",
2441
"sphinx_copybutton",
2542
"sphinx_design",
26-
"nbsphinx",
43+
"sphinx_gallery.gen_gallery"
2744
]
2845

46+
sphinx_gallery_conf = {
47+
"gallery_dirs": "_gallery",
48+
"backreferences_dir": "_gallery/backreferences",
49+
"doc_module": ("fastplotlib",),
50+
"image_scrapers": ("pygfx",),
51+
"remove_config_comments": True,
52+
"subsection_order": ExplicitOrder(
53+
[
54+
"../../examples/desktop/image",
55+
"../../examples/desktop/gridplot",
56+
"../../examples/desktop/line",
57+
"../../examples/desktop/line_collection",
58+
"../../examples/desktop/scatter",
59+
"../../examples/desktop/heatmap",
60+
"../../examples/desktop/misc"
61+
]
62+
),
63+
"ignore_pattern": r'__init__\.py',
64+
"nested_sections": False,
65+
"thumbnail_size": (250, 250)
66+
}
67+
68+
extra_conf = find_examples_for_gallery(EXAMPLES_DIR)
69+
sphinx_gallery_conf.update(extra_conf)
70+
71+
# download imageio examples for the gallery
72+
iio.imread("imageio:clock.png")
73+
iio.imread("imageio:astronaut.png")
74+
iio.imread("imageio:coffee.png")
75+
iio.imread("imageio:hubble_deep_field.png")
76+
2977
autosummary_generate = True
3078

3179
templates_path = ["_templates"]
@@ -52,12 +100,12 @@
52100
intersphinx_mapping = {
53101
"python": ("https://docs.python.org/3", None),
54102
"numpy": ("https://numpy.org/doc/stable/", None),
55-
"pygfx": ("https://pygfx.com/stable/", None),
103+
"pygfx": ("https://pygfx.com/stable", None),
56104
"wgpu": ("https://wgpu-py.readthedocs.io/en/latest", None),
57105
}
58106

59107
html_theme_options = {
60-
"source_repository": "https://github.com/kushalkolar/fastplotlib",
108+
"source_repository": "https://github.com/fastplotlib/fastplotlib",
61109
"source_branch": "main",
62110
"source_directory": "docs/",
63111
}

‎docs/source/user_guide/guide.rst

Copy file name to clipboardExpand all lines: docs/source/user_guide/guide.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ to be easily accessed from figures::
8080
fig[0, 0]["astronaut"]
8181
..
8282
83+
8384
Graphics also have mutable properties that can be linked to events. Some of these properties, such as the `data` or `colors` of a line can even be indexed,
8485
allowing for the creation of very powerful visualizations.
8586

@@ -197,6 +198,7 @@ PYGFX_EVENTS = [
197198
"resize",
198199
]
199200

201+
200202
adding events (2 methods)
201203

202204
attributes of all events (table)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.