Skip to content

Commit a695de0

Browse files
committed
Enhance documentation and dependencies: update index.rst for improved clarity and add sphinx-design for enhanced styling
1 parent fc77e22 commit a695de0

3 files changed

Lines changed: 38 additions & 45 deletions

File tree

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"sphinx.ext.viewcode",
3434
"sphinx.ext.intersphinx",
3535
"sphinx_gallery.gen_gallery",
36+
"sphinx_design",
3637
]
3738

3839
autosummary_generate = True

docs/index.rst

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,54 @@
1-
anyplotlib
2-
==========
1+
========================
2+
anyplotlib Documentation
3+
========================
34

4-
.. toctree::
5-
:maxdepth: 2
6-
:caption: Contents
7-
8-
getting_started
9-
api/index
10-
auto_examples/index
11-
12-
Welcome to **anyplotlib** – a lightweight, interactive viewer for 1-D signals and
13-
2-D images, backed by `anywidget <https://anywidget.dev/>`_ and a pure-JavaScript
14-
canvas renderer. The goal is to duplicate and extend the interactive plotting capabilities of Matplotlib,
15-
although the scope is intentionally limited in the following ways:
5+
anyplotlib is a lightweight, interactive plotting library for Jupyter notebooks and JupyterLab,
6+
backed by `anywidget <https://anywidget.dev/>`_ and a pure-JavaScript canvas renderer. It follows
7+
the object-oriented Matplotlib API — create a ``Figure``, call methods on ``Axes`` — while
8+
delivering real-time interactivity and high performance on large datasets through canvas-based
9+
blitting instead of SVG.
1610

17-
1. This uses the object-oriented API of Matplotlib, not the stateful pyplot interface. This means there is
18-
no ``plt.imshow`` or ``plt.plot`` — instead, you create a figure object and call methods on axes to add
19-
data and customize the plot. This is a deliberate choice to avoid the pitfalls of the stateful API.
11+
.. grid:: 2 3 3 3
12+
:gutter: 2
2013

21-
.. code-block:: python
14+
.. grid-item-card::
15+
:link: getting_started
16+
:link-type: doc
2217

23-
import anyplotlib as apl
24-
import matplotlib.pyplot as plt
18+
:octicon:`rocket;2em;sd-text-info` Getting Started
19+
^^^
2520

26-
# matplotlib:
27-
fig, axs = plt.subplots(1, 1)
28-
axs.imshow(...)
21+
New to anyplotlib? The getting started guide walks through installation and
22+
your first interactive figure in a Jupyter notebook.
2923

30-
# anyplotlib equivalent:
31-
fig, axs = apl.subplots(1, 1)
32-
axs.imshow(...)
24+
.. grid-item-card::
25+
:link: api/index
26+
:link-type: doc
3327

34-
2. In matplotlib they use vector graphics (SVG) to render the plot, which is great for static images. It's especially
35-
great for making publication-quality figures. (If you haven't tried inkscape + matplotlib SVG output,
36-
it's pretty amazing.) For interactivity, it can be slow. Anyplotlib uses a pure-JavaScript canvas renderer which is
37-
much faster for interactive applications, but the quality of the output is not as good as vector graphics. This is a
38-
trade-off that we are willing to make for the sake of interactivity.
28+
:octicon:`code-square;2em;sd-text-info` API Reference
29+
^^^
3930

40-
3. Matplotlib supports a wide range of marker styles, line styles, and other plot elements. Anyplotlib focuses on a
41-
core set of features that are most commonly used in scientific plotting. This means that some of the more
42-
esoteric features of Matplotlib may not be available in Anyplotlib. In general we try to match the lower level
43-
``collections`` API of Matplotlib.
31+
Full documentation of the anyplotlib API — ``Figure``, ``Axes``, plot classes,
32+
markers, widgets, and callbacks — with parameter descriptions and type signatures.
4433

45-
4. Each collection, plot, image is rendered as a single object on the canvas. This is highly performant and more
46-
importantly allows for blitting. This is one of the main reasons why the ``ipympl`` backend of Matplotlib is so slow.
34+
.. grid-item-card::
35+
:link: auto_examples/index
36+
:link-type: doc
4737

48-
5. Finally ``anyplotlib`` uses ``AnyWidget`` as the underlying widget framework. This means that it can be used in any
49-
environment that supports ``AnyWidget``, including Jupyter notebooks, JupyterLab, and PyCharm notebook preview. Under
50-
the hood, ``AnyWidget`` uses a pure-JavaScript implementation of the widget protocol, which allows for fast rendering
51-
and interactivity.
38+
:octicon:`zap;2em;sd-text-info` Examples
39+
^^^
5240

53-
**Status**: anyplotlib v0.1.0 provides a lightweight, interactive alternative to matplotlib's
54-
pyplot interface for Jupyter notebooks and compatible environments. Performance is optimized for
55-
real-time interactivity with large datasets on canvas-based rendering.
41+
Gallery of short, self-contained examples showing 1-D signals, 2-D images,
42+
3-D surfaces, bar charts, interactive widgets, and more.
5643

5744
.. toctree::
5845
:hidden:
46+
:maxdepth: 2
47+
48+
getting_started
49+
api/index
50+
auto_examples/index
5951

6052
* :ref:`genindex`
6153
* :ref:`modindex`
6254
* :ref:`search`
63-

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies = [
2121
docs = [
2222
"sphinx>=8.0",
2323
"pydata-sphinx-theme>=0.16",
24+
"sphinx-design>=0.6",
2425
"sphinx-gallery>=0.18",
2526
"pillow>=10.0",
2627
"matplotlib>=3.7",

0 commit comments

Comments
 (0)