Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set to 'visible=False' to HoverTool() #522

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
from collections.abc import Sequence
from logging import getLogger

from bokeh import __version__ as bokeh_version
from bokeh.models import HoverTool
from bokeh.models.renderers import GlyphRenderer

from bokeh.plotting import figure as Figure

import numpy as np
from packaging import version

from .callback_scheduling import BokehCallbackSched
from .message_flow import BokehMessageFlow
Expand Down Expand Up @@ -223,9 +225,17 @@ def histogram(
top=top, bottom=0, left=bins[i], right=bins[i+1],
color=color, alpha=1, line_color='white'
)
hover = HoverTool(
tooltips=[(x_label, f'{bins[i]}'), ('The number of samples', f'{top}')],
renderers=[quad]
if version.parse(bokeh_version) >= version.parse('3.4.0'):
hover = HoverTool(
tooltips=[(x_label, f'{bins[i]}'), ('The number of samples', f'{top}')],
renderers=[quad],
visible=False
)
else:
hover = HoverTool(
tooltips=[(x_label, f'{bins[i]}'), ('The number of samples', f'{top}')],
renderers=[quad],
toggleable=False
)
plot.add_tools(hover)
quad_dicts[target_object] = quad_dicts[target_object] + [quad]
Expand Down
Loading