Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of the 3D graphics into RootInteractive using Bokeh #73

Open
miranov25 opened this issue Nov 1, 2020 · 4 comments
Open

Comments

@miranov25
Copy link
Owner

Starting Example:
http://docs.bokeh.org/en/latest/docs/user_guide/extensions_gallery/wrapping.html#userguide-extensions-examples-wrapping

According main author of Bokeh - not native support of 3D. In example wrapper for vis.js.
See: https://groups.google.com/a/continuum.io/g/bokeh/c/u_j46VHRyt0

Hi,

The mpl.to_bokeh function was never able to convert 3D plots, so it would not have helped here. In fact, it was barely ever able to do much at all. The long-discussed MPL JSON spec that might have made maintainable MPL compatibility possible never materialized, which is why the whole idea was ultimately abandoned.

In any case, the core Bokeh library does not focus on or provide any built-in 3d capability, and it's unlikely that it ever will. The "surface3d" example is mostly intended as a demonstration that Bokeh can be extended with custom models and external JS libraries, but the underlying vis.js library that it wraps is purely a toy, in my opinion. If anyone wanted to create a custom extension to integrate a better 3d JS library with Bokeh, that would be great. Something like three.js is probably a good candidate, though there may be others I am not aware of. It could be a little work or a lot of work, depending on whether the extension was very specialized and narrow, or more general. For reference, the chapter on creating custom extensions is here:

https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

Thanks,

Bryan

@miranov25
Copy link
Owner Author

@miranov25
Copy link
Owner Author

We wil start with visjs example as in https://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html
based on success - later use threejs

@miranov25
Copy link
Owner Author

Adding 3D plot to the arrays:
RootInteractive/InteractiveDrawing/bokeh/bokehTools.py:def bokehDrawArray(dataFrame, query, figureArray, **kwargs):
if "varZ" - use it in 3D otherwise scatter as it was before:

            figureI.scatter(x=varNameX, y=varNameY, fill_alpha=1, source=source, size=optionLocal['size'],
                            color=optionLocal["color"],
                            marker=optionLocal["marker"], legend_label=varY + " vs " + varX)

New functionality to be tested within:
RootInteractive/InteractiveDrawing/bokeh/test_bokehDrawSA.py

Either new function there all add there 3D in one of figures

@miranov25
Copy link
Owner Author

3D graphics integrated via visJS - since commits above but not working properly in the Jupyter notebook
Should be fixed before closing.
Eventually other 3D library should be used ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant