Skip to content

Commit ef91a72

Browse files
authored
Merge b2f369a into 3e14801
2 parents 3e14801 + b2f369a commit ef91a72

10 files changed

Lines changed: 523 additions & 19 deletions

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ pre-commit install
3535
5. Add the notebook to the appropriate `index.md` so it appears in the gallery
3636
toctree.
3737

38-
6. Open a PR. CI will:
38+
6. Place the gallery thumbnail and any other media (GIFs, screenshots, static
39+
PNGs referenced from the notebook) under `_static/img/`. Reference them from
40+
`index.md` and notebook markdown cells with relative paths
41+
(e.g. `:img-top: ../_static/img/<slug>.png` from inside `examples/` or
42+
`tutorials/`, and `![…](../_static/img/<slug>.gif)` from a notebook cell).
43+
Do **not** drop assets next to the notebook itself.
44+
45+
7. Open a PR. CI will:
3946
- Lint structure and code (`lint.yaml`).
4047
- Re-execute the notebook against the latest `spatialdata-plot` release
4148
and diff outputs (`execute.yaml`).
6.45 MB
Loading
228 KB
Loading

examples/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
# Examples
22

3-
Worked examples on real datasets you'd actually analyse.
3+
Examples from real datasets you'd actually analyse.
44

55
::::{grid} 1 2 2 2
66
:gutter: 3
77

88
:::{grid-item-card} Visium mouse brain
99
:link: visium_mouse_brain
1010
:link-type: doc
11-
:img-top: visium_mouse_brain.png
11+
:img-top: ../_static/img/visium_mouse_brain.png
1212

1313
Render H&E tissue, overlay spots, color by gene expression and by cluster,
1414
and finish with a publication-style figure.
1515
:::
1616

17+
:::{grid-item-card} Interactive region annotation
18+
:link: interactive_annotate
19+
:link-type: doc
20+
:img-top: ../_static/img/interactive_annotate.png
21+
22+
Draw regions of interest directly on a `spatialdata-plot` canvas with
23+
`sdata.pl.annotate(...)` and persist them as a `ShapesModel` element.
24+
:::
25+
1726
::::
1827

1928
```{toctree}
2029
:hidden:
2130
:maxdepth: 1
2231
2332
visium_mouse_brain
33+
interactive_annotate
2434
```

examples/interactive_annotate.ipynb

Lines changed: 484 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ authors = [{ name = "scverse" }]
1616
# the notebooks end-to-end.
1717
[project.optional-dependencies]
1818
exec = [
19-
"spatialdata-plot>=0.3.4",
19+
"spatialdata-plot[interactive]>=0.4.0",
2020
"squidpy",
2121
"jupyter",
2222
"ipykernel",
@@ -40,22 +40,25 @@ bypass-selection = true
4040
# kernel-install`; the kernel will point at the pixi env's Python, so
4141
# `pixi run lab` (or any external Jupyter) can execute the notebooks
4242
# against the exact pinned dependencies.
43-
[tool.pixi]
44-
workspace.channels = ["conda-forge"]
45-
workspace.platforms = ["linux-64", "osx-arm64"]
43+
[tool.pixi.workspace]
44+
channels = ["conda-forge"]
45+
platforms = ["linux-64", "osx-arm64"]
4646

47-
dependencies.python = ">=3.11"
48-
dependencies.jupyterlab = "*"
49-
dependencies.ipykernel = "*"
50-
dependencies.nbconvert = "*"
51-
dependencies.watermark = "*"
47+
[tool.pixi.dependencies]
48+
python = ">=3.11"
49+
jupyterlab = "*"
50+
ipykernel = "*"
51+
nbconvert = "*"
52+
watermark = "*"
5253

53-
pypi-dependencies.spatialdata-plot = ">=0.3"
54-
pypi-dependencies.squidpy = "*"
54+
[tool.pixi.pypi-dependencies]
55+
spatialdata-plot = { version = ">=0.4.0", extras = ["interactive"] }
56+
squidpy = "*"
5557

56-
tasks.kernel-install = 'python -m ipykernel install --user --name sdata-plot-notebooks --display-name "sdata-plot-notebooks"'
57-
tasks.lab = "jupyter lab"
58-
tasks.execute = "jupyter nbconvert --to notebook --execute --inplace tutorials/*.ipynb examples/*.ipynb"
58+
[tool.pixi.tasks]
59+
kernel-install = 'python -m ipykernel install --user --name sdata-plot-notebooks --display-name "sdata-plot-notebooks"'
60+
lab = "jupyter lab"
61+
execute = "jupyter nbconvert --to notebook --execute --inplace tutorials/*.ipynb examples/*.ipynb"
5962

6063
[tool.ruff]
6164
line-length = 120

tutorials/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Entry-point material for learning the API on synthetic data.
88
:::{grid-item-card} Getting started
99
:link: getting_started
1010
:link-type: doc
11-
:img-top: getting_started.png
11+
:img-top: ../_static/img/getting_started.png
1212

1313
The fluent `.pl` API, layering, and styling on the in-memory `blobs`
1414
dataset. Ideal first read.
@@ -17,7 +17,7 @@ dataset. Ideal first read.
1717
:::{grid-item-card} Colour and palettes
1818
:link: color_and_palette
1919
:link-type: doc
20-
:img-top: color_and_palette.png
20+
:img-top: ../_static/img/color_and_palette.png
2121

2222
How `color=` resolves, the v0.3.0 `groups` behaviour, and building
2323
perceptually well-spaced or colourblind-safe palettes with

0 commit comments

Comments
 (0)