Open
Description
Software versions
Python version: 3.10.14
Bokeh version: 3.6.1
IPython version: 8.29.0
Browser name and version
ChromeDriver 131.0.6778.69
Jupyter notebook / Jupyter Lab version
No response
Expected behavior
The Div text should be shown in the exported SVG file and no random temporary files should be created!
Observed behavior
Exporting Bokeh layout or gridplot to SVG does not show Div elements. Moreover, the code generates a new temporary html
files (with a random name) in the working directory every time the code is executed even when I have specified an output_file
name. If output_file
name is specified, then the temporary file creation is skipped at the first execution.
Example code
import numpy as np
from bokeh.plotting import figure, output_file
from bokeh.models import Div
import bokeh.layouts as layouts
from bokeh.io import export_svg
N = 10000
x = np.random.normal(0, np.pi, N)
y = np.sin(x) + np.random.normal(0, 0.2, N)
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
p = figure(tools=TOOLS, output_backend="svg")
p.scatter(x, y, alpha=0.1, nonselection_alpha=0.001)
div = Div(text='Plotting random')
fig = layouts.column(div, p)
output_file('testSVG.html')
export_svg(fig, filename='testSVG.svg')
Stack traceback or browser console output
No response
Screenshots
No response