Skip to content

Commit

Permalink
dl button only interactive if regression plot is visible (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Haupt authored Dec 20, 2024
1 parent 9c42344 commit 3f726d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion birdnet_analyzer/gui/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ def create_log_plot(positives, negatives, fig_num=None):

box = ax.get_position()
ax.set_position([box.x0, box.y0, box.width * 0.8, box.height])
ax.legend(loc="center left", bbox_to_anchor=(1, 0.5))

if any(threshold <= 1 for threshold in thresholds):
ax.legend(loc="center left", bbox_to_anchor=(1, 0.5))

if len(y_val) > 0:
ax.scatter(x_vals, y_val, 2)
Expand Down Expand Up @@ -312,6 +314,8 @@ def update_review(next_review_state: dict, selected_species: str = None):
else:
update_dict |= {review_item_col: gr.Column(visible=False), no_samles_label: gr.Label(visible=True)}

update_dict[regression_dl_btn] = gr.Button(interactive=update_dict[species_regression_plot].constructor_args["visible"])

return update_dict

def undo_review(next_review_state):
Expand Down Expand Up @@ -377,6 +381,7 @@ def download_plot(plot, filename=""):
file_count_matrix,
species_regression_plot,
undo_btn,
regression_dl_btn
]

spectrogram_dl_btn.click(
Expand Down

0 comments on commit 3f726d6

Please sign in to comment.