/
computersci_app.py
44 lines (36 loc) · 944 Bytes
/
computersci_app.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
"""The network of ten Canadian universities
"""
import json
import dash
import dash_html_components as html
import dash_cytoscape as cyto
app = dash.Dash(__name__)
server = app.server
app.scripts.config.serve_locally = True
app.css.config.serve_locally = True
# Load Data
with open('computersci-data.json', 'r') as f:
elements = json.loads(f.read())
# Load stylesheet
with open('computersci-style.json', 'r') as f:
stylesheet = json.loads(f.read())
# App
app.layout = html.Div([
cyto.Cytoscape(
id = 'cytoscape',
elements = elements,
layout={'name': 'preset'},
stylesheet = stylesheet,
style={
'width': '80%',
'height': '750px',
'position': 'absolute',
#'background-color': '#0A0A0A',
'left': 0,
'top': 0,
'z-index': 999
}
)
])
if __name__ == '__main__':
app.run_server(debug=True)