entropy25 commited on
Commit
46ef3c3
·
verified ·
1 Parent(s): 3bb8d22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -5
app.py CHANGED
@@ -61,12 +61,16 @@ def load_css():
61
  font-size: 2.2rem;
62
  margin: 0;
63
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
 
 
64
  }}
65
  .main-subtitle {{
66
  {DESIGN_SYSTEM['fonts']['body']}
67
  font-size: 1rem;
68
  opacity: 0.9;
69
  margin-top: 0.5rem;
 
 
70
  }}
71
  .metric-card {{
72
  background: white;
@@ -83,6 +87,8 @@ def load_css():
83
  margin: 2rem 0 1rem 0;
84
  padding-bottom: 0.5rem;
85
  border-bottom: 2px solid {DESIGN_SYSTEM['colors']['primary']};
 
 
86
  }}
87
  .chart-container {{
88
  background: white;
@@ -97,6 +103,8 @@ def load_css():
97
  border-radius: 8px;
98
  padding: 1rem;
99
  color: {DESIGN_SYSTEM['colors']['success']};
 
 
100
  }}
101
  .alert-warning {{
102
  background: linear-gradient(135deg, {DESIGN_SYSTEM['colors']['warning']}15, {DESIGN_SYSTEM['colors']['warning']}25);
@@ -104,6 +112,19 @@ def load_css():
104
  border-radius: 8px;
105
  padding: 1rem;
106
  color: {DESIGN_SYSTEM['colors']['warning']};
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }}
108
  .stButton > button {{
109
  background: {DESIGN_SYSTEM['colors']['primary']};
@@ -113,6 +134,7 @@ def load_css():
113
  padding: 0.5rem 1rem;
114
  font-weight: 500;
115
  transition: all 0.2s ease;
 
116
  }}
117
  .stDownloadButton > button {{
118
  background: {DESIGN_SYSTEM['colors']['primary']} !important;
@@ -122,6 +144,7 @@ def load_css():
122
  padding: 0.5rem 1rem !important;
123
  font-weight: 500 !important;
124
  transition: all 0.2s ease !important;
 
125
  }}
126
  </style>
127
  """, unsafe_allow_html=True)
@@ -873,11 +896,14 @@ def main():
873
  for i, (material, info) in enumerate(outliers.items()):
874
  with cols[i]:
875
  if info['count'] > 0:
876
- if len(info['dates']) <= 5:
877
- dates_str = ", ".join(info['dates'])
878
- else:
879
- dates_str = f"{', '.join(info['dates'][:3])}, +{len(info['dates'])-3} more"
880
- st.markdown(f'<div class="alert-warning"><strong>{material.title()}</strong><br>{info["count"]} outliers detected<br>Normal range: {info["range"]}<br><small>Dates: {dates_str}</small></div>', unsafe_allow_html=True)
 
 
 
881
  else:
882
  st.markdown(f'<div class="alert-success"><strong>{material.title()}</strong><br>All values normal</div>', unsafe_allow_html=True)
883
  add_export_section(df, stats, outliers, model)
 
61
  font-size: 2.2rem;
62
  margin: 0;
63
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
64
+ word-wrap: break-word;
65
+ line-height: 1.2;
66
  }}
67
  .main-subtitle {{
68
  {DESIGN_SYSTEM['fonts']['body']}
69
  font-size: 1rem;
70
  opacity: 0.9;
71
  margin-top: 0.5rem;
72
+ word-wrap: break-word;
73
+ line-height: 1.4;
74
  }}
75
  .metric-card {{
76
  background: white;
 
87
  margin: 2rem 0 1rem 0;
88
  padding-bottom: 0.5rem;
89
  border-bottom: 2px solid {DESIGN_SYSTEM['colors']['primary']};
90
+ word-wrap: break-word;
91
+ line-height: 1.3;
92
  }}
93
  .chart-container {{
94
  background: white;
 
103
  border-radius: 8px;
104
  padding: 1rem;
105
  color: {DESIGN_SYSTEM['colors']['success']};
106
+ word-wrap: break-word;
107
+ line-height: 1.4;
108
  }}
109
  .alert-warning {{
110
  background: linear-gradient(135deg, {DESIGN_SYSTEM['colors']['warning']}15, {DESIGN_SYSTEM['colors']['warning']}25);
 
112
  border-radius: 8px;
113
  padding: 1rem;
114
  color: {DESIGN_SYSTEM['colors']['warning']};
115
+ word-wrap: break-word;
116
+ line-height: 1.4;
117
+ }}
118
+ .quality-dates {{
119
+ font-size: 0.85em;
120
+ margin-top: 0.5rem;
121
+ word-wrap: break-word;
122
+ line-height: 1.3;
123
+ max-height: 150px;
124
+ overflow-y: auto;
125
+ padding: 0.3rem;
126
+ background: rgba(255,255,255,0.3);
127
+ border-radius: 4px;
128
  }}
129
  .stButton > button {{
130
  background: {DESIGN_SYSTEM['colors']['primary']};
 
134
  padding: 0.5rem 1rem;
135
  font-weight: 500;
136
  transition: all 0.2s ease;
137
+ word-wrap: break-word;
138
  }}
139
  .stDownloadButton > button {{
140
  background: {DESIGN_SYSTEM['colors']['primary']} !important;
 
144
  padding: 0.5rem 1rem !important;
145
  font-weight: 500 !important;
146
  transition: all 0.2s ease !important;
147
+ word-wrap: break-word !important;
148
  }}
149
  </style>
150
  """, unsafe_allow_html=True)
 
896
  for i, (material, info) in enumerate(outliers.items()):
897
  with cols[i]:
898
  if info['count'] > 0:
899
+ # Show all dates for outliers
900
+ dates_str = ", ".join(info['dates'])
901
+ st.markdown(f'''<div class="alert-warning">
902
+ <strong>{material.title()}</strong><br>
903
+ {info["count"]} outliers detected<br>
904
+ Normal range: {info["range"]}<br>
905
+ <div class="quality-dates">Dates: {dates_str}</div>
906
+ </div>''', unsafe_allow_html=True)
907
  else:
908
  st.markdown(f'<div class="alert-success"><strong>{material.title()}</strong><br>All values normal</div>', unsafe_allow_html=True)
909
  add_export_section(df, stats, outliers, model)