Skip to content

Interactive and animated OCaml canvases ​

In Basthon's OCaml kernel, a Graphics_js canvas once shown stays alive after the cell has run. It reacts to the mouse and the keyboard with loop, mouse_pos or read_key, and can be animated with Lwt.

It works in the console as in the notebook, including with isolated kernels.

Play with it!

An OCaml canvas that reacts to clicks and to the keyboard