Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
import plotly.express as px
|
|
@@ -24,8 +25,6 @@ st.markdown("""<style>
|
|
| 24 |
margin-bottom: 25px;
|
| 25 |
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
| 26 |
border: 1px solid #e0e0e0;
|
| 27 |
-
position: relative; /* Penting untuk positioning logo */
|
| 28 |
-
box-sizing: border-box; /* Agar padding tidak menambah lebar total */
|
| 29 |
}
|
| 30 |
h1, h2, h3, h4, h5, .stMarkdown h1, .stMarkdown h2, .stMarkdown h3 {
|
| 31 |
text-align: center;
|
|
@@ -284,32 +283,69 @@ else:
|
|
| 284 |
st.sidebar.markdown('</div>', unsafe_allow_html=True)
|
| 285 |
|
| 286 |
|
| 287 |
-
# =================== HEADER
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
|
| 314 |
# =================== 1. Pie Charts: Temuan/Person by Company (PG & UM) - PERBAIKAN ===================
|
| 315 |
st.markdown("<h3 class='section-title'>OBJECTIVE 1 - Company Reporting Activity: Who Reports the Most?</h3>", unsafe_allow_html=True)
|
|
|
|
| 1 |
+
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
import plotly.express as px
|
|
|
|
| 25 |
margin-bottom: 25px;
|
| 26 |
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
| 27 |
border: 1px solid #e0e0e0;
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
h1, h2, h3, h4, h5, .stMarkdown h1, .stMarkdown h2, .stMarkdown h3 {
|
| 30 |
text-align: center;
|
|
|
|
| 283 |
st.sidebar.markdown('</div>', unsafe_allow_html=True)
|
| 284 |
|
| 285 |
|
| 286 |
+
# =================== HEADER ===================
|
| 287 |
+
|
| 288 |
+
# CSS untuk membuat box logo di kanan atas
|
| 289 |
+
st.markdown("""
|
| 290 |
+
<style>
|
| 291 |
+
.header-container {
|
| 292 |
+
display: flex;
|
| 293 |
+
justify-content: space-between;
|
| 294 |
+
align-items: center;
|
| 295 |
+
padding: 12px 20px;
|
| 296 |
+
border-radius: 10px;
|
| 297 |
+
background-color: #ffffff;
|
| 298 |
+
border: 1px solid #e0e0e0;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
.header-title {
|
| 302 |
+
flex-grow: 1;
|
| 303 |
+
text-align: center;
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
.logo-box {
|
| 307 |
+
border: 1px solid #e0e0e0;
|
| 308 |
+
padding: 6px;
|
| 309 |
+
border-radius: 10px;
|
| 310 |
+
background-color: #f8f9fa;
|
| 311 |
+
display: flex;
|
| 312 |
+
align-items: center;
|
| 313 |
+
}
|
| 314 |
+
</style>
|
| 315 |
+
""", unsafe_allow_html=True)
|
| 316 |
+
|
| 317 |
+
|
| 318 |
+
# ======== HEADER LAYOUT ========
|
| 319 |
+
logo_path = "pln.png"
|
| 320 |
+
|
| 321 |
+
st.markdown('<div class="header-container">', unsafe_allow_html=True)
|
| 322 |
+
|
| 323 |
+
# ---- TITLE (CENTER) ----
|
| 324 |
+
st.markdown("""
|
| 325 |
+
<div class="header-title">
|
| 326 |
+
<h1 style="margin-bottom:4px;">PLN Audit Insight & Intelligence Dashboard</h1>
|
| 327 |
+
<p style="color:#546e7a; font-size:1.05em; margin-top:0px;">
|
| 328 |
+
Operational Risk Intelligence for Audit & Compliance
|
| 329 |
+
</p>
|
| 330 |
+
</div>
|
| 331 |
+
""", unsafe_allow_html=True)
|
| 332 |
+
|
| 333 |
+
# ---- LOGO (RIGHT BOX) ----
|
| 334 |
+
if os.path.exists(logo_path):
|
| 335 |
+
st.markdown(f"""
|
| 336 |
+
<div class="logo-box">
|
| 337 |
+
<img src="data:image/png;base64,{open(logo_path, "rb").read().hex()}"
|
| 338 |
+
width="70">
|
| 339 |
+
</div>
|
| 340 |
+
""", unsafe_allow_html=True)
|
| 341 |
+
else:
|
| 342 |
+
st.markdown("""
|
| 343 |
+
<div class="logo-box">
|
| 344 |
+
<p style="color:red; font-size:0.9em;">Logo missing</p>
|
| 345 |
+
</div>
|
| 346 |
+
""", unsafe_allow_html=True)
|
| 347 |
+
|
| 348 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 349 |
|
| 350 |
# =================== 1. Pie Charts: Temuan/Person by Company (PG & UM) - PERBAIKAN ===================
|
| 351 |
st.markdown("<h3 class='section-title'>OBJECTIVE 1 - Company Reporting Activity: Who Reports the Most?</h3>", unsafe_allow_html=True)
|