File size: 1,253 Bytes
308e481
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
from graphviz import Digraph

# Initialize the graph
graph = Digraph(comment='Architectural Model')

# Add nodes to the graph
graph.node('data_layer', 'Data Layer')
graph.node('acr', 'Azure Container Registry')
graph.node('aks', 'Azure Kubernetes\n& Docker Container Pod\nwith Scalability')
graph.node('snowflake', 'Snowflake Instance')
graph.node('cosmos', 'Azure Cosmos\nDatabase')
graph.node('api', 'API Standard\n(using Uvicorn)')
graph.node('soar', 'SOAR Component\n(on Linux Python\nSlimbuster Docker)')

# Add edges to the graph
graph.edge('data_layer', 'acr')
graph.edge('acr', 'aks')
graph.edge('aks', 'snowflake')
graph.edge('aks', 'cosmos')
graph.edge('aks', 'api')
graph.edge('aks', 'soar')

# Define the Streamlit app
def app():
    st.title('Architectural Model')
    
    # Draw the graph
    st.graphviz_chart(graph.source)
    
    # Add buttons to customize the graph
    if st.button('Hide Data Layer'):
        graph.node('data_layer', style='invisible')
    
    if st.button('Hide Snowflake Instance'):
        graph.node('snowflake', style='invisible')
    
    if st.button('Hide SOAR Component'):
        graph.node('soar', style='invisible')

# Run the Streamlit app
if __name__ == '__main__':
    app()