I think the updates to the “Python View” node are exciting, especially in terms of its ability to maintain the interactivity of Plotly objects!
However, I noted that this ability seems to only function within the “Modern UI Preview” and not the default/current user interface. This seems rather odd since there are no directions which state that it only works within the preview interface (at least, in checking the node’s “description” panel, the KNIME-Python API, and the KNIME Python Integration Guide). I am embarrased to admit that I spent a considerable amount time trying to diagnose why my simple test workflow wasn’t being visualized interactively, only to switch to the Modern UI and discover it had no issues whatsoever within this interface.
Is this intended behavior? Will the Python View’s interactive view only ever work within the “Modern UI Preview” or should it also function within the default/current user interface? As far as I can tell, this is the only visualizer which does not work in the current UI, so this seems inconsistent.
Thanks!
For reference, my test workflow consisted of only a “Table Creator” node with simple numeric values (1-5) for two integer columns (X and Y) and a “Python View” node with the following code:
import knime.scripting.io as knio
import plotly.express as px
df = knio.input_tables[0].to_pandas()
fig = px.line(df, x=df.columns[0], y=df.columns[1])
knio.output_view = knio.view(fig)
This results in a straight line - a PNG image is generated within the default/current view, but you cannot view the plot interactively unless you are within the “Modern UI Preview” mode.