# Run with: bokeh serve app.py from bokeh.io import curdoc from bokeh.plotting import figure from bokeh.models import ColumnDataSource from bokeh.layouts import column from random import random
: Be aware that the default step value for numeric inputs is 1, which may unexpectedly cast float inputs to integers. You must explicitly set step to a float (e.g., 0.1 ) to avoid this . Plots Not Rendering on Private Network - Bokeh Discourse
Fixed an issue where a plot's height could not be reduced below 600px.
from bokeh.plotting import figure, output_file, show from bokeh.models import ColumnDataSource, HoverTool # 1. Define the destination output file output_file("interactive_scatter.html") # 2. Prepare the data using a ColumnDataSource data = 'x_values': [1, 2, 3, 4, 5], 'y_values': [6, 7, 2, 4, 5], 'labels': ['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon'] source = ColumnDataSource(data=data) # 3. Initialize the figure object p = figure( title="Bokeh 2.3.3 Interactive Scatter Plot", x_axis_label="X Axis", y_axis_label="Y Axis", plot_width=600, plot_height=400, tools="pan,box_zoom,reset,save" ) # 4. Add a circle glyph mapping the ColumnDataSource keys p.circle( x='x_values', y='y_values', size=15, source=source, color="navy", alpha=0.7, hover_color="firebrick" ) # 5. Add a highly responsive Hover Tool hover = HoverTool() hover.tooltips = [ ("Index", "$index"), ("Label", "@labels"), ("Coordinates", "(@x_values, @y_values)") ] p.add_tools(hover) # 6. Render the plot in a browser window show(p) Use code with caution. 5. Advanced Interactive Components
Passing tools as a comma-separated string directly into figure() remains fully supported and reliable in this build. 5. Why Stay on Bokeh 2.3.3? (Pros & Cons) bokeh 2.3.3
For more information, you can explore the official Bokeh 2.3.3 Documentation. If you'd like, I can: Show you . Compare 2.3.3 to the 3.x series . Help you troubleshoot a specific layout issue . Let me know how you'd like to proceed . Releases — Bokeh 2.3.3 Documentation
For developers, data scientists, and analysts utilizing the Bokeh library to build dashboards, 2.3.3 ensured smoother rendering and more predictable layouts across various browser environments. What’s New in Bokeh 2.3.3?
When applying custom themes to plots, consistent labeling is necessary for readability. The fix for y-axis label formatting ( #11110 ) ensured that font, color, and formatting choices defined in a Theme object are applied uniformly. 2. Interactive Components (Multi-Choice)
: Eliminates the need to overhaul layout structures or recompile complex frontend assets that were altered in later releases. Key Limitations vs. Modern Iterations # Run with: bokeh serve app
: The layout engine was patched to lift limits where a plot's target height could stubbornly refuse to shrink below a mandatory 600px floor, allowing data scientists to deploy highly responsive, compact UI charts. 4. CDN Extension Locking
If you plan to migrate an older codebase from Bokeh 2.3.3 to the modern 3.x ecosystem, you should prepare for several breaking architectural shifts.
Let’s build a functional, interactive chart using Bokeh 2.3.3. This example showcases a combined line and scatter plot that reads data from a ColumnDataSource .
This comprehensive guide explores the core architecture, installation, specific features, and optimization strategies for Bokeh 2.3.3. 1. Introduction to Bokeh 2.3.3 from bokeh
# 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 )
Bokeh 2.3.3 can be used in a variety of scenarios, including:
As a maintenance release within the 2.3.x line, 2.3.3 offers enhanced stability, making it a stable choice for production environments, including Google Colaboratory .