ndv.views #
Wrappers around GUI & graphics frameworks.
Most stuff in this module is not intended for public use, but ndv.views.bases shows the protocol that GUI & graphics classes should implement.
Modules:
-
bases–Abstract base classes for views and viewable objects.
Classes:
-
CanvasBackend–Enum of available canvas backends.
-
GuiFrontend–Enum of available GUI frontends.
Functions:
-
call_later–Call
funcaftermsecmilliseconds. -
get_array_canvas_class–Return
ArrayCanvasclass for current canvas backend. -
get_array_view_class–Return
ArrayViewclass for current GUI frontend. -
get_histogram_canvas_class–Return
HistogramCanvasclass for current canvas backend. -
process_events–Force processing of events for the application.
-
run_app–Start the active GUI application event loop.
-
set_canvas_backend–Sets the preferred canvas backend. Cannot be set after the GUI is running.
-
set_gui_backend–Sets the preferred GUI backend. Cannot be set after the GUI is running.
CanvasBackend #
GuiFrontend #
Enum of available GUI frontends.
Attributes:
call_later #
Call func after msec milliseconds.
This can be used to enqueue a function to be called after the current event loop iteration. For example, before calling run_app(), to ensure that the event loop is running before the function is called.
Parameters:
-
(msec#int) –The number of milliseconds to wait before calling
func. -
(func#Callable[[], None]) –The function to call.
Source code in src/ndv/views/_app.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
get_array_canvas_class #
get_array_canvas_class(
backend: str | None = None,
) -> type[ArrayCanvas]
Return ArrayCanvas class for current canvas backend.
Source code in src/ndv/views/_app.py
310 311 312 313 314 315 | |
get_array_view_class #
Return ArrayView class for current GUI frontend.
Source code in src/ndv/views/_app.py
305 306 307 | |
get_histogram_canvas_class #
get_histogram_canvas_class(
backend: str | None = None,
) -> type[HistogramCanvas]
Return HistogramCanvas class for current canvas backend.
Source code in src/ndv/views/_app.py
318 319 320 321 322 323 | |
process_events #
process_events() -> None
Force processing of events for the application.
Source code in src/ndv/views/_app.py
376 377 378 | |
run_app #
run_app() -> None
Start the active GUI application event loop.
Source code in src/ndv/views/_app.py
381 382 383 | |
set_canvas_backend #
set_canvas_backend(
backend: Literal["pygfx", "vispy"] | None = None,
) -> None
Sets the preferred canvas backend. Cannot be set after the GUI is running.
Source code in src/ndv/views/_app.py
246 247 248 249 250 251 252 253 | |
set_gui_backend #
set_gui_backend(
backend: Literal["jupyter", "qt", "wx"] | None = None,
) -> None
Sets the preferred GUI backend. Cannot be set after the GUI is running.
Source code in src/ndv/views/_app.py
256 257 258 259 260 261 262 263 | |