item.html, item.javascript) are SDK-only. Via the CLI
or HTTP API, write the chart to an HTML file (as above) and fetch it with code artifact download or a filesystem read.
Read the generated HTML directly:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create Plotly and other rich notebook outputs from code interpreter runs.
result = machine.run_code("""
import plotly.express as px
fig = px.line(x=[1, 2, 3], y=[1, 4, 9], title="Interactive chart")
fig.write_html("/workspace/chart.html")
fig.show()
""")
print(any(item.html or item.javascript for item in result.results))
item.html, item.javascript) are SDK-only. Via the CLI
or HTTP API, write the chart to an HTML file (as above) and fetch it with code artifact download or a filesystem read.
Read the generated HTML directly:
html = machine.files.read("/workspace/chart.html")