KaimonSlate export modes

Hi @kahliburke,

I have a large number of Pluto notebooks that I use to undertake assessments with multiple-choice questions. The typical packages that are used are the following:

CSV = “~0.10.16”
DataFrames = “~1.8.2”
HypertextLiteral = “~1.0.0”
PlutoPlotly = “~0.6.6”
PlutoTeachingTools = “~0.4.7”
PlutoUI = “~0.7.83”
StatsBase = “~0.34.11”
SHA = “~1.0.0”

Given that these assessments have to be undertaken under the umbrella of a software called Safe Exam Browser (a customized web browser environment that temporarily turns any computer into a secure workstation to conduct digital exams safely), integrating the SEB software with the notebook requires that the latter be an HTML self-contained file. We provide students with a customized .seb file, and when executed, it launches the HTML self-contained file in a protected environment.

I have been creating these self-contained HTML files by migrating my Pluto notebooks to Marimo.py and then compiling its App mode to the Wasm self-contained HTML file. It works like a charm: hover tooltips, dynamic legends, WebGL zooming and panning, sliders, buttons, mouse tracking, all working as if we were in an active, editable notebook. The only point is that I have all these notebooks written in Julia, and the migration is not a free lunch.

I read the documentation for KaimonSlate. The HTML export mode says:

“Figures embedded as base64 — CairoMakie rasters directly, and client-rendered ECharts frozen to their latest snapshot PNG.”

This means that the plots displayed in this mode are completely static. It does not suit my needs, because I need interactive plotting available in the exported file. On the other hand, in the case of the self-contained single source mode, it says:

“Export self-contained .jl produces one .jl that carries the notebook and its full environment, for sharing or archiving”

Does this .jl file require a Julia server to run in the background for the notebook to load? This is important because the SEB software does not work well in this case (at least as far as I have tried in the past).

My fundamental question is this: Is there a publishing/export mode that preserves live Makie or ECharts interactions, similar to Marimo’s self-contained HTML export, in a single executable file that does not require a Julia server to run? As far as I can tell, there is, because I checked your article “Out of Round”; it is a self-contained file as I need, and it looks like no Julia server is running when I click its link. However, I am a bit perplexed: how does a Julia file run without a notebook server running?

Thanks and congrats on your excellent package.

Normally Plotly plots (and presumably GLMakie?) can be embedded inside HTML, running without a backing server, with all the interactivity you mentioned. I like PlotlyLight.jl. Have you tried it?

Yes it’s definitely possible to create the type of environment you’re looking for, and to make it work within the Safe Exam Browser environment.

I’ll share a project with you that demonstrates it. I’ve created a notebook and I can export it as a standalone HTML file, no external dependencies and it could be deployed within a CMS/LMS like Moodle and accessed via SEB. SEB itself is a bit invasive so I’m not running it here but I’ve checked and I believe that everything that the browser is doing is fine within that environment.

I can grade myself on this submission, along with some other simulated students, apparently I still need to study my Solow models … oops!

I knew Plotly.py before I moved to Julia. It became natural to use PlotlyJS.jl and later PlutoPlotly.jl. When PlotlyLight appeared, I tried it out, but given that journey, I did not feel very comfortable with its syntax. When translating examples from the Plotly documentation, I often made small mistakes because I know nothing about JS. Every time I try to produce a simple plot with PlotlyLight, I fail. Like this one I tried just now: fig = plot(histogram(x=randn(500), opacity=0.75, nbinsx=50), Layout(bargap= 0.05)) . But I understand that it should be much faster than the other two plotting packages.