ExportViewer#

class jdaviz.configs.default.plugins.export_plot.export_plot.ExportViewer(*args, **kwargs)[source]#

Bases: PluginTemplateMixin, ViewerSelectMixin

See the Export Plot Plugin Documentation for more details.

Only the following attributes and methods are available through the public plugin API:

Public constructor

Attributes Summary

i_end

Mixin to handle empty integer field.

i_start

Mixin to handle empty integer field.

movie_enabled

A boolean (True, False) trait.

movie_filename

A trait which allows any value.

movie_fps

Mixin to handle empty floating point field.

movie_interrupt

A boolean (True, False) trait.

movie_msg

A trait for unicode strings.

movie_recording

A boolean (True, False) trait.

template_file

user_api

Methods Summary

save_figure([filename, filetype])

Save the figure to an image with a provided filename or through an interactive save dialog.

save_movie([i_start, i_end, fps, filename, ...])

Save selected slices as a movie.

vue_interrupt_recording(*args)

vue_save_figure(filetype)

Callback for save figure events in the front end viewer toolbars.

vue_save_movie(filetype)

Callback for save movie events in the front end viewer toolbars.

Attributes Documentation

i_end#

Mixin to handle empty integer field.

i_start#

Mixin to handle empty integer field.

movie_enabled#

A boolean (True, False) trait.

movie_filename#

A trait which allows any value.

movie_fps#

Mixin to handle empty floating point field.

movie_interrupt#

A boolean (True, False) trait.

movie_msg#

A trait for unicode strings.

movie_recording#

A boolean (True, False) trait.

template_file = ('/home/docs/checkouts/readthedocs.org/user_builds/jdaviz/envs/v3.7.0/lib/python3.11/site-packages/jdaviz/configs/default/plugins/export_plot/export_plot.py', 'export_plot.vue')#
user_api#

Methods Documentation

save_figure(filename=None, filetype=None)[source]#

Save the figure to an image with a provided filename or through an interactive save dialog.

If filetype is ‘png’ (or defaults to ‘png’ based on filename), the interactive save dialog will be bypassed (this is not supported for ‘svg’).

Parameters:
filenamestr or None

Filename to autopopulate the save dialog.

filetype{‘png’, ‘svg’, None}

Filetype (PNG or SVG). If None, will default based on filename or to PNG.

save_movie(i_start=None, i_end=None, fps=None, filename=None, filetype=None, rm_temp_files=True)[source]#

Save selected slices as a movie.

This method creates a PNG file per frame (._cubeviz_movie_frame_<n>.png) in the working directory before stitching all the frames into a movie. Please make sure you have sufficient memory for this operation. PNG files are deleted after the movie is created unless otherwise specified. If another PNG file with the same name already exists, it will be silently replaced.

Parameters:
i_start, i_endint or None

Slices to record; each slice will be a frame in the movie. If not given, it is obtained from plugin inputs. Unlike Python indexing, i_end is inclusive. Wrapping and reverse indexing are not supported.

fpsfloat or None

Frame rate in frames per second (FPS). If not given, it is obtained from plugin inputs.

filenamestr or None

Filename for the movie to be recorded. Include path if necessary. If not given, it is obtained from plugin inputs. If another file with the same name already exists, it will be silently replaced.

filetype{‘mp4’, None}

Currently only MPEG-4 is supported. This keyword is reserved for future support of other format(s).

rm_temp_filesbool

Remove temporary PNG files after movie creation. Default is True.

Returns:
out_filenamestr

The absolute path to the actual output file.

vue_interrupt_recording(*args)[source]#
vue_save_figure(filetype)[source]#

Callback for save figure events in the front end viewer toolbars. Uses the bqplot.Figure save methods.

vue_save_movie(filetype)[source]#

Callback for save movie events in the front end viewer toolbars. Uses the bqplot.Figure save methods.