Dashboard in HTML format
squirrels.dashboards
squirrels
HtmlDashboard
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?