Skip to content

Commit

Permalink
Fixing RangeTool with bokeh 3.1.0 not a GestureTool (#642)
Browse files Browse the repository at this point in the history
* Fixing RangeTool with bokeh 3.1.0 not a GestureTool

* Adjust requirements for bokeh to include latest 3.1.0

* Fix DatetimeTickFormatter passing in string format instead of list of strings as deprecated in 3.0.0 bokeh compatible with bokeh 2.4.3

---------

Co-authored-by: Claudiu Toma <ctoma@microsoft.com>
Co-authored-by: Ian Hellen <ianhelle@microsoft.com>
  • Loading branch information
3 people committed Mar 16, 2023
1 parent 4dce286 commit e97deac
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion conda/conda-reqs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ azure-mgmt-network>=2.7.0
azure-mgmt-resource>=16.1.0
azure-storage-blob>=12.5.0
beautifulsoup4>=4.0.0
bokeh>=1.4.0, <=3.0.2
bokeh>=1.4.0, <=3.1.0
cryptography>=3.1
deprecated>=1.2.4
dnspython>=2.0.0, <3.0.0
Expand Down
4 changes: 3 additions & 1 deletion msticpy/vis/process_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
HoverTool,
LayoutDOM,
RangeTool,
GestureTool,
)
from bokeh.models.widgets import DataTable, DateFormatter, TableColumn

Expand Down Expand Up @@ -534,7 +535,8 @@ def _create_vert_range_tool(
rng_select.ygrid.grid_line_color = None
rng_select.xgrid.grid_line_color = None
rng_select.add_tools(range_tool)
rng_select.toolbar.active_multi = range_tool
if isinstance(range_tool, GestureTool):
rng_select.toolbar.active_multi = range_tool
return rng_select


Expand Down
14 changes: 8 additions & 6 deletions msticpy/vis/timeline_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
LayoutDOM,
Range,
RangeTool,
GestureTool,
Title,
)

Expand Down Expand Up @@ -308,7 +309,8 @@ def create_range_tool(
range_tool.overlay.fill_alpha = 0.2 # type: ignore
rng_select.ygrid.grid_line_color = None
rng_select.add_tools(range_tool)
rng_select.toolbar.active_multi = range_tool # type: ignore
if isinstance(range_tool, GestureTool):
rng_select.toolbar.active_multi = range_tool # type: ignore
return rng_select


Expand Down Expand Up @@ -413,9 +415,9 @@ def get_tick_formatter() -> DatetimeTickFormatter:
"""Return tick formatting for different zoom levels."""
# '%H:%M:%S.%3Nms
tick_format = DatetimeTickFormatter()
tick_format.days = ["%m-%d %H:%M"] # type: ignore
tick_format.hours = ["%H:%M:%S"] # type: ignore
tick_format.minutes = ["%H:%M:%S"] # type: ignore
tick_format.seconds = ["%H:%M:%S"] # type: ignore
tick_format.milliseconds = ["%H:%M:%S.%3N"] # type: ignore
tick_format.days = "%m-%d %H:%M" # type: ignore
tick_format.hours = "%H:%M:%S" # type: ignore
tick_format.minutes = "%H:%M:%S" # type: ignore
tick_format.seconds = "%H:%M:%S" # type: ignore
tick_format.milliseconds = "%H:%M:%S.%3N" # type: ignore
return tick_format
2 changes: 1 addition & 1 deletion requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ azure-mgmt-resourcegraph>=8.0.0
azure-mgmt-subscription>=3.0.0
azure-storage-blob>=12.5.0
beautifulsoup4>=4.0.0
bokeh>=1.4.0, <=3.0.2
bokeh>=1.4.0, <=3.1.0
cryptography>=3.1
deprecated>=1.2.4
dnspython>=2.0.0, <3.0.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ azure-core>=1.24.0
azure-identity>=1.10.0
azure-mgmt-subscription>=3.0.0
beautifulsoup4>=4.0.0
bokeh>=1.4.0, <=3.0.2
bokeh>=1.4.0, <=3.1.0
cryptography>=3.1
deprecated>=1.2.4
dnspython>=2.0.0, <3.0.0
Expand Down

0 comments on commit e97deac

Please sign in to comment.