jvm-repr
jvm-repr copied to clipboard
How do you use display updates with the JVM Repr?
I'd like to be able to use update display in a Scala kernel. It involves using two things:
display_datamessage with atransientfield (alongsidedata,metadata) that has adisplay_idupdate_display_datamessage that also sets thedisplay_idinside oftransient
From a Python perspective, this is some of the interface provided to users:

/cc @rdblue
JVM repr is (currently) unrelated to display updates. That's like asking how to use _repr_html_ to call update_display in python.
This project seems like a reasonable place for an API to handle display updates between Java libraries and Java kernels, but we'd have to think about how we want it to work first. Any ideas?
Yeah, that makes sense. Since I don't know what would be idiomatic Java code for this, I'm unsure where to start.
My primary motivation is wanting to do HTML based progress bars for Spark (in Scala), which perhaps is best done within the kernel.
I don't think we want to have kernels implement this directly, for the same reason that we want this lib for getting Java object representations. It would be better to have an API to broker the interaction between libraries and kernels.
Is this basically a way to add an ID and replace the HTML representation that is displayed?
One of the terms for this is "named displays". You can change a particular display_data output at any point in time across an entire notebook, even persisting it to the document itself. The primary motivation for this protocol/message is one-way updates (without having to have widgets implemented in every kernel). This will end up being really great for dashboard usage.