-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsimple_demo.py
46 lines (36 loc) · 1.21 KB
/
simple_demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from dash import Dash
import dash_html_components as html
import dash_ui as dui
app = Dash()
my_css_urls = ["https://codepen.io/rmarren1/pen/mLqGRg.css"]
for url in my_css_urls:
app.css.append_css({
"external_url": url
})
grid = dui.Grid(_id="grid", num_rows=12, num_cols=12, grid_padding=0)
grid.add_element(col=1, row=1, width=3, height=4, element=html.Div(
style={"background-color": "red", "height": "100%", "width": "100%"}
))
grid.add_element(col=4, row=1, width=9, height=4, element=html.Div(
style={"background-color": "blue", "height": "100%", "width": "100%"}
))
grid.add_element(col=1, row=5, width=12, height=4, element=html.Div(
style={"background-color": "green", "height": "100%", "width": "100%"}
))
grid.add_element(col=1, row=9, width=9, height=4, element=html.Div(
style={"background-color": "orange", "height": "100%", "width": "100%"}
))
grid.add_element(col=10, row=9, width=3, height=4, element=html.Div(
style={"background-color": "purple", "height": "100%", "width": "100%"}
))
app.layout = html.Div(
dui.Layout(
grid=grid,
),
style={
'height': '100vh',
'width': '100vw'
}
)
if __name__ == "__main__":
app.run_server(debug=True)