renders pyecharts output as image
Project description
News - 16.04.2019
Since 0.2.0, NO LONGER, phantomjs is required! NO LONGER, it supports python 2.7
BUT, the capability to render pyecharts in a script has been merged into pyecharts 1.0.0. And the dependency on phantomjs has been sprawn as: snapshot-phantomjs .
If you love to use ‘snapshot’ command line, please continue to use this project.
Introduction
pyecharts-snapshot renders the output of pyecharts/echarts.js as a png, jpeg, gif, eps, svg image, raw base64 encoding or a pdf file at command line.
Usage
Get png:
$ snapshot render.html
And you will get:
Get pdf:
$ snapshot render.html pdf
And you will get:
And here the code to generate it
Get svg:
$ snapshot render.html svg
Please be aware that render.html should have configure echarts to do svg rendering. This library, being stupid, does not make canvas rendered image as svg rendered. Here is an example svg file.
Usage details
Command line options:
$ snapshot output.html [png|jpeg|gif|svg|pdf] [delay] [pixel ratio]
where:
delay tells pyecharts-snapshot to take a snapshot after some time measured in seconds. It is needed only when your snapshot is partial because the chart animation takes long than 1.5 second(default). pixel ratio tells pyecharts-snapshot to use a different pixel ratio when generate the image. It defaults to 2.
Programmatical usage is simple:
... somechart.render(path='cool_snapshot.png') # delay=1, pixel_ratio=3) 1 second delay, 3 as pixel ratio
where delay as an optional parameter can be given to specify delay_in_seconds.
Coffee
Please buy me a coffee if you think this library helped.
Installation
Package installation
You can install it via pip:
$ pip install pyecharts-snapshot $ pyppeteer-install
or clone it and install it:
$ git clone http://github.com/pyecharts/pyecharts-snapshot.git
$ cd pyecharts-snapshot
$ python setup.py install
$ pyppeteer-install
Note
pyppeteer-install is recommended but optional. Your first ever run of snapshot command will invoke pyppeteer-install. This command will download Chrominium, about 100MB
Test status
Fully tested on pypy, python 3.5, 3.6, 3.7 and 3.8-dev.
Constraints
Only one image at a time. No 3D image support
Design Considerations
- Ghost.Py: very hard to install on my own. Dropped
Maintenance Instructions
- install pyecharts-snapshot
- make demo
- take screenshots of grid.pdf and snapshot.pdf in examples folder
Contributors in alphabetical order
- chengjiandong
- chfw Author
Change log
0.2.0 - 17.04.2019
Added
- use pyppeteer, pythonic puppeteer for rendering pyecharts image
Removed
- python 2, 3.5- support
- no more phantomjs dependency
- programmatic rendering capability is removed. NO longer it is integrated with pyecharts
0.1.9 - 13.11.2018
Added
- Support eps
Updated
- Loosen the requirement on lml
0.1.7 - 31.05.2018
Fixed
- #23: phantomjs on windows does not like absolute path but file uri formatted ones
0.1.6 - 16.05.2018
Updated
- use system temp file instead of current working folder for tmp files
0.1.5 - 11.04.2018
Updated
- better error verbose when phantomjs fails to generate output
0.1.4 - 26.03.2018
Added
0.1.3 - 12.03.2018
Added
- svg support for pyecharts 0.4.0
0.1.1 - 17.12.2017
Updated
- higher resolution screenshots for all platforms: windows and linux.
0.1.0 - 15.12.2017
Updated
- support Mac OS Retina display, high resolution screenshots
0.0.10 - 23.10.2017
Updated
- pyexcel pyexcel#105, remove gease from setup_requires, introduced by 0.0.9.
0.0.7 - 26.08.2017
Updated
- Save the output of pyecharts to gif file
0.0.6 - 25.08.2017
Updated
- Allow user to specify a custom delay period in seconds. Default is 0.5s
0.0.5 - 22.08.2017
0.0.3 - 19.08.2017
Updated
- Remove download image arrow on the output file
0.0.2 - 18.08.2017
Added
- Save the output of pyecharts to pdf file
0.0.1 - 17.08.2017
Added
- Save the output of pyecharts to png file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyecharts_snapshot-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d03a1eb27b0a7176c1f4468d2d2811de0023ea462b8de517ecef4c1db116fe6 |
|
MD5 | efe15f51555ad7abebba0147b2298fff |
|
BLAKE2-256 | 85e8f0a14cc92d89d43e52efb48bca5053c24b53e06e93b43579071476ed0cc6 |