Skip to content

Commit

Permalink
chore: doc improvement (#2413)
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfu1 authored Feb 19, 2024
1 parent 45e785e commit 4e54202
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
15 changes: 9 additions & 6 deletions packages/site/docs/manual/getting-started.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ order: 1
---

## Installation
### Import by NPM
### Package manager

We provide `Ant Design Charts` npm package:

```bash
// Recommended usage
npm install @ant-design/charts --save
// npm
npm install @ant-design/charts@v1 --save

// yarn
yarn add @ant-design/charts@v1 --save
```

You can use `import` or `require` to start.
Expand All @@ -19,7 +22,7 @@ You can use `import` or `require` to start.
import { Line } from '@ant-design/charts';
```

Related subpackages
You can also only install sub-packages, refers to `@ant-design/charts`, charts contains the following sub-packages.
- Plots: `@ant-design/plots`
- Maps: `@ant-design/maps`
- Flowchart: `@ant-design/flowchart`
Expand All @@ -40,7 +43,7 @@ In addition to 'react' and 'react-dom', the flowchart also relies on 'antd', '@a

### Import by CDN in browser

You can download the script locally or import it directly from online resources.
You can download the script locally or import it directly from online resources, `latest` will point to the latest version. If you are using V1, remember to switch to the corresponding version number. You can check the version numbers on [npm website](https://www.npmjs.com/).

```ts
// Plots
Expand Down Expand Up @@ -151,4 +154,4 @@ const Page: React.FC = () => {
return <Line {...config} />;
};
export default Page;
```
```
16 changes: 9 additions & 7 deletions packages/site/docs/manual/getting-started.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ order: 1
---

## 安装
### 通过 npm 安装
### 包管理器

我们提供了 Ant Design 的 npm 包,通过下面的命令即可完成安装:

```bash
// 推荐用法
npm install @ant-design/charts --save
// npm
npm install @ant-design/charts@v1 --save

// yarn
yarn add @ant-design/charts@v1 --save
```

成功安装完成之后,即可使用 `import``require` 进行引用:
Expand All @@ -19,13 +22,12 @@ npm install @ant-design/charts --save
import { Line } from '@ant-design/charts';
```

也可仅引入相关子包
也可仅引入相关子包,安装方式参考 `@ant-design/charts`, charts 包含了如下子包
- 统计图表:`@ant-design/plots`
- 地图:`@ant-design/maps`
- 流程图:`@ant-design/flowchart`
- 关系图:`@ant-design/graphs`


流程图除 `react``react-dom` 外,还依赖 `antd``@ant-design/icons``lodash`,使用时确保已经安装,同时记得引入样式文件 `import "@ant-design/flowchart/dist/index.css";`

```ts
Expand All @@ -40,7 +42,7 @@ import { Line } from '@ant-design/charts';

### 浏览器引入

既可以通过将脚本下载到本地也可以直接引入在线资源。
既可以通过将脚本下载到本地也可以直接引入在线资源,latest 将会指向最新版本,如果使用的是 V1 版本,记得换成对应版本号,可在[npm 官网](https://www.npmjs.com/)查阅相关版本号

```ts
// Plots 相关的图表
Expand Down Expand Up @@ -152,4 +154,4 @@ const Page: React.FC = () => {
return <Line {...config} />;
};
export default Page;
```
```

0 comments on commit 4e54202

Please sign in to comment.