@danhachuel/thunderbolt 0.5.54 → 0.5.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +19 -14
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -1549,20 +1549,25 @@ def render_growth_youtube():
|
|
|
1549
1549
|
else:
|
|
1550
1550
|
st.button("BAIXAR ANALISE COMPLETA", disabled=True, use_container_width=True, key="growth_download_disabled")
|
|
1551
1551
|
st.subheader("Dashboard de Growth")
|
|
1552
|
-
st.caption("Vermelho: 0–30 · Amarelo: 31–69 · Verde: 70–100.
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1552
|
+
st.caption("Visão híbrida: os 3 pilares críticos em destaque e os 5 pilares operacionais abaixo. Vermelho: 0–30 · Amarelo: 31–69 · Verde: 70–100.")
|
|
1553
|
+
source_names = {"public": "PÚBLICO", "paligemma": "PALIGEMMA", "estimated": "DADO ESTIMADO", "unavailable": "INDISPONÍVEL", "youtube_analytics_oauth": "ANALYTICS OAUTH"}
|
|
1554
|
+
featured, secondary = metrics[:3], metrics[3:]
|
|
1555
|
+
|
|
1556
|
+
def growth_card(metric: dict[str, Any], featured_card: bool = False) -> str:
|
|
1557
|
+
score = int(metric.get("score", 0))
|
|
1558
|
+
source = source_names.get(str(metric.get("source", "unknown")), "A VERIFICAR")
|
|
1559
|
+
height = "min-height:238px" if featured_card else "min-height:190px"
|
|
1560
|
+
return (
|
|
1561
|
+
f'<div style="{height};border:1px solid #2b3b52;border-radius:14px;padding:18px;background:linear-gradient(145deg,#111c2b,#0b121c);box-shadow:0 8px 22px rgba(0,0,0,.16);">'
|
|
1562
|
+
f'<div style="font-size:11px;font-weight:800;letter-spacing:.08em;color:#7dd3fc;text-transform:uppercase;">{source}</div>'
|
|
1563
|
+
f'<div style="font-size:{"18px" if featured_card else "15px"};font-weight:750;color:#f8fafc;margin-top:9px;min-height:40px;">{metric.get("label", "Métrica")}</div>'
|
|
1564
|
+
f'<div style="display:flex;align-items:baseline;gap:5px;margin-top:7px;"><span style="font-size:{"42px" if featured_card else "32px"};font-weight:850;color:{_growth_score_color(score)};">{score}</span><span style="font-size:13px;color:#94a3b8;">/100</span></div>'
|
|
1565
|
+
f'<div style="border-top:1px solid #263447;margin-top:10px;padding-top:10px;font-size:13px;color:#e2e8f0;"><b>KPI observado</b><br>{metric.get("value", "—")}</div>'
|
|
1566
|
+
f'<div style="font-size:11px;color:#94a3b8;margin-top:9px;line-height:1.35;">{metric.get("diagnosis", "")[:150]}</div></div>'
|
|
1567
|
+
)
|
|
1568
|
+
|
|
1569
|
+
st.markdown('<div style="display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:14px 0 18px;">' + "".join(growth_card(metric, True) for metric in featured) + '</div>', unsafe_allow_html=True)
|
|
1570
|
+
st.markdown('<div style="display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:0 0 18px;">' + "".join(growth_card(metric) for metric in secondary) + '</div>', unsafe_allow_html=True)
|
|
1566
1571
|
st.divider()
|
|
1567
1572
|
history_tab, dashboard_tab = st.tabs(["Últimas análises", "Leitura estratégica"])
|
|
1568
1573
|
with dashboard_tab:
|
package/package.json
CHANGED