-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
58 lines (50 loc) · 1.82 KB
/
main.py
File metadata and controls
58 lines (50 loc) · 1.82 KB
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
47
48
49
50
51
52
53
54
55
56
57
from dash import Dash, html, dcc
#import dash_dangerously_set_inner_html as ddsih
from dash_dangerously_set_inner_html import DangerouslySetInnerHTML
import pandas as pd
import pygwalker as pyg
import dash_bootstrap_components as dbc
df = pd.read_csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv")
walker = pyg.walk(df, return_html=True)
#walker2 = pyg.walk(df)
#walker_html = walker2.to_html()
def simple_card(main_body):
return dbc.Card(
[
#dbc.CardImg(src=img_path, top=True, style={'width': '100%', 'max-width': '300px', 'height': 'auto'}),
dbc.CardBody(
[
html.H4("Card title", className="card-title"),
main_body,
html.P(
"Some quick example text to build on the card title and "
"make up the bulk of the card's content.",
className="card-text",
),
dbc.Button("Go somewhere", color="primary"),
]
),
],
style={
'display': 'flex',
'justify-content': 'center',
'align-items': 'center',
'box-shadow': '0px 0px 10px 0px rgba(0,0,0,0.2)',
'border-radius': '30px',
'overflow': 'hidden',
'padding': '20px 20px 20px 20px',
'height': "100%",
'width': "100%",
"background-color": "green"
},
)
app = Dash(__name__)
app.scripts.config.serve_locally = True
app.layout = html.Div(
#simple_card(DangerouslySetInnerHTML(walker)),
html.Iframe(srcDoc=walker, style={'height':'100vh' , 'width':'100vw'})
#dcc.Markdown(walker, dangerously_allow_html =True)
, style = {'height':'100vh' , 'width':'100vw'}
)
if __name__ == "__main__":
app.run_server(debug=True)