File tree 8 files changed +74
-30
lines changed
8 files changed +74
-30
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ instance/
60
60
# Sphinx documentation
61
61
docs /_build /
62
62
docs /auto_examples
63
+ docs /api
63
64
64
65
# MkDocs documentation
65
66
/site /
Original file line number Diff line number Diff line change
1
+ API reference
2
+ =============
3
+ This section documents the internal API of ``napari-matplotlib `` classes.
4
+ Most users shouldn't need this, and will just directly interact with the
5
+ plots though the napari user interface.
6
+
7
+
8
+ .. automodapi :: napari_matplotlib
9
+
10
+ .. automodapi :: napari_matplotlib.base
Original file line number Diff line number Diff line change
1
+ HistogramWidget
2
+ ===============
3
+
4
+ .. currentmodule :: napari_matplotlib
5
+
6
+ .. autoclass :: HistogramWidget
7
+ :show-inheritance:
8
+
9
+ .. rubric :: Methods Summary
10
+
11
+ .. autosummary ::
12
+
13
+ ~HistogramWidget.hist_current_layer
14
+ ~HistogramWidget.update_layer
15
+
16
+ .. rubric :: Methods Documentation
17
+
18
+ .. automethod :: hist_current_layer
19
+ .. automethod :: update_layer
Original file line number Diff line number Diff line change 27
27
# Add any Sphinx extension module names here, as strings. They can be
28
28
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29
29
# ones.
30
- extensions = ["sphinx_gallery.gen_gallery" ]
30
+ extensions = [
31
+ "numpydoc" ,
32
+ "sphinx_gallery.gen_gallery" ,
33
+ "sphinx_automodapi.automodapi" ,
34
+ ]
31
35
32
36
sphinx_gallery_conf = {
33
37
"filename_pattern" : "." ,
34
38
"image_scrapers" : (qtgallery .qtscraper ,),
35
39
"reset_modules" : (qtgallery .reset_qapp ,),
36
40
}
37
41
42
+ numpydoc_show_class_members = False
43
+
38
44
# Add any paths that contain templates here, relative to this directory.
39
45
templates_path = ["_templates" ]
40
46
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Welcome to matplotlib-napari's documentation!
11
11
:caption: Contents:
12
12
13
13
auto_examples/index
14
+ api
14
15
15
16
16
17
Original file line number Diff line number Diff line change @@ -49,9 +49,11 @@ napari.manifest =
49
49
50
50
[options.extras_require]
51
51
docs =
52
+ numpydoc
52
53
pydata-sphinx-theme
53
54
qtgallery
54
55
sphinx
56
+ sphinx-automodapi
55
57
sphinx-gallery
56
58
testing =
57
59
napari[pyqt5]
Original file line number Diff line number Diff line change 1
1
import napari
2
2
import numpy as np
3
- from matplotlib .backends .backend_qt5agg import FigureCanvas
4
- from matplotlib .figure import Figure
5
- from qtpy .QtWidgets import QVBoxLayout , QWidget
6
-
7
- __all__ = ["HistogramWidget" ]
8
3
4
+ from .base import NapariMPLWidget
9
5
10
- class NapariMPLWidget (QWidget ):
11
- """
12
- Attributes
13
- ----------
14
- viewer : napari.viewer.Viewer
15
- Main napari viewer.
16
- figure : matplotlib.figure.Figure
17
- Matplotlib figure.
18
- canvas : matplotlib.backends.backend_qt5agg.FigureCanvas
19
- Matplotlib canvas.
20
- axes : matplotlib.axes.Axes
21
- Matplotlib axes.
22
- """
23
-
24
- def __init__ (self , napari_viewer : napari .viewer .Viewer ):
25
- super ().__init__ ()
26
-
27
- self .viewer = napari_viewer
28
- self .figure = Figure (figsize = (5 , 3 ), tight_layout = True )
29
- self .canvas = FigureCanvas (self .figure )
30
- self .axes = self .canvas .figure .subplots ()
31
-
32
- self .setLayout (QVBoxLayout ())
33
- self .layout ().addWidget (self .canvas )
6
+ __all__ = ["HistogramWidget" ]
34
7
35
8
36
9
class HistogramWidget (NapariMPLWidget ):
Original file line number Diff line number Diff line change
1
+ import napari
2
+ from matplotlib .backends .backend_qt5agg import FigureCanvas
3
+ from matplotlib .figure import Figure
4
+ from qtpy .QtWidgets import QVBoxLayout , QWidget
5
+
6
+ __all__ = ["NapariMPLWidget" ]
7
+
8
+
9
+ class NapariMPLWidget (QWidget ):
10
+ """
11
+ Attributes
12
+ ----------
13
+ viewer : napari.viewer.Viewer
14
+ Main napari viewer.
15
+ figure : matplotlib.figure.Figure
16
+ Matplotlib figure.
17
+ canvas : matplotlib.backends.backend_qt5agg.FigureCanvas
18
+ Matplotlib canvas.
19
+ axes : matplotlib.axes.Axes
20
+ Matplotlib axes.
21
+ """
22
+
23
+ def __init__ (self , napari_viewer : napari .viewer .Viewer ):
24
+ super ().__init__ ()
25
+
26
+ self .viewer = napari_viewer
27
+ self .figure = Figure (figsize = (5 , 3 ), tight_layout = True )
28
+ self .canvas = FigureCanvas (self .figure )
29
+ self .axes = self .canvas .figure .subplots ()
30
+
31
+ self .setLayout (QVBoxLayout ())
32
+ self .layout ().addWidget (self .canvas )
You can’t perform that action at this time.
0 commit comments