Spaces:
Sleeping
Sleeping
gauravlochab
commited on
Commit
·
cefbde3
1
Parent(s):
b069ea1
fix: roi range fix
Browse files
app.py
CHANGED
|
@@ -1185,22 +1185,22 @@ def create_combined_roi_time_series_graph(df):
|
|
| 1185 |
max_time = df['timestamp'].max()
|
| 1186 |
|
| 1187 |
# Add background shapes for positive and negative regions
|
| 1188 |
-
# Add shape for positive ROI region (above zero)
|
| 1189 |
fig.add_shape(
|
| 1190 |
type="rect",
|
| 1191 |
fillcolor="rgba(230, 243, 255, 0.3)",
|
| 1192 |
line=dict(width=0),
|
| 1193 |
-
y0=0, y1=
|
| 1194 |
x0=min_time, x1=max_time,
|
| 1195 |
layer="below"
|
| 1196 |
)
|
| 1197 |
|
| 1198 |
-
# Add shape for negative ROI region (below zero)
|
| 1199 |
fig.add_shape(
|
| 1200 |
type="rect",
|
| 1201 |
fillcolor="rgba(255, 230, 230, 0.3)",
|
| 1202 |
line=dict(width=0),
|
| 1203 |
-
y0
|
| 1204 |
x0=min_time, x1=max_time,
|
| 1205 |
layer="below"
|
| 1206 |
)
|
|
@@ -1448,12 +1448,12 @@ def create_combined_roi_time_series_graph(df):
|
|
| 1448 |
x0=min_time, x1=max_time
|
| 1449 |
)
|
| 1450 |
|
| 1451 |
-
# Add background shapes with
|
| 1452 |
simple_fig.add_shape(
|
| 1453 |
type="rect",
|
| 1454 |
fillcolor="rgba(230, 243, 255, 0.3)",
|
| 1455 |
line=dict(width=0),
|
| 1456 |
-
y0=0, y1=
|
| 1457 |
x0=min_time, x1=max_time,
|
| 1458 |
layer="below"
|
| 1459 |
)
|
|
@@ -1462,26 +1462,7 @@ def create_combined_roi_time_series_graph(df):
|
|
| 1462 |
type="rect",
|
| 1463 |
fillcolor="rgba(255, 230, 230, 0.3)",
|
| 1464 |
line=dict(width=0),
|
| 1465 |
-
y0
|
| 1466 |
-
x0=min_time, x1=max_time,
|
| 1467 |
-
layer="below"
|
| 1468 |
-
)
|
| 1469 |
-
|
| 1470 |
-
# Add background shapes with dynamic values
|
| 1471 |
-
simple_fig.add_shape(
|
| 1472 |
-
type="rect",
|
| 1473 |
-
fillcolor="rgba(230, 243, 255, 0.3)",
|
| 1474 |
-
line=dict(width=0),
|
| 1475 |
-
y0=0, y1=df['roi'].max() * 1.1 if not df.empty else 10, # Dynamic positive value based on data
|
| 1476 |
-
x0=min_time, x1=max_time,
|
| 1477 |
-
layer="below"
|
| 1478 |
-
)
|
| 1479 |
-
|
| 1480 |
-
simple_fig.add_shape(
|
| 1481 |
-
type="rect",
|
| 1482 |
-
fillcolor="rgba(255, 230, 230, 0.3)",
|
| 1483 |
-
line=dict(width=0),
|
| 1484 |
-
y0=df['roi'].min() * 1.1 if not df.empty else -10, y1=0, # Dynamic negative value based on data
|
| 1485 |
x0=min_time, x1=max_time,
|
| 1486 |
layer="below"
|
| 1487 |
)
|
|
|
|
| 1185 |
max_time = df['timestamp'].max()
|
| 1186 |
|
| 1187 |
# Add background shapes for positive and negative regions
|
| 1188 |
+
# Add shape for positive ROI region (above zero) - use reasonable fixed range
|
| 1189 |
fig.add_shape(
|
| 1190 |
type="rect",
|
| 1191 |
fillcolor="rgba(230, 243, 255, 0.3)",
|
| 1192 |
line=dict(width=0),
|
| 1193 |
+
y0=0, y1=10, # Fixed positive range to avoid extreme outliers affecting the view
|
| 1194 |
x0=min_time, x1=max_time,
|
| 1195 |
layer="below"
|
| 1196 |
)
|
| 1197 |
|
| 1198 |
+
# Add shape for negative ROI region (below zero) - use reasonable fixed range
|
| 1199 |
fig.add_shape(
|
| 1200 |
type="rect",
|
| 1201 |
fillcolor="rgba(255, 230, 230, 0.3)",
|
| 1202 |
line=dict(width=0),
|
| 1203 |
+
y0=-10, y1=0, # Fixed negative range to avoid extreme outliers affecting the view
|
| 1204 |
x0=min_time, x1=max_time,
|
| 1205 |
layer="below"
|
| 1206 |
)
|
|
|
|
| 1448 |
x0=min_time, x1=max_time
|
| 1449 |
)
|
| 1450 |
|
| 1451 |
+
# Add background shapes with fixed reasonable ranges
|
| 1452 |
simple_fig.add_shape(
|
| 1453 |
type="rect",
|
| 1454 |
fillcolor="rgba(230, 243, 255, 0.3)",
|
| 1455 |
line=dict(width=0),
|
| 1456 |
+
y0=0, y1=10, # Fixed positive range to avoid extreme outliers affecting the view
|
| 1457 |
x0=min_time, x1=max_time,
|
| 1458 |
layer="below"
|
| 1459 |
)
|
|
|
|
| 1462 |
type="rect",
|
| 1463 |
fillcolor="rgba(255, 230, 230, 0.3)",
|
| 1464 |
line=dict(width=0),
|
| 1465 |
+
y0=-10, y1=0, # Fixed negative range to avoid extreme outliers affecting the view
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1466 |
x0=min_time, x1=max_time,
|
| 1467 |
layer="below"
|
| 1468 |
)
|