PreviewRenderer
Generates interactive HTML previews for VScene
Used by both Jupyter notebooks and the development server to create interactive animation previews with playback controls.
Constructor
PreviewRenderer(vscene: VScene)
Initialize with a VScene instance
Parameters
-
vscene - The VScene instance to display
Methods
display_iframe
display_iframe(frame_time: float = 0.0)
Display within an iframe in the Jupyter web page.
Parameters
-
frame_time - Time point to render (0.0 to 1.0)
Returns
JupyterSvgFrame object that displays in notebooks
display_image
display_image(frame_time: float = 0.0)
Display within an img tag in the Jupyter web page.
Parameters
-
frame_time - Time point to render (0.0 to 1.0)
Returns
JupyterSvgImage object that displays in notebooks
display_inline
display_inline(frame_time: float = 0.0)
Display inline in the Jupyter web page.
Parameters
-
frame_time - Time point to render (0.0 to 1.0)
Returns
JupyterSvgInline object that displays in notebooks
preview_animation
preview_animation(num_frames: int = 10, play_interval_ms: int = 100)
Preview animation with interactive controls (play/pause, slider, prev/next).
Parameters
-
num_frames - Number of frames to display (default: 10)
-
play_interval_ms - Milliseconds between frames when playing (default: 100)
Returns
HTML object that displays in Jupyter notebooks
preview_grid
preview_grid(num_frames: int = 10, scale: float = 1.0)
Preview animation by showing all frames in a grid layout.
Parameters
-
num_frames - Number of frames to display (default: 10)
-
scale - Scale factor for frame size, e.g. 0.5 for half size (default: 1.0)
Returns
HTML object that displays in Jupyter notebooks
repr_svg
repr_svg()
Generate SVG string for Jupyter's _repr_svg_ display
Returns
SVG string representation