Spaces:
Sleeping
Sleeping
Update dashboard.py
Browse files- dashboard.py +25 -23
dashboard.py
CHANGED
@@ -382,29 +382,6 @@ def create_overlay_plot(subject_df):
|
|
382 |
)
|
383 |
return overlay
|
384 |
|
385 |
-
def move_legend_below(plot, element):
|
386 |
-
p = plot.state
|
387 |
-
legends = p.legend
|
388 |
-
if legends:
|
389 |
-
leg = legends[0]
|
390 |
-
leg.orientation = 'horizontal'
|
391 |
-
leg.background_fill_color = 'white'
|
392 |
-
leg.border_line_color = 'black'
|
393 |
-
leg.label_text_font_size = '12pt'
|
394 |
-
leg.label_text_color = 'black'
|
395 |
-
leg.spacing = 10
|
396 |
-
leg.margin = 10
|
397 |
-
leg.label_standoff = 5
|
398 |
-
|
399 |
-
# Number of columns
|
400 |
-
try:
|
401 |
-
leg.columns = 8 # works in Bokeh 3.x
|
402 |
-
except Exception:
|
403 |
-
pass
|
404 |
-
|
405 |
-
# Remove it from its current location and re-add below
|
406 |
-
p.legend = []
|
407 |
-
p.add_layout(leg, 'below')
|
408 |
|
409 |
|
410 |
|
@@ -439,6 +416,30 @@ def legend_hook(plot, element):
|
|
439 |
'''
|
440 |
|
441 |
def create_overlay_plots(df):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
curves = []
|
443 |
max_y = 0
|
444 |
for i,obj_column in enumerate(df.columns):
|
@@ -446,6 +447,7 @@ def create_overlay_plots(df):
|
|
446 |
curves.append(curve)
|
447 |
|
448 |
|
|
|
449 |
overlay = hv.Overlay(curves).opts(
|
450 |
opts.Overlay(bgcolor='white',
|
451 |
#padding=-0.1,
|
|
|
382 |
)
|
383 |
return overlay
|
384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
|
386 |
|
387 |
|
|
|
416 |
'''
|
417 |
|
418 |
def create_overlay_plots(df):
|
419 |
+
|
420 |
+
def move_legend_below(plot, element):
|
421 |
+
p = plot.state
|
422 |
+
legends = p.legend
|
423 |
+
if legends:
|
424 |
+
leg = legends[0]
|
425 |
+
leg.orientation = 'horizontal'
|
426 |
+
leg.background_fill_color = 'white'
|
427 |
+
leg.border_line_color = 'black'
|
428 |
+
leg.label_text_font_size = '12pt'
|
429 |
+
leg.label_standoff = 5
|
430 |
+
|
431 |
+
# Number of columns
|
432 |
+
try:
|
433 |
+
leg.columns = 8 # works in Bokeh 3.x
|
434 |
+
except Exception:
|
435 |
+
pass
|
436 |
+
|
437 |
+
# Remove it from its current location and re-add below
|
438 |
+
p.legend = []
|
439 |
+
p.add_layout(leg, 'below')
|
440 |
+
|
441 |
+
|
442 |
+
|
443 |
curves = []
|
444 |
max_y = 0
|
445 |
for i,obj_column in enumerate(df.columns):
|
|
|
447 |
curves.append(curve)
|
448 |
|
449 |
|
450 |
+
|
451 |
overlay = hv.Overlay(curves).opts(
|
452 |
opts.Overlay(bgcolor='white',
|
453 |
#padding=-0.1,
|