Have been playing around with new notebook API, an...
# datascience
p
Have been playing around with new notebook API, and nice improvement over the JSON file. What I'm now trying is to get DISPLAY functionality to work using the API. So for example how to translate the following code snippet using the new API (DISPLAY doesn't seem to be exposed by the new API):
for (asset in assets) {
val html = CandlestickChart(asset).render()
DISPLAY(HTML(html))
}
I noticed the passed Notebook instance should be able to help with this (like currentCell etc), but cannot figure out last part of puzzle? Any hints?
i
Hello! Glad to hear that. In which part of integration (renderers, cell callbacks) are you trying to execute this code? Anyway, what you need is
org.jetbrains.kotlinx.jupyter.api.KotlinKernelHost#display
It is available in i.e.
beforeCellExecution
callback (as
this
)
p
right now trying to achieve it by implementing the Renderable interface. Goal is that if someone calls chart.render() some where in the cell it will be displayed, even if not the last statement in the cell.
But will have a look at your suggestions, thanks!!!