Skip to content

Commit

Permalink
docs: update doc api (antvis#1991)
Browse files Browse the repository at this point in the history
Co-authored-by: DanielLeefu <you@[email protected]>
  • Loading branch information
DanielLeefu and DanielLeefu authored Apr 11, 2022
1 parent 04e98cf commit e9332a7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions sites/x6-sites/docs/api/graph/model.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ getRootNodes(): Node[]
isRootNode(cell: Cell | string): boolean
```

返回指定的节点是否是跟节点
返回指定的节点是否是根节点

<span class="tag-param">参数<span>

Expand All @@ -431,6 +431,8 @@ getLeafNodes(): Node[]
isLeafNode(cell: Cell | string): boolean
```

返回指定的节点是否是叶子节点

<span class="tag-param">参数<span>

| 名称 | 类型 | 必选 | 默认值 | 描述 |
Expand Down Expand Up @@ -488,7 +490,6 @@ isPredecessor(cell1: Cell, cell2: Cell, options?: GetPredecessorsOptions): boole

返回 `cell2` 是否是 `cell1` 的前序节点,其中 `options` 选项与 [`getPredecessors(...)`](#getpredecessors) 方法的选项一致。

<span class="tag-param">参数<span>

### getSuccessors(...)

Expand Down
3 changes: 2 additions & 1 deletion sites/x6-sites/docs/api/graph/model.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ getLeafNodes(): Node[]
isLeafNode(cell: Cell | string): boolean
```

返回指定的节点是否是叶子节点

<span class="tag-param">参数<span>

| 名称 | 类型 | 必选 | 默认值 | 描述 |
Expand Down Expand Up @@ -488,7 +490,6 @@ isPredecessor(cell1: Cell, cell2: Cell, options?: GetPredecessorsOptions): boole

返回 `cell2` 是否是 `cell1` 的前序节点,其中 `options` 选项与 [`getPredecessors(...)`](#getpredecessors) 方法的选项一致。

<span class="tag-param">参数<span>

### getSuccessors(...)

Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/api/model/cell.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const rect = new Shape.Rect({

值得一提的是,支持使用[小驼峰(camelCase)格式](https://zh.wikipedia.org/zh-cn/%E9%A7%9D%E5%B3%B0%E5%BC%8F%E5%A4%A7%E5%B0%8F%E5%AF%AB)的属性名,如 `'fontSize'`,这就避免了 `'font-size'` 这种属性名作为对象 Key 时需要加引号的麻烦。

除了标准的 [SVG 属性](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute),我们在 X6 中还定义了一系列特殊属性,详情请参考[如何使用特殊属性]()[如何自定义属性]()。另外,我们还可以使用 [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) 来定制样式,节点和边渲染到画布后分别有 `'x6-node'``'x6-edge'` 两个样式名,默认的样式定义[参考这里](https://github.com/antvis/X6/blob/master/packages/x6/src/index.less#L26-L156)。例如,我们可以像下面这样来指定节点中 `<rect>` 元素的样式:
除了标准的 [SVG 属性](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute),我们在 X6 中还定义了一系列特殊属性,详情请参考[如何使用特殊属性](/en/docs/tutorial/intermediate/attrs#gatsby-focus-wrapper)[如何自定义属性](/en/docs/api/model/cell/#自定义属性)。另外,我们还可以使用 [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) 来定制样式,节点和边渲染到画布后分别有 `'x6-node'``'x6-edge'` 两个样式名,默认的样式定义[参考这里](https://github.com/antvis/X6/blob/master/packages/x6/src/index.less#L26-L156)。例如,我们可以像下面这样来指定节点中 `<rect>` 元素的样式:

```css
.x6-node rect {
Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/api/model/cell.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const rect = new Shape.Rect({

值得一提的是,支持使用[小驼峰(camelCase)格式](https://zh.wikipedia.org/zh-cn/%E9%A7%9D%E5%B3%B0%E5%BC%8F%E5%A4%A7%E5%B0%8F%E5%AF%AB)的属性名,如 `'fontSize'`,这就避免了 `'font-size'` 这种属性名作为对象 Key 时需要加引号的麻烦。

除了标准的 [SVG 属性](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute),我们在 X6 中还定义了一系列特殊属性,详情请参考[如何使用特殊属性]()[如何自定义属性]()。另外,我们还可以使用 [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) 来定制样式,节点和边渲染到画布后分别有 `'x6-node'``'x6-edge'` 两个样式名,默认的样式定义[参考这里](https://github.com/antvis/X6/blob/master/packages/x6/src/index.less#L26-L156)。例如,我们可以像下面这样来指定节点中 `<rect>` 元素的样式:
除了标准的 [SVG 属性](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute),我们在 X6 中还定义了一系列特殊属性,详情请参考[如何使用特殊属性](/zh/docs/tutorial/intermediate/attrs#gatsby-focus-wrapper)[如何自定义属性](/zh/docs/api/model/cell/#自定义属性)。另外,我们还可以使用 [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) 来定制样式,节点和边渲染到画布后分别有 `'x6-node'``'x6-edge'` 两个样式名,默认的样式定义[参考这里](https://github.com/antvis/X6/blob/master/packages/x6/src/index.less#L26-L156)。例如,我们可以像下面这样来指定节点中 `<rect>` 元素的样式:

```css
.x6-node rect {
Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/api/model/node.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ node.translate(undefined, 30) // 只在 Y 轴移动

我们可以通过 `options.restrict` 选项来将节点的移动限制在指定的矩形 `{x: number; y: number; width: number; height: number}` 范围内。

例如,我可以将字节的移动限制在父节点的包围盒中
例如,我们可以将子节点的移动限制在父节点的包围盒中

```ts
child.translate(30, 30, {
Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/api/model/node.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ node.translate(undefined, 30) // 只在 Y 轴移动

我们可以通过 `options.restrict` 选项来将节点的移动限制在指定的矩形 `{x: number; y: number; width: number; height: number}` 范围内。

例如,我可以将字节的移动限制在父节点的包围盒中
例如,我们可以将子节点的移动限制在父节点的包围盒中

```ts
child.translate(30, 30, {
Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/tutorial/epilog.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const graph = new Graph({
}
})
```
更多配置见: [interacting](https://x6.antv.vision/zh/docs/api/graph#interacting)
更多配置见: [interacting](/zh/docs/api/graph/interaction#interacting)

### 怎么支持特定节点的放大缩小

Expand Down
2 changes: 1 addition & 1 deletion sites/x6-sites/docs/tutorial/epilog.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const graph = new Graph({
}
})
```
更多配置见: [interacting](https://x6.antv.vision/zh/docs/api/graph#interacting)
更多配置见: [interacting](/zh/docs/api/graph/interaction#interacting)

### 怎么支持特定节点的放大缩小

Expand Down

0 comments on commit e9332a7

Please sign in to comment.