Interactive demo | demos/5-html

Intro

Run
Server offline
Idle

Parameters

Result

(none yet)

Sample api request

Source code

def endpoint(a:bool=True) -> serve.html():
    im = ["Lorem ipsum"] | toImg() | toHtml()
    a = f"<h1>a={a}</h1><div>Some image:<br>{im}</div>"
    b = px.data.iris() | toHtml()
    px.data.iris()[["sepal_length", "sepal_width"]].values | transpose() | ~aS(plt.plot, "o")
    plt.xlabel("sepal_length"); plt.ylabel("sepal_width"); plt.grid(True); c = plt.gcf() | toImg()
    d = px.bar(px.data.iris().head(20), x="sepal_length") | toHtml()
    e = px.bar(px.data.iris(), x="sepal_length", y="sepal_width") | toHtml()
    return [a, b, c, d, e] | aS(viz.Carousel) | toHtml()