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

Node List: support rendering Plotly images #122

Closed
nokome opened this issue Nov 4, 2020 · 3 comments
Closed

Node List: support rendering Plotly images #122

nokome opened this issue Nov 4, 2020 · 3 comments
Assignees

Comments

@nokome
Copy link
Member

nokome commented Nov 4, 2020

One of the mimetypes used as an output of Jupyter Notebooks is application/vnd.plotly.v1+json, for the Plotly JSON Schema. This output has widespread use in Jupyter Notebooks and as such is a high priority for support.

I am presently working on support in Encoda but to support interactive Plotly figures in the browser we should add support here too. That work in Encoda will help shape the design of the necessary web component but whatever that is, it will require integration of the Plotly.js package.

This is a similar issue to #119 in that it adds support for another code chunk output type.

@alex-ketch alex-ketch self-assigned this Nov 5, 2020
@alex-ketch
Copy link
Contributor

alex-ketch commented Nov 5, 2020

Unfortunately making use plotly.js is proving less straightforward than I hoped @nokome.
Due to issues with how it's packaged and old D3 versions, getting it working with modules/NPM imports isn't working.
The package size is also very large, so I don't want to include a blocking script tag everywhere any, even unrelated, Stencila components are used.

I'll see if someone has a fork of a new version of the library with the required code edit and if we can use that.

Otherwise I think a better and immediate solution would be to write a script loader shim. It would be run whenever the Plotly component is first referenced, pausing rendering of the component until dynamically loading of the script from a CDN is finished.

@nokome
Copy link
Member Author

nokome commented Nov 5, 2020

Uurgh, sorry to hear that @alex-ketch.

I thought that the bundle size would be large but hoped that code splitting would mean it would only be downloaded on demand, when needed. I certainly agree that we should not add a script tag everywhere. The script loader sound like a good solution though 👍

@alex-ketch
Copy link
Contributor

Closed by #123

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

2 participants