-
Notifications
You must be signed in to change notification settings - Fork 66
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
Failed to render plotly graph #777
Comments
Hi @zillionare - you can look here https://github.com/jupyter-book/myst-theme/blob/3a1b70b6f2a6b827effb60891f0e693c9bf65e05/packages/jupyter/src/jupyter.tsx#L84-L85 and here https://github.com/jupyter-book/myst-theme/blob/3a1b70b6f2a6b827effb60891f0e693c9bf65e05/packages/jupyter/src/plotly.ts to see what we are doing in react. Basically, you need to load the plotly extension and register it in the rendermime registry properly. |
Hi @stevejpurves , thanks for the instructions. Unfortunately, I don't understand React very well. For some syntax in the reference documents, I'm not sure how to translate it to vue. So, I will continue using Matplotlib for now. If anyone is interested in using Thebe in Vue, I'd be happy to share this. This code can be used as a Slidev component.
|
@zillionare ok - I think you are close, let me try and take React out of the picture.
Check that it is working by using the debugger in your browser, form a breakpoint dive into the ah, one last thing - we are actually patching the plotly package in order to expose the module export here: https://github.com/jupyter-book/myst-theme/blob/3a1b70b6f2a6b827effb60891f0e693c9bf65e05/patches/jupyterlab-plotly%2B5.18.0.patch look into https://www.npmjs.com/package/patch-package to do that in your project. |
I'm using thebe core, and already make it work, include matplotlib graph, show dataframe and etc.
However, I got some error when rendering plotly graph.
I'm using thebe in slidev project, and load require/plotly in this way:
It's loaded before thebe core is started.
when jupyter get result back and at the rending stage, errors happend as:
is this a plotly.js version error? which version should I use?
Thanks for help in advance!
The text was updated successfully, but these errors were encountered: