|
1 |
| -如果你想帮助 **ECharts** 的话,请首先阅读指导原则: |
| 1 | +# Contributing |
2 | 2 |
|
3 |
| -- 如果你希望提 bug: |
| 3 | +👍🎉 First off, thanks for taking the time to contribute! 🎉👍 |
4 | 4 |
|
5 |
| - - 清楚地描述问题,注意:**别人是否能通过你的描述理解这是什么问题**。 |
6 |
| - - 说明版本(ECharts 版本,浏览器版本,设备、操作系统版本等) |
7 |
| - - 最好提供完整的ECharts option,截图或线上实例(可以使用JSFiddle/JSBin/Codepen)。 |
| 5 | +Please check out the [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html). |
8 | 6 |
|
9 |
| -- 如果你想问问题: |
| 7 | +## Issues |
10 | 8 |
|
11 |
| - - 首先是否在这些文档中寻找过问题的答案:[option文档](http://echarts.baidu.com/option.html),[API文档](http://echarts.baidu.com/api.html),[教程](http://echarts.baidu.com/tutorial.html) |
12 |
| - - 简单的问题,可以在QQ群中求助(群号:465958031) |
| 9 | +When opening new issues, please use the [echarts issue helper](https://ecomfe.github.io/echarts-issue-helper/), opening issues in any other way will cause our robot to close them automatically |
13 | 10 |
|
14 |
| -- 如何取得能运行的 `ECharts option` |
| 11 | +And before you do so, please search for similar questions in [issues list](https://github.com/apache/incubator-echarts/issues?utf8=%E2%9C%93&q=is%3Aissue). If a closed issue have new problems in your environment, please create a new issue and reference the previous one. |
15 | 12 |
|
16 |
| - 一个参考方式: |
17 |
| - 在你的程序的 |
18 |
| - ```javascript |
19 |
| - chart.setOption(option); |
20 |
| - ``` |
21 |
| - 前加入这句话 |
22 |
| - ```javascript |
23 |
| - console.log(JSON.stringify(option, null, 4)); |
24 |
| - ``` |
25 |
| - |
26 |
| - 然后打开浏览器的调试工具(如 `Chrome Deverloper Tool`)的 `控制台(console)`,可以得到option输出。 |
| 13 | +Please read the [documentation](http://echarts.apache.org/option.html) carefully before asking any questions. |
27 | 14 |
|
| 15 | +Any questions in the form of *how can I use echarts to* or *how to use echarts x feature to* belong to [Stack Overflow](http://stackoverflow.com), issues with questions like that in the issue tracker will be closed. |
| 16 | + |
| 17 | +## Pull Requests |
| 18 | + |
| 19 | +If you wish to fix a bug or add new features, please discuss it with us in an issue first. If there's no issue, please create one using the [echarts issue helper](https://ecomfe.github.io/echarts-issue-helper/). |
| 20 | + |
| 21 | +## How to Debug ECharts |
| 22 | + |
| 23 | +The following steps help you to set up a developing environment for ECharts. |
| 24 | + |
| 25 | +### 1. Clone ECharts project |
| 26 | + |
| 27 | +If you wish to make pull requests, you should fork the ECharts project first. Otherwise, just clone it locally. |
| 28 | + |
| 29 | +```bash |
| 30 | +git clone [email protected]:apache/incubator-echarts.git |
| 31 | +``` |
| 32 | + |
| 33 | +[ZRender](https://github.com/ecomfe/zrender) is the rendering library under the hood. You need to clone it along with ECharts. |
| 34 | + |
| 35 | +```bash |
| 36 | +git clone [email protected]:ecomfe/zrender.git |
| 37 | +``` |
| 38 | + |
| 39 | +We assume these projects are downloaded at `~/workspace/echarts` and `~/workspace/zrender`. But their locations can be arbitrary. |
| 40 | + |
| 41 | +### 2. Install dependencies |
| 42 | + |
| 43 | +```bash |
| 44 | +cd ~/workspace/echarts |
| 45 | +npm install |
| 46 | +cd ~/workspace/zrender |
| 47 | +npm install |
| 48 | +``` |
| 49 | + |
| 50 | +Sometimes, in order to fix an issue within echarts, changes have to be made inside the codebase of zrender. To test any changes to zrender locally you can use npm's [npm link](https://docs.npmjs.com/cli/link.html) feature, for example: |
| 51 | + |
| 52 | +```bash |
| 53 | +cd ~/workspace/zrender |
| 54 | +npm link |
| 55 | +cd ~/workspace/echarts |
| 56 | +npm link |
| 57 | +``` |
| 58 | + |
| 59 | +With this, you can see that `~/workspace/echarts/node_modules/zrender` is a link to `~/workspace/zrender`. |
| 60 | + |
| 61 | +### 3. Run and debug |
| 62 | + |
| 63 | +To build the ECharts project and watch source file changes (including ZRender project) to rebuild: |
| 64 | + |
| 65 | +```bash |
| 66 | +cd ~/workspace/echarts |
| 67 | +node build/build.js --watch |
| 68 | +``` |
| 69 | + |
| 70 | +To build once: |
| 71 | +contributing-inspect.png |
| 72 | +```bash |
| 73 | +node build/build.js |
| 74 | +``` |
| 75 | + |
| 76 | +Then, open the test cases under `~/workspace/echarts/test` in Web browser. You can add breakpoints under `src` directory. For example, in Chrome Inspect, it looks like: |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +### 4. Make a pull request |
| 81 | + |
| 82 | +Fork ECharts project into your own project. Checkout a branch from master branch named `fix-xxxx`, where xxxx is the issue id related. If there's no related issue, you need to create one in most cases to describe what's wrong or what new feature is required. |
| 83 | + |
| 84 | +If you are a committer of apache/incubator-echarts project, which means you have the write access to the project, you still need to push to a new branch (by `git push origin HEAD:refs/heads/fix-xxxx`) and use pull request to push your code. You cannot push code directly to `master` branch, otherwise it will be rejected by GitHub. |
| 85 | + |
| 86 | +Once your PR is merged, you will be asked to sign a PDF file called [Apache ICLA](https://www.apache.org/licenses/icla.pdf). This is required for all non-trival commits of the apache/incubator-echarts project, which means you don't have to sign it if you only changed some spelling in `README.md`. |
0 commit comments