g6/packages/site/docs/apis/modules/graph.zh.md

47 lines
6.0 KiB
Markdown
Raw Normal View History

---
title: graph
---
2023-08-31 23:46:08 +08:00
> 📋 中文文档还在翻译中... 欢迎 PR
2023-08-31 23:46:08 +08:00
[Overview - v5.0.0-beta.2](../README.zh.md) / [Modules](../modules.zh.md) / graph
2023-08-31 22:06:26 +08:00
## Interfaces
2023-08-31 22:06:26 +08:00
- [GraphData](../interfaces/graph/GraphData.zh.md)
- [IGraph](../interfaces/graph/IGraph.zh.md)
- [Specification](../interfaces/graph/Specification.zh.md)
2023-08-31 22:06:26 +08:00
## Classes
2023-08-31 22:06:26 +08:00
- [Graph](../classes/graph/Graph.zh.md)
2023-08-31 22:06:26 +08:00
## Variables
2023-08-31 22:06:26 +08:00
### Util
2023-08-31 22:06:26 +08:00
`Const` **Util**: `Object`
2023-08-31 22:06:26 +08:00
#### Type declaration
2023-08-31 23:46:08 +08:00
| Name | Type |
| :----------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `extend` | <B1, B2, T1, T2\>(`GraphClass`: typeof [`Graph`](../classes/graph/Graph.zh.md), `extendLibrary`: { `behaviors?`: `B1` ; `edges?`: `EdgeRegistry` ; `layouts?`: `LayoutRegistry` ; `nodes?`: `NodeRegistry` ; `plugins?`: `PluginRegistry` ; `themeSolvers?`: `T1` }) => typeof [`Graph`](../classes/graph/Graph.zh.md) |
| `getArrowPath` | (`type`: `ArrowType`, `width`: `number`, `height`: `number`) => `string` |
| `getEdgesBetween` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `ids`: `ID`[]) => `ID`[] |
| `graphComboTreeDfs` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `nodes`: `NodeUserModel`[], `fn`: `any`, `mode`: `"TB"` \| `"BT"`) => `void` |
| `graphCoreTreeDfs` | (`graphCore`: `GraphCore`, `nodes`: `NodeUserModel`[], `fn`: `any`, `mode`: `"TB"` \| `"BT"`, `treeKey`: `string`, `stopFns`: { `stopAllFn?`: (`node`: `NodeUserModel`) => `boolean` ; `stopBranchFn?`: (`node`: `NodeUserModel`) => `boolean` }) => `void` |
| `graphData2TreeData` | (`nodeMap`: { `[id: string]`: `any`; }, `graphData`: [`GraphData`](../interfaces/graph/GraphData.zh.md), `propRootIds`: `ID`[]) => `any`[] |
| `isEncode` | (`value`: `any`) => value is Encode<any\> |
| `isSucceed` | (`graph`: `any`, `testParent`: `any`, `testSucceed`: `any`) => `boolean` |
| `mock` | (`nodeCount`: `number`) => { `circle`: (`centerId`: `string`) => { `edges`: `any`[] ; `nodes`: { `data`: {} = {}; `id`: `string` }[] } ; `random`: (`ratio`: `number`) => { `edges`: `any`[] ; `nodes`: { `data`: {} = {}; `id`: `string` }[] } } |
| `traverse` | (`treeData`: `any`, `callback`: `any`) => `void` |
| `traverseAncestors` | (`graphCore`: `any`, `nodes`: `any`, `fn`: `any`) => `void` |
| `traverseAncestorsAndSucceeds` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `graphCore`: `GraphCore`, `nodes`: `NodeUserModel`[], `fn`: `any`, `mode`: `"TB"` \| `"BT"`) => `void` |
| `traverseGraphAncestors` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.zh.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `nodes`: `NodeUserModel`[], `fn`: `any`) => `void` |
| `treeData2GraphData` | (`treeData`: `TreeData`<[`NodeUserModelData`](../interfaces/item/NodeUserModelData.zh.md)\> \| `TreeData`<[`NodeUserModelData`](../interfaces/item/NodeUserModelData.zh.md)\>[]) => { `combos`: `any`[] = []; `edges`: `any`[] = []; `nodes`: `any`[] = [] } |
2023-08-31 22:06:26 +08:00
#### Defined in
[packages/g6/src/util/index.ts:18](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/util/index.ts#L18)