squirrels.dashboards or the squirrels module.
Constructor
Creates aHtmlDashboard object.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Dashboard in HTML format
squirrels.dashboards or the squirrels module.
HtmlDashboard object.
def __init__(self, content: io.StringIO | str) -> None:
Hide arguments
from squirrels.dashboards import HtmlDashboard
from squirrels.arguments import DashboardArgs
import plotly.express as px
async def main(sqrl: DashboardArgs) -> HtmlDashboard:
# Get dataset
df = await sqrl.dataset("sales_data")
# Create interactive plotly chart
fig = px.line(
df.to_pandas(),
x='date',
y='revenue',
title='Sales Revenue Over Time'
)
# Convert to HTML
html_content = fig.to_html(include_plotlyjs='cdn')
# Return as HtmlDashboard
return HtmlDashboard(content=html_content)
Was this page helpful?