Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions packages/site/common/api/elements/combos/circle-combo-interest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
```js | ob { pin: false }
createGraph(
{
autoFit: 'center',
data: {
nodes: [
{ id: 'node1', combo: 'combo2', style: { x: 150, y: 150 } },
{ id: 'node2', combo: 'combo2', style: { x: 200, y: 150 } },
{ id: 'node3', combo: 'combo3', style: { x: 300, y: 150 } },
{ id: 'node4', combo: 'combo3', style: { x: 350, y: 150 } },
{ id: 'node5', combo: 'combo4', style: { x: 230, y: 300 } },
{ id: 'node6', combo: 'combo4', style: { x: 280, y: 300 } },
],
combos: [
{ id: 'combo1', style: { labelText: '兴趣小组' } },
{ id: 'combo2', combo: 'combo1', style: { labelText: '书法' } },
{ id: 'combo3', combo: 'combo1', style: { labelText: '影视' } },
{ id: 'combo4', combo: 'combo1', style: { labelText: '游戏' } },
],
},
node: {
style: {
labelText: (d) => d.id,
},
},
behaviors: ['drag-element', 'collapse-expand'],
animation: true,
},
{ width: 600, height: 600 },
);
```
2 changes: 1 addition & 1 deletion packages/site/common/api/elements/combos/circle-combo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ createGraph(
],
},
node: { style: { fill: '#7e3feb' } },
behaviors: ['collapse-expand'],
behaviors: ['drag-element', 'collapse-expand'],
plugins: ['grid-line'],
animation: true,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
```js | ob { pin: false }
createGraph(
{
autoFit: 'center',
data: {
nodes: [
{ id: 'node1', combo: 'combo2', style: { x: 100, y: 100, labelText: '微服务1' } },
{ id: 'node2', combo: 'combo2', style: { x: 200, y: 100, labelText: '微服务2' } },
{ id: 'node3', combo: 'combo2', style: { x: 100, y: 200, labelText: '微服务3' } },
{ id: 'node4', combo: 'combo2', style: { x: 200, y: 200, labelText: '微服务4' } },
{ id: 'node5', combo: 'combo3', style: { x: 300, y: 100, labelText: '第三方登录' } },
{ id: 'node6', combo: 'combo3', style: { x: 300, y: 150, labelText: '任务调度' } },
{ id: 'node7', combo: 'combo3', style: { x: 300, y: 200, labelText: '消息服务' } },
],
edges: [
{ source: 'node1', target: 'node2' },
{ source: 'node1', target: 'node3' },
{ source: 'node3', target: 'node4' },
],
combos: [
{ id: 'combo1', style: { labelText: '服务层' } },
{ id: 'combo2', combo: 'combo1', style: { labelText: '业务微服务' } },
{ id: 'combo3', combo: 'combo1', style: { labelText: '集成模块' } },
],
},
node: {
type: 'rect',
},
edge: {
style: {
endArrow: true,
},
},
combo: {
type: 'rect',
style: {
padding: 16,
},
},
behaviors: ['drag-element', 'collapse-expand'],
animation: true,
},
{ width: 600, height: 400 },
);
```
626 changes: 531 additions & 95 deletions packages/site/docs/manual/element/combo/build-in/BaseCombo.zh.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
title: Circle 圆形
---

## 概述

圆形组合以圆形边界包裹子节点或子组合,适合表示平等或非层级化的群组关系。

适用场景:

- 适合表示无明确层级关系的节点群组,圆形组合能体现成员的平等性,如社交网络中的用户群体、分散式团队结构(突出协作性)。

## 在线体验

<embed src="@/common/api/elements/combos/circle-combo.md"></embed>

> 如果元素有其特定的属性,我们将在下面列出。对于所有的通用样式属性,见[BaseCombo](./BaseCombo.zh.md)
## 样式配置

> 如果元素有其特定的属性,我们将在下面列出。对于所有的通用样式属性,见 [BaseCombo](./BaseCombo.zh.md)

## 示例

以下示例为兴趣小组人员分布:

<embed src="@/common/api/elements/combos/circle-combo-interest.md"></embed>
21 changes: 20 additions & 1 deletion packages/site/docs/manual/element/combo/build-in/RectCombo.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
title: Rect 矩形
---

## 概述

矩形组合以直角边界组织内容,支持严格的层级结构。

适用场景:

- **系统架构图**:如系统架构里面的服务分层,以及每层服务里面的细分等。
- **地理区域划分**:如城市包含多个区域,矩形组合能直观展示行政边界或功能分区。

## 在线体验

<embed src="@/common/api/elements/combos/rect-combo.md"></embed>

> 如果元素有其特定的属性,我们将在下面列出。对于所有的通用样式属性,见[BaseCombo](./BaseCombo.zh.md)
## 样式配置

> 如果元素有其特定的属性,我们将在下面列出。对于所有的通用样式属性,见 [BaseCombo](./BaseCombo.zh.md)

## 示例

以下示例为简单的微服务架构服务层:

<embed src="@/common/api/elements/combos/rect-combo-architecture.md"></embed>
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const graph = new Graph({

| 属性 | 描述 | 类型 | 默认值 | 必选 |
| ------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------- | --------- | ---- |
| collapsed | 当前节点/组合是否展开 | boolean | false | |
| collapsed | 当前节点/组合是否折叠 | boolean | false | |
| cursor | 节点鼠标移入样式,[配置项](#cursor) | string | default | |
| fill | 节点填充色 | string | `#1783FF` | |
| fillOpacity | 节点填充色透明度 | number \| string | 1 | |
Expand Down