annotators Module

annotators Module

class holoviews.annotators.Annotator(object=None, **params)[source]

Bases: panel.pane.base.PaneBase

An Annotator allows drawing, editing and annotating a specific type of element. Each Annotator consists of the plot to draw and edit the element and the editor, which contains a list of tables, which make it possible to annotate each object in the element with additional properties defined in the annotations.

align = param.ObjectSelector(default=’start’, objects=[‘start’, ‘end’, ‘center’])

Whether the object should be aligned with the start, end or center of its container

aspect_ratio = param.Parameter()

Describes the proportional relationship between component’s width and height. This works if any of component’s dimensions are flexible in size. If set to a number, width / height =         aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

background = param.Parameter()

Background color of the component.

css_classes = param.List(bounds=(0, None))

CSS classes to apply to the layout.

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

min_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

min_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

max_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

max_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

margin = param.Parameter(default=5)

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).

width_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its width. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

height_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its height. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

sizing_mode = param.ObjectSelector(objects=[‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, None])

How the component should size itself. This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode). * “fixed” Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events. * “stretch_width” Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_height” Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_both” Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component. * “scale_width” Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio. * “scale_height” Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio. * “scale_both” Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

default_layout = param.ClassSelector(class_=<class ‘panel.layout.Panel’>, default=<class ‘panel.layout.Row’>)

Defines the layout the model(s) returned by the pane will be placed in.

object = param.ClassSelector(class_=<class ‘holoviews.core.element.Element’>)

The Element to edit and annotate.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

default_opts = param.Dict(class_=<class ‘dict’>, default={‘responsive’: True, ‘min_height’: 400, ‘padding’: 0.1, ‘framewise’: True})

Opts to apply to the element.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

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.

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.

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.

notebook_url: str

URL to the notebook server

port: int (optional, default=0)

Allows specifying a specific port

classmethod applies(obj)[source]

Given the object return a boolean indicating whether the Pane can render the object. If the priority of the pane is set to None, this method may also be used to define a priority depending on the object being rendered.

clone(object=None, **params)

Makes a copy of the Pane sharing the same parameters.

params: Keyword arguments override the parameters on the clone.

Cloned Pane object

classmethod compose(*annotators)[source]

Composes multiple Annotator instances and elements

The composed Panel will contain all the elements in the supplied Annotators and Tabs containing all editors.

Args:

annotators: Annotator objects or elements to compose

Returns:

A new Panel consisting of the overlaid plots and tables

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: 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.

A layout of the controls

debug(**kwargs)

Inspect .param.debug method for the full docstring

default_layout

alias of panel.layout.Row

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

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.

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

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
classmethod get_pane_type(obj, **kwargs)

Returns the applicable Pane type given an object by resolving the precedence of all types whose applies method declares that the object is supported.

obj (object): The object type to return a Pane for

The applicable Pane type with the highest precedence.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

Returns the bokeh model corresponding to this panel object

get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
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.

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

callback: Callback

The Callback which can be used to disable the 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.

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.

link: GenericLink

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

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.

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.

message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
pprint()

Prints a compositional repr of the class.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

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.

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.

script_repr(imports=[], prefix=' ')

Variant of __repr__ designed for generating a runnable script.

select(selector=None)[source]

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

selector: type or callable or None

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

viewables: 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. Arguments ——— title : str

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

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

docbokeh.Document

The bokeh document the panel was attached to

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.Annotator'>)
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.

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.

titlestr

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

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

server: bokeh.server.Server or threading.Thread

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

holoviews.annotators.BoxAnnotator

alias of holoviews.annotators.RectangleAnnotator

class holoviews.annotators.CurveAnnotator(object=None, **params)[source]

Bases: holoviews.annotators._GeomAnnotator

Annotator which allows editing a Curve element and associating values with each vertex using a Table.

align = param.ObjectSelector(default=’start’, objects=[‘start’, ‘end’, ‘center’])

Whether the object should be aligned with the start, end or center of its container

aspect_ratio = param.Parameter()

Describes the proportional relationship between component’s width and height. This works if any of component’s dimensions are flexible in size. If set to a number, width / height =         aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

background = param.Parameter()

Background color of the component.

css_classes = param.List(bounds=(0, None))

CSS classes to apply to the layout.

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

min_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

min_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

max_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

max_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

margin = param.Parameter(default=5)

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).

width_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its width. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

height_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its height. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

sizing_mode = param.ObjectSelector(objects=[‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, None])

How the component should size itself. This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode). * “fixed” Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events. * “stretch_width” Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_height” Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_both” Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component. * “scale_width” Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio. * “scale_height” Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio. * “scale_both” Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

default_layout = param.ClassSelector(class_=<class ‘panel.layout.Panel’>, default=<class ‘panel.layout.Row’>)

Defines the layout the model(s) returned by the pane will be placed in.

object = param.ClassSelector(class_=<class ‘holoviews.element.chart.Curve’>)

Points element to edit and annotate.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

default_opts = param.Dict(class_=<class ‘dict’>, default={‘responsive’: True, ‘min_height’: 400, ‘padding’: 0.1, ‘framewise’: True})

Opts to apply to the element.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

vertex_style = param.Dict(class_=<class ‘dict’>, default={‘size’: 10})

Options to apply to vertices during drawing and editing.

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.

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.

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.

notebook_url: str

URL to the notebook server

port: int (optional, default=0)

Allows specifying a specific port

classmethod applies(obj)

Given the object return a boolean indicating whether the Pane can render the object. If the priority of the pane is set to None, this method may also be used to define a priority depending on the object being rendered.

clone(object=None, **params)

Makes a copy of the Pane sharing the same parameters.

params: Keyword arguments override the parameters on the clone.

Cloned Pane object

classmethod compose(*annotators)

Composes multiple Annotator instances and elements

The composed Panel will contain all the elements in the supplied Annotators and Tabs containing all editors.

Args:

annotators: Annotator objects or elements to compose

Returns:

A new Panel consisting of the overlaid plots and tables

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: 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.

A layout of the controls

debug(**kwargs)

Inspect .param.debug method for the full docstring

default_layout

alias of panel.layout.Row

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

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.

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

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
classmethod get_pane_type(obj, **kwargs)

Returns the applicable Pane type given an object by resolving the precedence of all types whose applies method declares that the object is supported.

obj (object): The object type to return a Pane for

The applicable Pane type with the highest precedence.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

Returns the bokeh model corresponding to this panel object

get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
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.

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

callback: Callback

The Callback which can be used to disable the 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.

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.

link: GenericLink

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

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.

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.

message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
pprint()

Prints a compositional repr of the class.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

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.

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.

script_repr(imports=[], prefix=' ')

Variant of __repr__ designed for generating a runnable script.

select(selector=None)

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

selector: type or callable or None

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

viewables: 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. Arguments ——— title : str

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

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

docbokeh.Document

The bokeh document the panel was attached to

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.CurveAnnotator'>)
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.

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.

titlestr

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

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

server: bokeh.server.Server or threading.Thread

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

class holoviews.annotators.PathAnnotator(object=None, **params)[source]

Bases: holoviews.annotators.Annotator

Annotator which allows drawing and editing Paths and associating values with each path and each vertex of a path using a table.

align = param.ObjectSelector(default=’start’, objects=[‘start’, ‘end’, ‘center’])

Whether the object should be aligned with the start, end or center of its container

aspect_ratio = param.Parameter()

Describes the proportional relationship between component’s width and height. This works if any of component’s dimensions are flexible in size. If set to a number, width / height =         aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

background = param.Parameter()

Background color of the component.

css_classes = param.List(bounds=(0, None))

CSS classes to apply to the layout.

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

min_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

min_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

max_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

max_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

margin = param.Parameter(default=5)

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).

width_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its width. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

height_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its height. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

sizing_mode = param.ObjectSelector(objects=[‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, None])

How the component should size itself. This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode). * “fixed” Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events. * “stretch_width” Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_height” Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_both” Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component. * “scale_width” Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio. * “scale_height” Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio. * “scale_both” Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

default_layout = param.ClassSelector(class_=<class ‘panel.layout.Panel’>, default=<class ‘panel.layout.Row’>)

Defines the layout the model(s) returned by the pane will be placed in.

object = param.ClassSelector(class_=<class ‘holoviews.element.path.Path’>)

Path object to edit and annotate.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

default_opts = param.Dict(class_=<class ‘dict’>, default={‘responsive’: True, ‘min_height’: 400, ‘padding’: 0.1, ‘framewise’: True})

Opts to apply to the element.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

edit_vertices = param.Boolean(bounds=(0, 1), default=True)

Whether to add tool to edit vertices.

show_vertices = param.Boolean(bounds=(0, 1), default=True)

Whether to show vertices when drawing the Path.

vertex_annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Columns to annotate the Polygons with.

vertex_style = param.Dict(class_=<class ‘dict’>, default={‘nonselection_alpha’: 0.5})

Options to apply to vertices during drawing and editing.

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.

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.

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.

notebook_url: str

URL to the notebook server

port: int (optional, default=0)

Allows specifying a specific port

classmethod applies(obj)

Given the object return a boolean indicating whether the Pane can render the object. If the priority of the pane is set to None, this method may also be used to define a priority depending on the object being rendered.

clone(object=None, **params)

Makes a copy of the Pane sharing the same parameters.

params: Keyword arguments override the parameters on the clone.

Cloned Pane object

classmethod compose(*annotators)

Composes multiple Annotator instances and elements

The composed Panel will contain all the elements in the supplied Annotators and Tabs containing all editors.

Args:

annotators: Annotator objects or elements to compose

Returns:

A new Panel consisting of the overlaid plots and tables

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: 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.

A layout of the controls

debug(**kwargs)

Inspect .param.debug method for the full docstring

default_layout

alias of panel.layout.Row

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

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.

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

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
classmethod get_pane_type(obj, **kwargs)

Returns the applicable Pane type given an object by resolving the precedence of all types whose applies method declares that the object is supported.

obj (object): The object type to return a Pane for

The applicable Pane type with the highest precedence.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

Returns the bokeh model corresponding to this panel object

get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
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.

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

callback: Callback

The Callback which can be used to disable the 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.

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.

link: GenericLink

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

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.

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.

message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
pprint()

Prints a compositional repr of the class.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

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.

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.

script_repr(imports=[], prefix=' ')

Variant of __repr__ designed for generating a runnable script.

select(selector=None)

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

selector: type or callable or None

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

viewables: 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. Arguments ——— title : str

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

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

docbokeh.Document

The bokeh document the panel was attached to

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PathAnnotator'>)
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.

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.

titlestr

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

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

server: bokeh.server.Server or threading.Thread

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

class holoviews.annotators.PointAnnotator(object=None, **params)[source]

Bases: holoviews.annotators._GeomAnnotator

Annotator which allows drawing and editing Points and associating values with each point using a table.

align = param.ObjectSelector(default=’start’, objects=[‘start’, ‘end’, ‘center’])

Whether the object should be aligned with the start, end or center of its container

aspect_ratio = param.Parameter()

Describes the proportional relationship between component’s width and height. This works if any of component’s dimensions are flexible in size. If set to a number, width / height =         aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

background = param.Parameter()

Background color of the component.

css_classes = param.List(bounds=(0, None))

CSS classes to apply to the layout.

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

min_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

min_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

max_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

max_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

margin = param.Parameter(default=5)

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).

width_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its width. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

height_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its height. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

sizing_mode = param.ObjectSelector(objects=[‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, None])

How the component should size itself. This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode). * “fixed” Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events. * “stretch_width” Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_height” Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_both” Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component. * “scale_width” Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio. * “scale_height” Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio. * “scale_both” Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

default_layout = param.ClassSelector(class_=<class ‘panel.layout.Panel’>, default=<class ‘panel.layout.Row’>)

Defines the layout the model(s) returned by the pane will be placed in.

object = param.ClassSelector(class_=<class ‘holoviews.element.geom.Points’>)

Points element to edit and annotate.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

default_opts = param.Dict(class_=<class ‘dict’>, default={‘responsive’: True, ‘min_height’: 400, ‘padding’: 0.1, ‘size’: 10, ‘framewise’: True})

Opts to apply to the element.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

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.

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.

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.

notebook_url: str

URL to the notebook server

port: int (optional, default=0)

Allows specifying a specific port

classmethod applies(obj)

Given the object return a boolean indicating whether the Pane can render the object. If the priority of the pane is set to None, this method may also be used to define a priority depending on the object being rendered.

clone(object=None, **params)

Makes a copy of the Pane sharing the same parameters.

params: Keyword arguments override the parameters on the clone.

Cloned Pane object

classmethod compose(*annotators)

Composes multiple Annotator instances and elements

The composed Panel will contain all the elements in the supplied Annotators and Tabs containing all editors.

Args:

annotators: Annotator objects or elements to compose

Returns:

A new Panel consisting of the overlaid plots and tables

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: 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.

A layout of the controls

debug(**kwargs)

Inspect .param.debug method for the full docstring

default_layout

alias of panel.layout.Row

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

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.

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

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
classmethod get_pane_type(obj, **kwargs)

Returns the applicable Pane type given an object by resolving the precedence of all types whose applies method declares that the object is supported.

obj (object): The object type to return a Pane for

The applicable Pane type with the highest precedence.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

Returns the bokeh model corresponding to this panel object

get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
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.

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

callback: Callback

The Callback which can be used to disable the 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.

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.

link: GenericLink

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

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.

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.

message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
pprint()

Prints a compositional repr of the class.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

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.

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.

script_repr(imports=[], prefix=' ')

Variant of __repr__ designed for generating a runnable script.

select(selector=None)

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

selector: type or callable or None

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

viewables: 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. Arguments ——— title : str

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

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

docbokeh.Document

The bokeh document the panel was attached to

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PointAnnotator'>)
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.

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.

titlestr

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

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

server: bokeh.server.Server or threading.Thread

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

class holoviews.annotators.PolyAnnotator(object=None, **params)[source]

Bases: holoviews.annotators.PathAnnotator

Annotator which allows drawing and editing Polygons and associating values with each polygon and each vertex of a Polygon using a table.

align = param.ObjectSelector(default=’start’, objects=[‘start’, ‘end’, ‘center’])

Whether the object should be aligned with the start, end or center of its container

aspect_ratio = param.Parameter()

Describes the proportional relationship between component’s width and height. This works if any of component’s dimensions are flexible in size. If set to a number, width / height =         aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

background = param.Parameter()

Background color of the component.

css_classes = param.List(bounds=(0, None))

CSS classes to apply to the layout.

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

min_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

min_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

max_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

max_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

margin = param.Parameter(default=5)

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).

width_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its width. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

height_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its height. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

sizing_mode = param.ObjectSelector(objects=[‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, None])

How the component should size itself. This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode). * “fixed” Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events. * “stretch_width” Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_height” Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_both” Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component. * “scale_width” Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio. * “scale_height” Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio. * “scale_both” Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

default_layout = param.ClassSelector(class_=<class ‘panel.layout.Panel’>, default=<class ‘panel.layout.Row’>)

Defines the layout the model(s) returned by the pane will be placed in.

object = param.ClassSelector(class_=<class ‘holoviews.element.path.Polygons’>)

Polygon element to edit and annotate.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

default_opts = param.Dict(class_=<class ‘dict’>, default={‘responsive’: True, ‘min_height’: 400, ‘padding’: 0.1, ‘framewise’: True})

Opts to apply to the element.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

edit_vertices = param.Boolean(bounds=(0, 1), default=True)

Whether to add tool to edit vertices.

show_vertices = param.Boolean(bounds=(0, 1), default=True)

Whether to show vertices when drawing the Path.

vertex_annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Columns to annotate the Polygons with.

vertex_style = param.Dict(class_=<class ‘dict’>, default={‘nonselection_alpha’: 0.5})

Options to apply to vertices during drawing and editing.

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.

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.

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.

notebook_url: str

URL to the notebook server

port: int (optional, default=0)

Allows specifying a specific port

classmethod applies(obj)

Given the object return a boolean indicating whether the Pane can render the object. If the priority of the pane is set to None, this method may also be used to define a priority depending on the object being rendered.

clone(object=None, **params)

Makes a copy of the Pane sharing the same parameters.

params: Keyword arguments override the parameters on the clone.

Cloned Pane object

classmethod compose(*annotators)

Composes multiple Annotator instances and elements

The composed Panel will contain all the elements in the supplied Annotators and Tabs containing all editors.

Args:

annotators: Annotator objects or elements to compose

Returns:

A new Panel consisting of the overlaid plots and tables

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: 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.

A layout of the controls

debug(**kwargs)

Inspect .param.debug method for the full docstring

default_layout

alias of panel.layout.Row

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

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.

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

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
classmethod get_pane_type(obj, **kwargs)

Returns the applicable Pane type given an object by resolving the precedence of all types whose applies method declares that the object is supported.

obj (object): The object type to return a Pane for

The applicable Pane type with the highest precedence.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

Returns the bokeh model corresponding to this panel object

get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
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.

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

callback: Callback

The Callback which can be used to disable the 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.

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.

link: GenericLink

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

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.

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.

message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
pprint()

Prints a compositional repr of the class.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

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.

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.

script_repr(imports=[], prefix=' ')

Variant of __repr__ designed for generating a runnable script.

select(selector=None)

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

selector: type or callable or None

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

viewables: 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. Arguments ——— title : str

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

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

docbokeh.Document

The bokeh document the panel was attached to

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.PolyAnnotator'>)
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.

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.

titlestr

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

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

server: bokeh.server.Server or threading.Thread

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

class holoviews.annotators.RectangleAnnotator(object=None, **params)[source]

Bases: holoviews.annotators._GeomAnnotator

Annotator which allows drawing and editing Rectangles and associating values with each point using a table.

align = param.ObjectSelector(default=’start’, objects=[‘start’, ‘end’, ‘center’])

Whether the object should be aligned with the start, end or center of its container

aspect_ratio = param.Parameter()

Describes the proportional relationship between component’s width and height. This works if any of component’s dimensions are flexible in size. If set to a number, width / height =         aspect_ratio relationship will be maintained. Otherwise, if set to "auto", component’s preferred width and height will be used to determine the aspect (if not set, no aspect will be preserved).

background = param.Parameter()

Background color of the component.

css_classes = param.List(bounds=(0, None))

CSS classes to apply to the layout.

width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

min_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

min_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

max_width = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal width of the component (in pixels) if width is adjustable.

max_height = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Minimal height of the component (in pixels) if height is adjustable.

margin = param.Parameter(default=5)

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).

width_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its width. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

height_policy = param.ObjectSelector(default=’auto’, objects=[‘auto’, ‘fixed’, ‘fit’, ‘min’, ‘max’])

Describes how the component should maintain its height. * “auto” Use component’s preferred sizing policy. * “fixed” Use exactly width pixels. Component will overflow if it can’t fit in the available horizontal space. * “fit” Use component’s preferred width (if set) and allow it to fit into the available horizontal space within the minimum and maximum width bounds (if set). Component’s width neither will be aggressively minimized nor maximized. * “min” Use as little horizontal space as possible, not less than the minimum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors. * “max” Use as much horizontal space as possible, not more than the maximum width (if set). The starting point is the preferred width (if set). The width of the component may shrink or grow depending on the parent layout, aspect management and other factors.

sizing_mode = param.ObjectSelector(objects=[‘fixed’, ‘stretch_width’, ‘stretch_height’, ‘stretch_both’, ‘scale_width’, ‘scale_height’, ‘scale_both’, None])

How the component should size itself. This is a high-level setting for maintaining width and height of the component. To gain more fine grained control over sizing, use width_policy, height_policy and aspect_ratio instead (those take precedence over sizing_mode). * “fixed” Component is not responsive. It will retain its original width and height regardless of any subsequent browser window resize events. * “stretch_width” Component will responsively resize to stretch to the available width, without maintaining any aspect ratio. The height of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_height” Component will responsively resize to stretch to the available height, without maintaining any aspect ratio. The width of the component depends on the type of the component and may be fixed or fit to component’s contents. * “stretch_both” Component is completely responsive, independently in width and height, and will occupy all the available horizontal and vertical space, even if this changes the aspect ratio of the component. * “scale_width” Component will responsively resize to stretch to the available width, while maintaining the original or provided aspect ratio. * “scale_height” Component will responsively resize to stretch to the available height, while maintaining the original or provided aspect ratio. * “scale_both” Component will responsively resize to both the available width and height, while maintaining the original or provided aspect ratio.

default_layout = param.ClassSelector(class_=<class ‘panel.layout.Panel’>, default=<class ‘panel.layout.Row’>)

Defines the layout the model(s) returned by the pane will be placed in.

object = param.ClassSelector(class_=<class ‘holoviews.element.geom.Rectangles’>)

Points element to edit and annotate.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

default_opts = param.Dict(class_=<class ‘dict’>, default={‘responsive’: True, ‘min_height’: 400, ‘padding’: 0.1, ‘framewise’: True})

Opts to apply to the element.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

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.

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.

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.

notebook_url: str

URL to the notebook server

port: int (optional, default=0)

Allows specifying a specific port

classmethod applies(obj)

Given the object return a boolean indicating whether the Pane can render the object. If the priority of the pane is set to None, this method may also be used to define a priority depending on the object being rendered.

clone(object=None, **params)

Makes a copy of the Pane sharing the same parameters.

params: Keyword arguments override the parameters on the clone.

Cloned Pane object

classmethod compose(*annotators)

Composes multiple Annotator instances and elements

The composed Panel will contain all the elements in the supplied Annotators and Tabs containing all editors.

Args:

annotators: Annotator objects or elements to compose

Returns:

A new Panel consisting of the overlaid plots and tables

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: 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.

A layout of the controls

debug(**kwargs)

Inspect .param.debug method for the full docstring

default_layout

alias of panel.layout.Row

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

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.

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

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
classmethod get_pane_type(obj, **kwargs)

Returns the applicable Pane type given an object by resolving the precedence of all types whose applies method declares that the object is supported.

obj (object): The object type to return a Pane for

The applicable Pane type with the highest precedence.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
get_root(doc=None, comm=None)

Returns the root model and applies pre-processing hooks

doc: bokeh.Document

Bokeh document the bokeh model will be attached to.

comm: pyviz_comms.Comm

Optional pyviz_comms when working in notebook

Returns the bokeh model corresponding to this panel object

get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
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.

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

callback: Callback

The Callback which can be used to disable the 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.

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.

link: GenericLink

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

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.

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.

message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
pprint()

Prints a compositional repr of the class.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

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.

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.

script_repr(imports=[], prefix=' ')

Variant of __repr__ designed for generating a runnable script.

select(selector=None)

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

selector: type or callable or None

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

viewables: 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. Arguments ——— title : str

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

The Panel object itself

server_doc(doc=None, title=None)

Returns a serveable bokeh Document with the panel attached

docbokeh.Document (optional)

The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc()

titlestr

A string title to give the Document

docbokeh.Document

The bokeh document the panel was attached to

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.RectangleAnnotator'>)
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.

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.

titlestr

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

verbose: boolean (optional, default=True)

Whether to print the address and port

openboolean (optional, default=True)

Whether to open the server in a new browser tab

server: bokeh.server.Server or threading.Thread

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

class holoviews.annotators.annotate(*, fig, holomap, widgets, fps, max_frames, size, dpi, filename, info, css, widget_location)[source]

Bases: param.parameterized.ParameterizedFunction

The annotate function allows drawing, editing and annotating any given Element (if it is supported). The annotate function returns a Layout of the editable plot and an Overlay of table(s), which allow editing the data of the element. The edited and annotated data may be accessed using the element and selected properties.

annotator = param.Parameter()

The current Annotator instance.

annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Annotations to associate with each object.

edit_vertices = param.Boolean(bounds=(0, 1), default=True)

Whether to add tool to edit vertices.

empty_value = param.Parameter()

The value to insert on annotation columns when drawing a new element.

num_objects = param.Integer(bounds=(0, None), inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

The maximum number of objects to draw.

show_vertices = param.Boolean(bounds=(0, 1), default=True)

Whether to show vertices when drawing the Path.

table_transforms = param.HookList(bounds=(0, None), default=[])

Transform(s) to apply to element when converting data to Table. The functions should accept the Annotator and the transformed element as input.

table_opts = param.Dict(class_=<class ‘dict’>, default={‘editable’: True, ‘width’: 400})

Opts to apply to the editor table(s).

vertex_annotations = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default=[])

Columns to annotate the Polygons with.

vertex_style = param.Dict(class_=<class ‘dict’>, default={‘nonselection_alpha’: 0.5})

Options to apply to vertices during drawing and editing.

classmethod compose(*annotators)[source]

Composes multiple annotator layouts and elements

The composed Layout will contain all the elements in the supplied annotators and an overlay of all editor tables.

Args:

annotators: Annotator layouts or elements to compose

Returns:

A new layout consisting of the overlaid plots and tables

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.annotators.annotate'>)
message(**kwargs)

Inspect .param.message method for the full docstring

params = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
pprint(imports=None, prefix='\n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod set_default(*args, **kwargs)

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.annotators.annotate'>)
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

holoviews.annotators.preprocess(function, current=[])[source]

Turns a param.depends watch call into a preprocessor method, i.e. skips all downstream events triggered by it. NOTE: This is a temporary hack while the addition of preprocessors

in param is under discussion. This only works for the first method which depends on a particular parameter. (see https://github.com/pyviz/param/issues/332)