Skip to content

CustomJSTransform #5015

@birdsarah

Description

@birdsarah

Adding new transforms is easy, but people should be able to self serve something like this:

from bokeh.models import CustomJSTransform

transform = 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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions