Skip to content

Commit

Permalink
Merge pull request #20 from gaoli/update_docs
Browse files Browse the repository at this point in the history
docs: Update zh-CN documentation
  • Loading branch information
tennisonchan authored Aug 29, 2018
2 parents 276e607 + 538f9f6 commit 3c69463
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 57 deletions.
16 changes: 8 additions & 8 deletions docs/api/editorEvents.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import GGEditor, { Flow } from 'gg-editor';
</GGEditor>
```

## 命令对象

| 命令属性 | 属性说明 |
| :--- | :--- |
| name | 命令名称 |
| queue | 是否进入命令队列,进入命令队列则可以执行撤销、重做 |

## 事件列表

| 事件名称 | 事件说明 |
| :--- | :--- |
| onBeforeCommandExecute | 命令执行前 |
| onBfterCommandExecute | 命令执行后 |
| onAfterCommandExecute | 命令执行后 |

## 命令对象

| 命令属性 | 属性说明 | 类型 |
| :--- | :--- | :--- |
| name | 命令名称 | `string` |
| queue | 是否进入命令队列,进入命令队列则可以执行撤销、重做 | `boolean` |
14 changes: 7 additions & 7 deletions docs/api/flow.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ import GGEditor, { Flow } from 'gg-editor';
| :--- | :--- | :--- | :--- |
| data | 初始数据 | `object` | - |
| graph | 图配置项,参考 [G6 Graph API](https://antv.alipay.com/zh-cn/g6/1.x/api/graph.html) | `object` | - |
| align | 对齐配置 | [`object`](#align) | - |
| grid | 网格线配置 | [`object`](#grid) | - |
| shortcut | 快捷键配置,[内置命令](command.zh-CN.md#内置命令) | [`object`](#shortcut) | - |
| align | 对齐配置 | [`object`](#Align) | - |
| grid | 网格线配置 | [`object`](#Grid) | - |
| shortcut | 快捷键配置,[内置命令](./command.zh-CN.md#内置命令) | [`object`](#Shortcut) | - |
| noEndEdge | 是否支持悬空边 | `boolean` | `true` |

### align
### Align

| 属性 | 说明 | 类型 | 默认值 |
| :--- | :--- | :--- | :--- |
| line | 对齐线样式 | `object` | - |
| item | 图项对齐 | `true` `false` `horizontal` `vertical` `center` | - |
| grid | 网格对齐 | `true` `false` `cc` `tl` | - |

### grid
### Grid

| 属性 | 说明 | 类型 | 默认值 |
| :--- | :--- | :--- | :--- |
| cell | 网孔尺寸 | `number` | - |
| line | 网格线样式 | `object` | - |

### shortcut
### Shortcut

示例:

Expand All @@ -51,4 +51,4 @@ import GGEditor, { Flow } from 'gg-editor';

## Events

请移步至 [PageEvents](pageEvents.zh-CN.md) 查看详情
请移步至 [PageEvents](./pageEvents.zh-CN.md) 查看详情
2 changes: 1 addition & 1 deletion docs/api/ggEditor.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ import GGEditor, { Flow } from 'gg-editor';

## Events

请移步至 [EditorEvents](editorEvents.zh-CN.md) 查看详情
请移步至 [EditorEvents](./editorEvents.zh-CN.md) 查看详情
8 changes: 4 additions & 4 deletions docs/api/itemPanel.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import GGEditor, { Flow, Item, ItemPanel } from 'gg-editor';

| 属性 | 说明 | 类型 | 默认值 |
| :--- | :--- | :--- | :--- |
| type | `必填` 元素类型,可选类型:`node` `edge` | `string` | - |
| size | `必填` 元素尺寸,书写格式:`50*50` | `string` | - |
| shape | `必填` 元素形状,内置形状:[node](registerNode.zh-CN.md#内置节点)[edge](registerEdge.zh-CN.md#内置边) | `string` | - |
| type | **必填** 元素类型,可选类型:`node` `edge` | `string` | - |
| size | **必填** 元素尺寸,书写格式:`50*50` | `string` | - |
| shape | **必填** 元素形状,内置形状:[node](./registerNode.zh-CN.md#内置节点)[edge](./registerEdge.zh-CN.md#内置边) | `string` | - |
| model | 元素初始 model | `object` | - |
| src | 元素概览 src | `string` | - |
| src | 元素概览 src | `string` | - |
6 changes: 3 additions & 3 deletions docs/api/mind.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import GGEditor, { Mind } from 'gg-editor';
| :--- | :--- | :--- | :--- |
| data | 初始数据 | `object` | - |
| graph | 图配置项,参考 [G6 Graph API](https://antv.alipay.com/zh-cn/g6/1.x/api/graph.html) | `object` | - |
| shortcut | 快捷键配置,[内置命令](command.zh-CN.md#内置命令) | [`object`](#shortcut) | - |
| shortcut | 快捷键配置,[内置命令](./command.zh-CN.md#内置命令) | [`object`](#Shortcut) | - |

### shortcut
### Shortcut

示例:

Expand All @@ -33,4 +33,4 @@ import GGEditor, { Mind } from 'gg-editor';

## Events

请移步至 [PageEvents](pageEvents.zh-CN.md) 查看详情
请移步至 [PageEvents](./pageEvents.zh-CN.md) 查看详情
2 changes: 1 addition & 1 deletion docs/api/minimap.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ import GGEditor, { Flow, Minimap } from 'gg-editor';
| width | 宽度 | `number` | - |
| height | 高度 | `number` | - |
| viewportWindowStyle | 视窗样式,参考 [G 绘图属性](https://antv.alipay.com/zh-cn/g2/3.x/api/graphic.html) | `object` | - |
| viewportBackStyle | 背景样式,参考 [G 绘图属性](https://antv.alipay.com/zh-cn/g2/3.x/api/graphic.html) | `object` | - |
| viewportBackStyle | 背景样式,参考 [G 绘图属性](https://antv.alipay.com/zh-cn/g2/3.x/api/graphic.html) | `object` | - |
52 changes: 26 additions & 26 deletions docs/api/pageEvents.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,62 @@ import GGEditor, { Flow } from 'gg-editor';

| 属性属性 | 属性说明 |
| :--- | :--- |
| action | 动作:addupdateremovechangeData |
| action | 动作包括:`add``update``remove``changeData` |
| item | 图项 |
| shape | 图形 |
| x | 图横坐标 |
| y | 图纵坐标 |
| domX | dom 横坐标 |
| domY | dom 纵坐标 |
| domEvent | 原生 dom 事件 |
| currentItem | drag 拖动图项 |
| currentShape | drag 拖动图形 |
| toShape | mouseleavedragleave 到达的图形 |
| toItem | mouseleavedragleave 到达的图项 |
| currentItem | `drag` 拖动图项 |
| currentShape | `drag` 拖动图形 |
| toShape | `mouseleave``dragleave` 到达的图形 |
| toItem | `mouseleave``dragleave` 到达的图项 |

## 事件列表

### 组合事件

此类事件可以结合前缀 `item` `node` `edge` 组合使用,例如:
此类事件可以结合前缀 `item``node``edge` 组合使用,例如:

```jsx
import GGEditor, { Flow } from 'gg-editor';

<GGEditor>
<Flow
onClick={() => {}} // 点击任意
onItemclick={() => {}} // 点击图项
onNodeclick={() => {}} // 点击节点
onEdgeclick={() => {}} // 点击边
onItemClick={() => {}} // 点击图项
onNodeClick={() => {}} // 点击节点
onEdgeClick={() => {}} // 点击边
/>
</GGEditor>
```

| 事件名称 | 事件说明 |
| :--- | :--- |
| onClick | 鼠标左键点击事件 |
| onDblclick | 鼠标左键双击事件 |
| onMouseenter | 鼠标移入事件 |
| onMouseleave | 鼠标移除事件 |
| onMousedown | 鼠标按下事件 |
| onMouseup | 鼠标抬起事件 |
| onMousemove | 鼠标移动事件 |
| onDragstart | 鼠标开始拖拽事件 |
| onDoubleClick | 鼠标左键双击事件 |
| onMouseEnter | 鼠标移入事件 |
| onMouseLeave | 鼠标移除事件 |
| onMouseDown | 鼠标按下事件 |
| onMouseUp | 鼠标抬起事件 |
| onMouseMove | 鼠标移动事件 |
| onDragStart | 鼠标开始拖拽事件 |
| onDrag | 鼠标拖拽事件 |
| onDragend | 鼠标拖拽结束事件 |
| onDragenter | 鼠标拖拽进入事件 |
| onDragleave | 鼠标拖拽移出事件 |
| onDragEnd | 鼠标拖拽结束事件 |
| onDragEnter | 鼠标拖拽进入事件 |
| onDragLeave | 鼠标拖拽移出事件 |
| onDrop | 鼠标拖拽放置事件 |
| onContextmenu | 鼠标右键菜单事件 |
| onContextMenu | 鼠标右键菜单事件 |

### 普通事件

| 事件名称 | 事件说明 |
| :--- | :--- |
| onMousewheel | 鼠标滚轮事件 |
| onKeydown | 键盘按键按下事件 |
| onKeyup | 键盘按键抬起事件 |
| onMouseWheel | 鼠标滚轮事件 |
| onKeyDown | 键盘按键按下事件 |
| onKeyUp | 键盘按键抬起事件 |
| onBeforeChange | 子项数据变化前 |
| onAfterChange | 子项数据变化后 |
| onBeforeChangeSize | 画布尺寸变化前 |
Expand All @@ -82,10 +82,10 @@ import GGEditor, { Flow } from 'gg-editor';
| onAfterViewportChange | 视口变化后 |
| onBeforeItemActived | 激活前 |
| onAfterItemActived | 激活后 |
| onBeforeItemunActived | 取消激活前 |
| onAfterItemunActived | 取消激活后 |
| onBeforeItemUnactived | 取消激活前 |
| onAfterItemUnactived | 取消激活后 |
| onBeforeItemSelected | 选中前 |
| onAfterItemSelected | 选中后 |
| onBeforeItemUnselected | 取消选中前 |
| onAfterItemUnselected | 取消选中后 |
| onKeyupEditLabel | 键盘按键抬起事件(节点编辑)|
| onKeyUpEditLabel | 键盘按键抬起事件(节点编辑)|
2 changes: 1 addition & 1 deletion docs/api/registerBehaviour.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ import GGEditor, { Flow, RegisterBehaviour } from 'gg-editor';
| :--- | :--- | :--- | :--- |
| name | 行为名称 | `string` | - |
| behaviour | 行为配置 | `function(page)` | - |
| dependences | 继承行为 | `string[]` | - |
| dependences | 继承行为 | `string[]` | - |
2 changes: 1 addition & 1 deletion docs/api/registerCommand.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ import GGEditor, { Flow, RegisterCommand } from 'gg-editor';
| :--- | :--- | :--- | :--- |
| name | 命令名称 | `string` | - |
| config | 命令配置 | `object` | - |
| extend | 继承命令,[内置命令](command.zh-CN.md#内置命令) | `string` | - |
| extend | 继承命令,[内置命令](./command.zh-CN.md#内置命令) | `string` | - |
2 changes: 1 addition & 1 deletion docs/api/registerEdge.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ import GGEditor, { Flow, RegisterEdge } from 'gg-editor';
| 节点英文名 | 节点中文名 | 示例预览 |适用页面 |
| :--- | :--- | :--- | :--- |
| flow-polyline | 图折线 | ![图折线](https://cdn.yuque.com/lark/2018/png/223/1522559188562-7ecad6d2-36a7-4b68-ba6e-2d0b65b594e1.png) | Flow |
| flow-polyline-round | 圆角折线 | ![圆角折现](https://cdn.yuque.com/lark/2018/png/223/1522558993675-9448ac3d-27d7-46f3-8db9-c6d1a6a35c74.png) | Flow |
| flow-polyline-round | 圆角折线 | ![圆角折线](https://cdn.yuque.com/lark/2018/png/223/1522558993675-9448ac3d-27d7-46f3-8db9-c6d1a6a35c74.png) | Flow |
| flow-smooth | 图曲线 | ![分叉节点](https://cdn.yuque.com/lark/2018/png/223/1522558884115-d96bf55b-4771-4f12-8641-d552829215e1.png) | Flow |
2 changes: 1 addition & 1 deletion docs/api/registerGroup.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ import GGEditor, { Flow, RegisterGroup } from 'gg-editor';
| :--- | :--- | :--- | :--- |
| name | 组名称 | `string` | - |
| config | 组配置 | `object` | - |
| extend | 继承图形 | `string` | - |
| extend | 继承图形 | `string` | - |
2 changes: 1 addition & 1 deletion docs/api/registerNode.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ import GGEditor, { Flow, RegisterNode } from 'gg-editor';
| flow-circle | 起止节点 | ![起止节点](https://gw.alipayobjects.com/zos/rmsportal/ZnPxbVjKYADMYxkTQXRi.svg) | Flow |
| flow-rect | 常规节点 | ![起止节点](https://gw.alipayobjects.com/zos/rmsportal/wHcJakkCXDrUUlNkNzSy.svg) | Flow |
| flow-rhombus | 分叉节点 | ![分叉节点](https://gw.alipayobjects.com/zos/rmsportal/SnWIktArriZRWdGCnGfK.svg) | Flow |
| flow-capsule | 模型节点 | ![模型节点](https://gw.alipayobjects.com/zos/rmsportal/rQMUhHHSqwYsPwjXxcfP.svg) | Flow |
| flow-capsule | 模型节点 | ![模型节点](https://gw.alipayobjects.com/zos/rmsportal/rQMUhHHSqwYsPwjXxcfP.svg) | Flow |
4 changes: 2 additions & 2 deletions docs/api/toolbar.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## 使用说明

必需配合 [`<Command />`](command.zh-CN.md) 组件使用
必需配合 [`<Command />`](./command.zh-CN.md) 组件使用

```jsx
import GGEditor, { Flow, Command, Toolbar } from 'gg-editor';
Expand All @@ -16,4 +16,4 @@ import GGEditor, { Flow, Command, Toolbar } from 'gg-editor';
<Command name="redo">重做</Command>
</Toolbar>
</GGEditor>
```
```

0 comments on commit 3c69463

Please sign in to comment.