Créer des tableaux de bord avec Dash et Plotly
Alex Scriven
Data Scientist
dash.html.H1().Div()<div>
<div style=
"background-color: red;
width:250; height:250;">
</div>
<div style=
"background-color: lightblue;
width:250; height:250;">
<h1>This box</h1>
</div>
</div>
.Br() = Saut de ligne.Img() = Insérer une image
.Ul() \ .Ol() et .Li() = Créer des listes.Ul() pour liste non ordonnée (puces, comme ici).Ol() pour liste ordonnée (numérotée).Li() pour chaque élément de liste
app.layout = [html.Img(src='www.website.com/logo.png'), html.H1("Our Sales Dashboard")]

Définir et formater le texte
.P() ou .Span() = Insérer du texte brut.P() ou .Span()).B() = texte en gras.I() = texte en italique
Mise en forme plus complexe :
app.layout = [ html.H1("Our Sales Dashboard"),html.Span(children=[f"Prepared: {datetime.now().date()}"," by ", html.B("Jessie Parker, "),html.I("Data Scientist")])]

$$
app.layout = [
html.H1("Our Sales Dashboard"),
html.Span(children=[
f"Prepared: {datetime.now().date()}",
html.Br(),
" by ", html.B("Jessie Parker, "),
html.Br(),
html.I("Data Scientist")])
]

Créer des tableaux de bord avec Dash et Plotly