Public functions
JavisNB.embed — Methodembed(
video::Video;
framerate=30,
pathname="javis_GIBBERISH.gif",
liveview=false,
tempdirectory="",
ffmpeg_loglevel="panic",
rescale_factor=1.0,
postprocess_frame=identity,
postprocess_frames_flow=default_postprocess
)The core function of JavisNB. It allows one to show the output of Javis.render from Javis directly within a notebook. Notebooks supported are:
- IJulia
- Pluto
To use embed just replace Javis.render with embed. Here is an example one can use within a Pluto notebook:
# In one cell
using Javis, JavisNB
# In a new one
begin
function ground(args...)
background("white")
sethue("black")
end
vid = Video(500, 500)
Background(1:50, ground)
o = Object(JCircle(O, 20, action=:fill))
act!(o, Action(1:25, anim_translate(Point(20, 0))))
act!(o, Action(26:50, anim_translate(Point(-20, 0))))
# In pure Javis here we would have
# render(args...;kwargs...)
# Instead, within a notebook one uses
# embed(args...;kwargs...)
# For example
embed(vid, pathname="rendered_with_embed.gif")
endJavisNB.embed — Methodembed(pathname::String)Shows a gif within a notebook by calling the path to the gif.
Arguments
pathname::String: path of the gif to render in the notebook
Private functions
JavisNB.PlutoViewer — TypePlutoViewerWrapper to assist viewing rendered gifs as cell outputs of Pluto notebooks when liveview = false.
JavisNB._jupyter_viewer — Method_jupyter_viewer(video::Video, frames::Int, actions::Vector)Creates an interactive viewer in a Jupyter Notebook.
JavisNB._pluto_viewer — Method_pluto_viewer(video::Video, frames::Int, actions::Vector)Creates an interactive viewer in a Pluto Notebook by storing all the frames in-memory.
Returns
arr: List of Javis frames