使用 Dash 與 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() = 換行.Img() = 插入圖片
.Ul() \ .Ol() 與 .Li() = 建立清單.Ul():無序清單(項目符號,如本列).Ol():有序清單(編號項目).Li():單一清單項目
app.layout = [html.Img(src='www.website.com/logo.png'), html.H1("Our Sales Dashboard")]

設定與格式化文字內容
.P() 或 .Span() = 插入純文字.P() 或 .Span()).B() = 粗體 文字.I() = 斜體 文字
較複雜的格式:
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")])
]

使用 Dash 與 Plotly 建立儀表板