Hi, Im trying to learn how to create plugins, playing with examples at the moment, but for some reason i am not able to use @knext.output_view example. I tried code below, but node is not visible in knime - other examples work well - enviroment setup should be fine:
# from typing import List # Not sure what this line is for - it was in the example of python extension guide
import knime.extension as knext
import seaborn as sns # installed through "pixi add seaborn", ran "pixi install" to make sure that it is installed
@knext.node(name="My Node", node_type=knext.NodeType.VISUALIZER, icon_path="icons/icon.png", category="/") # changed icon path to reflect example code structure
@knext.input_table(name="Input Data", description="We read data from here")
@knext.output_view(name="My pretty view", description="Showing a seaborn plot")
class MyViewNode:
"""
A view node
This node shows a plot.
"""
def configure(self, config_context, input_table_schema)
pass
def execute(self, exec_context, table):
df = table.to_pandas()
sns.lineplot(x="x", y="y", data=df)
return knext.view_seaborn()
Im not that interested in seaborn library - im more interested if it is plausible to display HTML with some tables, plausible images? Maybe someone has a simple working example?