Emitting graphics from python notebook or script as a separate tile

While working with new Python Notebooks feature in Datagrok, I came by with an idea, or rather an observation. I was thinking of data visualization through scripts in general. Maybe there is already a known way, which I oversaw in the docs or public repo and where you’d hint me to. So far I’ve only found JS-based API-s connected to the client to create own visualizers.

As of now we can yield a dataframe by a grok(...) call from a Python notebook running on an existing dataframe. What if one could also yield an image (svg/png) to be displayed somewhere aside of this existing dataframe, in a separate window tile maybe? Then, say, if I change that dataframe in Datagrok grid (or select a subrange to render), the script will re-run and the graphics shall be updated, this all will be done without me manually running anything. This ends up being a Python-based visualizer.

I realise this may be not a very valued feature, and would perfectly understand a “no-fix” resolution :slight_smile: Part this is due to possibly less interactivity, as the script re-runs on the backend to re-render the image. Yet, working with the Notebook I noticed loading even significant datasets (megabytes) to the backend and generating some advanced seaborn visualizations doesn’t take more than a second or two for me.

I think what you were looking for are Scripting Viewers. You can easily use code written in the Jupyter notebook to create such a viewer.

On a similar subject, some time ago I was thinking about a more generalized feature that would automatically convert a notebook into a function, taking the initial data frame as a parameter, and reproducing all steps that lead to the final result. This way we’ll combine the ability to interactively develop Jupyter notebooks with the reproducible and manageable nature of Datagrok’s script-based functions.

Thanks Andrew, this fully answers my question!