panel.widgets Package


widgets Package

The widgets module contains Widget which provide bi-directional communication between a rendered panel and the Widget parameters.


ace Module

Inheritance diagram of panel.widgets.ace

Defines various Select widgets which allow choosing one or more items from a list of options.

class panel.widgets.ace.Ace(**params)[source]

Bases: panel.widgets.base.Widget

Ace widget allow editing text in an Ace editor.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.String(default=’’)

State of the current code in the editor

annotations = param.List(bounds=(0, None), default=[])

List of annotations to add to the editor.

theme = param.ObjectSelector(default=’chrome’, objects=[‘ambiance’, ‘chaos’, ‘chrome’, ‘clouds’, ‘clouds_midnight’, ‘cobalt’, ‘crimson_editor’, ‘dawn’, ‘dracula’, ‘dreamweaver’, ‘eclipse’, ‘github’, ‘gob’, ‘gruvbox’, ‘idle_fingers’, ‘iplastic’, ‘katzenmilch’, ‘kr_theme’, ‘kuroir’, ‘merbivore’, ‘merbivore_soft’, ‘mono_industrial’, ‘monokai’, ‘pastel_on_dark’, ‘solarized_dark’, ‘solarized_light’, ‘sqlserver’, ‘terminal’, ‘textmate’, ‘tomorrow’, ‘tomorrow_night’, ‘tomorrow_night_blue’, ‘tomorrow_night_bright’, ‘tomorrow_night_eighties’, ‘twilight’, ‘vibrant_ink’, ‘xcode’])

Theme of the editor

language = param.String(default=’python’)

Language of the editor

readonly = param.Boolean(bounds=(0, 1), default=False)

Define if editor content can be modified

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


base Module

Inheritance diagram of panel.widgets.base

Defines the Widget base class which provides bi-directional communication between the rendered dashboard and the Widget parameters.

class panel.widgets.base.CompositeWidget(**params)[source]

Bases: panel.widgets.base.Widget

A baseclass for widgets which are made up of two or more other widgets

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)[source]

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.base.Widget(**params)[source]

Bases: panel.viewable.Reactive

Widgets allow syncing changes in bokeh widget models with the parameters on the Widget instance.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True))

The width of the component (in pixels). This can be either fixed or preferred width, depending on width sizing policy.

height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True))

The height of the component (in pixels). This can be either fixed or preferred height, depending on height sizing policy.

margin = param.Parameter(default=(5, 10))

Allows to create additional space around the component. May be specified as a two-tuple of the form (vertical, horizontal) or a four-tuple (top, right, bottom, left).

disabled = param.Boolean(bounds=(0, 1), default=False)

Whether the widget is disabled.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


button Module

Inheritance diagram of panel.widgets.button

Defines Button and button-like widgets which allow triggering events or merely toggling between on-off states.

class panel.widgets.button.Button(**params)[source]

Bases: panel.widgets.button._ButtonBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.button._ButtonBase: button_type

clicks = param.Integer(default=0, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

js_on_click(args={}, code='')[source]

Allows defining a JS callback to be triggered when the button is clicked.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • code (str) – The Javascript code to execute when the button is clicked.

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.button.Toggle(**params)[source]

Bases: panel.widgets.button._ButtonBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.button._ButtonBase: button_type

value = param.Boolean(bounds=(0, 1), default=False)

Whether the button is currently toggled.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


file_selector Module

Inheritance diagram of panel.widgets.file_selector

Defines a FileSelector widget which allows selecting files and directories on the server.

class panel.widgets.file_selector.FileSelector(directory=None, **params)[source]

Bases: panel.widgets.base.CompositeWidget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, disabled

margin = param.Parameter(default=(5, 10, 20, 10))

Allows to create additional space around the component. May be specified as a two-tuple of the form (vertical, horizontal) or a four-tuple (top, right, bottom, left).

directory = param.String(default=’/home/travis/build/holoviz/panel/doc’)

The directory to explore.

file_pattern = param.String(default=’*’)

A glob-like pattern to filter the files.

only_files = param.Boolean(bounds=(0, 1), default=False)

Whether to only allow selecting files.

show_hidden = param.Boolean(bounds=(0, 1), default=False)

Whether to show hidden files and directories (starting with a period).

size = param.Integer(default=10, inclusive_bounds=(True, True))

The number of options shown at once (note this is the only way to control the height of this widget)

value = param.List(bounds=(0, None), default=[])

List of selected files.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

panel.widgets.file_selector.scan_path(path, file_pattern='*')[source]

Scans the supplied path for files and directories and optionally filters the files with the file keyword, returning a list of sorted paths of all directories and files.

Parameters
  • path (str) – The path to search

  • file_pattern (str) – A glob-like pattern to filter the files

Returns

Return type

A sorted list of paths


input Module

Inheritance diagram of panel.widgets.input

The input widgets generally allow entering arbitrary information into a text field or similar.

class panel.widgets.input.Checkbox(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.Boolean(bounds=(0, 1), default=False)

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.ColorPicker(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.Color()

The selected color

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.DatePicker(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.Date(inclusive_bounds=(True, True))

start = param.Date(inclusive_bounds=(True, True))

end = param.Date(inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.DatetimeInput(**params)[source]

Bases: panel.widgets.input.LiteralInput

DatetimeInput allows declaring Python literals using a text input widget. Optionally a type may be declared.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.input.LiteralInput: serializer, type

value = param.Date(inclusive_bounds=(True, True))

format = param.String(default=’%Y-%m-%d %H:%M:%S’)

Datetime format used for parsing and formatting the datetime.

start = param.Date(inclusive_bounds=(True, True))

end = param.Date(inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

type

alias of datetime.datetime

class panel.widgets.input.FileInput(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

accept = param.String()

filename = param.String()

mime_type = param.String()

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename)[source]

Saves the uploaded FileInput data to a file or BytesIO object.

Parameters

(str) (filename) –

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.LiteralInput(**params)[source]

Bases: panel.widgets.base.Widget

LiteralInput allows declaring Python literals using a text input widget. Optionally a type may be declared.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

serializer = param.ObjectSelector(default=’ast’, objects=[‘ast’, ‘json’])

The serialization (and deserialization) method to use. ‘ast’ uses ast.literal_eval and ‘json’ uses json.loads and json.dumps.

type = param.ClassSelector(class_=(<class ‘type’>, <class ‘tuple’>))

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.PasswordInput(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.String(default=’’)

placeholder = param.String(default=’’)

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.Spinner(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

start = param.Number(inclusive_bounds=(True, True))

Optional minimum allowable value.

end = param.Number(inclusive_bounds=(True, True))

Optional maximum allowable value.

value = param.Number(default=0, inclusive_bounds=(True, True))

The initial value of the spinner.

step = param.Number(default=1, inclusive_bounds=(True, True))

The step added or subtracted to the current value.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.StaticText(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

style = param.Dict(class_=<class ‘dict’>)

Dictionary of CSS property:value pairs to apply to this Div.

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.TextAreaInput(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.String(default=’’)

placeholder = param.String(default=’’)

max_length = param.Integer(default=5000, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.input.TextInput(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

value = param.String(default=’’)

placeholder = param.String(default=’’)

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


misc Module

Inheritance diagram of panel.widgets.misc

Miscellaneous widgets which do not fit into the other main categories.

class panel.widgets.misc.Audio(**params)[source]

Bases: panel.widgets.misc._MediaBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.misc._MediaBase: loop, time, throttle, paused, volume

value = param.ClassSelector(class_=(<class ‘str’>, <class ‘numpy.ndarray’>), default=’’)

The audio file either local or remote.

sample_rate = param.Integer(default=44100, inclusive_bounds=(True, True))

The sample_rate of the audio when given a NumPy array.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.misc.FileDownload(file=None, **params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

auto = param.Boolean(bounds=(0, 1), default=True)

Whether to download on the initial click or allow for right-click save as.

button_type = param.ObjectSelector(default=’default’, objects=[‘default’, ‘primary’, ‘success’, ‘warning’, ‘danger’])

callback = param.Callable()

A callable that returns the file path or file-like object.

data = param.String()

The data being transferred.

embed = param.Boolean(bounds=(0, 1), default=False)

Whether to embed the file on initialization.

file = param.Parameter()

The file, file-like object or file contents to transfer. If the file is not pointing to a file on disk a filename must also be provided.

filename = param.String()

A filename which will also be the default name when downloading the file.

label = param.String(default=’Download file’)

The label of the download button

_clicks = param.Integer(default=0, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.misc.Progress(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

active = param.Boolean(bounds=(0, 1), default=True)

If no value is set the active property toggles animation of the progress bar on and off.

bar_color = param.ObjectSelector(default=’success’, objects=[‘primary’, ‘secondary’, ‘success’, ‘info’, ‘danger’, ‘warning’, ‘light’, ‘dark’])

max = param.Integer(default=100, inclusive_bounds=(True, True))

The maximum value of the progress bar.

value = param.Integer(bounds=(0, 100), inclusive_bounds=(True, True))

The current value of the progress bar. If set to None the progress bar will be indeterminate and animate depending on the active parameter.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.misc.VideoStream(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

format = param.ObjectSelector(default=’png’, objects=[‘png’, ‘jpeg’])

The file format as which the video is returned.

paused = param.Boolean(bounds=(0, 1), default=False)

Whether the video is currently paused

timeout = param.Number(inclusive_bounds=(True, True))

Interval between snapshots in millisecons

value = param.String(default=’’)

A base64 representation of the video stream snapshot.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

snapshot()[source]

Triggers a snapshot of the current VideoStream state to sync the widget value.


player Module

Inheritance diagram of panel.widgets.player

Defines Player widgets which offer media-player like controls.

class panel.widgets.player.DiscretePlayer(**params)[source]

Bases: panel.widgets.player.PlayerBase, panel.widgets.select.SelectBase

The DiscretePlayer provides controls to iterate through a list of discrete options. The speed at which the widget plays is defined by the interval, but it is also possible to skip items using the step parameter.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.player.PlayerBase: width, height, loop_policy, step

interval = param.Integer(default=500, inclusive_bounds=(True, True))

Interval between updates

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.player.Player(**params)[source]

Bases: panel.widgets.player.PlayerBase

The Player provides controls to play and skip through a number of frames defined by explicit start and end values. The speed at which the widget plays is defined by the interval, but it is also possible to skip frames using the step parameter.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: margin, disabled

panel.widgets.player.PlayerBase: width, height, interval, loop_policy, step

start = param.Integer(default=0, inclusive_bounds=(True, True))

Lower bound on the slider value

end = param.Integer(default=10, inclusive_bounds=(True, True))

Upper bound on the slider value

value = param.Integer(default=0, inclusive_bounds=(True, True))

Current player value

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.player.PlayerBase(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: margin, disabled

width = param.Integer(bounds=(0, None), default=510, inclusive_bounds=(True, True))

The width of the component (in pixels). This can be either fixed or preferred width, depending on width sizing policy.

height = param.Integer(bounds=(0, None), default=80, inclusive_bounds=(True, True))

The height of the component (in pixels). This can be either fixed or preferred height, depending on height sizing policy.

interval = param.Integer(default=500, inclusive_bounds=(True, True))

Interval between updates

loop_policy = param.ObjectSelector(default=’once’, objects=[‘once’, ‘loop’, ‘reflect’])

Policy used when player hits last frame

step = param.Integer(default=1, inclusive_bounds=(True, True))

Number of frames to step forward and back by on each event.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


select Module

Inheritance diagram of panel.widgets.select

Defines various Select widgets which allow choosing one or more items from a list of options.

class panel.widgets.select.AutocompleteInput(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

min_characters = param.Integer(default=2, inclusive_bounds=(True, True))

The number of characters a user must type before completions are presented.

options = param.List(bounds=(0, None), default=[])

placeholder = param.String(default=’’)

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.CheckBoxGroup(**params)[source]

Bases: panel.widgets.select._CheckGroupBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.select._CheckGroupBase: value

inline = param.Boolean(bounds=(0, 1), default=False)

Whether the items be arrange vertically (False) or horizontally in-line (True).

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.CheckButtonGroup(**params)[source]

Bases: panel.widgets.select._CheckGroupBase, panel.widgets.button._ButtonBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.button._ButtonBase: button_type

panel.widgets.select.SelectBase: options

panel.widgets.select._CheckGroupBase: value

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.CrossSelector(**params)[source]

Bases: panel.widgets.base.CompositeWidget, panel.widgets.select.MultiSelect

A composite widget which allows selecting from a list of items by moving them between two lists. Supports filtering values by name to select them in bulk.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.select._MultiSelectBase: value

width = param.Integer(bounds=(0, None), default=600, inclusive_bounds=(True, True))

The number of options shown at once (note this is the only way to control the height of this widget)

height = param.Integer(bounds=(0, None), default=200, inclusive_bounds=(True, True))

The number of options shown at once (note this is the only way to control the height of this widget)

size = param.Integer(default=10, inclusive_bounds=(True, True))

The number of options shown at once (note this is the only way to control the height of this widget)

filter_fn = param.Callable()

The filter function applied when querying using the text fields, defaults to re.search. Function is two arguments, the query or pattern and the item label.

definition_order = param.Integer(default=True, inclusive_bounds=(True, True))

Whether to preserve definition order after filtering. Disable to allow the order of selection to define the order of the selected list.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

filter_fn(string, flags=0)

Scan through string looking for a match to the pattern, returning a Match object, or None if no match was found.

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.MultiChoice(**params)[source]

Bases: panel.widgets.select._MultiSelectBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.select._MultiSelectBase: value

delete_button = param.Boolean(bounds=(0, 1), default=True)

Whether to display a button to delete a selected option.

max_items = param.Integer(bounds=(1, None), inclusive_bounds=(True, True))

Maximum number of options that can be selected.

option_limit = param.Integer(bounds=(1, None), inclusive_bounds=(True, True))

Maximum number of options to display at once.

placeholder = param.String(default=’’)

String displayed when no selection has been made.

solid = param.Boolean(bounds=(0, 1), default=True)

Whether to display widget with solid or light style.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.MultiSelect(**params)[source]

Bases: panel.widgets.select._MultiSelectBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.select._MultiSelectBase: value

size = param.Integer(default=4, inclusive_bounds=(True, True))

The number of items displayed at once (i.e. determines the widget height).

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.RadioBoxGroup(**params)[source]

Bases: panel.widgets.select._RadioGroupBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.select.Select: value

inline = param.Boolean(bounds=(0, 1), default=False)

Whether the items be arrange vertically (False) or horizontally in-line (True).

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.RadioButtonGroup(**params)[source]

Bases: panel.widgets.select._RadioGroupBase, panel.widgets.button._ButtonBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.button._ButtonBase: button_type

panel.widgets.select.SelectBase: options

panel.widgets.select.Select: value

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.Select(**params)[source]

Bases: panel.widgets.select.SelectBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.select.SelectBase: options

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.SelectBase(**params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

options = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.select.ToggleGroup(**params)[source]

Bases: panel.widgets.select.Select

This class is a factory of ToggleGroup widgets.

A ToggleGroup is a group of widgets which can be switched ‘on’ or ‘off’.

Two types of widgets are available through the widget_type argument :
  • ‘button’ (default)

  • ‘box’

Two different behaviors are available through behavior argument:
  • ‘check’ (default)boolean

    Any number of widgets can be selected. In this case value is a ‘list’ of objects.

  • ‘radio’boolean

    One and only one widget is switched on. In this case value is an ‘object’.

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.select.SelectBase: options

panel.widgets.select.Select: value

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


slider Module

Inheritance diagram of panel.widgets.slider

Defines the Widget base class which provides bi-directional communication between the rendered dashboard and the Widget parameters.

class panel.widgets.slider.ContinuousSlider(**params)[source]

Bases: panel.widgets.slider._SliderBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

format = param.ClassSelector(class_=(<class ‘str’>, <class ‘bokeh.models.formatters.TickFormatter’>))

Allows defining a custom format string or bokeh TickFormatter.

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.DateRangeSlider(**params)[source]

Bases: panel.widgets.slider._SliderBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

value = param.Tuple(default=(None, None), length=2)

value_throttled = param.Tuple(length=2)

start = param.Date(inclusive_bounds=(True, True))

end = param.Date(inclusive_bounds=(True, True))

step = param.Number(default=1, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.DateSlider(**params)[source]

Bases: panel.widgets.slider._SliderBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

value = param.Date(inclusive_bounds=(True, True))

value_throttled = param.Date(inclusive_bounds=(True, True))

start = param.Date(inclusive_bounds=(True, True))

end = param.Date(inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.DiscreteSlider(**params)[source]

Bases: panel.widgets.base.CompositeWidget, panel.widgets.slider._SliderBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

options = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

value = param.Parameter()

value_throttled = param.Parameter()

formatter = param.String(default=’%.3g’)

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.FloatSlider(**params)[source]

Bases: panel.widgets.slider.ContinuousSlider

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

panel.widgets.slider.ContinuousSlider: format

start = param.Number(default=0.0, inclusive_bounds=(True, True))

end = param.Number(default=1.0, inclusive_bounds=(True, True))

value = param.Number(default=0.0, inclusive_bounds=(True, True))

value_throttled = param.Number(inclusive_bounds=(True, True))

step = param.Number(default=0.1, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.IntRangeSlider(**params)[source]

Bases: panel.widgets.slider.RangeSlider

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

panel.widgets.slider.RangeSlider: format, value, value_throttled

start = param.Integer(default=0, inclusive_bounds=(True, True))

end = param.Integer(default=1, inclusive_bounds=(True, True))

step = param.Integer(default=1, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.IntSlider(**params)[source]

Bases: panel.widgets.slider.ContinuousSlider

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

panel.widgets.slider.ContinuousSlider: format

value = param.Integer(default=0, inclusive_bounds=(True, True))

value_throttled = param.Integer(inclusive_bounds=(True, True))

start = param.Integer(default=0, inclusive_bounds=(True, True))

end = param.Integer(default=1, inclusive_bounds=(True, True))

step = param.Integer(default=1, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread

class panel.widgets.slider.RangeSlider(**params)[source]

Bases: panel.widgets.slider._SliderBase

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

panel.widgets.slider._SliderBase: bar_color, direction, orientation, show_value, tooltips

format = param.ClassSelector(class_=(<class ‘str’>, <class ‘bokeh.models.formatters.TickFormatter’>))

Allows defining a custom format string or bokeh TickFormatter.

value = param.NumericTuple(default=(0, 1), length=2)

value_throttled = param.NumericTuple(length=2)

start = param.Number(default=0, inclusive_bounds=(True, True))

end = param.Number(default=1, inclusive_bounds=(True, True))

step = param.Number(default=0.1, inclusive_bounds=(True, True))

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread


tables Module

Inheritance diagram of panel.widgets.tables
class panel.widgets.tables.DataFrame(value=None, **params)[source]

Bases: panel.widgets.base.Widget

Parameters inherited from:

panel.viewable.Layoutable: align, aspect_ratio, background, css_classes, min_width, min_height, max_width, max_height, width_policy, height_policy, sizing_mode

panel.widgets.base.Widget: width, height, margin, disabled

editors = param.Dict(class_=<class ‘dict’>, default={})

Bokeh CellEditor to use for a particular column (overrides the default chosen based on the type).

formatters = param.Dict(class_=<class ‘dict’>, default={})

Bokeh CellFormatter to use for a particular column (overrides the default chosen based on the type).

fit_columns = param.Boolean(bounds=(0, 1), default=True)

Whether columns should expand to the available width. This results in no horizontal scrollbar showing up, but data can get unreadable if there is no enough space available.

selection = param.List(bounds=(0, None), default=[])

The currently selected rows of the table.

row_height = param.Integer(default=25, inclusive_bounds=(True, True))

The height of each table row.

widths = param.Dict(class_=<class ‘dict’>, default={})

A mapping from column name to column width.

value = param.Parameter()

add_periodic_callback(callback, period=500, count=None, timeout=None, start=True)

Schedules a periodic callback to be run at an interval set by the period. Returns a PeriodicCallback object with the option to stop and start the callback.

Parameters
  • callback (callable) – Callable function to be executed at periodic interval.

  • period (int) – Interval in milliseconds at which callback will be executed.

  • count (int) – Maximum number of times callback will be invoked.

  • timeout (int) – Timeout in seconds when the callback should be stopped.

  • start (boolean (default=True)) – Whether to start callback immediately.

Returns

Return type

Return a PeriodicCallback object with start and stop methods.

app(notebook_url='localhost:8888', port=0)

Displays a bokeh server app inline in the notebook.

Parameters
  • notebook_url (str) – URL to the notebook server

  • port (int (optional, default=0)) – Allows specifying a specific port

clone(**params)

Makes a copy of the object sharing the same parameters.

Parameters

params (Keyword arguments override the parameters on the clone.) –

Returns

Return type

Cloned Viewable object

controls(parameters=[], jslink=True)

Creates a set of widgets which allow manipulating the parameters on this instance. By default all parameters which support linking are exposed, but an explicit list of parameters can be provided.

Parameters
  • parameters (list(str)) – An explicit list of parameters to return controls for.

  • jslink (bool) – Whether to use jslinks instead of Python based links. This does not allow using all types of parameters.

Returns

Return type

A layout of the controls

embed(max_states=1000, max_opts=3, json=False, save_path='./', load_path=None, progress=True)

Renders a static version of a panel in a notebook by evaluating the set of states defined by the widgets in the model. Note this will only work well for simple apps with a relatively small state space.

Parameters
  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • json (boolean (default=True)) – Whether to export the data to json files

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

  • progress (boolean (default=False)) – Whether to report progress

get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

Parameters
  • doc (bokeh.Document) – Bokeh document the bokeh model will be attached to.

  • comm (pyviz_comms.Comm) – Optional pyviz_comms when working in notebook

Returns

Return type

Returns the bokeh model corresponding to this panel object

jscallback(args={}, **callbacks)

Allows defining a JS callback to be triggered when a property changes on the source object. The keyword arguments define the properties that trigger a callback and the JS code that gets executed.

Parameters
  • args (dict) – A mapping of objects to make available to the JS callback

  • **callbacks (dict) – A mapping between properties on the source model and the code to execute when that property changes

Returns

callback – The Callback which can be used to disable the callback.

Return type

Callback

Links properties on the source object to those on the target object in JS code. Supports two modes, either specify a mapping between the source and target model properties as keywords or provide a dictionary of JS code snippets which maps from the source parameter to a JS code snippet which is executed when the property changes.

Parameters
  • target (HoloViews object or bokeh Model or panel Viewable) – The target to link the value to.

  • code (dict) – Custom code which will be executed when the widget value changes.

  • bidirectional (boolean) – Whether to link source and target bi-directionally

  • **links (dict) – A mapping between properties on the source model and the target model property to link it to.

Returns

link – The GenericLink which can be used unlink the widget and the target model.

Return type

GenericLink

Links the parameters on this object to attributes on another object in Python. Supports two modes, either specify a mapping between the source and target object parameters as keywords or provide a dictionary of callbacks which maps from the source parameter to a callback which is triggered when the parameter changes.

Parameters
  • target (object) – The target object of the link.

  • callbacks (dict) – Maps from a parameter in the source object to a callback.

  • **links (dict) – Maps between parameters on this object to the parameters on the supplied object.

pprint()

Prints a compositional repr of the class.

save(filename, title=None, resources=None, template=None, template_variables=None, embed=False, max_states=1000, max_opts=3, embed_json=False, json_prefix='', save_path='./', load_path=None)

Saves Panel objects to file.

Parameters
  • filename (string or file-like object) – Filename to save the plot to

  • title (string) – Optional title for the plot

  • resources (bokeh resources) – One of the valid bokeh.resources (e.g. CDN or INLINE)

  • template – passed to underlying io.save

  • template_variables – passed to underlying io.save

  • embed (bool) – Whether the state space should be embedded in the saved file.

  • max_states (int) – The maximum number of states to embed

  • max_opts (int) – The maximum number of states for a single widget

  • embed_json (boolean (default=True)) – Whether to export the data to json files

  • json_prefix (str (default='')) – Prefix for the auto-generated json directory

  • save_path (str (default='./')) – The path to save json files to

  • load_path (str (default=None)) – The path or URL the json files will be loaded from.

select(selector=None)

Iterates over the Viewable and any potential children in the applying the Selector.

Parameters

selector (type or callable or None) – The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by.

Returns

viewables

Return type

list(Viewable)

property selected_dataframe

Returns a DataFrame of the currently selected rows.

servable(title=None)

Serves the object if in a panel serve context and returns the Panel object to allow it to display itself in a notebook context.

Parameters

title (str) – A string title to give the Document (if served as an app)

Returns

Return type

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

Parameters
  • doc (bokeh.Document (optional)) – The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

  • title (str) – A string title to give the Document

Returns

doc – The bokeh document the panel was attached to

Return type

bokeh.Document

show(title=None, port=0, websocket_origin=None, threaded=False, verbose=True, open=True, **kwargs)

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters
  • port (int (optional, default=0)) – Allows specifying a specific port

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • title (str) – A string title to give the Document (if served as an app)

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

Returns

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type

bokeh.server.Server or threading.Thread