Creating a 2d ndarray object in bokehjs #13767
Replies: 3 comments 2 replies
-
cc @mattpap it would probably be nice to have a full image example in |
Beta Was this translation helpful? Give feedback.
-
I'd be happy to make a pull request with a fleshed out example if someone pointed me in the right direction. How to make a 2d ndarray object in JS |
Beta Was this translation helpful? Give feedback.
-
ndarrays aren't well defined in bokehjs and the current API is more suited for internal usage. However, the image API requires ndarrays, so here's an example how to define them: bokeh/bokehjs/test/integration/regressions.ts Lines 79 to 108 in d9a2f7a Essentially one has to work with a flat array and do indexing manually, and create an I started PR #13785, where I will add some more examples to bokehjs covering this and other topics. |
Beta Was this translation helpful? Give feedback.
-
Hello, my ultimate goal is to create a Bokeh.Image purely in bokehjs. I've learned this needs to be done by constructing a CDS that contains a 2d ndarray object. How do I create the ndarray object?
So far I've only found a hacky way of creating 1d ndarray objects with minified Bokehjs loaded, using Bokeh.LinAlg.np.arange(0,100,2).
For anyone interested, this is for some physics calculations I'm trying out in a svelte app. I'd like to replace the vanilla canvas part with a bokeh Image.
Thanks for the help!!
Beta Was this translation helpful? Give feedback.
All reactions