Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from graphviz import Digraph
|
3 |
+
|
4 |
+
# Initialize the graph
|
5 |
+
graph = Digraph(comment='Architectural Model')
|
6 |
+
|
7 |
+
# Add nodes to the graph
|
8 |
+
graph.node('data_layer', 'Data Layer')
|
9 |
+
graph.node('acr', 'Azure Container Registry')
|
10 |
+
graph.node('aks', 'Azure Kubernetes\n& Docker Container Pod\nwith Scalability')
|
11 |
+
graph.node('snowflake', 'Snowflake Instance')
|
12 |
+
graph.node('cosmos', 'Azure Cosmos\nDatabase')
|
13 |
+
graph.node('api', 'API Standard\n(using Uvicorn)')
|
14 |
+
graph.node('soar', 'SOAR Component\n(on Linux Python\nSlimbuster Docker)')
|
15 |
+
|
16 |
+
# Add edges to the graph
|
17 |
+
graph.edge('data_layer', 'acr')
|
18 |
+
graph.edge('acr', 'aks')
|
19 |
+
graph.edge('aks', 'snowflake')
|
20 |
+
graph.edge('aks', 'cosmos')
|
21 |
+
graph.edge('aks', 'api')
|
22 |
+
graph.edge('aks', 'soar')
|
23 |
+
|
24 |
+
# Define the Streamlit app
|
25 |
+
def app():
|
26 |
+
st.title('Architectural Model')
|
27 |
+
|
28 |
+
# Draw the graph
|
29 |
+
st.graphviz_chart(graph.source)
|
30 |
+
|
31 |
+
# Add buttons to customize the graph
|
32 |
+
if st.button('Hide Data Layer'):
|
33 |
+
graph.node('data_layer', style='invisible')
|
34 |
+
|
35 |
+
if st.button('Hide Snowflake Instance'):
|
36 |
+
graph.node('snowflake', style='invisible')
|
37 |
+
|
38 |
+
if st.button('Hide SOAR Component'):
|
39 |
+
graph.node('soar', style='invisible')
|
40 |
+
|
41 |
+
# Run the Streamlit app
|
42 |
+
if __name__ == '__main__':
|
43 |
+
app()
|