-
Notifications
You must be signed in to change notification settings - Fork 41
Render locally offline #35
Comments
Hello @piranna, thanks for the comment. Unfortunately, this is out of the scope of this module as this is simplly an node HTTP wrapper around our REST API. This module will not be extended to including features such as offline image-rendering. If you still wish to do that, your best solution would be to load the |
Thank you for your comment, I'm going to try to do it using PhantomJS, since gitbook-plugin-mermaid uses it already. |
Great! I look forward to seeing your implementation! Cheers! |
I have been trying to achieve this during the last two days without luck :-( Nor PhantomJS (based on WebKit) nor PhantoJS 2 (based on Chromium) nor JsDom could made it work, sometimes I get that the |
@piranna we've had success using Feel free to share the repository or gist or CodePen where you've tried out PhantomJS and I can poke around a bit. |
I've done a new test on Firefox and got a
When using the minimified version this obviously doesn't happens. You can get the code from https://github.com/piranna/gitbook-plugin-plotly, you'll need to have PhantomJS 2 (based on Chromium) installed globally. I got similar results with PhantomJS 1 (based on WebKit), but needs to be added some polyfills, maybe I'll try again with it later to make it easier to install if we got this to work with PhantomJS 2 (PhantomJS 2 don't have official binaries for Linux). |
By the way, the uploaded code gave me the next error:
|
@piranna this plotly/plotly.js#39 (comment) should help you. |
Well, at least now I can be able to use the unminimified version :-) The error I get is
|
@alexander-daniel, did you were able to take a look to PhantomJS? If you fetch my plugin project, just by executing |
Cloned the repo, ran
|
Yes, that's the same error I was getting before, |
@piranna Not too sure. Unfortunately this out still out of the scope of this module. Again, I can only vouch for node-webkit and electron. Perhaps try using one of those? They are becoming much more mature projects! I cannot debug too much on this, but if you tag me in an issue on your own Repo, we can try troubleshooting there. Cheers! |
AFAIK they are more focused on building desktop application instead of working headless, so I'm not sure how much useful they would be, and also don't know how bloated they are... That's why I tried to use jsDom too, to try to have runtime dependencies as low as possible and the install fully automated by npm.
Ok, I'll do. |
@piranna any update on this. I am also trying to render the plotly.js charts with Phantom JS and keep running into different errors depending on the version. So far I have had this consistent error on phantom-prebuilt 2.1.14 @alexander-daniel why is there no support for headless browsers? This really creates a limitation for people wanting to render charts as part of a PDF/Image solution right? Alternative solutions:
|
@leifdejong I'd recommend taking a look at http://community.plot.ly/t/how-to-perform-server-side-manipulation-using-plotly-js/1077/3 for the latest info. |
Allow to render the charts by using the plotly.js module now that's free software.
The text was updated successfully, but these errors were encountered: