Skip to content

Commit

Permalink
fix: set to 'visible=False' to HoverTool() (#522)
Browse files Browse the repository at this point in the history
* add visible off to HoverTool() of histgrams

Signed-off-by: ISP akm <[email protected]>

* fix for pytest

Signed-off-by: ISP akm <[email protected]>

---------

Signed-off-by: ISP akm <[email protected]>
  • Loading branch information
xygyo77 authored Aug 15, 2024
1 parent 8dce0e0 commit c03ed69
Showing 1 changed file with 13 additions and 3 deletions.
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

0 comments on commit c03ed69

Please sign in to comment.