Hi. I’m wondering if there is currently a way to drive the parameters of an annotation via CustomJSTransform.
Something like:
main_src = ColumnDataSource({'x':[1,2,3,4]})
#transform that calcs the average x of src
tr = CustomJSTransform(args=dict(src=src)
,func='''
return src.data['x'].reduce((a, b) => a + b, 0) / src.data['x'].length;
'''
)
sl = Slope(gradient=tr # or transform(field_name='dum',transform=tr) ?? also doesn't work
,y_intercept=0, #etc.
)
Am I missing something obvious? The gradient runs off a singular value (I think that means “non vectorized”), and the transform returns a singular value, but I’m definitely missing something in how to assign the transform to it (or if that is even possible)…
Thanks!