_panel_manipulation Module#
_panel_manipulation Module#
- waloviz._panel_manipulation.save_player_panel(player_panel: Viewable, out_file: Optional[Union[str, PathLike, IO]] = None, title: Optional[str] = None, resources: Resources = Resources(mode='inline'), embed: bool = True) Union[str, PathLike, IO][source]#
- Saves a panel player to an HTML file.Does not save the download button.
Parameters#
sourcepn.viewable.ViewableThe player created by
wv.Audioout_filestr | os.PathLike | IOThe output file path for the generated html, default is “{title}.html”
titlestrThe title to be used in the generated file name and the html title, if
wv.Audio(title="...")was specified, then that value is used, otherwise, the default is “waloviz”.resourcesbokeh.resources.ResourcesThe resources for the
panelsave method, default is INLINEembedboolThe embed value for the
panelsave method, default is True
Returns#
out_filestr | os.PathLike | IOThe file that the HTML player content was written into
- waloviz._panel_manipulation.wrap_player_with_panel(player_bokeh: Model, wav: Tensor, sr: int, title: Optional[str], width: Union[int, str], height: Union[int, str], audio_height: int, button_height: int, pbar_height: int, both_min_height: int, download_button: bool, native_player: bool, aspect_ratio: Optional[float], sizing_mode: Optional[str]) Viewable[source]#
- Wraps the bokeh player with panel, adds the audio and optionally a download button.
Parameters#
player_bokehbokeh.model.ModelThe generated bokeh player with the custom jslink interactivity, without the audio
wavtorch.TensorThe audio tensor
srintThe sample rate
titlestrA title to be used when saving the plot
heightint | strThe total height of the plot
widthint | strThe total width of the plot
audio_heightboolThe expected height of the audio widget
button_heightboolThe expected height of the download button
download_buttonboolWhether to show the html download button
native_playerboolWhether the underlying native audio player should be visible
aspect_ratiofloatThe ratio between the width and height, relevant only when either width, height or both are “responsive”
sizing_modestrThe panel
sizing_mode, can be one of seven values: “stretch_width”, “stretch_height”, “stretch_both”, “scale_width”, “scale_height”, “scale_both”, or “fixed”.
Returns#
player_panelpn.viewable.ViewableA panel pane with a fully featured interactive player