SHELLAPANDIANGANHUNGING commited on
Commit
b20e631
·
verified ·
1 Parent(s): 37df689

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -25
app.py CHANGED
@@ -290,7 +290,10 @@ st.sidebar.markdown('</div>', unsafe_allow_html=True)
290
  import streamlit as st
291
  import os
292
 
293
- # CSS HEADER BOX
 
 
 
294
  st.markdown("""
295
  <style>
296
  .header-box {
@@ -307,58 +310,56 @@ st.markdown("""
307
  text-align: center;
308
  flex: 1;
309
  }
 
 
310
  .logo-container {
311
  display: flex;
312
  align-items: center;
313
  justify-content: flex-end;
314
- width: 220px; /* 🔥 Logo area bigger */
315
- height: auto;
316
  }
317
  .logo-img {
318
- max-width: 200px; /* 🔥 Logo bigger */
319
- height: auto;
 
320
  }
321
  </style>
322
  """, unsafe_allow_html=True)
323
 
324
- # === HEADER LAYOUT ===
325
  with st.container():
326
  st.markdown('<div class="header-box">', unsafe_allow_html=True)
327
-
328
  col1, col2, col3 = st.columns([1, 5, 1])
329
 
330
- # Left (empty)
331
  with col1:
332
  st.write("")
333
 
334
- # CENTER TITLE
335
  with col2:
336
  st.markdown("""
337
  <div class="header-title">
338
- <h1 style="margin-bottom:6px;">Proactive Safety Intelligence & Analytics Dashboard</h1>
339
- <p style="color:#546e7a; font-size:1.05em; margin-top:-8px;"></p>
 
340
  </div>
341
  """, unsafe_allow_html=True)
342
 
343
- # RIGHT LOGO (NOW BIGGER)
344
  with col3:
345
- if os.path.exists("pln.png"):
346
  st.markdown(
347
- f"""
348
- <div class="logo-container">
349
- <img src="pln.png" class="logo-img">
350
- </div>
351
- """,
352
- unsafe_allow_html=True,
353
  )
354
- else:
355
  st.write("")
356
 
357
  st.markdown('</div>', unsafe_allow_html=True)
358
 
359
 
360
 
361
-
362
  import streamlit as st
363
  import plotly.graph_objects as go
364
  import numpy as np
@@ -532,13 +533,12 @@ if 'temuan_kode_distrik' in df_local.columns:
532
  linecolor="white", # 🔥 Warna garis derajat jadi putih
533
  gridcolor="rgba(255,255,255,0.2)" # 🔥 Warna grid derajat jadi transparan putih
534
  ),
535
- ),
536
  showlegend=True, # 🔥 Aktifkan legend
537
  legend=dict(
538
  orientation="v",
539
- yanchor="top",
540
  y=1,
541
- xanchor="left",
542
  x=1.02,
543
  font=dict(size=10)
544
  ),
@@ -548,7 +548,6 @@ if 'temuan_kode_distrik' in df_local.columns:
548
  plot_bgcolor="rgba(0,0,0,0)"
549
  )
550
 
551
- return fig
552
 
553
  # Plot
554
  col1, col2 = st.columns(2)
 
290
  import streamlit as st
291
  import os
292
 
293
+ import streamlit as st
294
+ import os
295
+
296
+ # ====================== CSS UNTUK HEADER ===========================
297
  st.markdown("""
298
  <style>
299
  .header-box {
 
310
  text-align: center;
311
  flex: 1;
312
  }
313
+
314
+ /* === Perbaikan Logo Besar Tanpa Pecah (ZOOM) === */
315
  .logo-container {
316
  display: flex;
317
  align-items: center;
318
  justify-content: flex-end;
 
 
319
  }
320
  .logo-img {
321
+ width: 100px; /* ukuran asli PNG kecil */
322
+ transform: scale(2); /* DIBESARKAN TANPA PECAH */
323
+ transform-origin: right center;
324
  }
325
  </style>
326
  """, unsafe_allow_html=True)
327
 
328
+ # ====================== HEADER LAYOUT ==============================
329
  with st.container():
330
  st.markdown('<div class="header-box">', unsafe_allow_html=True)
 
331
  col1, col2, col3 = st.columns([1, 5, 1])
332
 
333
+ # LEFT empty
334
  with col1:
335
  st.write("")
336
 
337
+ # CENTER TITLE
338
  with col2:
339
  st.markdown("""
340
  <div class="header-title">
341
+ <h1 style="margin-bottom:6px;">
342
+ Proactive Safety Intelligence & Analytics Dashboard
343
+ </h1>
344
  </div>
345
  """, unsafe_allow_html=True)
346
 
347
+ # RIGHT LOGO WITH ZOOM CSS
348
  with col3:
349
+ try:
350
  st.markdown(
351
+ f'<div class="logo-container">'
352
+ f'<img src="pln.png" class="logo-img">'
353
+ f'</div>',
354
+ unsafe_allow_html=True
 
 
355
  )
356
+ except:
357
  st.write("")
358
 
359
  st.markdown('</div>', unsafe_allow_html=True)
360
 
361
 
362
 
 
363
  import streamlit as st
364
  import plotly.graph_objects as go
365
  import numpy as np
 
533
  linecolor="white", # 🔥 Warna garis derajat jadi putih
534
  gridcolor="rgba(255,255,255,0.2)" # 🔥 Warna grid derajat jadi transparan putih
535
  ),
 
536
  showlegend=True, # 🔥 Aktifkan legend
537
  legend=dict(
538
  orientation="v",
539
+ yanchor="top", # 🔥 Atas
540
  y=1,
541
+ xanchor="right", # 🔥 Kanan
542
  x=1.02,
543
  font=dict(size=10)
544
  ),
 
548
  plot_bgcolor="rgba(0,0,0,0)"
549
  )
550
 
 
551
 
552
  # Plot
553
  col1, col2 = st.columns(2)