Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,15 +54,13 @@ def get_inspired():
|
|
| 54 |
return store
|
| 55 |
|
| 56 |
def app():
|
| 57 |
-
footer()
|
| 58 |
-
st.title("Graph Example")
|
| 59 |
-
st.sidebar.title("Welcome")
|
| 60 |
query_type = st.sidebar.selectbox("Query Tpye: ", ["Inspirationals", "Marvel", "Fraud"]) # could add more stuff here later on or add other endpoints in the sidebar.
|
| 61 |
config = Config(height=600, width=700, nodeHighlightBehavior=True, highlightColor="#F7A7A6", directed=True,
|
| 62 |
collapsible=True)
|
| 63 |
|
| 64 |
if query_type=="Inspirationals":
|
| 65 |
-
|
|
|
|
| 66 |
with st.spinner("Loading data"):
|
| 67 |
store = get_inspired()
|
| 68 |
st.write("Nodes loaded: " + str(len(store.getNodes())))
|
|
@@ -70,6 +68,7 @@ def app():
|
|
| 70 |
agraph(list(store.getNodes()), (store.getEdges() ), config)
|
| 71 |
|
| 72 |
if query_type=="Marvel":
|
|
|
|
| 73 |
#based on http://marvel-force-chart.surge.sh/
|
| 74 |
with open("data/marvel.json", encoding="utf8") as f:
|
| 75 |
marvel_file = json.loads(f.read())
|
|
@@ -86,6 +85,7 @@ def app():
|
|
| 86 |
|
| 87 |
|
| 88 |
if query_type=="Fraud":
|
|
|
|
| 89 |
#based on http://marvel-force-chart.surge.sh/
|
| 90 |
with open("data/fraud.json", encoding="utf8") as f:
|
| 91 |
marvel_file = json.loads(f.read())
|
|
|
|
| 54 |
return store
|
| 55 |
|
| 56 |
def app():
|
|
|
|
|
|
|
|
|
|
| 57 |
query_type = st.sidebar.selectbox("Query Tpye: ", ["Inspirationals", "Marvel", "Fraud"]) # could add more stuff here later on or add other endpoints in the sidebar.
|
| 58 |
config = Config(height=600, width=700, nodeHighlightBehavior=True, highlightColor="#F7A7A6", directed=True,
|
| 59 |
collapsible=True)
|
| 60 |
|
| 61 |
if query_type=="Inspirationals":
|
| 62 |
+
|
| 63 |
+
st.title("Random Graph")
|
| 64 |
with st.spinner("Loading data"):
|
| 65 |
store = get_inspired()
|
| 66 |
st.write("Nodes loaded: " + str(len(store.getNodes())))
|
|
|
|
| 68 |
agraph(list(store.getNodes()), (store.getEdges() ), config)
|
| 69 |
|
| 70 |
if query_type=="Marvel":
|
| 71 |
+
st.title("Marvel Example")
|
| 72 |
#based on http://marvel-force-chart.surge.sh/
|
| 73 |
with open("data/marvel.json", encoding="utf8") as f:
|
| 74 |
marvel_file = json.loads(f.read())
|
|
|
|
| 85 |
|
| 86 |
|
| 87 |
if query_type=="Fraud":
|
| 88 |
+
st.title("Fraud Ring")
|
| 89 |
#based on http://marvel-force-chart.surge.sh/
|
| 90 |
with open("data/fraud.json", encoding="utf8") as f:
|
| 91 |
marvel_file = json.loads(f.read())
|