-
Notifications
You must be signed in to change notification settings - Fork 11
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
SVG output #3
Comments
Good question! The current implementation uses PhantomJS and its web page echarts-node-export-server/export-server/renderPhantom.js Lines 71 to 73 in 2d8d1d3
Unfortunatly, SVG is not among the supported formats of the render() method. According to the PhantomJS documentation, the supported formats are:
So an output in JPEG format instead of PNG format could be easily done (it's basically a one-liner). But SVG is not possible, because PhantomJS simply does not support it. It is a limitation of PhantomJS. |
It is a little tricky to find from google somehow, but e-charts actually implement server side rendering which is way faster (~70ms vs ~3s) than the phantomjs implementation, it is really simple to use and does just that, it also supports other image types aswell, so i built my own small server! Thank you any way a lot for your kind interest :) |
The server-side rendering (SSR) was added as a new feature in ECharts 5.3.0, which is quite recent. Since echarts-node-export-server still was using an older version, I just updated it to ECharts 5.3.2 in the new release v2.2.0. Bear in mind that I have not looked into the new SSR feature of ECharts yet. However, I guess(!) that it should be possible to implement SVG output using the new SSR feature of ECharts. Maybe I will take a closer look into it in the coming days, but I cannot promise that anything in that direction will be happening.
I don't think that is a fair comparison, because the output formats are different (PNG vs. SVG). That being said: The performance difference may be in part due to PhantomJS being rather old and not getting any updates anymore. It may also be due to the fact that the ECharts people did some performance improvements in ECharts 5.3.0:
So maybe the version 2.2.0 of echarts-node-export-server will bring some improvements to the performance, too, because it also uses the newer ECharts version, but I doubt it will be anywhere near the 70ms, because there still is PhantomJS doing its part here, and that will probably still be slower. Note that I haven't measured anything here, because I do not need to generate many images within a short time where performance would become an issue. So any of that is purely speculation, and should be taken as such. The only way to find out is by measuring it. |
Nice, thanks for the update! |
Well, it is indeed possible: https://github.com/striezel/echarts-node-export-server/releases/tag/v3.0.0 To get an SVG file instead of a PNG file, just add the HTTP header |
Hello, I am wandering if generating SGV files is possible, or if there is any design limitation.
I can work on a PR myself if you think the work should be straight forward.
Thanks for the effort you put into this :)
The text was updated successfully, but these errors were encountered: