solara icon indicating copy to clipboard operation
solara copied to clipboard

feat: solara.html for all html elements

Open maartenbreddels opened this issue 1 year ago • 0 comments

TODO:

  • [ ] test
  • [ ] document

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

maartenbreddels avatar Jun 15 '23 08:06 maartenbreddels