Skip to content

Commit 15ef6b9

Browse files
authored
docs: add browser compatibility in FAQ (#2596)
1 parent 6afc12c commit 15ef6b9

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.github/workflows/auto-inspection.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- name: Get branch name (pull request)
1414
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
15-
- uses: lxfu1/surge-preview@v2
15+
- uses: lxfu1/surge-preview@v2.0.1
1616
id: preview_step
1717
with:
1818
project_name: 'G2Plot'

docs/manual/faq.en.md

+27
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ order: 8
77

88
Here are the frequently asked questions about G2Plot that you should look up before you ask in the community or create a new issue.
99

10+
### Browser compatibility
11+
12+
> Due to the condition limit, the lower version limit is only for reference, which does not mean that the lower version cannot be supported. The test was completed in CDN mode. [online Demo](https://lxfu1.github.io/browser-compatibility-of-antv).
13+
14+
| | Chrome | Edge | Firefox | IE | Opera | Safari | UC | 360 speed | 360 safe browser |
15+
| ---------- | :----: | :--: | :-----: | :-: | :---: | :----: | :-: | :-------: | :--------------: |
16+
| **G2Plot** | 40 | 12 | 85 | 9 | 40 | 14 | 6.2 | 12 | 7.3 |
17+
18+
How to add `polyfill` into your project.
19+
20+
- CDN
21+
22+
The following JS is introduced in the HEAD.
23+
24+
```ts
25+
<script src="https://unpkg.com/@babel/polyfill@latest"></script> // optional
26+
<script src="https://unpkg.com/@antv/g2plot@latest"></script>
27+
28+
var line = new G2Plot.Line({
29+
// ...
30+
});
31+
```
32+
33+
- NPM
34+
35+
Use NPM mode, if there is a compatibility problem please use combination of Babel and `@Babel/polyfill`, reference G2 [.babelrc](https://github.com/antvis/G2/blob/master/.babelrc) and [webpack.config](https://github.com/antvis/G2/blob/master/webpack.config.js), More questions are welcome to join the DingTalk Group.
36+
1037
### How do I set the horizontal axis to start at 0
1138

1239
<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*NAvlTZ66qzMAAAAAAAAAAAAAARQnAQ" alt="faq">

docs/manual/faq.zh.md

+25
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ order: 8
77

88
以下整理了一些 G2Plot 社区常见的问题和官方答复,提问或新增 issue 前先看看。
99

10+
### 浏览器兼容性
11+
12+
> 由于条件限制,版本下限仅供参考,并不意味着不能支持更低版本,该测试在 CDN 模式下测试完成,[在线 Demo](https://lxfu1.github.io/browser-compatibility-of-antv)
13+
14+
| | Chrome | Edge | Firefox | IE | Opera | Safari | UC | 360 极速浏览器 | 360 安全浏览器 |
15+
| ---------- | :----: | :--: | :-----: | :-: | :---: | :----: | :-: | :------------: | :------------: |
16+
| **G2Plot** | 40 | 12 | 85 | 9 | 40 | 14 | 6.2 | 12 | 7.3 |
17+
18+
如果出现浏览器兼容,看是否项目中有引入 polyfill。在不同使用方式下,添加方式如下:
19+
20+
- CDN 下使用
21+
22+
```ts
23+
<script src="https://unpkg.com/@babel/polyfill@latest"></script> // 非必需
24+
<script src="https://unpkg.com/@antv/g2plot@latest"></script>
25+
26+
var line = new G2Plot.Line({
27+
// ...
28+
});
29+
```
30+
31+
- NPM
32+
33+
使用 npm 模式,如果出现兼容性问题请结合 babel 和 @babel/polyfill 使用,参考 G2 [.babelrc](https://github.com/antvis/G2/blob/master/.babelrc)[webpack.config](https://github.com/antvis/G2/blob/master/webpack.config.js),更多问题欢迎进群交流。
34+
1035
### 怎么设置横轴从 0 开始
1136

1237
<img src="https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*NAvlTZ66qzMAAAAAAAAAAAAAARQnAQ" alt="faq">

0 commit comments

Comments
 (0)