{"id":1403,"library":"bokeh","title":"Bokeh","description":"Bokeh is an interactive visualization library for modern web browsers. It helps create versatile, interactive plots, dashboards, and data applications from Python, targeting web browsers for rendering. It is currently at version 3.9.0 and typically releases minor versions every few months with major versions less frequently.","status":"active","version":"3.9.0","language":"en","source_language":"en","source_url":"https://github.com/bokeh/bokeh","tags":["data visualization","interactive plots","web applications","dashboarding"],"install":[{"cmd":"pip install bokeh","lang":"bash","label":"Install Bokeh"}],"dependencies":[],"imports":[{"symbol":"figure","correct":"from bokeh.plotting import figure"},{"symbol":"show","correct":"from bokeh.plotting import show"},{"symbol":"ColumnDataSource","correct":"from bokeh.models import ColumnDataSource"},{"note":"`curdoc` was moved to `bokeh.io` in Bokeh 3.x.","wrong":"from bokeh.document import curdoc","symbol":"curdoc","correct":"from bokeh.io import curdoc"}],"quickstart":{"code":"from bokeh.plotting import figure, show\nfrom bokeh.models import ColumnDataSource\nimport numpy as np\n\nx = np.linspace(0, 4*np.pi, 100)\ny = np.sin(x)\n\nsource = ColumnDataSource(data=dict(x=x, y=y))\n\np = figure(width=600, height=400, title=\"Simple Sine Wave\",\n           x_axis_label='x', y_axis_label='y')\np.line('x', 'y', source=source, line_width=2)\n\nshow(p)","lang":"python","description":"This quickstart creates a simple interactive sine wave plot and displays it in your default web browser. For more complex interactions or live updates, consider using Bokeh server."},"warnings":[{"fix":"Remove explicit `output_file`/`output_notebook` calls. Rely on `show()` to display the plot. For Bokeh server applications, run `bokeh serve your_app.py`.","message":"Bokeh 3.x introduced significant breaking changes, most notably the removal of `output_file()`, `output_notebook()`, and `output_server()`. The `show()` function now handles output implicitly based on the environment (e.g., Jupyter, script).","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always wrap your data in `ColumnDataSource(data=...)` and reference columns by string names (e.g., `p.line('x', 'y', source=source)`).","message":"For interactive features like callbacks, linked panning, or dynamic updates, data should be stored in a `ColumnDataSource`. Direct Python lists or NumPy arrays are static and will not update interactively without manual re-rendering.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Structure your application logic to add components to `curdoc().add_root()` and define callbacks using `curdoc().on_change()` or `source.on_change()`. Run with `bokeh serve your_app.py`.","message":"Building Bokeh server applications (`bokeh serve`) requires specific structuring using `curdoc()` and callbacks, and cannot be run like a standard Python script that calls `show()` at the end. The server continuously updates the document.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `from bokeh.layouts import row, column, layout` and compose your plots/widgets using these functions instead of `gridplot`.","message":"The `gridplot` function is largely superseded by the more flexible `layout`, `row`, and `column` functions for arranging multiple plots or widgets.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}