Skip to content

Commit a9bd057

Browse files
Merge pull request #2 from Genovese-Felipe/codespace-potential-carnival-5g9r7x4r5wg4fv4wj
🚀 feat: Complete Python Data Driven Visualization Journey - 3 Working Dashboards + Professional Documentation - Codespace potential carnival 5g9r7x4r5wg4fv4wj
2 parents 9c06b62 + 9b5268b commit a9bd057

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+16135
-274
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"image":"mcr.microsoft.com/devcontainers/universal:2"}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sunburst_cost_explorer (7).html
12
# Python
23
__pycache__/
34
*.py[cod]

COMO_EXECUTAR.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# 🚀 INSTRUÇÕES PARA EXECUTAR O APLICATIVO
2+
3+
## ✅ Status Atual
4+
- ✅ Ambiente Python configurado em: `/workspaces/Py_Vy_000/.venv/bin/python`
5+
- ✅ Dependências instaladas: dash, plotly, pandas, numpy
6+
- ✅ Código verificado e sem erros de sintaxe
7+
- ✅ Aplicativo melhorado criado seguindo os guias Plotly
8+
9+
## 🎯 Como Executar
10+
11+
### Opção 1: Aplicativo Completo (Recomendado)
12+
```bash
13+
cd /workspaces/Py_Vy_000
14+
/workspaces/Py_Vy_000/.venv/bin/python sunburst_cost_explorer_app.py
15+
```
16+
17+
### Opção 2: Versão Simplificada (Para Teste)
18+
```bash
19+
cd /workspaces/Py_Vy_000
20+
/workspaces/Py_Vy_000/.venv/bin/python run_app.py
21+
```
22+
23+
### Opção 3: Script Automatizado
24+
```bash
25+
cd /workspaces/Py_Vy_000
26+
./start_app.sh
27+
```
28+
29+
## 🌐 Acesso ao Aplicativo
30+
Após executar qualquer uma das opções acima:
31+
1. Aguarde a mensagem: "Running on http://0.0.0.0:8050"
32+
2. Acesse: **http://localhost:8050**
33+
3. Ou use o Simple Browser do VS Code
34+
35+
## 🛠️ Troubleshooting
36+
37+
### Se não abrir:
38+
1. Verifique se a porta 8050 está livre:
39+
```bash
40+
netstat -an | grep 8050
41+
```
42+
43+
2. Mate processos anteriores:
44+
```bash
45+
pkill -f python
46+
```
47+
48+
3. Tente outra porta:
49+
- Edite o arquivo e mude `port=8050` para `port=8051`
50+
51+
### Logs de Debug:
52+
- O aplicativo roda em modo debug
53+
- Erros aparecerão no terminal
54+
- Mudanças no código são recarregadas automaticamente
55+
56+
## 📊 Funcionalidades Implementadas
57+
58+
### ✅ Melhorias Baseadas nos Guias Plotly:
59+
60+
1. **Sunburst Interativo**
61+
- Hierarquia de 5 níveis (Pillar → Area → Service → Task → Sub-task)
62+
- Hover personalizado com informações detalhadas
63+
- Controle de profundidade via slider
64+
65+
2. **Gráficos Comparativos**
66+
- Barras agrupadas (Custo Real vs Orçamento)
67+
- Treemap com codificação de cor
68+
- Tabela detalhada com filtros
69+
70+
3. **Interface Profissional**
71+
- Cards de métricas KPI
72+
- Sistema de abas navegável
73+
- Filtros dinâmicos por pilar
74+
- Design responsivo
75+
76+
4. **Customizações Avançadas**
77+
- Paleta de cores corporativa
78+
- Typography consistente (Arial, sans-serif)
79+
- Formatação monetária adequada
80+
- Estados visuais para status orçamentário
81+
82+
## 🎨 Características Visuais
83+
84+
- **Cores por Status**: Verde (Under Budget), Vermelho (Over Budget), Azul (On Budget)
85+
- **Hierarchy Colors**: Azul (Design), Laranja (Management), Verde (Construction), Vermelho (Finishing)
86+
- **Layout**: Grid responsivo com shadows e bordas arredondadas
87+
- **Interatividade**: Callbacks otimizados para performance
88+
89+
## 📈 Dados de Exemplo
90+
91+
O aplicativo inclui dados realistas de construção residencial:
92+
- **Project Design**: $315,000 (Arquitetura, Engenharia, Interior)
93+
- **Management**: $405,000 (Administração, Logística, Financeiro)
94+
- **Construction**: $2,005,000 (Fundação, Estrutura, MEP, Acabamentos)
95+
- **Finishing & Landscaping**: $250,000 (Móveis, Paisagismo)
96+
97+
**Total do Projeto**: ~$3,000,000
98+
99+
## 🚀 Próximos Passos
100+
101+
1. Execute uma das opções acima
102+
2. Aguarde a inicialização (5-10 segundos)
103+
3. Acesse http://localhost:8050
104+
4. Explore as diferentes abas e filtros
105+
5. Teste a interatividade dos gráficos
106+
107+
---
108+
**Status**: ✅ Pronto para execução
109+
**Versão**: 2.0 Advanced (Baseado nos guias Plotly XML)

Plan_Data_V3.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Prepare Data for Complex Dashboard (Simulated Dataset)
2+
3+
import pandas as pd
4+
import numpy as np
5+
6+
# Simulate a dataset for Smart Home Installation Analytics
7+
# Levels: Region, City, Installation Type
8+
# Metrics: Installation Cost, Energy Savings (Annual), Number of Devices, Customer Satisfaction Score, Latitude, Longitude
9+
10+
data = {
11+
'Region': ['North', 'North', 'North', 'South', 'South', 'South', 'East', 'East', 'West', 'West'],
12+
'City': ['Seattle', 'Seattle', 'Portland', 'Austin', 'Dallas', 'Houston', 'New York', 'Boston', 'San Francisco', 'Los Angeles'],
13+
'Installation_Type': ['Solar Panels', 'Smart Thermostat', 'Solar Panels', 'Smart Thermostat', 'Security System', 'Solar Panels', 'Smart Thermostat', 'Security System', 'Solar Panels', 'Smart Thermostat'],
14+
'Installation_Cost': np.random.randint(2000, 25000, 10),
15+
'Annual_Energy_Savings': np.random.randint(500, 3000, 10),
16+
'Number_of_Devices': np.random.randint(2, 15, 10),
17+
'Customer_Satisfaction': np.random.uniform(3.0, 5.0, 10).round(1),
18+
# Simulate some approximate coordinates for the cities
19+
'Latitude': [47.6062, 47.6062, 45.5051, 30.2672, 32.7767, 29.7604, 40.7128, 42.3601, 37.7749, 34.0522],
20+
'Longitude': [-122.3321, -122.3321, -122.6750, -97.7431, -96.7970, -95.3698, -74.0060, -71.0589, -122.4194, -118.2437]
21+
}
22+
23+
df_complex = pd.DataFrame(data)
24+
25+
print("Simulated Complex Dashboard Dataset:")
26+
print(df_complex)
27+
28+
# Note: This is a very small simulated dataset for demonstration.
29+
# A real-world dataset would be much larger and require more extensive
30+
# data cleaning and feature engineering.
31+
32+
# Potential Feature Engineering for Predictive Analysis:
33+
# - Create interaction terms between features.
34+
# - One-hot encode categorical features if using models that require numerical input.
35+
# - Scale numerical features.
36+
37+
# For this preparatory step, we will keep the data simple and directly use
38+
# the existing numerical and categorical columns.
39+
40+
# Data formatting for visualizations:
41+
# - Hierarchical data is already in a suitable format for sunburst/treemap (multiple columns).
42+
# - Numerical data is ready for scatter plots and other charts.
43+
# - Geographical data (Latitude, Longitude) is ready for map visualizations.

0 commit comments

Comments
 (0)