-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
59 lines (42 loc) · 1.44 KB
/
app.py
File metadata and controls
59 lines (42 loc) · 1.44 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
51
52
53
54
55
56
57
58
59
import streamlit as st
from src.data_loader import load_all
from ui.sidebar import render as render_sidebar
from ui.style import PAGE_CONFIG, inject_css
from ui.views import show_chart, show_metrics, show_missing_data, show_table
st.set_page_config(**PAGE_CONFIG)
inject_css()
@st.cache_data(show_spinner=False)
def cached_load_all():
return load_all()
def main():
st.markdown(
'<p class="main-header">🔬 Microeletrônica no Brasil</p>',
unsafe_allow_html=True,
)
st.markdown(
'<p class="sub-header">'
"Análise temporal da indústria de microeletrônica — "
"Estabelecimentos e Empregados (2006-2019)"
"</p>",
unsafe_allow_html=True,
)
datasets = cached_load_all()
if not datasets:
show_missing_data()
return
_dataset_key, dataset, localities, chart_type, top_n = render_sidebar(datasets)
st.info(f"📌 **{dataset.title}** — {dataset.description}")
if localities:
show_metrics(dataset, localities, top_n)
st.markdown("---")
show_chart(dataset, localities, chart_type, top_n)
if localities:
show_table(dataset, localities)
st.markdown("---")
st.caption(
"📚 **Fonte:** RAIS (Relação Anual de Informações Sociais) — "
"Ministério do Trabalho e Emprego | "
"**TCC (2021)** — Análise da indústria de microeletrônica no Brasil"
)
if __name__ == "__main__":
main()