Skip to content

Commit

Permalink
docs: update cdn urls for docs (#3257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyan-Wang authored Oct 20, 2021
1 parent 5a339c0 commit 09dc802
Show file tree
Hide file tree
Showing 24 changed files with 61 additions and 19 deletions.
6 changes: 6 additions & 0 deletions packages/site/docs/api/Items/itemMethods.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,35 @@ order: 0

Item 是 G6 中绘图元素实例,目前包含节点和边的实例。对于实例的变更建议在 graph 上进行。


## 更新

### item.update(model)


根据元素数据项,更新元素。

**参数**


| 名称 | 类型 | 是否必选 | 描述 |
| ----- | ------ | -------- | -------------------------- |
| model | Object | true | 元素描述项,包括数据和样式 |


<span style="background-color: rgb(251, 233, 231); color: rgb(139, 53, 56)"><strong> 提示:</strong></span>

其中参数 model 可包括以下属性,下面属性的详细描述参见 [元素配置项](/zh/docs/api/Items/itemProperties)


| 名称 | 类型 | 是否必选 | 描述 |
| -------- | ------ | -------- | ------------------------------------------ |
| style | Object | false | 元素样式 |
| type | String | false | 元素的类型,不传则使用默认值 |
| label | String | false | 元素的文本标签,有该字段时默认会渲染 label |
| labelCfg | Object | false | 元素文本标签的样式 |


**用法**

```javascript
Expand Down
10 changes: 7 additions & 3 deletions packages/site/docs/manual/FAQ/upgradeGuide.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ G6 3.3.0 supports three build outcomes:

The built outcomes of esm and commonjs do not support layouts with Web-Worker.

if you want to support layouts with Web-Worker, please use the file of [CDN](https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js).
if you want to support layouts with Web-Worker, please use the file of [CDN](https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js).

## Util

Expand Down Expand Up @@ -53,9 +53,13 @@ const grid = new Grid({
})


// G6 3.5.10
// G6 4.x
// Import by CDN. Yuo only need to import G6.
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.5.10/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

// address of G6 3.x
// <script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.5.10/dist/g6.min.js"></script>

// Or import by NPM. Yuo only need to import G6.
import G6 from '@antv/G6'

Expand Down
10 changes: 7 additions & 3 deletions packages/site/docs/manual/FAQ/upgradeGuide.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ G6 3.3.0 支持三种构建产物:

**其中 esm 及 commonjs 构建产物不支持 webworker 布局。**

如果要支持 webworker 布局,请引用 [CDN](https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js) 上的文件。
如果要支持 webworker 布局,请引用 [CDN](https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js) 上的文件。

## Util

Expand Down Expand Up @@ -49,9 +49,13 @@ const grid = new Grid({
})


// G6 3.5
// G6 4.x
// CDN 引入,只需要引入 G6
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.5.10/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

// G6 3.x 引入地址
// <script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.5.10/dist/g6.min.js"></script>

// 或 NPM 引入,只需要引入 G6
import G6 from '@antv/G6'

Expand Down
2 changes: 1 addition & 1 deletion packages/site/docs/manual/advanced/iconfont.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PS: The directory for this example is '/static/icons'.
There are several ways to import G6 introduced in [Getting Started](/en/docs/manual/getting-started). <br />PS: We import G6 by CDN in this example.

```html
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
```

## Import the Iconfont
Expand Down
2 changes: 1 addition & 1 deletion packages/site/docs/manual/advanced/iconfont.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PS: 本案文件目录为 '/static/icons'。
多种引入方式,请移步[快速上手](/zh/docs/manual/getting-started)。 <br />PS: 本案例简单粗暴,通过 CDN 的方式引入。

```html
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
```

## 添加字体图标
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Here goes the basic HTML code for this chapter. We will add new codes incrementa
<option value="addEdge">Add Edge</option>
</select>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
<script>
// Source data
const data = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ order: 7
<option value="addEdge">添加边</option>
</select>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
<script>
// 初始数据
const data = {
Expand Down
6 changes: 5 additions & 1 deletion packages/site/docs/manual/getting-started.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import G6 from '@antv/g6';

// version >= 3.3
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/{$version}/dist/g6.min.js"></script>

// version >= 4.0
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

```

<span style="background-color: rgb(251, 233, 231); color: rgb(139, 53, 56)"><strong>⚠️Attention:</strong></span>
Expand Down Expand Up @@ -136,7 +140,7 @@ graph.render(); // Render the graph
<div id="mountNode"></div>

/* Import G6 by CDN */
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.0/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

<script>
// Define the source data
Expand Down
6 changes: 5 additions & 1 deletion packages/site/docs/manual/getting-started.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import G6 from '@antv/g6';

// version >= 3.3
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/{$version}/dist/g6.min.js"></script>

// version >= 4.0
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

```

<span style="background-color: rgb(251, 233, 231); color: rgb(139, 53, 56)"><strong>⚠️ 注意:</strong></span>
Expand Down Expand Up @@ -136,7 +140,7 @@ graph.render(); // 渲染图
<div id="mountNode"></div>

/* 引入 G6 */
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>

<script>
// 定义数据源
Expand Down
2 changes: 1 addition & 1 deletion packages/site/docs/manual/middle/graph.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The code for interpretation of this chapter will base on the following JavaScrip
/* The container of the graph */
<div id="mountNode"></div>
/* Import G6 */
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
<script>
// Define the source data
const data = {
Expand Down
2 changes: 1 addition & 1 deletion packages/site/docs/manual/middle/graph.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ order: 1
/* 图的画布容器 */
<div id="mountNode"></div>
/* 引入 G6 */
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
<script>
// 定义数据源
const data = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ In the first stage, the graph is arranged by random layout. Transform to force l
</head>
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.1.0/build/g6.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script>
<script>
const data = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ changeData(data);
</head>
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.1.0/build/g6.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/assets/lib/jquery-3.2.1.min.js"></script>
<script>
const data = {
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/behavior.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ graph.on('edge:click', (e) => {
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/behavior.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ graph.on('edge:click', (e) => {
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/elements.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ graph.render();
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/elements.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ graph.render();
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/example.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ The configurations below will be used in the following Tutorial:
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/example.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ const graph = new G6.Graph({
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/layout.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ The result:
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
2 changes: 2 additions & 0 deletions packages/site/docs/manual/tutorial/layout.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ const graph = new G6.Graph({
<body>
<div id="mountNode"></div>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->
<script>
const graph = new G6.Graph({
container: 'mountNode',
Expand Down
4 changes: 3 additions & 1 deletion packages/site/docs/manual/tutorial/preface.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ It doesn't matter if you're not familiar with G6. But we’ll assume that you ha

## Setup

Any code editor works for this Tutorial. We recommend to run this demo in Chrome. In this tutorial, we import G6 V3.5.10 by CDN. We simplified the code to make it easy. For other environments, please refer to the installation guide in [Getting Started](/en/docs/manual/getting-started).
Any code editor works for this Tutorial. We recommend to run this demo in Chrome. In this tutorial, we import G6 V3.7.1 by CDN. We simplified the code to make it easy. For other environments, please refer to the installation guide in [Getting Started](/en/docs/manual/getting-started).

New an index.html file, and add the code below:

Expand All @@ -50,6 +50,8 @@ New an index.html file, and add the code below:
<body>
<!-- import G6 by CDN -->
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->

<script>
console.log(G6.Global.version);
Expand Down
4 changes: 3 additions & 1 deletion packages/site/docs/manual/tutorial/preface.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ G6 是一个图可视化引擎。它提供了图的绘制、布局、分析、

## 环境准备

建议使用新版的 Chrome 浏览器作为运行环境,用任意的代码编辑器进行代码的编写即可。本教程默认采用 CDN 的方式直接引入 G6 类库,引入的版本是 3.5.10,此版本很多特性会大大简化我们的代码。如果希望在其他环境尝试本教程的学习,读者可以参考 [快速上手](/zh/docs/manual/getting-started) 中的安装配置部分。
建议使用新版的 Chrome 浏览器作为运行环境,用任意的代码编辑器进行代码的编写即可。本教程默认采用 CDN 的方式直接引入 G6 类库,引入的版本是 3.7.1,此版本很多特性会大大简化我们的代码。如果希望在其他环境尝试本教程的学习,读者可以参考 [快速上手](/zh/docs/manual/getting-started) 中的安装配置部分。

新建 index.html 文件,并添加如下代码:

Expand All @@ -51,6 +51,8 @@ G6 是一个图可视化引擎。它提供了图的绘制、布局、分析、
<body>
<!-- 引入 G6 -->
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
<!-- 4.x and later versions -->
<!-- <script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.3.11/dist/g6.min.js"></script> -->

<script>
console.log(G6.Global.version);
Expand Down
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@ant-design/icons": "^4.0.6",
"@antv/chart-node-g6": "^0.0.3",
"@antv/g6": "4.3.8",
"@antv/gatsby-theme-antv": "1.1.1",
"@antv/gatsby-theme-antv": "1.1.12",
"@antv/util": "^2.0.9",
"@antv/vis-predict-engine": "^0.1.1",
"@types/react": "^16.9.35",
Expand Down

0 comments on commit 09dc802

Please sign in to comment.