Question about Smooth Curve Glyphs (Spline Glyphs) from PR #10323

Hello Bokeh Community,

I recently came across PR #10323 regarding smooth curve glyphs (spline glyphs). However, I couldn’t find any mention of this feature in the documentation. I’m wondering if the smooth curve glyphs are currently unavailable in the Python API, or if there are plans to expose and support them in the future.

Thank you very much for all your hard work and contributions to Bokeh. I really appreciate your efforts and look forward to any insights you can provide.

Best regards.

The referenced PR only added support for splines on the BokehJS side, there has not been any work yet to add it to the Python side that I am aware of. AFAIK the intention was always to do so, but I think it got lost amidst other priorities. I don’t see a current open issue about it (maybe a reason it got neglected, in fact) so if you are interested in a Python API for this I’d encourage you to open a GitHub Issue about it.

Thank you very much for all your hard work and contributions to Bokeh. I really appreciate your efforts and look forward to any insights you can provide.

Thank you for the kind words!

1 Like

Just little FYI, this piqued my interest → here’s a basic MRE to create a spline glyph on the JS side:

from bokeh.plotting import figure, show
from bokeh.layouts import column
from bokeh.models import CustomJS, ColumnDataSource, RadioButtonGroup
import numpy as np

src = ColumnDataSource(data={'x':np.arange(25),'y':np.arange(25)})
src.data['y'] = src.data['y']*np.random.random(25)

fig = figure()
rb = RadioButtonGroup(labels=['Line','Spline'],active=0)

rl = fig.line(x='x',y='y',source=src)

cb = CustomJS(args=dict(fig=fig,src=src,rb=rb,rl=rl)
              ,code='''
            if (Bokeh.documents[0].get_model_by_name('spline_rend') == null){
                    var spl = Bokeh.Models._known_models.get('Spline')
                    var g = new spl()
                    g.x = {'field':'x'}
                    g.y = {'field':'y'}
                    var r = fig.add_glyph(g,src)
                    r.name = 'spline_rend'
                    }
            var r = Bokeh.documents[0].get_model_by_name('spline_rend')
            if (rb.active == 1){ 
                   r.visible = true
                   rl.visible = false
                   }
            else {
                  r.visible = false
                  rl.visible = true
                  }
   
              '''
              )
rb.js_on_change('active',cb)

show(column([fig,rb]))

spl

1 Like