widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.62k stars 105 forks source link

feat: solara.html for all html elements #153

Open maartenbreddels opened 11 months ago

maartenbreddels commented 11 months ago

TODO:

The motivation for this was a discord question about using ydata-profiling (formerly known as pandas-profiling):

import pandas as pd
from ydata_profiling import ProfileReport

import solara

df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv")
html = ProfileReport(df, title="Profiling Report").to_html()

@solara.component
def Page():
    with solara.Column():
        with solara.html.H1():
            solara.Text("gapminderDataFiveYear ydata profiling 🎉!")
        solara.html.Iframe(srcdoc=html, style={"width": "100%", "height": "100vh", "border": "none"})

We can now easily embed the HTML in an iframe