-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart_script.py
More file actions
50 lines (42 loc) · 1.98 KB
/
Copy pathchart_script.py
File metadata and controls
50 lines (42 loc) · 1.98 KB
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
45
46
47
48
49
50
# Create a system architecture diagram for Quant Risk Optimizer
diagram_code = """
graph TB
subgraph "Frontend Layer"
WD["Web Dashboard<br/>Dash/Plotly<br/>━━━━━━━━━━━━━━━━<br/>• Interactive UI<br/>• File Upload<br/>• Visualizations<br/>• Export Tools"]
end
subgraph "Middleware Layer"
API["Python API<br/>NumPy/SciPy<br/>━━━━━━━━━━━━━━━━<br/>• Risk Management<br/>• Portfolio Optimization<br/>• Data Validation<br/>• Error Handling"]
end
subgraph "Integration Layer"
PB["pybind11<br/>C++/Python Bridge<br/>━━━━━━━━━━━━━━━━<br/>• GIL Release<br/>• Type Conversion<br/>• Error Propagation"]
end
subgraph "Backend Layer"
CORE["C++ Core<br/>Eigen/Modern C++17<br/>━━━━━━━━━━━━━━━━<br/>• Monte Carlo<br/>• Linear Algebra<br/>• Matrix Operations<br/>• Optimization Algorithms"]
end
%% Data flow arrows
WD -->|User Requests| API
API -->|Results & Data| WD
API -->|Function Calls| PB
PB -->|Native Data| API
PB -->|Optimized Calls| CORE
CORE -->|Computed Results| PB
%% Styling
classDef frontend fill:#B3E5EC,stroke:#1FB8CD,stroke-width:2px,color:#000
classDef middleware fill:#A5D6A7,stroke:#2E8B57,stroke-width:2px,color:#000
classDef integration fill:#FFEB8A,stroke:#D2BA4C,stroke-width:2px,color:#000
classDef backend fill:#FFCDD2,stroke:#DB4545,stroke-width:2px,color:#000
class WD frontend
class API middleware
class PB integration
class CORE backend
"""
# Create the mermaid diagram and save as both PNG and SVG
png_path, svg_path = create_mermaid_diagram(
diagram_code,
png_filepath='architecture_diagram.png',
svg_filepath='architecture_diagram.svg',
width=1200,
height=900
)
print(f"Architecture diagram saved as PNG: {png_path}")
print(f"Architecture diagram saved as SVG: {svg_path}")