File tree Expand file tree Collapse file tree 3 files changed +13
-16
lines changed
Expand file tree Collapse file tree 3 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 55
66
77class ExampleQWidget (QWidget ):
8- # your QWidget.__init__ can optionally request the napari viewer instance
9- # in one of two ways:
10- # 1. use a parameter called `napari_viewer`, as done here
11- # 2. use a type annotation of 'napari.viewer.Viewer' for any parameter
128 def __init__ (self , napari_viewer : napari .viewer .Viewer ):
139 super ().__init__ ()
1410 self .viewer = napari_viewer
Original file line number Diff line number Diff line change @@ -5,17 +5,7 @@ contributions:
55 - id : napari-matplotlib.make_qwidget
66 python_name : napari_matplotlib._widget:ExampleQWidget
77 title : Make example QWidget
8- - id : napari-matplotlib.make_magic_widget
9- python_name : napari_matplotlib._widget:example_magic_widget
10- title : Make example magic widget
11- - id : napari-matplotlib.make_func_widget
12- python_name : napari_matplotlib._widget:example_function_widget
13- title : Make example function widget
8+
149 widgets :
1510 - command : napari-matplotlib.make_qwidget
16- display_name : Example QWidget
17- - command : napari-matplotlib.make_magic_widget
18- display_name : Example Magic Widget
19- - command : napari-matplotlib.make_func_widget
20- autogenerate : true
21- display_name : Example Function Widget
11+ display_name : Matplotlib
Original file line number Diff line number Diff line change 1+ import napari
2+
3+ viewer = napari .Viewer ()
4+ viewer .window .add_plugin_dock_widget (
5+ plugin_name = "napari-matplotlib" , widget_name = "Matplotlib"
6+ )
7+
8+ if __name__ == "__main__" :
9+ # The napari event loop needs to be run under here to allow the window
10+ # to be spawned from a Python script
11+ napari .run ()
You can’t perform that action at this time.
0 commit comments