Bokeh JSON Schema?

I’d like to integrate Bokeh plots into my react application without a Python web server running.

Can I artificially create the JSON data used to embed the plot? Where is the JSON schema published so I can assess this approach?

I’m thinking some of the JSON describe what UI features are enabled and another part of the JSON describes the X,Y data. I’d only edit the latter, changing the data as necessary. Is there any merit to this approach?

For many years BokehJS and the JSON spec were pure private implementation details. That is changing, but slowly, and work is still ongoing. So, I won’t say this is impossible, but I also won’t say we make any stability guarantees at this point. E.g. we are looking to simplify the JSON by doing away with explicit object IDs in cases where they could be auto-generated on demand.

I’m happy to offer “at your own risk” guidance, but before getting in to that, I’d like to point out that that BokehJS has a pure JavaScript API:

I’d really suggest you take a look at that first, since it would be the most stable way to interact with BokehJS.

Lastly I would note that, while I would love for BokehJS to be a first-class JS library in its own right, the fact of limited resources means this use case has not gotten nearly as much attention (but the best way to make it better is for new motivated users to try things out and make suggestions or code contributions).

1 Like

I had no idea of a native JS API - thank you! I was basing my question off of the docs where JSON is the only interop if I read correctly.