holoviews.widgets Package


widgets Package

class holoviews.plotting.widgets. NdWidget ( plot , renderer=None , **params ) [source]

Bases: param.parameterized.Parameterized

NdWidget is an abstract base class implementing a method to find the dimensions and keys of any ViewableElement, GridSpace or UniformNdMapping type. In the process it creates a mock_obj to hold the dimensions and keys.

param Dict display_options ( allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False )
The display options used to generate individual frames
param Boolean embed ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Whether to embed all plots in the Javascript, generating a static widget not dependent on the IPython server.
param Boolean export_json ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Whether to export plots as json files, which can be dynamically loaded through a callback from the slider.
param String json_save_path ( allow_None=False, basestring=<class ‘str’>, constant=False, default=./json_figures, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
If export_json is enabled the widget will save the json data to this path. If None data will be accessible via the json_data attribute.
param String json_load_path ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
If export_json is enabled the widget JS code will load the data from this path, if None defaults to json_save_path. For loading the data from within the notebook the path must be relative, when exporting the notebook the path can be set to another location like a webserver where the json files can be uploaded to.

param Dict CDN ( allow_None=False, constant=False, default={‘underscore’: ‘https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js’, ‘jQueryUI’: ‘https://code.jquery.com/ui/1.10.4/jquery-ui.min.js’}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False )

param String css ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Defines the local CSS file to be loaded for this widget.
param String basejs ( allow_None=False, basestring=<class ‘str’>, constant=False, default=widgets.js, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
JS file containing javascript baseclasses for the widget.
param String extensionjs ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Optional javascript extension file for a particular backend.
debug ( msg , *args , **kw )

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults ( )

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.plotting.widgets.NdWidget'>)
get_param_values ( onlychanged=False )

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.plotting.widgets.NdWidget'>)
inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.plotting.widgets.NdWidget'>)
message ( msg , *args , **kw )

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

params ( parameter_name=None )

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( )

Print the default values of all cls’s Parameters.

print_param_values ( )

Print the values of all this object’s Parameters.

save_json ( frames ) [source]

Saves frames data into a json file at the specified json_path, named with the widget uuid.

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

Variant of __repr__ designed for generating a runnable script.

set_default ( param_name , value )

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.plotting.widgets.NdWidget'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.plotting.widgets.NdWidget'>)
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 ( msg , *args , **kw )

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning ( msg , *args , **kw )

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class holoviews.plotting.widgets. ScrubberWidget ( plot , renderer=None , **params ) [source]

Bases: holoviews.plotting.widgets.NdWidget

ScrubberWidget generates a basic animation widget with a slider and various play/rewind/stepping options. It has been adapted from Jake Vanderplas’ JSAnimation library, which was released under BSD license.

Optionally the individual plots can be exported to json, which can be dynamically loaded by serving the data the data for each frame on a simple server.

param Dict display_options ( allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False )
The display options used to generate individual frames
param Boolean embed ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Whether to embed all plots in the Javascript, generating a static widget not dependent on the IPython server.
param Boolean export_json ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Whether to export plots as json files, which can be dynamically loaded through a callback from the slider.
param String json_save_path ( allow_None=False, basestring=<class ‘str’>, constant=False, default=./json_figures, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
If export_json is enabled the widget will save the json data to this path. If None data will be accessible via the json_data attribute.
param String json_load_path ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
If export_json is enabled the widget JS code will load the data from this path, if None defaults to json_save_path. For loading the data from within the notebook the path must be relative, when exporting the notebook the path can be set to another location like a webserver where the json files can be uploaded to.

param Dict CDN ( allow_None=False, constant=False, default={‘underscore’: ‘https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js’, ‘jQueryUI’: ‘https://code.jquery.com/ui/1.10.4/jquery-ui.min.js’}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False )

param String css ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Defines the local CSS file to be loaded for this widget.
param String basejs ( allow_None=False, basestring=<class ‘str’>, constant=False, default=widgets.js, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
JS file containing javascript baseclasses for the widget.
param String extensionjs ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Optional javascript extension file for a particular backend.
param String base_template ( allow_None=False, basestring=<class ‘str’>, constant=False, default=jsscrubber.jinja, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
The jinja2 template used to generate the html output.
param String template ( allow_None=False, basestring=<class ‘str’>, constant=False, default=jsscrubber.jinja, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
The jinja2 template used to generate the html output.
debug ( msg , *args , **kw )

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults ( )

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.plotting.widgets.ScrubberWidget'>)
get_param_values ( onlychanged=False )

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.plotting.widgets.ScrubberWidget'>)
inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.plotting.widgets.ScrubberWidget'>)
message ( msg , *args , **kw )

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

params ( parameter_name=None )

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( )

Print the default values of all cls’s Parameters.

print_param_values ( )

Print the values of all this object’s Parameters.

save_json ( frames )

Saves frames data into a json file at the specified json_path, named with the widget uuid.

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

Variant of __repr__ designed for generating a runnable script.

set_default ( param_name , value )

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.plotting.widgets.ScrubberWidget'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.plotting.widgets.ScrubberWidget'>)
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 ( msg , *args , **kw )

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning ( msg , *args , **kw )

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class holoviews.plotting.widgets. SelectionWidget ( plot , renderer=None , **params ) [source]

Bases: holoviews.plotting.widgets.NdWidget

Javascript based widget to select and view ViewableElement objects contained in an NdMapping. For each dimension in the NdMapping a slider or dropdown selection widget is created and can be used to select the html output associated with the selected ViewableElement type. The widget maybe set to embed all frames in the supplied object into the rendered html or to dynamically update the widget with a live IPython kernel.

The widget supports all current HoloViews figure backends including png, svg and nbagg output. To select nbagg output, the SelectionWidget must not be set to embed.

Just like the ScrubberWidget the data can be optionally saved to json and dynamically loaded from a server.

param Dict display_options ( allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False )
The display options used to generate individual frames
param Boolean embed ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Whether to embed all plots in the Javascript, generating a static widget not dependent on the IPython server.
param Boolean export_json ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Whether to export plots as json files, which can be dynamically loaded through a callback from the slider.
param String json_save_path ( allow_None=False, basestring=<class ‘str’>, constant=False, default=./json_figures, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
If export_json is enabled the widget will save the json data to this path. If None data will be accessible via the json_data attribute.
param String json_load_path ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
If export_json is enabled the widget JS code will load the data from this path, if None defaults to json_save_path. For loading the data from within the notebook the path must be relative, when exporting the notebook the path can be set to another location like a webserver where the json files can be uploaded to.

param Dict CDN ( allow_None=False, constant=False, default={‘underscore’: ‘https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js’, ‘jQueryUI’: ‘https://code.jquery.com/ui/1.10.4/jquery-ui.min.js’}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False )

param String css ( allow_None=False, basestring=<class ‘str’>, constant=False, default=jsslider.css, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Defines the local CSS file to be loaded for this widget.
param String basejs ( allow_None=False, basestring=<class ‘str’>, constant=False, default=widgets.js, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
JS file containing javascript baseclasses for the widget.
param String extensionjs ( allow_None=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
Optional javascript extension file for a particular backend.
param String base_template ( allow_None=False, basestring=<class ‘str’>, constant=False, default=jsslider.jinja, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
The jinja2 template used to generate the html output.
param String template ( allow_None=False, basestring=<class ‘str’>, constant=False, default=jsslider.jinja, instantiate=False, pickle_default_value=True, precedence=None, readonly=False )
The jinja2 template used to generate the html output.
debug ( msg , *args , **kw )

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults ( )

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.plotting.widgets.SelectionWidget'>)
get_param_values ( onlychanged=False )

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.plotting.widgets.SelectionWidget'>)
inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.plotting.widgets.SelectionWidget'>)
message ( msg , *args , **kw )

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

params ( parameter_name=None )

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( )

Print the default values of all cls’s Parameters.

print_param_values ( )

Print the values of all this object’s Parameters.

save_json ( frames )

Saves frames data into a json file at the specified json_path, named with the widget uuid.

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

Variant of __repr__ designed for generating a runnable script.

set_default ( param_name , value )

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.plotting.widgets.SelectionWidget'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.plotting.widgets.SelectionWidget'>)
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 ( msg , *args , **kw )

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning ( msg , *args , **kw )

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

holoviews.plotting.widgets. escape_vals ( vals , escape_numerics=True ) [source]

Escapes a list of values to a string, converting to unicode for safety.