Adding new transforms is easy, but people should be able to self serve something like this:
frombokeh.modelsimportCustomJSTransformtransform=CustomJSTransform.from_coffeescript(
compute="""return 2*x""",
v_compute=""" vals = [] for x in xs: vals.push(2*x) return vals """
)
.....
p.circle(x='x', y='y', size={field: 'x', transform: transform})
Just like #4659, user would know that single x is passed to compute and array xs is passed to v_compute. User would specify a return value and would also be able to pass in args - like for CustomJS.
The text was updated successfully, but these errors were encountered:
It's probably the case that alot of that code can be re-used.
Then the first step would be to define what the python class that will represent a CustomJSTransform should look like. It will be a subclass of Transform with some extra properties to represent the JS code for the transform.
Adding new transforms is easy, but people should be able to self serve something like this:
Just like #4659, user would know that single
x
is passed to compute and arrayxs
is passed to v_compute. User would specify a return value and would also be able to pass in args - like for CustomJS.The text was updated successfully, but these errors were encountered: