PluginTemplateMixin

class jdaviz.core.template_mixin.PluginTemplateMixin(*args, **kwargs)[source] [edit on github]

Bases: TemplateMixin

This base class can be inherited by all sidebar/tray plugins to expose common functionality.

Public constructor

Attributes Summary

disabled_msg

A trait for unicode strings.

plugin_opened

A boolean (True, False) trait.

user_api

Methods Summary

open_in_tray()

Open the plugin in the sidebar/tray (and open the sidebar if it is not already).

show([loc, title])

Display the plugin UI.

Attributes Documentation

disabled_msg

A trait for unicode strings.

plugin_opened

A boolean (True, False) trait.

user_api

Methods Documentation

open_in_tray()[source] [edit on github]

Open the plugin in the sidebar/tray (and open the sidebar if it is not already).

show(loc='inline', title=None)[source] [edit on github]

Display the plugin UI.

Parameters:
locstr

The display location determines where to present the viz app. Supported locations:

“inline”: Display the plugin inline in a notebook.

“sidecar”: Display the plugin in a separate JupyterLab window from the notebook, the location of which is decided by the ‘anchor.’ right is the default

Other anchors:

  • sidecar:right (The default, opens a tab to the right of display)

  • sidecar:tab-before (Full-width tab before the current notebook)

  • sidecar:tab-after (Full-width tab after the current notebook)

  • sidecar:split-right (Split-tab in the same window right of the notebook)

  • sidecar:split-left (Split-tab in the same window left of the notebook)

  • sidecar:split-top (Split-tab in the same window above the notebook)

  • sidecar:split-bottom (Split-tab in the same window below the notebook)

See jupyterlab-sidecar for the most up-to-date options.

“popout”: Display the plugin in a detached display. By default, a new window will open. Browser popup permissions required.

Other anchors:

  • popout:window (The default, opens Jdaviz in a new, detached popout)

  • popout:tab (Opens Jdaviz in a new, detached tab in your browser)

titlestr, optional

The title of the sidecar tab. Defaults to the name of the plugin.

NOTE: Only applicable to a “sidecar” display.

Notes

If “sidecar” is requested in the “classic” Jupyter notebook, the plugin will appear inline, as only JupyterLab has a mechanism to have multiple tabs.