Plot
By creating an index.html file in the correct directory, an interactive plot can be created. The easiest way to create an interactive plot is to use Plotly, but you can also handcraft an HTML file as long as the file is placed in:
Plotly
Section titled “Plotly”Following is an example using Plotly:
import polars as plimport plotly.express as pximport os
def transform(): # example data df = pl.DataFrame({ "Category": ["Group A", "Group B", "Group C", "Group D"], "Value": [45, 72, 38, 91] })
# Generate the bar chart using Plotly fig = px.bar(df.to_pandas(), x="Category", y="Value", title="Simple Bar Chart")
# Save the chart as HTML fig.write_html(f"{os.environ['ARTIFACT_FOLDER']}/index.html")
return df
