first viz; looks terrible

This commit is contained in:
Mark Eaton
2024-12-14 02:57:31 -05:00
parent da559db22b
commit 21badae763
2 changed files with 28 additions and 12 deletions
+7 -8
View File
@@ -1,22 +1,21 @@
from dash import Dash, html
from pprint import pprint
import dash_cytoscape as cyto
import json
app = Dash(__name__)
with open('viz_data.json') as f:
data = json.load(f)
app.layout = html.Div([
html.P("Dash Cytoscape:"),
cyto.Cytoscape(
id='cytoscape',
elements=[
{'data': {'id': 'ca', 'label': 'Canada'}},
{'data': {'id': 'on', 'label': 'Ontario'}},
{'data': {'id': 'qc', 'label': 'Quebec'}},
{'data': {'source': 'ca', 'target': 'on'}},
{'data': {'source': 'ca', 'target': 'qc'}}
],
elements=data,
layout={'name': 'breadthfirst'},
style={'width': '400px', 'height': '500px'}
)
)
])