Metadata-Version: 2.1
Name: pyg2plot
Version: 0.1.3
Summary: Python3 binding for `@AntV/G2Plot` Plotting Library, make charting easier.
Home-page: https://github.com/hustcc/pyg2plot
Author: hustcc
Author-email: i@hust.cc
License: MIT
Keywords: AntV,G2Plotcharts,visualazation
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
Requires-Dist: jinja2 (~=2.11.2)
Requires-Dist: simplejson

# PyG2Plot

> 🎨 Python3 binding for `@AntV/G2Plot` Plotting Library. Inspired by pyecharts.

[![Latest Stable Version](https://img.shields.io/pypi/v/pyg2plot.svg)](https://pypi.python.org/pypi/pyg2plot)
[![build Status](https://github.com/hustcc/pyg2plot/workflows/build/badge.svg?branch=main)](https://github.com/hustcc/pyg2plot/actions?query=workflow%3Abuild)

## Installation

```bash
$ pip install pyg2plot
```


## Usage

```py
from pyg2plot import __version__, Plot

line = Plot("Line")

line.set_options({
  "data": [
    { "year": "1991", "value": 3 },
    { "year": "1992", "value": 4 },
    { "year": "1993", "value": 3.5 },
    { "year": "1994", "value": 5 },
    { "year": "1995", "value": 4.9 },
    { "year": "1996", "value": 6 },
    { "year": "1997", "value": 7 },
    { "year": "1998", "value": 9 },
    { "year": "1999", "value": 13 },
  ],
  "xField": "year",
  "yField": "value",
})

line.render()
```

![image](https://user-images.githubusercontent.com/7856674/104466432-31be5000-55f0-11eb-8333-68279d50861e.png)


## API

Now, only has one API of `pyg2plot`.

 - **Plot**

1. *Plot(plot_type: str)*: get an instance of `Plot` class.

2. *plot.set_options(options: object)*: set the options of [G2Plot](https://g2plot.antv.vision/) into instance.

3. *plot.render(path, env, **kwargs)*: render out html file by setting the path, jinja2 env and kwargs.

4. *plot.render_html(env, **kwargs)*: render out html string by setting jinja2 env and kwargs.

5. *plot.dump_js_options(env, **kwargs)*: dump js options by setting jinja2 env and kwargs, use it for HTTP request.

> More apis is on the way.


## License

MIT@[hustcc](https://github.com/hustcc).

