The website uses cookies, e.g. to collect data on website traffic. You decide to accept cookies in your browser settings.
The website uses cookies, e.g. to collect data on website traffic. You decide to accept cookies in your browser settings.
+48503663933 [email protected] Rządza 10E, 05-304 Stanisławów 24h

Bokeh 2.3.3

Bokeh 2.3.3

from bokeh.layouts import column
from bokeh.models import Slider, CustomJS, ColumnDataSource
from bokeh.plotting import figure, show

x = [1,2,3,4,5] y = [2,4,6,8,10] source = ColumnDataSource(data=dict(x=x, y=y))

p = figure() p.line("x", "y", source=source)

slider = Slider(start=0, end=10, step=1, value=1, title="Multiplier")

callback = CustomJS(args=dict(source=source, slider=slider), code=""" const data = source.data; const multiplier = slider.value; const new_y = data['x'].map(x => x * multiplier); data['y'] = new_y; source.change.emit(); """)

slider.js_on_change('value', callback)

show(column(p, slider))


Bokeh 2.3.3 automatically tries to load BokehJS (the client-side library) from a CDN. If you're working in an air-gapped or offline environment, you can download the BokehJS static files separately and serve them locally.

In a world chasing the newest features, Bokeh 2.3.3 stands as a testament to the value of stability. It offers a mature, bug-free interactive visualization engine that has been battle-tested in thousands of production dashboards, financial applications, and scientific research tools. For anyone maintaining systems that rely on the Bokeh 2.x API, this version is the definitive upgrade—the final polished gem before the paradigm shift of Bokeh 3.0.

Whether you're a data engineer preserving a legacy dashboard, a professor teaching a course with fixed dependencies, or a developer who values "if it ain't broke, don't fix it," Bokeh 2.3.3 delivers. Install it, explore its capabilities, and appreciate the craftsmanship of a library that turned complex web visualizations into elegant Python code.


Have you used Bokeh 2.3.3 in production? Share your experience or migration story in the comments below.

Released in July 2021, Bokeh 2.3.3 is a patch release focusing on fixing layout, extension, and widget-related bugs within the 2.x legacy branch. The update resolves issues with CSS scrolling, y-axis label formatting, and specifically addresses component rendering for Dropdown menus and plot constraints. For the full release notes, visit Bokeh 2.3.3 Documentation Bokeh documentation Releases — Bokeh 2.3.3 Documentation

Overview of Bokeh

Bokeh is an open-source library that allows users to create web-based interactive plots, charts, and dashboards. It's designed to be highly customizable and extensible, making it a favorite among data scientists, researchers, and developers.

Key Features of Bokeh 2.3.3

The Bokeh 2.3.3 release includes several new features, improvements, and bug fixes. Some of the key highlights include: bokeh 2.3.3

What's New in Bokeh 2.3.3

Here's a summary of the major changes in Bokeh 2.3.3:

  • Improvements:
  • Bug Fixes:
  • Upgrade and Installation

    To upgrade to Bokeh 2.3.3, you can use pip:

    pip install --upgrade bokeh
    

    Or, if you're using conda:

    conda update bokeh
    

    If you're new to Bokeh, you can install it using pip or conda:

    pip install bokeh
    

    or

    conda install bokeh
    

    Example Use Cases

    Here are a few examples of using Bokeh 2.3.3:

    Example 1: Simple Line Plot

    import numpy as np
    from bokeh.plotting import figure, show
    x = np.linspace(0, 10, 100)
    y = np.sin(x)
    p = figure(title="simple line plot")
    p.line(x, y, legend_label="sin(x)")
    show(p)
    

    Example 2: Interactive Dashboard

    import numpy as np
    from bokeh.plotting import figure, show
    from bokeh.models import ColumnDataSource, HoverTool
    # Create a sample dataset
    x = np.random.normal(size=100)
    y = np.random.normal(size=100)
    # Create a ColumnDataSource
    source = ColumnDataSource(data=dict(x=x, y=y))
    # Create a figure
    p = figure(title="Interactive Dashboard")
    # Add a line renderer
    p.line('x', 'y', source=source)
    # Add a hover tool
    hover = HoverTool(tooltips=[
        ("x", "@x"),
        ("y", "@y"),
    ])
    p.add_tools(hover)
    # Show the plot
    show(p)
    

    These examples demonstrate the simplicity and flexibility of Bokeh 2.3.3. With its powerful features and extensive customization options, Bokeh is an ideal choice for creating interactive visualizations and dashboards.

    Here’s a helpful reference paper for Bokeh 2.3.3 — structured as a quick-start + cheat sheet for users who need to work with this specific version.


    p = figure( title="Stock Price with Moving Average", x_axis_type="datetime", width=800, height=400, tools="pan,wheel_zoom,box_zoom,reset,save" )

    dates = pd.date_range('2023-01-01', periods=200) prices = 100 + np.cumsum(np.random.randn(200).cumsum()) volume = np.random.randint(1000, 10000, 200) from bokeh

    source = ColumnDataSource(data= 'date': dates, 'price': prices, 'volume': volume, 'moving_avg': pd.Series(prices).rolling(10).mean() )

    Before diving into the specifics of version 2.3.3, let's briefly contextualize the library. Bokeh is a powerful Python library for creating interactive and scalable visualizations for modern web browsers. Unlike static plotting libraries (e.g., Matplotlib), Bokeh generates visualizations as HTML/JavaScript applications. This allows for:

    Bokeh sits comfortably between low-level visualization tools and high-level dashboard frameworks like Dash or Streamlit, offering granular control without writing raw JavaScript.

    Archived docs:
    https://docs.bokeh.org/en/2.3.3/


    Bokeh 2.3.3 , you are working with a legacy release of the powerful Python interactive visualization library. While newer versions exist, 2.3.3 is often maintained for specific dependency environments. 🛠️ Official Documentation & Installation The most authoritative "deep guide" is the archived Bokeh 2.3.3 User Guide

    , which covers everything from basic glyphs to server deployment. Bokeh documentation Installation : Use pip to target this specific version: pip install bokeh==2.3.3 Sample Data

    : To follow many tutorial examples, you may need to download the companion datasets using: bokeh sampledata Bokeh documentation 💡 Core Architecture: How 2.3.3 Works Bokeh operates on a two-part system: Python Library

    : You define your plots, widgets, and logic in Python. It generates a declarative JSON object graph.

    : A client-side JavaScript library that takes that JSON and renders the actual interactive visualization in the browser. Bokeh documentation 🗝️ Key Features in 2.3.3

    Version 2.3.3 introduced or refined several critical features that were major updates at the time: Hatch Patterns

    : Support for textured fills (dots, stripes, etc.) on all fill-able glyphs and annotations. Multi-line Labels : The ability to have multi-line axis and tick labels. WebGL Acceleration

    : Enhanced performance for large datasets (thousands of points) by offloading rendering to the GPU. SVG Export

    : While PNG was standard, 2.3.3 documentation provides specific paths for exporting layouts as SVGs Bokeh documentation 🏗️ Building a Basic Plot In Bokeh 2.3.3, the bokeh.plotting interface is the most common entry point: # Create a figure with specific tools = figure(title= Basic Line Plot , x_axis_label= , y_axis_label= pan,wheel_zoom,box_zoom,reset # Add a renderer ], line_width= # Display the result Use code with caution. Copied to clipboard 🚀 Advanced Usage Bokeh Server

    : Use this to build applications where Python code reacts to browser events (like sliders or selections). You run these apps via the bokeh serve Interactions CustomJS callbacks

    for interactions that don't require a Python server, allowing your plots to remain interactive even as standalone HTML files. Integration : Seamlessly works with Jupyter Notebooks by calling output_notebook() Bokeh documentation ⚠️ Version-Specific Warnings Python Compatibility Bokeh 2

    : This version is typically used with Python 3.6 through 3.9. Check your environment if you encounter installation errors. Documentation Warning : Ensure you are looking at the /en/2.3.3/ path in the docs; the

    documentation contains breaking changes and new syntax (like the bokeh.models overhaul) not present in 2.3.3. Bokeh documentation specific code example

    (like a real-time dashboard or a complex map) to build with Bokeh 2.3.3? User guide — Bokeh 2.3.3 Documentation

    Bokeh 2.3.3 is a specific version of the Bokeh interactive visualization library released in July 2021. It is a patch-release that primarily addresses bugs related to layouts and extensions. Key Features of Bokeh 2.3.3

    Version Focus: As a minor patch release, its main goal was fixing regressions rather than adding major new features.

    Fixes: Notable fixes included resolving an issue where the Column layout ignored the scrollable CSS class.

    Legacy Context: This version still relied on older WebGL code, which some users found buggy, leading many to later upgrade to version 2.4.x for better performance. Working with Text in Bokeh 2.3.3

    When developing text-based elements in this version, you typically use several core models and properties:

    Axis Labels: You can add line breaks to labels using the \n string.

    Text Properties: Visual attributes like text_color, text_font, and text_font_style can be applied to titles, labels, and annotations.

    Mathematical Text: Bokeh 2.3.x supports rendering mathematical notation (LaTeX) via MathJax through the MathText model.

    Text Glyphs: You can render text directly onto a plot using the text() glyph method, which allows for vectorized text placement. Usage Example (v2.3.3 Syntax)

    To display a simple text label on a plot in this version, you would use the following structure:

    from bokeh.plotting import figure, show p = figure(width=400, height=400) # Adding text glyphs p.text(x=[1, 2], y=[1, 2], text=["Label A", "Label B"], text_color="firebrick", text_font_size="20pt") show(p) Use code with caution. Copied to clipboard

    For more detailed documentation, you can refer to the archived Bokeh 2.3.3 User Guide or see current installation options on PyPI. Styling visual attributes — Bokeh 2.3.3 Documentation

    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