Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.1k stars 105 forks source link

Dynamic update of cell output #318

Closed dbolotin closed 2 years ago

dbolotin commented 2 years ago

I want to implement a dynamically updateable cell output. To dynamically show the progress of an ongoing operation.

As I understand DisplayResult interface has an id field which somehow can be used to re-render the object after it was initially displayed in a cell. It seems that the updateDisplay method of the KotlinKernelHost should do exactly that. Unfortunately I didn't find a way to get an instance of the host object.

Can you please point us in the right direction. Is it even possible with the current kernel version?

Thank you.

ileasile commented 2 years ago

Hi! It was technically possible, but not convenient to achieve from the notebook. I've added a couple of additional methods, now you may do something like this: update-display-data

ileasile commented 2 years ago

Use version 0.10.0.183

dbolotin commented 2 years ago

Thank you! It works!