Skip to content

Commit

Permalink
Merge pull request #286 from antvis/readme-cn
Browse files Browse the repository at this point in the history
Readme cn
  • Loading branch information
paleface001 committed Nov 21, 2019
2 parents 4d2fe45 + 1010f35 commit a77d491
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 31 deletions.
74 changes: 74 additions & 0 deletions README-en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# G2Plot

A charting library based on the Grammar of Graphics.

[![版本](https://badgen.net/npm/v/@antv/g2plot)](https://www.npmjs.com/@antv/g2plot)
[![NPM downloads](http://img.shields.io/npm/dm/@antv/g2plot.svg)](http://npmjs.com/@antv/g2plot)
![最近提交](https://badgen.net/github/last-commit/antvis/g2plot)

g2plot is an interactive and responsive charting library based on [the grammar of graphics](https://github.com/antvis/g2), which enables users to generate high quality statistical charts through a few lines of code easily.

Moreover, combining with AntV design principles, g2plot provides standard and elegant visual styles as well as better user experience.

<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*MjhQQLsbWeQAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*CkSoSpPfWQMAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*ZYmtSqcNDtkAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*gV_JQZVbDWAAAAAAAAAAAABkARQnAQ" width="200">
<br/>

<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*gd00QaD9110AAAAAAAAAAABkARQnAQ" width="500">
<br/>

## Installation

```bash
$ npm install @antv/g2plot
```

## Usage

<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*37siRJftYDIAAAAAAAAAAABkARQnAQ" width="450">

```html
<div id="container"></div>
```

```js
import { Bar } from '@antv/g2plot';

const data = [
{ year: '1951 年', sales: 38 },
{ year: '1952 年', sales: 52 },
{ year: '1956 年', sales: 61 },
{ year: '1957 年', sales: 145 },
{ year: '1958 年', sales: 48 },
];

const bar = new Bar(document.getElementById('container'), {
data,
xField: 'sales',
yField: 'year',
colorField: 'year',
});

bar.render();
```

## Development

```bash
$ npm install

# run test case
$ npm run test

# run demos
$ npm start
```

## How to Contribute

Please let us know how can we help. Do check out [issues](https://github.com/antvis/g2plot/issues) for bug reports or suggestions first.

To become a contributor, please follow our [contributing guide](https://github.com/antvis/g2plot/blob/master/CONTRIBUTING.md).

## License

MIT
50 changes: 22 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# G2Plot

A charting library based on the Grammar of Graphics.
G2Plot 是一套简单、易用、并具备一定扩展能力和组合能力的统计图表库,基于图形语法理论搭建而成,"G2Plot"中的 G2 即意指图形语法 (the Gramma of Graphics),同时也致敬了 ggplot2。

[![版本](https://badgen.net/npm/v/@antv/g2plot)](https://www.npmjs.com/@antv/g2plot)
[![NPM downloads](http://img.shields.io/npm/dm/@antv/g2plot.svg)](http://npmjs.com/@antv/g2plot)
![最近提交](https://badgen.net/github/last-commit/antvis/g2plot)
<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*MjhQQLsbWeQAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*CkSoSpPfWQMAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*ZYmtSqcNDtkAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*gV_JQZVbDWAAAAAAAAAAAABkARQnAQ" width="200">

g2plot is an interactive and responsive charting library based on [the grammar of graphics](https://github.com/antvis/g2), which enables users to generate high quality statistical charts through a few lines of code easily.
<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*gd00QaD9110AAAAAAAAAAABkARQnAQ" width="500">

Moreover, combining with AntV design principles, g2plot provides standard and elegant visual styles as well as better user experience.
## 特性

<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*MjhQQLsbWeQAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*CkSoSpPfWQMAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*ZYmtSqcNDtkAAAAAAAAAAABkARQnAQ" width="200"><img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*gV_JQZVbDWAAAAAAAAAAAABkARQnAQ" width="200">
<br/>
- 📦 开箱即用、默认好用的高质量统计图表

<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*gd00QaD9110AAAAAAAAAAABkARQnAQ" width="500">
<br/>
- 🎨 提炼自企业级产品的视觉语言和设计规范

- 📊 响应式图表:致力于解决图表在任何数据和显示尺寸下的基本可读性问题

- 🔳 图层化设计方法:在 g2plot 体系下,图表不仅仅只是各不相关的实例,图层概念的引入提供了多图表组合叠联动,共同讲述一个数据故事的可能性

## Installation
## 安装

```bash
$ npm install @antv/g2plot
```

## Usage
## 使用

<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*37siRJftYDIAAAAAAAAAAABkARQnAQ" width="450">

```html
<div id="container"></div>
<div id="c1"></div>
```

```js
import { Bar } from '@antv/g2plot';
import g2plot from '@antv/g2plot';

const data = [
{ year: '1951 年', sales: 38 },
Expand All @@ -41,34 +41,28 @@ const data = [
{ year: '1958 年', sales: 48 },
];

const bar = new Bar(document.getElementById('container'), {
const barPlot = new g2plot.Bar('c1', {
data,
xField: 'sales',
yField: 'year',
colorField: 'year',
});

bar.render();
barPlot.render();
```

## Development
## 开发

```bash
$ npm install

# run test case
$ npm run test
$ npm run test-live

# build watching file changes and run demos
$ npm run dev

# run demos
$ npm start
$ npm run demos
```

## How to Contribute

Please let us know how can we help. Do check out [issues](https://github.com/antvis/g2plot/issues) for bug reports or suggestions first.

To become a contributor, please follow our [contributing guide](https://github.com/antvis/g2plot/blob/master/CONTRIBUTING.md).

## License

MIT
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g2plot",
"version": "0.11.0",
"version": "0.11.1",
"description": "G2 Plot, a market of plots built with the Grammar of Graphics'",
"author": "https://github.com/orgs/antvis/people",
"main": "lib/index.js",
Expand All @@ -13,7 +13,7 @@
"README.md",
"LICENSE"
],
"homepage": "https://antvis.github.io/g2plot",
"homepage": "https://g2plot.antv.vision",
"repository": {
"type": "git",
"url": "https://github.com/antvis/g2plot"
Expand Down Expand Up @@ -68,7 +68,7 @@
"tslib": "^1.10.0"
},
"devDependencies": {
"@antv/gatsby-theme-antv": "^0.9.87",
"@antv/gatsby-theme-antv": "^0.9.89",
"@commitlint/cli": "^8.2.0",
"@commitlint/config-angular": "^8.2.0",
"@types/jest": "^24.0.23",
Expand Down

0 comments on commit a77d491

Please sign in to comment.