Skip to content

Commit

Permalink
Use Bokeh 3.x interface in tracking scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
timothy-nunn committed Dec 11, 2024
1 parent 7844aa2 commit d2b68ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ mkdocs-material>=4.6.3
mkdocs-git-revision-date-localized-plugin >= 1.2
mkdocs-glightbox >= 0.3.4
pymdown-extensions>=6.3
bokeh==2.4.0
bokeh>=3.0.0,<4
mkdocstrings==0.18.0
Jinja2>=3.0
23 changes: 13 additions & 10 deletions tracking/tracking_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@
import argparse
import math
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, HoverTool, DatetimeTickFormatter
from bokeh.models import (
ColumnDataSource,
HoverTool,
DatetimeTickFormatter,
Tabs,
TabPanel,
)
from bokeh.layouts import gridplot
from bokeh.models.widgets import Panel, Tabs
from bokeh.palettes import Category10
from bokeh.resources import CDN
from bokeh.embed import file_html
Expand Down Expand Up @@ -427,14 +432,12 @@ def plot_tracking_data(database):
df["title"].to_numpy()
) # all scenarios this variable is tracked in

figur = figure(
title=variable, x_axis_type="datetime", plot_width=600, plot_height=600
)
figur = figure(title=variable, x_axis_type="datetime", width=600, height=600)
figur.xaxis.formatter = DatetimeTickFormatter(
hours=["%d %B %Y"],
days=["%d %B %Y"],
months=["%d %B %Y"],
years=["%d %B %Y"],
hours="%d %B %Y",
days="%d %B %Y",
months="%d %B %Y",
years="%d %B %Y",
)
figur.xaxis.major_label_orientation = math.pi / 4

Expand Down Expand Up @@ -503,7 +506,7 @@ def plot_tracking_data(database):
else:
gplot = gridplot([figs[i : i + 2] for i in range(0, len(figs) - 1, 2)])

panels.append(Panel(child=gplot, title=parent_module_name))
panels.append(TabPanel(child=gplot, title=parent_module_name))

tabs = Tabs(tabs=panels)

Expand Down

0 comments on commit d2b68ec

Please sign in to comment.