From c11c0730a19c2ed0859830aeb2fc650ed2835db9 Mon Sep 17 00:00:00 2001 From: handwerkerd Date: Mon, 1 Apr 2024 16:37:15 -0400 Subject: [PATCH 1/2] fixed crash --- pyproject.toml | 2 +- tedana/reporting/dynamic_figures.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c7cb4d1f..50216a592 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ license = {file = "LICENSE"} requires-python = ">=3.8" dependencies = [ - "bokeh", + "bokeh>=1.0.0,<=3.4.0", "mapca>=0.0.4,<=0.0.5", "matplotlib", "nibabel>=2.5.1,<=5.2.1", diff --git a/tedana/reporting/dynamic_figures.py b/tedana/reporting/dynamic_figures.py index ae52863f8..005add6ab 100644 --- a/tedana/reporting/dynamic_figures.py +++ b/tedana/reporting/dynamic_figures.py @@ -170,7 +170,7 @@ def _create_kr_plt(comptable_cds, kappa_elbow=None, rho_elbow=None): ) diagonal = models.Slope(gradient=1, y_intercept=0, line_color="#D3D3D3") fig.add_layout(diagonal) - fig.circle( + fig.scatter( "kappa", "rho", size="size", @@ -287,7 +287,7 @@ def _create_sorted_plt( y=comptable_cds.data[y_var].sort_values(ascending=False).values, color="black", ) - fig.circle(x_var, y_var, source=comptable_cds, size=5, color="color", alpha=0.7) + fig.scatter(x_var, y_var, source=comptable_cds, size=5, color="color", alpha=0.7) fig.xaxis.axis_label = x_label fig.yaxis.axis_label = y_label fig.x_range = models.Range1d(-1, n_comps + 1) @@ -347,7 +347,9 @@ def _create_varexp_pie_plt(comptable_cds): fig.grid.visible = False fig.toolbar.logo = None - circle = models.Circle(x=0, y=1, size=150, fill_color="white", line_color="white") + circle = models.Scatter( + x=0, y=1, size=150, marker="circle", fill_color="white", line_color="white" + ) fig.add_glyph(circle) return fig From 75a7483f8d12cf24b02b5141434a2177e42108ea Mon Sep 17 00:00:00 2001 From: handwerkerd Date: Thu, 4 Apr 2024 12:40:53 -0400 Subject: [PATCH 2/2] hopefully solved --- tedana/reporting/dynamic_figures.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tedana/reporting/dynamic_figures.py b/tedana/reporting/dynamic_figures.py index 005add6ab..95ac95edb 100644 --- a/tedana/reporting/dynamic_figures.py +++ b/tedana/reporting/dynamic_figures.py @@ -162,10 +162,15 @@ def _create_kr_plt(comptable_cds, kappa_elbow=None, rho_elbow=None): ("Tags", "@classtag"), ] ) + fig = plotting.figure( width=400, height=400, - tools=["tap,wheel_zoom,reset,pan,crosshair,save", kr_hovertool], + tools=[ + "wheel_zoom,reset,pan,crosshair,save", + models.TapTool(mode="replace"), + kr_hovertool, + ], title="Kappa / Rho Plot", ) diagonal = models.Slope(gradient=1, y_intercept=0, line_color="#D3D3D3") @@ -279,7 +284,7 @@ def _create_sorted_plt( fig = plotting.figure( width=400, height=400, - tools=["tap,wheel_zoom,reset,pan,crosshair,save", hovertool], + tools=["wheel_zoom,reset,pan,crosshair,save", models.TapTool(mode="replace"), hovertool], title=title, ) fig.line( @@ -319,18 +324,22 @@ def _create_sorted_plt( def _create_varexp_pie_plt(comptable_cds): - fig = plotting.figure( - width=400, - height=400, - title="Variance Explained View", - tools=["hover,tap,save"], + + pie_hovertool = models.HoverTool( tooltips=[ - ("Component ID", " @component"), + ("Component ID", "@component"), ("Kappa", "@kappa{0.00}"), ("Rho", "@rho{0.00}"), - ("Var. Exp.", "@varexp{0.00}%"), + ("Var. Expl.", "@varexp{0.00}%"), ("Tags", "@classtag"), - ], + ] + ) + + fig = plotting.figure( + width=400, + height=400, + title="Variance Explained View", + tools=[pie_hovertool, models.TapTool(mode="replace"), "save"], ) fig.wedge( x=0,