Bokeh 2.3.3

Using Bokeh 2.3.3, they wrote a script to visualize the intensity. They decided to use a combination of box plots and scatter points to show not just the average noise, but the outliers—those moments when the crowd truly erupted.

Here is the Python script they used to generate the visualization:

from bokeh.plotting import figure, show, output_file
from bokeh.models import ColumnDataSource, BoxAnnotation
from bokeh.io import curdoc
from bokeh.layouts import gridplot
import pandas as pd
import numpy as np
# --- 1. Preparing the Data ---
# Simulating decibel data for the story
np.random.seed(42)
data_2019 = np.random.normal(loc=85, scale=5, size=1000)
data_2021 = np.random.normal(loc=92, scale=8, size=1000) # Louder and more varied
# Creating a DataFrame for Bokeh's ColumnDataSource
df = pd.DataFrame(
    'decibels': np.concatenate([data_2019, data_2021]),
    'year': ['2019 (Pre-Pandemic)'] * 1000 + ['2021 (Return)'] * 1000
)
# We'll use a simplified aggregation for the box plot glyphs manually for this example
# In a real scenario, you might use boxplot mod, but let's build it manually for the story effect
q1_2019, q2_2019, q3_2019 = np.percentile(data_2019, [25, 50, 75])
q1_2021, q2_2021, q3_2021 = np.percentile(data_2021, [25, 50, 75])
# --- 2. Setting up the Bokeh Figure ---
output_file("crowd_roar_analysis.html")
# Using version 2.3.3's robust handling of toolbar location and sizing_mode
p = figure(
    title="Stadium Noise Levels: The Roar of the Return (2021 vs 2019)",
    y_range=['2019 (Pre-Pandemic)', '2021 (Return)'],
    width=800, 
    height=400,
    x_axis_label='Decibels (dB)',
    toolbar_location="above"
)
# --- 3. Visualizing the "Roar" ---
# Adding scatter points (jittered) to show density
# Bokeh 2.3.3 handles large numbers of glyphs efficiently
source = ColumnDataSource(df)
# Jittering the y-axis slightly for better visualization
p.circle(
    x='decibels', 
    y='year', 
    source=source,
    size=5, 
    alpha=0.3, 
    color="navy", 
    legend_label="Individual Readings"
)
# Adding the median lines (the story's climax)
p.segment(x0=q2_2019, y0='2019 (Pre-Pandemic)', x1=q2_2019, y1='2019 (Pre-Pandemic)', 
          line_width=4, color="red", line_dash="dashed")
p.segment(x0=q2_2021, y0='2021 (Return)', x1=q2_2021, y1='2021 (Return)', 
          line_width=4, color="red", line_dash="dashed")
# Highlighting the "Pain Threshold" (120 dB is the threshold of pain)
p.add_layout(BoxAnnotation(left=120, fill_color='red', fill_alpha=0.1, line_color='red'))
p.text(x=121, y=0.5, text=["Threshold of Pain"], text_font_size="10px", text_color="red")
# --- 4. The Reveal ---
p.legend.location = "top_left"
p.title.text_font_size = "14px"
show(p)

Bokeh 2.3.3 is a maintenance patch release for the Bokeh interactive visualization library, published in July 2021. As a minor update within the 2.3 series, it focused on stabilization rather than introducing new features, specifically addressing layout and extension bugs that emerged in previous 2.x versions. Key Improvements and Bug Fixes

This version resolved several regressions and formatting issues critical for consistent dashboard layouts:

Layout Fixes: Addressed an issue where a Column would ignore the "scrollable" CSS class and fixed height constraints where plots could not go below 600px. bokeh 2.3.3

UI Components: Fixed a bug where dropdown menus were hidden in multi-choice components and ensured active tabs were correctly in view upon rendering.

Axis Labeling: Corrected bad formatting of y-axis labels when specific themes were applied.

Extensions: Improved how extensions fetch exact versions from CDNs to prevent compatibility mismatches. Overview of Bokeh (Library Context)

Bokeh remains a premier choice for Python developers needing web-ready interactivity without writing JavaScript. Using Bokeh 2

Architecture: Built on a "layered glyph" system similar to ggplot's geoms, allowing users to build complex plots one layer at a time.

Interactivity: Unlike Matplotlib, Bokeh is designed for large or streaming datasets and supports complex interactive elements like linked brushing and hover tools.

Dashboards: It is highly suited for data applications and dashboards, with a dedicated server component for real-time updates. Recommendations

While 2.3.3 was an essential update for stability in its time, it has since been succeeded by the 3.x branch, which introduced major architectural changes, including improved CSS-based theming and performance upgrades. Releases — Bokeh 2.3.3 Documentation Bokeh 2


Let's build a small but complete example that showcases the power of Bokeh 2.3.3: an interactive stock price viewer with a linked table and hover tool.

# stock_viewer.py
from bokeh.plotting import figure, show
from bokeh.models import ColumnDataSource, HoverTool, DataTable, TableColumn
from bokeh.layouts import column, row
from bokeh.io import output_file
import pandas as pd
import numpy as np

In the summer of 2021, as the world began to open up, a small data analytics team was tasked with a sensitive project: quantifying the "enthusiasm" of the return to live sports. The hypothesis was that after a year of silence, the crowds would be louder than ever.

To prove this, the team turned to Bokeh 2.3.3. This version was particularly exciting for the team because it introduced new capabilities for responsive grid layouts and simplified JSON outputs, making it easier to embed their findings directly into the stadium's executive dashboard.

For scatter plots with tens or hundreds of thousands of points, Bokeh 2.3.3 includes refinements to the WebGL rendering backend. Markers no longer flicker when panning and zooming, and performance degradation over time (memory leaks) was significantly reduced.

python -m venv bokeh_env
source bokeh_env/bin/activate  # On Windows: bokeh_env\Scripts\activate
pip install bokeh==2.3.3
bokeh 2.3.3