Spaces:
Sleeping
Sleeping
import graphviz | |
import streamlit as st | |
def display_architecture_diagram(): | |
# Create a directed graph | |
graph = graphviz.Digraph(format='png') | |
# Define node styles | |
styles = { | |
'start': {'shape': 'cylinder', 'style': 'filled', 'fillcolor': '#22c55e', 'fontcolor': 'white'}, | |
'input': {'shape': 'box', 'style': 'filled', 'fillcolor': '#f97316', 'fontcolor': 'white'}, | |
'decision': {'shape': 'diamond', 'style': 'filled', 'fillcolor': '#0ea5e9', 'fontcolor': 'white'}, | |
'process': {'shape': 'box', 'style': 'filled', 'fillcolor': '#8b5cf6', 'fontcolor': 'white'}, | |
'output': {'shape': 'box', 'style': 'filled', 'fillcolor': '#ec4899', 'fontcolor': 'white'} | |
} | |
# Add nodes | |
graph.node('Start', 'π Start\nApplication', **styles['start']) | |
graph.node('Upload', 'π Upload DOCX\nResume', **styles['input']) | |
graph.node('JobDesc', 'πΌ Input Job\nDescription', **styles['input']) | |
graph.node('ApiKey', 'π Input GROQ\nAPI Key', **styles['input']) | |
graph.node('ChooseAction', 'π Choose\nAction', **styles['decision']) | |
graph.node('AnalysisType', 'π Analysis\nType', **styles['decision']) | |
# Add process nodes with detailed content | |
quick_analysis = """Quick Analysis | |
ββββββββββββββ | |
β’ Skills Match Rating | |
β’ Experience Alignment | |
β’ Pros and Cons | |
β’ Match Percentage""" | |
graph.node('QuickAnalysis', quick_analysis, **styles['process']) | |
in_depth = """In-Depth Analysisc | |
ββββββββββββββ | |
β’ Comprehensive Skill Gap | |
β’ Detailed Experience Review | |
β’ Career Path Alignment | |
β’ Strategic Recommendations""" | |
graph.node('InDepthAnalysis', in_depth, **styles['process']) | |
enhancement = """Resume Enhancement | |
ββββββββββββββ | |
β’ In-Depth Analysis | |
β’ Format Optimization | |
β’ Content Improvement | |
β’ Design Enhancement""" | |
graph.node('Enhancement', enhancement, **styles['process']) | |
# Add output nodes | |
results = """Analysis Results | |
ββββββββββββββ | |
π Analysis Summary | |
π Recommendations | |
β Action Items""" | |
graph.node('Results', results, **styles['output']) | |
enhanced = """Enhanced Resume | |
ββββββββββββββ | |
π Optimized DOCX | |
ποΈ Text Highlighting Changes | |
π HTML Version""" | |
graph.node('EnhancedOutputs', enhanced, **styles['output']) | |
# Add edges | |
graph.edge('Start', 'Upload') | |
graph.edge('Upload', 'JobDesc') | |
graph.edge('JobDesc', 'ApiKey') | |
graph.edge('ApiKey', 'ChooseAction') | |
graph.edge('ChooseAction', 'AnalysisType', 'Analyze') | |
graph.edge('ChooseAction', 'Enhancement', 'Enhance') | |
graph.edge('AnalysisType', 'QuickAnalysis', 'Quick') | |
graph.edge('AnalysisType', 'InDepthAnalysis', 'In-Depth') | |
graph.edge('QuickAnalysis', 'Results') | |
graph.edge('InDepthAnalysis', 'Results') | |
graph.edge('Enhancement', 'EnhancedOutputs') | |
graph.edge('Results', 'ChooseAction', 'New Analysis') | |
graph.edge('EnhancedOutputs', 'ChooseAction', 'New Analysis') | |
# Graph settings | |
graph.attr(rankdir='TB', splines='ortho') | |
return graph | |