Merge pull request #5108 from antvis/beta28

feat: updateStateConfig api for graph
This commit is contained in:
Yanyan Wang 2023-11-08 09:56:07 +08:00 committed by GitHub
commit 9b20b27d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
219 changed files with 8560 additions and 18673 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@antv/g6",
"version": "5.0.0-beta.26",
"version": "5.0.0-beta.27",
"description": "A Graph Visualization Framework in JavaScript",
"main": "lib/index.js",
"module": "esm/index.js",
@ -53,13 +53,13 @@
"@ant-design/colors": "^7.0.0",
"@antv/algorithm": "^0.1.26",
"@antv/event-emitter": "latest",
"@antv/g": "^5.18.16",
"@antv/g": "^5.18.17",
"@antv/g-canvas": "^1.11.19",
"@antv/g-plugin-3d": "^1.9.22",
"@antv/g-plugin-control": "^1.9.15",
"@antv/g-plugin-dragndrop": "^1.8.15",
"@antv/g-svg": "^1.10.17",
"@antv/g-webgl": "^1.9.25",
"@antv/g-webgl": "^1.9.29",
"@antv/graphlib": "^2.0.2",
"@antv/gui": "0.5.1-alpha.1",
"@antv/hierarchy": "latest",

View File

@ -15,7 +15,7 @@ runtime.enableCSSParsing = false;
* Extend the graph class with std lib
*/
const version = '5.0.0-beta.26';
const version = '5.0.0-beta.27';
const Graph = extend(EmptyGraph, stdLib);

View File

@ -105,6 +105,7 @@ export default class Combo extends Node {
*/
public forceUpdate = throttle(
() => {
if (this.destroyed || !this.shapeMap.keyShape) return;
this.updateModelByBounds(this.displayModel as ComboDisplayModel);
if (!this.destroyed) this.draw(this.displayModel as ComboDisplayModel);
},

View File

@ -153,7 +153,7 @@ export default class Edge extends Item {
* @param force bypass the nodes position change check and force to re-draw
*/
public forceUpdate() {
if (this.destroyed) return;
if (this.destroyed || !this.shapeMap.keyShape) return;
const force = isPolylineWithObstacleAvoidance(this.displayModel);
const { sourcePoint, targetPoint, changed } = this.getEndPoints(
this.displayModel,

View File

@ -20,14 +20,20 @@ import {
NodeDisplayModel,
NodeEncode,
NodeModelData,
NodeShapesEncode,
} from '../../types';
import { ComboDisplayModel, ComboEncode } from '../../types/combo';
import {
ComboDisplayModel,
ComboEncode,
ComboShapesEncode,
} from '../../types/combo';
import { GraphCore } from '../../types/data';
import {
EdgeDisplayModel,
EdgeEncode,
EdgeModel,
EdgeModelData,
EdgeShapesEncode,
} from '../../types/edge';
import Node from '../../item/node';
import Edge from '../../item/edge';
@ -233,6 +239,9 @@ export class ItemController {
this.graph.hooks.render.tap(this.onRender.bind(this));
this.graph.hooks.itemchange.tap(this.onChange.bind(this));
this.graph.hooks.itemstatechange.tap(this.onItemStateChange.bind(this));
this.graph.hooks.itemstateconfigchange.tap(
this.onItemStateConfigChange.bind(this),
);
this.graph.hooks.itemvisibilitychange.tap(
this.onItemVisibilityChange.bind(this),
);
@ -794,6 +803,36 @@ export class ItemController {
});
}
private onItemStateConfigChange(param: {
itemType: ITEM_TYPE;
stateConfig:
| {
[stateName: string]:
| ((data: NodeModel) => NodeDisplayModel)
| NodeShapesEncode;
}
| {
[stateName: string]:
| ((data: EdgeModel) => EdgeDisplayModel)
| EdgeShapesEncode;
}
| {
[stateName: string]:
| ((data: ComboModel) => ComboDisplayModel)
| ComboShapesEncode;
};
}) {
const { itemType, stateConfig } = param;
const fieldName = `${itemType}StateMapper`;
this[fieldName] = stateConfig;
this.graph.getAllNodesData().forEach((node) => {
const item = this.itemMap.get(node.id);
if (item) {
item.stateMapper = stateConfig;
}
});
}
private onItemVisibilityChange(param: {
ids: ID[];
shapeIds: string[];
@ -1641,7 +1680,8 @@ export class ItemController {
return false;
}
return item.isVisible();
const transientVisible = this.transientItemMap.get(id);
return item.isVisible() || transientVisible?.isVisible();
}
public sortByComboTree(graphCore: GraphCore) {

View File

@ -302,7 +302,7 @@ export class LayoutController {
positions = await layout.execute(layoutGraphCore, {
onTick: (positionsOnTick: LayoutMapping) => {
// Display the animated process of layout.
this.updateNodesPosition(positionsOnTick);
this.updateNodesPosition(positionsOnTick, false);
this.graph.emit('tick', positionsOnTick);
},
});
@ -380,17 +380,15 @@ export class LayoutController {
node.data.x = meanCenter.x / meanCenter.count + Math.random();
node.data.y = meanCenter.y / meanCenter.count + Math.random();
node.data.z = meanCenter.z / meanCenter.count + Math.random();
} else {
node.data.x = center[0] + Math.random();
node.data.y = center[1] + Math.random();
node.data.z = Math.random();
initNaNPositions.nodes.push(node);
}
initNaNPositions.nodes.push(node);
} else {
nodeWithPostions.set(node.id, 1);
}
});
this.updateNodesPosition(initNaNPositions, false, false);
if (initNaNPositions.nodes.length) {
this.updateNodesPosition(initNaNPositions, false, false);
}
return nodeWithPostions;
};

View File

@ -33,10 +33,19 @@ import type {
} from '../types';
import type { CameraAnimationOptions } from '../types/animate';
import type { BehaviorOptionsOf, BehaviorRegistry } from '../types/behavior';
import type { ComboDisplayModel, ComboModel } from '../types/combo';
import type {
ComboDisplayModel,
ComboModel,
ComboShapesEncode,
} from '../types/combo';
import type { Bounds, Padding, Point } from '../types/common';
import type { DataChangeType, DataConfig, GraphCore } from '../types/data';
import type { EdgeDisplayModel, EdgeModel, EdgeModelData } from '../types/edge';
import type {
EdgeDisplayModel,
EdgeModel,
EdgeModelData,
EdgeShapesEncode,
} from '../types/edge';
import type { StackType } from '../types/history';
import type { Hooks, ViewportChangeHookParams } from '../types/hook';
import type { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from '../types/item';
@ -45,7 +54,12 @@ import type {
LayoutOptions,
StandardLayoutOptions,
} from '../types/layout';
import type { NodeDisplayModel, NodeModel, NodeModelData } from '../types/node';
import type {
NodeDisplayModel,
NodeModel,
NodeModelData,
NodeShapesEncode,
} from '../types/node';
import { Plugin as PluginBase } from '../types/plugin';
import type { RendererName } from '../types/render';
import { ComboMapper, EdgeMapper, NodeMapper } from '../types/spec';
@ -360,6 +374,27 @@ export class Graph<B extends BehaviorRegistry, T extends ThemeRegistry>
}>({
name: 'itemstatechange',
}),
itemstateconfigchange: new Hook<{
itemType: ITEM_TYPE;
stateConfig:
| {
[stateName: string]:
| ((data: NodeModel) => NodeDisplayModel)
| NodeShapesEncode;
}
| {
[stateName: string]:
| ((data: EdgeModel) => EdgeDisplayModel)
| EdgeShapesEncode;
}
| {
[stateName: string]:
| ((data: ComboModel) => ComboDisplayModel)
| ComboShapesEncode;
};
}>({
name: 'itemstateconfigchange',
}),
itemvisibilitychange: new Hook<{ ids: ID[]; value: boolean }>({
name: 'itemvisibilitychange',
}),
@ -428,11 +463,28 @@ export class Graph<B extends BehaviorRegistry, T extends ThemeRegistry>
* Update the specs(configurations).
*/
public updateSpecification(spec: Specification<B, T>): Specification<B, T> {
const {
node,
edge,
combo,
theme,
nodeState,
edgeState,
comboState,
...others
} = spec;
if (node) this.updateMapper('node', node);
if (edge) this.updateMapper('edge', edge);
if (combo) this.updateMapper('combo', combo);
if (theme) this.updateTheme(theme);
if (nodeState) this.updateStateConfig('node', nodeState, 'replace');
if (edgeState) this.updateStateConfig('edge', edgeState, 'replace');
if (comboState) this.updateStateConfig('combo', comboState, 'replace');
const newSpec = Object.assign(
this.specification,
this.formatSpecification(spec),
this.formatSpecification(others),
);
// TODO: update something
return newSpec;
}
/**
@ -481,6 +533,47 @@ export class Graph<B extends BehaviorRegistry, T extends ThemeRegistry>
});
}
/**
* Updates the state configuration for the specified item type, corresponds to the nodeState, edgeState, or comboState on the graph spec.
* @param {string} itemType - The type of item (node, edge, or combo).
* @param {object} stateConfig - The state configuration to update.
* @param {string} updateType - The type of update ('mergeReplace' or 'replace'). Default is 'mergeReplace'.
**/
public updateStateConfig(
itemType: ITEM_TYPE,
stateConfig:
| {
[stateName: string]:
| ((data: NodeModel) => NodeDisplayModel)
| NodeShapesEncode;
}
| {
[stateName: string]:
| ((data: EdgeModel) => EdgeDisplayModel)
| EdgeShapesEncode;
}
| {
[stateName: string]:
| ((data: ComboModel) => ComboDisplayModel)
| ComboShapesEncode;
},
updateType: 'mergeReplace' | 'replace' = 'mergeReplace',
) {
if (isEmpty(stateConfig)) return;
const stateField = `${itemType}State`;
if (updateType === 'mergeReplace') {
const config = {
...this.specification[stateField],
...stateConfig,
};
this.specification[itemType] = config;
this.hooks.itemstateconfigchange.emit({ itemType, stateConfig: config });
} else {
this.specification[itemType] = stateConfig;
this.hooks.itemstateconfigchange.emit({ itemType, stateConfig });
}
}
/**
* Get the copy of specs(configurations).
* @returns graph specs

View File

@ -5,14 +5,29 @@ import { Command } from '../stdlib/plugin/history/command';
import { Hooks } from '../types/hook';
import { CameraAnimationOptions } from './animate';
import { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
import { ComboModel, ComboUserModel } from './combo';
import {
ComboDisplayModel,
ComboModel,
ComboShapesEncode,
ComboUserModel,
} from './combo';
import { Padding, Point } from './common';
import { GraphData } from './data';
import { EdgeDisplayModel, EdgeModel, EdgeUserModel } from './edge';
import {
EdgeDisplayModel,
EdgeModel,
EdgeShapesEncode,
EdgeUserModel,
} from './edge';
import type { StackType } from './history';
import { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from './item';
import { LayoutOptions } from './layout';
import { NodeModel, NodeUserModel } from './node';
import {
NodeDisplayModel,
NodeModel,
NodeShapesEncode,
NodeUserModel,
} from './node';
import { RendererName } from './render';
import { ComboMapper, EdgeMapper, NodeMapper, Specification } from './spec';
import { ThemeOptionsOf, ThemeRegistry } from './theme';
@ -55,6 +70,32 @@ export interface IGraph<
type: ITEM_TYPE,
mapper: NodeMapper | EdgeMapper | ComboMapper,
) => void;
/**
* Updates the state configuration for the specified item type, corresponds to the nodeState, edgeState, or comboState on the graph spec.
* @param {string} itemType - The type of item (node, edge, or combo).
* @param {object} stateConfig - The state configuration to update.
* @param {string} updateType - The type of update ('mergeReplace' or 'replace'). Default is 'mergeReplace'.
**/
updateStateConfig: (
itemType: ITEM_TYPE,
stateConfig:
| {
[stateName: string]:
| ((data: NodeModel) => NodeDisplayModel)
| NodeShapesEncode;
}
| {
[stateName: string]:
| ((data: EdgeModel) => EdgeDisplayModel)
| EdgeShapesEncode;
}
| {
[stateName: string]:
| ((data: ComboModel) => ComboDisplayModel)
| ComboShapesEncode;
},
updateType?: 'mergeReplace' | 'replace',
) => void;
/**
* Get the copy of specs(configurations).
* @returns graph specs
@ -121,6 +162,7 @@ export interface IGraph<
* Get nearby edges from a start node using quadtree collision detection.
* @param nodeId id of the start node
* @returns nearby edges' data array
* @group Data
*/
getNearEdgesData: (
nodeId: ID,
@ -173,6 +215,7 @@ export interface IGraph<
/**
* Clear the graph, means remove all the items on the graph.
* @returns
* @group Data
*/
clear: () => void;
/**
@ -298,7 +341,7 @@ export interface IGraph<
* @param dy the distance alone y-axis to move the combo.
* @param upsertAncestors whether update the ancestors in the combo tree.
* @param callback callback function after move combo done.
* @group Data
* @group Combo
*/
moveCombo: (
ids: ID[],
@ -318,6 +361,7 @@ export interface IGraph<
* @param dx x of the relative vector
* @param dy y of the relative vector
* @param effectTiming animation configurations
* @group View
*/
translate: (
distance: Partial<{
@ -331,6 +375,7 @@ export interface IGraph<
* Move the graph and align to a point.
* @param point position on the canvas to align
* @param effectTiming animation configurations
* @group View
*/
translateTo: (
point: PointLike,
@ -339,6 +384,7 @@ export interface IGraph<
/**
* Return the current zoom level of camera.
* @returns current zoom
* @group View
*/
getZoom: () => number;
/**
@ -346,6 +392,7 @@ export interface IGraph<
* @param ratio relative ratio to zoom
* @param center zoom center
* @param effectTiming animation configurations
* @group View
*/
zoom: (
ratio: number,
@ -357,6 +404,7 @@ export interface IGraph<
* @param toRatio specified ratio
* @param center zoom center
* @param effectTiming animation configurations
* @group View
*/
zoomTo: (
toRatio: number,
@ -368,6 +416,7 @@ export interface IGraph<
* @param angle
* @param center
* @param effectTiming
* @group View
*/
rotate: (
angle: number,
@ -379,6 +428,7 @@ export interface IGraph<
* @param toAngle
* @param center
* @param effectTiming
* @group View
*/
rotateTo: (
toAngle: number,
@ -390,6 +440,7 @@ export interface IGraph<
* Transform the graph with a CSS-Transform-like syntax.
* @param options
* @param effectTiming
* @group View
*/
transform: (
options: GraphTransformOptions,
@ -397,10 +448,12 @@ export interface IGraph<
) => Promise<void>;
/**
* Stop the current transition of transform immediately.
* @group View
*/
stopTransformTransition: () => void;
/**
* Return the center of viewport, e.g. for a 500 * 500 canvas, its center is [250, 250].
* @group View
*/
getViewportCenter: () => PointLike;
/**
@ -609,6 +662,7 @@ export interface IGraph<
// ===== layout =====
/**
* Layout the graph (with current configurations if cfg is not assigned).
* @group Layout
*/
layout: (options?: LayoutOptions, disableAnimate?: boolean) => Promise<void>;
stopLayout: () => void;
@ -637,6 +691,7 @@ export interface IGraph<
* @param behaviors behavior names or configs
* @param modes mode names
* @returns
* @group Interaction
*/
addBehaviors: (
behaviors: BehaviorOptionsOf<B> | BehaviorOptionsOf<B>[],
@ -726,6 +781,7 @@ export interface IGraph<
/**
* Determine if history (redo/undo) is enabled.
* @group History
*/
isHistoryEnabled: () => void;
@ -733,56 +789,67 @@ export interface IGraph<
* Push the operation(s) onto the specified stack
* @param cmd commands to be pushed
* @param stackType undo/redo stack
* @group History
*/
pushStack: (cmd: Command[], stackType: StackType) => void;
/**
* Pause stacking operation.
* @group History
*/
pauseStack: () => void;
/**
* Resume stacking operation.
* @group History
*/
resumeStack: () => void;
/**
* Execute a callback without allowing any stacking operations.
* @param callback
* @group History
*/
executeWithNoStack: (callback: () => void) => void;
/**
* Retrieve the current redo stack which consists of operations that could be undone
* @group History
*/
getUndoStack: () => void;
/**
* Retrieve the current undo stack which consists of operations that were undone
* @group History
*/
getRedoStack: () => void;
/**
* Retrieve the complete history stack
* @returns
* @group History
*/
getStack: () => void;
/**
* Revert the last n operation(s) on the graph.
* @returns
* @group History
*/
undo: () => void;
/**
* Restore the operation that was last n reverted on the graph.
* @returns
* @group History
*/
redo: () => void;
/**
* Indicate whether there are any actions available in the undo stack.
* @group History
*/
canUndo: () => void;
/**
* Indicate whether there are any actions available in the redo stack.
* @group History
*/
canRedo: () => void;
@ -790,6 +857,7 @@ export interface IGraph<
* Begin a historyBatch operation.
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
* treated as a single operation when undoing or redoing.
* @group History
*/
startHistoryBatch: () => void;
@ -797,6 +865,7 @@ export interface IGraph<
* End a historyBatch operation.
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
* treated as a single operation when undoing or redoing.
* @group History
*/
stopHistoryBatch: () => void;
@ -805,6 +874,7 @@ export interface IGraph<
* All operations performed inside callback will be treated as a composite operation
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
* @param callback The func containing operations to be batched together.
* @group History
*/
historyBatch: (callback: () => void) => void;
@ -813,6 +883,7 @@ export interface IGraph<
* All operations performed inside callback will be treated as a composite operation
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
* @param callback The func containing operations to be batched together.
* @group History
*/
cleanHistory: (stackType?: StackType) => void;
// ===== tree operations =====

View File

@ -3,13 +3,23 @@ import { GraphChange, ID } from '@antv/graphlib';
import { CameraAnimationOptions } from './animate';
import { BehaviorOptionsOf } from './behavior';
import { DataChangeType, DataConfig, GraphCore } from './data';
import { EdgeModel, EdgeModelData } from './edge';
import {
EdgeDisplayModel,
EdgeModel,
EdgeModelData,
EdgeShapesEncode,
} from './edge';
import { ITEM_TYPE, ShapeStyle, SHAPE_TYPE } from './item';
import { LayoutOptions } from './layout';
import { NodeModel, NodeModelData } from './node';
import {
NodeDisplayModel,
NodeModel,
NodeModelData,
NodeShapesEncode,
} from './node';
import { ThemeSpecification } from './theme';
import { GraphTransformOptions } from './view';
import { ComboModel } from './combo';
import { ComboDisplayModel, ComboModel, ComboShapesEncode } from './combo';
import { Plugin as PluginBase } from './plugin';
import { ComboMapper, EdgeMapper, NodeMapper } from './spec';
@ -83,6 +93,25 @@ export interface Hooks {
enableStack?: boolean;
changes?: any;
}>;
itemstateconfigchange: IHook<{
itemType: ITEM_TYPE;
stateConfig:
| {
[stateName: string]:
| ((data: NodeModel) => NodeDisplayModel)
| NodeShapesEncode;
}
| {
[stateName: string]:
| ((data: EdgeModel) => EdgeDisplayModel)
| EdgeShapesEncode;
}
| {
[stateName: string]:
| ((data: ComboModel) => ComboDisplayModel)
| ComboShapesEncode;
};
}>;
itemvisibilitychange: IHook<{
ids: ID[];
graphCore?: GraphCore;

View File

@ -64,7 +64,7 @@ export interface Specification<
tileBehavior?: boolean | number;
/** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
tileBehaviorSize?: number;
/** Tile size for level of detial changing. */
/** Tile size for level of detail changing. */
tileLodSize?: number;
};
autoFit?:
@ -86,7 +86,6 @@ export interface Specification<
alignment?: GraphAlignment;
effectTiming?: CameraAnimationOptions;
};
optimizeThreshold?: number;
/** data */
data?: DataConfig;

View File

@ -183,5 +183,5 @@ export const upsertTransientItem = (
* @returns
*/
export function generateEdgeID(source: ID, target: ID) {
return [source, uniqueId(), target].join('->');
return [source, uniqueId(), target].join('-');
}

View File

@ -1841,7 +1841,7 @@ export default (
linkDistance: 100,
edgeStrength: 1000,
nodeStrength: 2000,
// animated: true,
animated: true,
// maxSpeed: 10000,
// minMovement: 0.1,
},

View File

@ -293,61 +293,60 @@ export default defineConfig({
// },
// ==========API====================
{
slug: 'apis/modules',
slug: 'apis/data',
title: {
zh: 'modules',
en: 'modules',
zh: '数据',
en: 'Data',
},
order: 2,
},
{
slug: 'apis/interfaces/graph',
slug: 'apis/graph',
title: {
zh: 'graph',
en: 'graph',
zh: '图实例',
en: 'Graph',
},
order: 2,
},
{
slug: 'apis/item',
title: {
zh: '元素',
en: 'Item',
},
order: 3,
},
{
slug: 'apis/interfaces/item',
slug: 'apis/shape',
title: {
zh: 'item',
en: 'item',
zh: '图形',
en: 'Shape',
},
order: 4,
},
{
slug: 'apis/interfaces/plugins',
slug: 'apis/layout',
title: {
zh: 'plugins',
en: 'plugins',
},
order: 7,
},
{
slug: 'apis/interfaces/layout',
title: {
zh: 'layout',
zh: '布局',
en: 'layout',
},
order: 5,
},
{
slug: 'apis/interfaces/behaviors',
slug: 'apis/behaviors',
title: {
zh: 'behaviors',
en: 'behaviors',
zh: '交互',
en: 'Interaction',
},
order: 6,
},
{
slug: 'apis/classes',
slug: 'apis/plugins',
title: {
zh: 'classes',
en: 'classes',
zh: '自由插件',
en: 'Plugin',
},
order: 8,
order: 7,
},
// {
// slug: 'apis/interfaces',

View File

@ -1 +0,0 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

View File

@ -1,61 +0,0 @@
Overview / [Modules](modules.md)
# G6 API Core Modules
- [behaviors](modules/behaviors.md)
- [graph](modules/graph.md)
- [item](modules/item.md)
- [layout](modules/layout.md)
- [plugins](modules/plugins.md)
- [types](modules/types.md)
- [util](modules/util.md)
```jsx
import { Graph, Util } from '@antv/g6';
const data = Util.mock(6).circle();
const graph = new Graph({
container: 'container',
width: 500,
height: 500,
data,
layout: {
type: 'grid',
},
plugins: [
{
key: 'minimap',
type: 'minimap',
size: [300, 200],
mode: 'delegate',
delegateStyle: {
fill: 'red',
},
className: 'g6-minimap-2',
viewportClassName: 'g6-minimap-viewport-2',
},
],
});
const nodes = graph.getAllNodesData();
const nodes = graph.getAllNodesData();
graph.on('node:click', (e) => {});
```
# Introduce
In the above code snippet, we may want to know more about what G6 has to offer, in which case we will need the G6 API documentation
#### What types, methods and classes are exported in the '@antv/g6' package?
- [Graph](./classes/graph.Graph.md)
- [Util](./module/utils.md)
#### What is Specification which in `new Graph(Specification)`
- [Specification](./interfaces/types.Specification.md)
#### What are the detailed parameters of the plugins ?
- [Plugins](./modules/plugins.md)

View File

@ -1,11 +0,0 @@
[Overview - v5.0.0-alpha.9](README.md) / Modules
## Modules
- [behaviors](modules/behaviors.md)
- [graph](modules/graph.md)
- [item](modules/item.md)
- [layout](modules/layout.md)
- [plugins](modules/plugins.md)
- [types](modules/types.md)
- [util](modules/util.md)

View File

@ -1,30 +0,0 @@
[Overview - v5.0.0-alpha.9](../README.md) / [Modules](../modules.md) / behaviors
## Interfaces
- [ActivateRelationsOptions](../interfaces/behaviors/ActivateRelationsOptions.md)
- [BrushSelectOptions](../interfaces/behaviors/BrushSelectOptions.md)
- [CollapseExpandComboOptions](../interfaces/behaviors/CollapseExpandComboOptions.md)
- [DragCanvasOptions](../interfaces/behaviors/DragCanvasOptions.md)
- [DragComboOptions](../interfaces/behaviors/DragComboOptions.md)
- [DragNodeOptions](../interfaces/behaviors/DragNodeOptions.md)
- [HoverActivateOptions](../interfaces/behaviors/HoverActivateOptions.md)
- [IG6GraphEvent](../interfaces/behaviors/IG6GraphEvent.md)
- [Options](../interfaces/behaviors/Options.md)
- [OrbitCanvas3DOptions](../interfaces/behaviors/OrbitCanvas3DOptions.md)
- [RotateCanvas3DOptions](../interfaces/behaviors/RotateCanvas3DOptions.md)
- [TrackCanvas3DOptions](../interfaces/behaviors/TrackCanvas3DOptions.md)
- [ZoomCanvas3DOptions](../interfaces/behaviors/ZoomCanvas3DOptions.md)
- [ZoomCanvasOptions](../interfaces/behaviors/ZoomCanvasOptions.md)
## Type Aliases
### ICanvasEventType
Ƭ **ICanvasEventType**: \`${CANVAS\_EVENT\_TYPE}\`
Event type union
#### Defined in
[packages/g6/src/types/event.ts:38](https://github.com/antvis/G6/blob/4b803837a5/packages/g6/src/types/event.ts#L38)

View File

@ -1,40 +0,0 @@
[Overview - v5.0.0-alpha.9](../README.md) / [Modules](../modules.md) / graph
## Interfaces
- [GraphData](../interfaces/graph/GraphData.md)
- [IGraph](../interfaces/graph/IGraph.md)
- [Specification](../interfaces/graph/Specification.md)
## Classes
- [Graph](../classes/graph/Graph.md)
## Variables
### Util
`Const` **Util**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `extend` | <B1, B2, T1, T2\>(`GraphClass`: typeof [`Graph`](../classes/graph/Graph.md), `extendLibrary`: { `behaviors?`: `B1` ; `edges?`: `EdgeRegistry` ; `layouts?`: `LayoutRegistry` ; `nodes?`: `NodeRegistry` ; `plugins?`: `PluginRegistry` ; `themeSolvers?`: `T1` }) => typeof [`Graph`](../classes/graph/Graph.md) |
| `getArrowPath` | (`type`: `ArrowType`, `width`: `number`, `height`: `number`) => `string` |
| `getEdgesBetween` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `ids`: `ID`[]) => `ID`[] |
| `graphComboTreeDfs` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.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.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.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `graphCore`: `GraphCore`, `nodes`: `NodeUserModel`[], `fn`: `any`, `mode`: ``"TB"`` \| ``"BT"``) => `void` |
| `traverseGraphAncestors` | (`graph`: [`IGraph`](../interfaces/graph/IGraph.md)<`BehaviorRegistry`, `ThemeRegistry`\>, `nodes`: `NodeUserModel`[], `fn`: `any`) => `void` |
| `treeData2GraphData` | (`treeData`: `TreeData`<[`NodeUserModelData`](../interfaces/item/NodeUserModelData.md)\> \| `TreeData`<[`NodeUserModelData`](../interfaces/item/NodeUserModelData.md)\>[]) => { `combos`: `any`[] = []; `edges`: `any`[] = []; `nodes`: `any`[] = [] } |
#### Defined in
[packages/g6/src/util/index.ts:18](https://github.com/antvis/G6/blob/4b803837a5/packages/g6/src/util/index.ts#L18)

View File

@ -1,12 +0,0 @@
[Overview - v5.0.0-alpha.9](../README.md) / [Modules](../modules.md) / plugins
## Interfaces
- [FisheyeConfig](../interfaces/plugins/FisheyeConfig.md)
- [GridConfig](../interfaces/plugins/GridConfig.md)
- [HistoryConfig](../interfaces/plugins/HistoryConfig.md)
- [LegendConfig](../interfaces/plugins/LegendConfig.md)
- [MenuConfig](../interfaces/plugins/MenuConfig.md)
- [MiniMapConfig](../interfaces/plugins/MiniMapConfig.md)
- [ToolbarConfig](../interfaces/plugins/ToolbarConfig.md)
- [TooltipConfig](../interfaces/plugins/TooltipConfig.md)

View File

@ -1 +0,0 @@
[Overview - v5.0.0-alpha.9](../README.md) / [Modules](../modules.md) / types

View File

@ -1,92 +0,0 @@
[Overview - v5.0.0-alpha.9](../README.md) / [Modules](../modules.md) / util
## Functions
### extend
**extend**<`B1`, `B2`, `T1`, `T2`\>(`GraphClass`, `extendLibrary`): typeof [`Graph`](../classes/graph/Graph.md)
Extend graph class with custom libs (extendLibrary), and extendLibrary will be merged into useLib.
B1 is the Behavior lib from user, B2 is the Behavior lib of the graph to be extended(built-in graph)
TODO: more templates, and might be merged to be two templates for the whole extendLibrary
#### Type parameters
| Name | Type |
| :------ | :------ |
| `B1` | extends `BehaviorRegistry` |
| `B2` | extends `BehaviorRegistry` |
| `T1` | extends `ThemeRegistry` |
| `T2` | extends `ThemeRegistry` |
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `GraphClass` | typeof [`Graph`](../classes/graph/Graph.md) | graph class to be extended |
| `extendLibrary` | `Object` | custom libs to extend |
| `extendLibrary.behaviors?` | `B1` | - |
| `extendLibrary.edges?` | `EdgeRegistry` | - |
| `extendLibrary.layouts?` | `LayoutRegistry` | - |
| `extendLibrary.nodes?` | `NodeRegistry` | - |
| `extendLibrary.plugins?` | `PluginRegistry` | - |
| `extendLibrary.themeSolvers?` | `T1` | - |
#### Returns
typeof [`Graph`](../classes/graph/Graph.md)
extended graph class
#### Defined in
[packages/g6/src/util/extend.ts:18](https://github.com/antvis/G6/blob/4b803837a5/packages/g6/src/util/extend.ts#L18)
___
### isEncode
**isEncode**(`value`): value is Encode<any\>
Whether value is a Encode<T> type with fields and formatter function.
#### Parameters
| Name | Type |
| :------ | :------ |
| `value` | `any` |
#### Returns
value is Encode<any\>
#### Defined in
[packages/g6/src/util/type.ts:8](https://github.com/antvis/G6/blob/4b803837a5/packages/g6/src/util/type.ts#L8)
___
### mock
**mock**(`nodeCount`): `Object`
mock graph data
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `nodeCount` | `number` | node count |
#### Returns
`Object`
| Name | Type |
| :------ | :------ |
| `circle` | (`centerId`: `string`) => { `edges`: `any`[] ; `nodes`: { `data`: {} = {}; `id`: `string` }[] } |
| `random` | (`ratio`: `number`) => { `edges`: `any`[] ; `nodes`: { `data`: {} = {}; `id`: `string` }[] } |
#### Defined in
[packages/g6/src/util/mock.ts:7](https://github.com/antvis/G6/blob/4b803837a5/packages/g6/src/util/mock.ts#L7)

View File

@ -1,15 +1,3 @@
---
title: README
---
Overview
## Modules
- [behaviors](modules/behaviors.en.md)
- [graph](modules/graph.en.md)
- [item](modules/item.en.md)
- [layout](modules/layout.en.md)
- [plugins](modules/plugins.en.md)
- [types](modules/types.en.md)
- [util](modules/util.en.md)

View File

@ -2,16 +2,6 @@
title: README
---
> 📋 中文文档还在翻译中... 欢迎PR
TODO
Overview
## Modules
- [behaviors](modules/behaviors.zh.md)
- [graph](modules/graph.zh.md)
- [item](modules/item.zh.md)
- [layout](modules/layout.zh.md)
- [plugins](modules/plugins.zh.md)
- [types](modules/types.zh.md)
- [util](modules/util.zh.md)
包括接入指南,开发指南,迁移指南的链接。

View File

@ -0,0 +1,14 @@
---
title: IG6GraphEvent
---
| Name | Type | Description |
| :--------------- | :----------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------- |
| `itemType` | `'node' | 'edge' | 'combo' 'canvas'` | 事件发生在哪一类元素上,`undefined` 表示发生在画布空白处 |
| `itemId` | `ID` | 事件发生在的元素的 id发生在画布空白处则为 `undefined` |
| `target` | `Shape` | 事件发生在的图形 |
| `key` | `string` | 键盘事件中,被按下或抬起的键盘 key |
| `canvas` | `{ x: number, y: number, z: number}` | 事件发生时画布上的绘制坐标 |
| `viewport` | `{ x: number, y: number, z: number}` | 事件发生时视窗 DOM 上的坐标 |
| `clieant` | `{ x: number, y: number, z: number}` | 事件发生时浏览器上的坐标 |
| `preventDefault` | `() => void` | 阻止浏览器默认事件的发生e.g. contextmenu 事件中阻止浏览器的右键菜单弹出,有时可能还需要在自定义的菜单 DOM 上阻止 DOM 本身的右键默认事件。注意,有些事件可能不存在该函数。 |

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
---
title: ComboUserModelData
order: 5
---

View File

@ -0,0 +1,60 @@
---
title: ComboUserModelData
order: 5
---
用户输入数据中,每一项 Combo 数据的 data 部分的类型说明如下。
## 属性
### type
- 是否必须:`否`
- 类型: `string`
Combo 的渲染类型,可以是已经注册到图类上的 Combo 类型,内置并默认注册的有 `'circle-node'``'rect-node'``'image-node'`。
### visible
- 是否必须:`否`
- 类型: `boolean`
`Optional` **visible**: `boolean`
Combo 是否默认展示出来。
### color
- 是否必须:`否`
- 类型: `string`
该 Combo 的主图形keyShape的主题色值为十六进制字符串。为方便简单配置而提供更多的样式配置应当在 Graph 实例的 Combo mapper 中配置 keyShape 以及各种图形的图形样式。
### label
- 是否必须:`否`
- 类型: `string`
Combo labelShape 的文本内容。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的 Combo mapper 中配置 labelShape 的 text 值或其他图形样式。
### icon
- 是否必须:`否`
- 类型:
```typescript
{
type: 'text' | 'icon',
img?: string, // type 为 'text' 时需要提供
text?: string, // type 为 'icon' 时需要提供
}
```
Combo 上的 icon 配置。内置 Combo 的 icon 绘制在文本后方。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的 Combo mapper 中配置 iconShape 的图形样式。
### parentId
- 是否必须:`否`
- 类型: `string | number`
在有 Combo 的图上表示该 Combo 所属的父亲 Combo 的 id。

View File

@ -0,0 +1,4 @@
---
title: Data Intro
order: 0
---

View File

@ -0,0 +1,95 @@
---
title: 数据使用简介
order: 0
---
在 G6 v5 中,为了更好地做好数据隔离,控制数据映射,全新定义规范数据流如下:
【User Data】 - _Transforms_ -> 【Inner Data】 - _Mappers_ -> 【Display Data】
以下介绍各个阶段的数据以及转换阶段。
### User Data 用户输入数据
数据类型为 [`GraphData`](./GraphData.zh.md) 或 [`TreeData`](./GraphData.zh.md)。用户输入数据是由用户提供的原始数据可以是来自业务的数据。是节点、边、Combo 的集合。这些数据可能来自外部数据源,或者是用户通过交互操作生成的。
用户数据输入的方式有:
1. **图实例化时传入配置**
实例化完成后自动渲染图。
```javascript
const data = {
nodes: [...],
edges: [...],
combos: [...]
}
const graph = new Graph({
// ... 其他配置
data
})
```
2. **调用 API 传入数据**
图实例读取并渲染数据。
```javascript
graph.read(data);
```
3. **调用 API 更新数据**
- 更新全量数据 [changeData](TODO)
```javascript
graph.changeData(data);
```
- 新增部分数据 [addData](TODO)
```javascript
graph.addData('node', [
{ id: 'newnode-1', data: {} },
{ id: 'newnode-2', data: {} },
]);
graph.addData('edge', [{ id: 'newedge-1', source: 'newnode-2', target: 'newnode-1', data: {} }]);
```
- 更新部分已有数据 [updateData](TODO)
```javascript
const nodes = [
{ id: 'node-1', data: { xx: 1 } },
{ id: 'node-2', data: { xx: 2 } },
];
// 将更新已存在的 node-1 和 node-2 的上述属性
graph.updateData('node', nodes);
```
- 删除部分数据 [removeData](TODO)
```javascript
graph.removeData('node', ['node-1', 'node-2']);
```
### Transforms 数据转换器
数据转换器是用于对用户输入数据进行转换和处理的功能模块。它们可以执行各种操作,例如属性字段转换、数据过滤、数据聚合等。转换器可以根据实际需求进行自定义配置,以便将输入数据转换为适合后续处理的内部数据格式。
使用图配置中的 `transforms` 字段配置的各种转换器。`transforms` 接受的是转换器配置数组G6 在读取用户数据时,将按照 `transforms` 中转换器的顺序执行数据转换,前一个转换器的结果将作为下一个转换器的输入。 例如TODO
### Inner Data 内部流转数据
内部流转数据是在 Transforms 转换阶段后生成的数据,它是经过转换器处理和转换后的数据。内部流转数据可以作为后续数据映射的输入,也可以用于其他数据处理和操作。在 G6 读取用户数据后,后续用户获取和修改的都是内部流转数据。
### Mappers 数据映射器
数据映射器是用于将内部流转数据映射到具体的视觉通道上。它们根据预定义的规则和配置,将内部数据映射到特定的节点样式、边样式、标签等可视化属性上。数据映射器支持 JSON 格式的配置,也支持函数式的配置。
使用图配置中的 `node``edge`,或 `combo`类型见TODO。
### Display Data 渲染数据
渲染数据是经过数据映射器Mappers处理后生成的最终用于渲染的数据您将不会在任何地方读取到这份数据。它包含了节点的位置、各个图形的样式等用于最终的图形渲染和展示。

View File

@ -0,0 +1,4 @@
---
title: EdgeUserModelData
order: 4
---

View File

@ -0,0 +1,83 @@
---
title: EdgeUserModelData
order: 4
---
用户输入数据中,每一项边数据的 data 部分的类型说明如下。
## 属性
### type
- 是否必须:`否`
- 类型: `string`
边的渲染类型,可以是已经注册到图类上的边类型,内置并默认注册的有 `'line-edge'``'loop-edge'`。
### visible
- 是否必须:`否`
- 类型: `boolean`
`Optional` **visible**: `boolean`
边是否默认展示出来。
### color
- 是否必须:`否`
- 类型: `string`
该边的主图形keyShape的主题色值为十六进制字符串。为方便简单配置而提供更多的样式配置应当在 Graph 实例的边 mapper 中配置 keyShape 以及各种图形的图形样式。
### label
- 是否必须:`否`
- 类型: `string`
边 labelShape 的文本内容。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的边 mapper 中配置 labelShape 的 text 值或其他图形样式。
### badge
- 是否必须:`否`
- 类型:
```typescript
{
position: BadgePosition,
type: 'text' | 'icon',
img?: string, // type 为 'text' 时需要提供
text?: string, // type 为 'icon' 时需要提供
};
```
边上的徽标配置,内置边的徽标绘制在文本后方。更多的样式配置应当在 Graph 实例的边 mapper 中配置 badgeShapes 的图形样式。
### icon
- 是否必须:`否`
- 类型:
```typescript
{
type: 'text' | 'icon',
img?: string, // type 为 'text' 时需要提供
text?: string, // type 为 'icon' 时需要提供
}
```
边上的 icon 配置。内置边的 icon 绘制在文本后方。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的边 mapper 中配置 iconShape 的图形样式。
### sourceAnchor
- 是否必须:`否`
- 类型: `number`
起点节点上 `anchorPoints` 表示允许相关边连入的位置,是一个数组。而边的 `sourceAnchor` 表示了这条边连入起点时选择哪个锚点连入,对应了起点节点上 `anchorPoints` 对应位置的序号。
### targetAnchor
- 是否必须:`否`
- 类型: `number`
终点节点上 `anchorPoints` 表示允许相关边连入的位置,是一个数组。而边的 `sourceAnchor` 表示了这条边连入终点时选择哪个锚点连入,对应了起点节点上 `anchorPoints` 对应位置的序号。

View File

@ -0,0 +1,4 @@
---
title: GraphData
order: 1
---

View File

@ -0,0 +1,61 @@
---
title: GraphData
order: 1
---
本章介绍的 GraphData 是图数据的类型,是 Graph 接收的数据类型之一。同时v5 还打通了 Graph 和 TreeGraph即使用同一个 Graph 类,即可以读取本文中的 GraphData 数据格式,也可以读取树图的数据格式,树图数据格式见 [TreeData](./TreeData.zh.md)。
## 属性
### nodes
- 是否必须:`是`
- 类型: [`NodeUserModel[]`](#NodeUserModel)
#### NodeUserModel
`必须` **id**: `string|number`
节点的唯一 ID节点创建后ID 不可被修改。
`必须` **data**: [`NodeUserModelData`](./NodeUserModelData.zh.md)
节点除 ID 以外的的数据,建议存放业务数据。若需要进行数据转换,可通过 Graph 实例的 transform 配置转换函数,见 [Specification.transforms](TODO)。转换后的数据成为内部流通的数据 Inner Data后续所有地方获取的都是这份内部数据。与渲染有关的可以通过 Graph 实例的节点 mapper 进行映射,见 [Specification.node](TODO),该 mapper 的输入是 Inner Data生成的结果 Display Data 只交给渲染器消费,用户不会在任何地方获得。
### edges
- 是否必须:`是`
- 类型: `EdgeUserModel`[]
#### EdgeUserModel
`必须` **id**: `string|number`
边的唯一 ID节点创建后ID 不可被修改。
`必须` **source**: `string|number`
边起始节点的 ID应与 `nodes` 中的一项对应,否则该边数据不会被加入到图中。
`必须` **target**: `string|number`
边结束节点的 ID应与 `nodes` 中的一项对应,否则该边数据不会被加入到图中。
`必须` **data**: [`EdgeUserModelData`](./EgdeUserModelData.zh.md)
边除 ID、起点 ID、终点 ID 以外的数据,建议存放业务数据。若需要进行数据转换,可通过 Graph 实例的 transform 配置转换函数,见 [Specification.transforms](TODO)。转换后的数据成为内部流通的数据 Inner Data后续所有地方获取的都是这份内部数据。与渲染有关的可以通过 Graph 实例的边 mapper 进行映射,见 [Specification.edge](TODO),该 mapper 的输入是 Inner Data生成的结果 Display Data 只交给渲染器消费,用户不会在任何地方获得。
### combos
- 是否必须:`否`
- 类型: `ComboUserModel`[]
#### ComboUserModel
`必须` **id**: `string|number`
Combo 的唯一 IDCombo 创建后ID 不可被修改。
`必须` **data**: [`ComboUserModelData`](./ComboUserModelData.zh.md)
Combo 除 ID 以外的的数据,建议存放业务数据。若需要进行数据转换,可通过 Graph 实例的 transform 配置转换函数,见 [Specification.transforms](TODO)。转换后的数据成为内部流通的数据 Inner Data后续所有地方获取的都是这份内部数据。与渲染有关的可以通过 Graph 实例的 combo mapper 进行映射,见 [Specification.combo](TODO),该 mapper 的输入是 Inner Data生成的结果 Display Data 只交给渲染器消费,用户不会在任何地方获得。

View File

@ -0,0 +1,4 @@
---
title: NodeUserModelData
order: 3
---

View File

@ -0,0 +1,133 @@
---
title: NodeUserModelData
order: 3
---
用户输入数据中,每一项节点数据的 data 部分的类型说明如下。
## 属性
### type
- 是否必须:`否`
- 类型: `string`
节点的渲染类型,可以是已经注册到图类上的节点类型,内置并默认注册的有 `'circle-node'``'rect-node'``'image-node'`。
### x
- 是否必须:`否`
- 类型: `number`
节点的 x 轴位置。若未指定节点位置,且未为图实例配置 `layout`(布局),则节点可能被渲染在画布左上角。
### y
- 是否必须:`否`
- 类型: `number`
节点的 y 轴位置。若未指定节点位置,且未为图实例配置 `layout`(布局),则节点可能被渲染在画布左上角。
### z
- 是否必须:`否`
- 类型: `number`
对于 2D 的图,不需要指定 z 值。若指定可能导致 WebGL 渲染器下节点看不见。在 3D 图中z 值是必须的,代表节点的 z 轴位置。若未指定节点位置,且未为图实例配置 `layout`(布局),则节点可能被渲染在画布左上角。
### visible
- 是否必须:`否`
- 类型: `boolean`
`Optional` **visible**: `boolean`
节点是否默认展示出来。
### color
- 是否必须:`否`
- 类型: `string`
该节点主图形keyShape的主题色值为十六进制字符串。为方便简单配置而提供更多的样式配置应当在 Graph 实例的节点 mapper 中配置 keyShape 以及各种图形的图形样式。
### label
- 是否必须:`否`
- 类型: `string`
节点 labelShape 的文本内容。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的节点 mapper 中配置 labelShape 的 text 值或其他图形样式。
### badges
- 是否必须:`否`
- 类型:
```typescript
{
position: BadgePosition,
type: 'text' | 'icon',
img?: string, // type 为 'text' 时需要提供
text?: string, // type 为 'icon' 时需要提供
}[];
```
节点四周的徽标配置,其中的可配置的位置 `BadgePosition` 如下。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的节点 mapper 中配置 badgeShapes 的图形样式。
```typescript
BadgePosition: 'rightTop' |
'right' |
'rightBottom' |
'bottomRight' |
'bottom' |
'bottomLeft' |
'leftBottom' |
'left' |
'leftTop' |
'topLeft' |
'top' |
'topRight';
```
### icon
- 是否必须:`否`
- 类型:
```typescript
{
type: 'text' | 'icon',
img?: string, // type 为 'text' 时需要提供
text?: string, // type 为 'icon' 时需要提供
}
```
节点中心 icon 的配置。为方便简单配置而提供,更多的样式配置应当在 Graph 实例的节点 mapper 中配置 iconShape 的图形样式。
### anchorPoints
- 是否必须:`否`
- 类型: `number[][]`
该节点四周连接图形的位置,也是边连入的位置。若不配置,边则自动寻找节点边缘最近的位置进行连接。例如 `[[0,0.5],[1,0.5]]`,数字表示在 x 或 y 方向上相对于节点主图形keyShape的百分比位置。为方便简单配置而提供更多的样式配置应当在 Graph 实例的节点 mapper 中配置 anchorShapes 的图形样式。
### parentId
- 是否必须:`否`
- 类型: `string | number`
在有 combo 的图上表示该节点所属的 combo 的 id。
### isRoot
- 是否必须:`否`
- 类型: `boolean`
若要将该份数据作为树图展示,同时使用树图布局时,指定该节点是否为树的根节点之一。
### preventPolylineEdgeOverlap
- 是否必须:`否`
- 类型: `boolean`
是否将该节点作为一个障碍物,使 `'polyline-edge'` 类型的边躲避。默认为 `false`

View File

@ -0,0 +1,4 @@
---
title: TreeData
order: 2
---

View File

@ -0,0 +1,31 @@
---
title: TreeData
order: 2
---
本章介绍的 TreeData 是树图数据的类型,即是 Graph 接收的数据类型之一。是 Graph 接收的数据类型。v5 打通了 Graph 和 TreeGraph即使用同一个 Graph 类,即可以读取 [GraphData](./GraphData.zh.md) 数据格式,也可以读取本文中的树图的数据格式。`TreeGraph` 是一个嵌套的数据结构,表达了树的父子层级。不像 `GraphData``TreeData` 不显式定义边,没有 `edges` 数组,其中 `children` 的嵌套隐式表示了边,即父子节点之间存在一条边。
v5 的 Graph 可以读取 `GraphData`、`TreeData`、`TreeData[]`,即可以展示图数据、树图数据、多棵树的森林数据。
## 属性
### id
- 是否必须:`是`
- 类型: `string | number`
节点的唯一 ID节点创建后ID 不可被修改。
### data
- 是否必须:`是`
- 类型:[`NodeUserModelData`](./NodeUserModelData.zh.md)
节点除 ID 以外的的数据,建议存放业务数据。若需要进行数据转换,可通过 Graph 实例的 transform 配置转换函数,见 [Specification.transforms](TODO)。转换后的数据成为内部流通的数据 Inner Data后续所有地方获取的都是这份内部数据。与渲染有关的可以通过 Graph 实例的节点 mapper 进行映射,见 [Specification.node](TODO),该 mapper 的输入是 Inner Data生成的结果 Display Data 只交给渲染器消费,用户不会在任何地方获得。
### children
- 是否必须:`否`
- 类型:`TreeData`
该节点的子节点数组。嵌套的 `TreeData` 格式的节点。

View File

@ -0,0 +1,4 @@
---
title: ComboDisplayModelData
order: 12
---

View File

@ -0,0 +1,4 @@
---
title: ComboDisplayModelData
order: 12
---

View File

@ -0,0 +1,4 @@
---
title: ComboInnerModelData
order: 9
---

View File

@ -0,0 +1,4 @@
---
title: ComboInnerModelData
order: 8
---

View File

@ -0,0 +1,4 @@
---
title: Custom Transform
order: 13
---

View File

@ -0,0 +1,4 @@
---
title: 自定义数据处理器
order: 13
---

View File

@ -0,0 +1,4 @@
---
title: EdgeDisplayModelData
order: 11
---

View File

@ -0,0 +1,4 @@
---
title: EdgeDisplayModelData
order: 11
---

View File

@ -0,0 +1,4 @@
---
title: EdgeInnerModelData
order: 8
---

View File

@ -0,0 +1,4 @@
---
title: EdgeInnerModelData
order: 8
---

View File

@ -0,0 +1,4 @@
---
title: NodeDisplayModelData
order: 10
---

View File

@ -0,0 +1,4 @@
---
title: NodeDisplayModelData
order: 10
---

View File

@ -0,0 +1,4 @@
---
title: NodeDisplayModelData
order:
---

View File

@ -0,0 +1,4 @@
---
title: NodeInnerModelData
order: 6
---

View File

@ -1,127 +0,0 @@
---
title: BadgePosition
---
[Overview - v5.0.0-beta.21](../../README.en.md) / [Modules](../../modules.en.md) / [item](../../modules/item.en.md) / BadgePosition
[item](../../modules/item.en.md).BadgePosition
## Enumeration Members
### bottom
**bottom** = `"bottom"`
#### Defined in
[packages/g6/src/types/item.ts:139](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L139)
---
### bottomLeft
**bottomLeft** = `"bottomLeft"`
#### Defined in
[packages/g6/src/types/item.ts:140](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L140)
---
### bottomRight
**bottomRight** = `"bottomRight"`
#### Defined in
[packages/g6/src/types/item.ts:138](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L138)
---
### left
**left** = `"left"`
#### Defined in
[packages/g6/src/types/item.ts:142](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L142)
---
### leftBottom
**leftBottom** = `"leftBottom"`
#### Defined in
[packages/g6/src/types/item.ts:141](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L141)
---
### leftTop
**leftTop** = `"leftTop"`
#### Defined in
[packages/g6/src/types/item.ts:143](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L143)
---
### right
**right** = `"right"`
#### Defined in
[packages/g6/src/types/item.ts:136](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L136)
---
### rightBottom
**rightBottom** = `"rightBottom"`
#### Defined in
[packages/g6/src/types/item.ts:137](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L137)
---
### rightTop
**rightTop** = `"rightTop"`
#### Defined in
[packages/g6/src/types/item.ts:135](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L135)
---
### top
**top** = `"top"`
#### Defined in
[packages/g6/src/types/item.ts:145](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L145)
---
### topLeft
**topLeft** = `"topLeft"`
#### Defined in
[packages/g6/src/types/item.ts:144](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L144)
---
### topRight
**topRight** = `"topRight"`
#### Defined in
[packages/g6/src/types/item.ts:146](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L146)

View File

@ -1,129 +0,0 @@
---
title: BadgePosition
---
> 📋 中文文档还在翻译中... 欢迎 PR
[Overview - v5.0.0-beta.21](../../README.zh.md) / [Modules](../../modules.zh.md) / [item](../../modules/item.zh.md) / BadgePosition
[item](../../modules/item.zh.md).BadgePosition
## Enumeration Members
### bottom
**bottom** = `"bottom"`
#### Defined in
[packages/g6/src/types/item.ts:139](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L139)
---
### bottomLeft
**bottomLeft** = `"bottomLeft"`
#### Defined in
[packages/g6/src/types/item.ts:140](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L140)
---
### bottomRight
**bottomRight** = `"bottomRight"`
#### Defined in
[packages/g6/src/types/item.ts:138](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L138)
---
### left
**left** = `"left"`
#### Defined in
[packages/g6/src/types/item.ts:142](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L142)
---
### leftBottom
**leftBottom** = `"leftBottom"`
#### Defined in
[packages/g6/src/types/item.ts:141](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L141)
---
### leftTop
**leftTop** = `"leftTop"`
#### Defined in
[packages/g6/src/types/item.ts:143](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L143)
---
### right
**right** = `"right"`
#### Defined in
[packages/g6/src/types/item.ts:136](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L136)
---
### rightBottom
**rightBottom** = `"rightBottom"`
#### Defined in
[packages/g6/src/types/item.ts:137](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L137)
---
### rightTop
**rightTop** = `"rightTop"`
#### Defined in
[packages/g6/src/types/item.ts:135](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L135)
---
### top
**top** = `"top"`
#### Defined in
[packages/g6/src/types/item.ts:145](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L145)
---
### topLeft
**topLeft** = `"topLeft"`
#### Defined in
[packages/g6/src/types/item.ts:144](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L144)
---
### topRight
**topRight** = `"topRight"`
#### Defined in
[packages/g6/src/types/item.ts:146](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/item.ts#L146)

View File

@ -0,0 +1,4 @@
---
title: Graph Methods
order: 1
---

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
---
title: Graph Properties
order: 2
---

View File

@ -0,0 +1,30 @@
---
title: Graph 属性
order: 2
---
以下属性均只读。
### canvas
存储当前图的主画布对象。您一般不需要使用。
**类型**: `Canvas`
### container
存储图画布的 DOM 容器。
**类型**: `HTMLElement`
### destroyed
当前图实例是否已经被销毁。
**类型**: `boolean`
### rendererType
图当前的渲染器名称。
**类型**: `'canvas' | 'webgl' | 'svg' | 'webgl-3d'`

View File

@ -0,0 +1,4 @@
---
title: Graph Specification
order: 0
---

View File

@ -0,0 +1,446 @@
---
title: Specification 图配置项
order: 0
---
## container
图的容器 DOM可以是已经存在的 DOM id也可以是 DOM 对象。
• 是否必须: 是
• 类型: `string` \| `HTMLElement`
## height
画布标签 DOM 的高度。未指定,则自适应容器。
• 是否必须: 否
• 类型: `number`
## width
画布标签 DOM 的宽度。未指定,则自适应容器。
• 是否必须: 否
• 类型: `number`
## renderer
渲染器类型名称,默认为 `'canvas'`。大规模数据建议使用 `'webgl'`。若使用 `'webgl-3d'` 应当配合 3D 相关的交互和元素类型。
• 是否必须: 否
• 类型: `RendererCfg`
```typescript
type RendererName = 'canvas' | 'webgl' | 'svg' | 'webgl-3d';
type RendererCfg =
| RendererName
| {
// 渲染器名称
type: RendererName;
// 是否使用无头浏览器,默认为 false。true 适用于 node 端渲染
headless?: boolean;
// 像素比,不指定将自动获取当前设备自动像素比。一般在 1-3 之间。可在渲染模糊的情况下,设置较大的值
pixelRatio?: number;
};
```
## data
图数据。可以在此配置项中给出,也可以通过 Graph 的 API 写入,见 [graph.read](./Graph.zh.md/#read)。
• 是否必须: 否
• 类型: `DataConfig`
```typescript
type DataConfig = GraphData | InlineGraphDataConfig | InlineTreeDataConfig;
interface InlineGraphDataConfig {
type: 'graphData';
value: GraphData;
}
interface InlineTreeDataConfig {
type: 'treeData';
value: TreeData;
}
```
其中 [`GraphData`](../data//GraphData.zh.md)[`TreeData`](../data//TreeData.zh.md) 详见对应类型定义文档。
## transforms
数据转换器。可配置多个内置的或自定义的数据转换器,图读取用户数据时,将按照配置的数组顺序,线性执行数据转换器。即前一个数据处理器的结果将输入到下一个数据处理器中。所有数据处理器完成后,生成 G6 内部流转的数据。详见[数据介绍文档](../data//DataIntro.zh.md)。自定义方式见[自定义数据处理器文档](../data/CustomTransform.zh.md)。
• 是否必须: 否
• 类型:
```typescript
string[]
| {
type: string;
activeLifecycle: string | string[];
[param: string]: unknown;
}[]
| TransformerFn[]
```
## node
节点映射器mapper可以是 JSON 配置,也可以函数映射。映射器的生成结果应当是渲染所需的图形样式等。这一映射器在每次渲染节点时,将内部流转数据转换为渲染数据,详见[数据介绍文档](../data//DataIntro.zh.md)。
• 是否必须: 否
• 类型: `NodeEncode` \| (`data`: `NodeModel`) => `NodeDisplayModel`
**TODO**: NodeEncode、NodeModel、NodeDisplayModel 类型定义
## edge
边映射器mapper可以是 JSON 配置,也可以函数映射。映射器的生成结果应当是渲染所需的图形样式等。这一映射器在每次渲染边时,将内部流转数据转换为渲染数据,详见[数据介绍文档](../data//DataIntro.zh.md)。
• 是否必须: 否
• 类型: `EdgeEncode` \| (`data`: `EdgeModel`) => `EdgeDisplayModel`
**TODO**: EdgeEncode、EdgeModel、 EdgeDisplayModel 类型定义
## combo
Combo 映射器mapper可以是 JSON 配置,也可以函数映射。映射器的生成结果应当是渲染所需的图形样式等。这一映射器在每次渲染 Combo 时,将内部流转数据转换为渲染数据,详见[数据介绍文档](../data//DataIntro.zh.md)。
• 是否必须: 否
• 类型: `ComboEncode` \| (`data`: `ComboModel`) => `ComboDisplayModel`
**TODO**: ComboEncode、 ComboModel、ComboDisplayModel 类型定义
## nodeState
节点的状态样式配置。内置主题中已经提供了 `'selected'`、`'active'`、`'highlight'`、`'inactive'`、`'disable'` 的状态样式。如果需要修改或为自定义状态名设置样式,可在此处配置。
• 是否必须: 否
• 类型:
```typescript
{
// key 为状态名称,例如 selected
[stateName: string]: {
// key 为图形名称,值表示该状态下该图形的样式
[shapeId]: ShapStyle
}
}
```
## edgeState
边的状态样式配置。内置主题中已经提供了 `'selected'`、`'active'`、`'highlight'`、`'inactive'`、`'disable'` 的状态样式。如果需要修改或为自定义状态名设置样式,可在此处配置。
• 是否必须: 否
• 类型:
```typescript
{
// key 为状态名称,例如 selected
[stateName: string]: {
// key 为图形名称,值表示该状态下该图形的样式
[shapeId]: ShapStyle
}
}
```
## comboState
Combo 的状态样式配置。内置主题中已经提供了 `'selected'`、`'active'`、`'highlight'`、`'inactive'`、`'disable'` 的状态样式。如果需要修改或为自定义状态名设置样式,可在此处配置。
• 是否必须: 否
• 类型:
```typescript
{
// key 为状态名称,例如 selected
[stateName: string]: {
// key 为图形名称,值表示该状态下该图形的样式
[shapeId]: ShapStyle
}
}
```
## theme
主题配置,默认使用亮色主题。
• 是否必须: 否
• 类型: `ThemeCfg`
```typescript
// 色板的类型,可以是十六进制颜色字符串数组,也可以是对象形式 key 为数据类型名value 为十六进制颜色值
type Palette = string[] | { [dataType: string]: string };
type ITEM_TYPE = 'node' | 'edge' | 'combo';
type ThemeCfg = {
type: 'spec';
// 自定义主题基于的内置主题,默认为 'light'
base: 'light' | 'dark';
specification: {
[itemType: ITEM_TYPE]: {
// 节点/边/ combo 的数据类型字段,例如节点根据 'cluster' 字段分类,则可指定 dataTypeField: 'cluster',后续将根据此分类从色板中取色
dataTypeField: string;
// 色板
palette: Palette;
// 自定义色板对应图形的样式
getStyleSets: (palette: Palette) => {
default: {
[shapeId: string]: ShapeStyle;
};
[stateName: string]: {
[shapeId: string]: ShapeStyle;
};
};
};
canvas: {
// 画布背景色的配置,不配置则跟随 base 的默认色
backgroundColor: string;
};
};
};
```
• 例子:
```javascript
const data = {
nodes: [
{ id: 'node1', data: { cluster: '1' } },
{ id: 'node2', data: { cluster: '1' } },
{ id: 'node3', data: { cluster: '2' } },
],
};
const graph = new Graph({
// ... 其他配置
theme: {
type: 'spec',
base: 'light',
specification: {
canvas: {
backgroundColor: '#f3faff',
},
node: {
dataTypeField: 'cluster',
palette: ['#bae0ff', '#91caff', '#69b1ff', '#4096ff', '#1677ff', '#0958d9', '#003eb3', '#002c8c', '#001d66'],
},
},
},
});
```
## layout
布局的配置。若不配置,且节点数据中存在 `x` `y`,则使用数据中的位置信息进行绘制。若不配置,且数据中无位置信息,则使用 `'grid'` 网格布局进行计算和绘制。
• 是否必须: 否
• 类型: `LayoutOptions`
```typescript
type layoutOptions = StandardLayoutOptions
| ImmediatelyInvokedLayoutOptions;
type PureLayoutOptions = CircularLayout | RandomLayout | ...; // 各个布局配置,详见布局配置文档
type StandardLayoutOptions = PureLayoutOptions & {
type: string;
// 预布局,以提升力导向布局的质量和收敛速度
presetLayout?: StandardLayoutOptions;
// 是否启用迭代动画,适用于力导向布局
animated: boolean;
// 是否启用 webworker避免计算过程阻塞页面
workerEnabled: boolean;
};
```
**TODO**: 链接各个布局配置文档
## modes
交互模式配置。G6 图提供不同的交互模式配置,可以理解为交互的分组。不同模式下配置不同交互,以便快速切换不同的交互分组。例如只读模式下,只能拖拽和缩放画布。编辑模式下,可以创建边等。此处可配置图上的交互分组,后续需要动态切换和通过 Graph 的 API [`setMode`](#setmode) 切换交互模式,[`getMode`](#getmode) 获取当前的交互模式。
• 是否必须: 否
• 类型: `ModesCfg`
```typescript
type BehaviorCfg =
| string // 可只指定 type 类型名称字符串
| {
// 若后续需要删改,需要指定唯一 key 用以检索
key: string;
type: string;
// ...其他配置,各个交互不相同
}
| BehaviorClass;
type ModesCfg = {
default: BehaviorCfg[];
[mode: string]: BehaviorCfg[];
};
```
## zoom
初次渲染的绝对缩放比例值。
• 是否必须: 否
• 类型: `number`
## autoFit
是否自适应容器,以及自适应的方式。'view' 表示缩放并平移以适配容器。'center' 表示仅平移不缩放以时图内容中心对齐容器中心。
• 是否必须: 否
• 类型: `"center"` \| `"view"` \| { `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `padding?`: `Padding` ; `rules?`: `FitViewRules` ; `type`: `"view"` } \| { `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `type`: `"center"` } \| { `alignment?`: `GraphAlignment` ; `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `position`: `Point` ; `type`: `"position"` }
```typescript
type FitViewRules = {
onlyOutOfViewport?: boolean;
onlyZoomAtLargerThanViewport?: boolean;
direction?: 'x' | 'y' | 'both';
ratioRule?: 'max' | 'min';
boundsType?: 'render' | 'layout';
};
type GraphAlignment = 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | 'center' | [number, number];
```
## animate
是否开启全局动画,优先级低于各 API 指定的动画。
• 是否必须: 否
• 类型:
```typescript
interface AnimateCfg {
/**
* 一次动画执行的时长ms
*/
duration?: number;
/**
* 动画的缓动函数。
*/
easing?: string;
/**
* 动画开始前的延迟时长ms
*/
delay?: number;
/**
* 动画执行的次数Infinity 表示循环。
*/
iterations?: number | typeof Infinity;
/**
* 动画结束时的回调函数。
*/
callback?: () => void;
/**
* 动画暂停时的回调函数。
*/
pauseCallback?: () => void;
/**
* 动画恢复时的回调函数。
*/
resumeCallback?: () => void;
}
```
## plugins
插件配置。
• 是否必须: 否
• 类型: `PluginsCfg`
```typescript
type PluginsCfg = (
| string
| {
// 若后续需要删改,需要指定唯一 key 用以检索
key: string;
type: string;
// ... 其他配置,不同的插件配置不哦那个
}
| PluginClass
)[];
```
**TODO**: 链接各个插件的配置文档
## enableStack
是否允许开启历史栈。
• 是否必须: 否
• 类型: `boolean`
## stackCfg
• 是否必须: 否
• 类型: `StackCfg`
```typescript
type StackCfg = {
/** 历史栈允许存储的最大步数。*/
stackSize?: number;
/** 默认是否允许入栈。*/
stackActive?: boolean;
/** 需要排除入栈的 API 名称,此处配置的优先级最高。*/
excludes?: string[];
/** 需要入栈的 API 名称,此处配置的优先级最高。*/
includes?: string[];
/** 是否忽略所有的新增数据操作。*/
ignoreAdd?: boolean;
/** 是否忽略所有的删除数据操作。*/
ignoreRemove?: boolean;
/** 是否忽略所有的更新数据操作。*/
ignoreUpdate?: boolean;
/** 是否忽略所有的元素状态变更操作。*/
ignoreStateChange?: boolean;
/** 是否忽略所有的层级变更操作。*/
ignoreLayerChange?: boolean;
/** 是否忽略所有的渲染变更操作。*/
ignoreDisplayChange?: boolean;
};
```
## optimize
图实例性能优化配置项。控制首屏分片渲染、分片交互等。包括单片的元素数量和开启分片渲染的上限。后续可能继续添加与性能优化有关的配置内容。
```typescript
{
/** 是否开启首屏的分片渲染。若指定 number则表示开启分片渲染的元素数量上限*/
tileFirstRender?: boolean | number;
/** 单片/一帧渲染包含的元素数量。*/
tileFirstRenderSize?: number;
/** 是否在 drag-canvas, zoom-canvas 的现实隐藏图形过程中,启用分片渲染。若指定 number则表示开启分片渲染的元素数量上限。但各个交互中的 enableOptimize 拥有更高的优先级。*/
tileBehavior?: boolean | number;
/** 交互的分片渲染单片/一帧渲染的元素数量。但各个交互中的 enableOptimize 拥有更高的优先级。*/
tileBehaviorSize?: number;
/** 信息分层分片渲染的单片/一帧渲染的元素数量。*/
tileLodSize?: number;
}
```

View File

@ -1,5 +1,5 @@
---
title: modules
title: guideline
---
[Overview - v5.0.0-beta.21](README.en.md) / Modules

View File

@ -0,0 +1,90 @@
---
title: 导航
---
## Modules
- [内置交互 behaviors](./behaviors/Options.zh.md)
- [ActivateRelationsOptions](./behaviors/ActivateRelationsOptions.zh.md)
- [BrushSelectOptions](./behaviors/BrushSelectOptions.zh.md)
- [CollapseExpandComboOptions](./behaviors/CollapseExpandComboOptions.zh.md)
- [DragCanvasOptions](./behaviors/DragCanvasOptions.zh.md)
- [DragComboOptions](./behaviors/DragComboOptions.zh.md)
- [DragNodeOptions](./behaviors/DragNodeOptions.zh.md)
- [HoverActivateOptions](./behaviors/HoverActivateOptions.zh.md)
- [IG6GraphEvent](./behaviors/IG6GraphEvent.zh.md)
- [OrbitCanvas3DOptions](./behaviors/OrbitCanvas3DOptions.zh.md)
- [RotateCanvas3DOptions](./behaviors/RotateCanvas3DOptions.zh.md)
- [TrackCanvas3DOptions](./behaviors/TrackCanvas3DOptions.zh.md)
- [ZoomCanvas3DOptions](./behaviors/ZoomCanvas3DOptions.zh.md)
- [ZoomCanvasOptions](./behaviors/ZoomCanvasOptions.zh.md)
- [图实例 graph](./graph/Graph.zh.md)
- [配置项](./graph/Specification.zh.md)
- [图方法](./graph/Graph.zh.md)
- [图属性](./graph/GraphProperties.zh.md)
- [数据 Data](./data/NodeUserModelData.zh.md)
- [数据流简介](./data/DataIntro.zh.md)
- [图数据 GraphData](./data/GraphData.zh.md)
- [树图数据 TreeData](./data/TreeData.zh.md)
- [NodeUserModelData](./data/NodeUserModelData.zh.md)
- [EdgeUserModelData](./data/EdgeUserModelData.zh.md)
- [ComboUserModelData](./data/ComboUserModelData.zh.md)
- [节点类型](./item/CircleNode.zh.md)
- [CircleNode](./item/CircleNode.zh.md)
- ImageNode(TODO)
- [DiamondNode](./item/DiamondNode.zh.md)
- [DonutNode](./item/DonutNode.zh.md)
- [EllipseNode](./item/EllipseNode.zh.md)
- [HexagonNode](./item/HexagonNode.zh.md)
- [ModelRectNode](./item/ModelRectNode.zh.md)
- [RectNode](./item/RectNode.zh.md)
- [SphereNode](./item/SphereNode.zh.md)
- [StarNode](./item/StarNode.zh.md)
- [TriangleNode](./item/TriangleNode.zh.md)
- CubeNode(TODO)
- [CustomNode](./item/CustomNode.zh.md)
- [CustomNode3D](./item/CustomNode3D.zh.md)
- [边类型](./item/CircleNode.zh.md)
- [CustomEdge](./item/CustomEdge.zh.md)
- TODO
- [Combo 类型](./item/CircleNode.zh.md)
- TODO
- [图形 Shape](./shape/NodeShapeStyles.zh.md)
- [NodeShapeStyles](./shape/NodeShapeStyles.zh.md)
- [CircleStyleProps](./shape/CircleStyleProps.zh.md)
- [CubeGeometryProps](./shape/CubeGeometryProps.zh.md)
- [EllipseStyleProps](./shape/EllipseStyleProps.zh.md)
- [IAnchorPositionMap](./shape/IAnchorPositionMap.zh.md)
- [ImageStyleProps](./shape/ImageStyleProps.zh.md)
- [LineStyleProps](./shape/LineStyleProps.zh.md)
- [PathStyleProps](./shape/PathStyleProps.zh.md)
- [PlaneGeometryProps](./shape/PlaneGeometryProps.zh.md)
- [PolygonStyleProps](./shape/PolygonStyleProps.zh.md)
- [PolylineStyleProps](./shape/PolylineStyleProps.zh.md)
- [RectStyleProps](./shape/RectStyleProps.zh.md)
- [SphereGeometryProps](./shape/SphereGeometryProps.zh.md)
- [TextStyleProps](./shape/TextStyleProps.zh.md)
- [TorusGeometryProps](./shape/TorusGeometryProps.zh.md)
- [布局 layout](../layout/CircularLayoutOptions.zh.md)
- [CircularLayoutOptions](../layout/CircularLayoutOptions.zh.md)
- [ComboCombinedLayoutOptions](../layout/ComboCombinedLayoutOptions.zh.md)
- [ConcentricLayoutOptions](../layout/ConcentricLayoutOptions.zh.md)
- [D3ForceLayoutOptions](../layout/D3ForceLayoutOptions.zh.md)
- [DagreLayoutOptions](../layout/DagreLayoutOptions.zh.md)
- [ForceAtlas2LayoutOptions](../layout/ForceAtlas2LayoutOptions.zh.md)
- [ForceLayoutOptions](../layout/ForceLayoutOptions.zh.md)
- [FruchtermanLayoutOptions](../layout/FruchtermanLayoutOptions.zh.md)
- [GridLayoutOptions](../layout/GridLayoutOptions.zh.md)
- [MDSLayoutOptions](../layout/MDSLayoutOptions.zh.md)
- [RadialLayoutOptions](../layout/RadialLayoutOptions.zh.md)
- [自由插件 plugins](./plugins/FisheyeConfig.zh.md)
- [FisheyeConfig](./plugins/FisheyeConfig.zh.md)
- [GridConfig](./plugins/GridConfig.zh.md)
- [HistoryConfig](./plugins/HistoryConfig.zh.md)
- [LegendConfig](./plugins/LegendConfig.zh.md)
- [MenuConfig](./plugins/MenuConfig.zh.md)
- [MiniMapConfig](./plugins/MiniMapConfig.zh.md)
- [ToolbarConfig](./plugins/ToolbarConfig.zh.md)
- [TooltipConfig](./plugins/TooltipConfig.zh.md)
- TimebarConfig (TODO)
- Snapline (TODO)

View File

@ -1,37 +0,0 @@
---
title: GraphData
---
[Overview - v5.0.0-beta.21](../../README.en.md) / [Modules](../../modules.en.md) / [graph](../../modules/graph.en.md) / GraphData
[graph](../../modules/graph.en.md).GraphData
## Properties
### combos
`Optional` **combos**: `ComboUserModel`[]
#### Defined in
[packages/g6/src/types/data.ts:14](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/data.ts#L14)
---
### edges
`Optional` **edges**: `EdgeUserModel`[]
#### Defined in
[packages/g6/src/types/data.ts:13](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/data.ts#L13)
---
### nodes
`Optional` **nodes**: `NodeUserModel`[]
#### Defined in
[packages/g6/src/types/data.ts:12](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/data.ts#L12)

View File

@ -1,39 +0,0 @@
---
title: GraphData
---
> 📋 中文文档还在翻译中... 欢迎 PR
[Overview - v5.0.0-beta.21](../../README.zh.md) / [Modules](../../modules.zh.md) / [graph](../../modules/graph.zh.md) / GraphData
[graph](../../modules/graph.zh.md).GraphData
## Properties
### combos
`Optional` **combos**: `ComboUserModel`[]
#### Defined in
[packages/g6/src/types/data.ts:14](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/data.ts#L14)
---
### edges
`Optional` **edges**: `EdgeUserModel`[]
#### Defined in
[packages/g6/src/types/data.ts:13](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/data.ts#L13)
---
### nodes
`Optional` **nodes**: `NodeUserModel`[]
#### Defined in
[packages/g6/src/types/data.ts:12](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/data.ts#L12)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,306 +0,0 @@
---
title: Specification
---
[Overview - v5.0.0-beta.21](../../README.en.md) / [Modules](../../modules.en.md) / [graph](../../modules/graph.en.md) / Specification
[graph](../../modules/graph.en.md).Specification
## Type parameters
| Name | Type |
| :--- | :------------------------- |
| `B` | extends `BehaviorRegistry` |
| `T` | extends `ThemeRegistry` |
## Properties
### animate
`Optional` **animate**: `AnimateCfg`
global animate
#### Defined in
[packages/g6/src/types/spec.ts:114](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L114)
---
### autoFit
`Optional` **autoFit**: `"center"` \| `"view"` \| { `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `padding?`: `Padding` ; `rules?`: `FitViewRules` ; `type`: `"view"` } \| { `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `type`: `"center"` } \| { `alignment?`: `GraphAlignment` ; `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `position`: `Point` ; `type`: `"position"` }
#### Defined in
[packages/g6/src/types/spec.ts:50](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L50)
---
### backgroundCanvas
`Optional` **backgroundCanvas**: `Canvas`
#### Defined in
[packages/g6/src/types/spec.ts:37](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L37)
---
### canvas
`Optional` **canvas**: `Canvas`
#### Defined in
[packages/g6/src/types/spec.ts:38](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L38)
---
### combo
`Optional` **combo**: `ComboEncode` \| (`data`: `ComboModel`) => `ComboDisplayModel`
#### Defined in
[packages/g6/src/types/spec.ts:84](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L84)
---
### comboState
`Optional` **comboState**: `Object`
#### Index signature
▪ [stateName: `string`]: (`data`: `ComboModel`) => `ComboDisplayModel` \| `ComboShapesEncode`
#### Defined in
[packages/g6/src/types/spec.ts:97](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L97)
---
### container
`Optional` **container**: `string` \| `HTMLElement`
#### Defined in
[packages/g6/src/types/spec.ts:36](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L36)
---
### data
`Optional` **data**: `DataConfig`
data
#### Defined in
[packages/g6/src/types/spec.ts:72](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L72)
---
### edge
`Optional` **edge**: `EdgeEncode` \| (`data`: `EdgeModel`) => `EdgeDisplayModel`
#### Defined in
[packages/g6/src/types/spec.ts:83](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L83)
---
### edgeState
`Optional` **edgeState**: `Object`
#### Index signature
▪ [stateName: `string`]: (`data`: `EdgeModel`) => `EdgeDisplayModel` \| `EdgeShapesEncode`
#### Defined in
[packages/g6/src/types/spec.ts:92](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L92)
---
### enableStack
`Optional` **enableStack**: `boolean`
#### Defined in
[packages/g6/src/types/spec.ts:130](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L130)
---
### height
`Optional` **height**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:41](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L41)
---
### layout
`Optional` **layout**: `LayoutOptions` \| `LayoutOptions`[]
layout
#### Defined in
[packages/g6/src/types/spec.ts:104](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L104)
---
### mode
`Optional` **mode**: `string`
#### Defined in
[packages/g6/src/types/spec.ts:111](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L111)
---
### modes
`Optional` **modes**: `Object`
interaction
#### Index signature
▪ [mode: `string`]: `BehaviorOptionsOf`<`B`\>[]
#### Defined in
[packages/g6/src/types/spec.ts:107](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L107)
---
### node
`Optional` **node**: `NodeEncode` \| (`data`: `NodeModel`) => `NodeDisplayModel`
item
#### Defined in
[packages/g6/src/types/spec.ts:82](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L82)
---
### nodeState
`Optional` **nodeState**: `Object`
item state styles
#### Index signature
▪ [stateName: `string`]: (`data`: `NodeModel`) => `NodeDisplayModel` \| `NodeShapesEncode`
#### Defined in
[packages/g6/src/types/spec.ts:87](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L87)
---
### optimizeThreshold
`Optional` **optimizeThreshold**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:69](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L69)
---
### plugins
`Optional` **plugins**: (`string` \| `Plugin` \| { `[cfgName: string]`: `unknown`; `key`: `string` ; `type`: `string` })[]
free plugins
#### Defined in
[packages/g6/src/types/spec.ts:117](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L117)
---
### renderer
`Optional` **renderer**: `RendererName` \| { `headless`: `boolean` ; `pixelRatio`: `number` ; `type`: `RendererName` }
#### Defined in
[packages/g6/src/types/spec.ts:42](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L42)
---
### stackCfg
`Optional` **stackCfg**: `StackCfg`
#### Defined in
[packages/g6/src/types/spec.ts:132](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L132)
---
### theme
`Optional` **theme**: `ThemeOptionsOf`<`T`\>
theme
#### Defined in
[packages/g6/src/types/spec.ts:128](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L128)
---
### transforms
`Optional` **transforms**: `string`[] \| { `[param: string]`: `unknown`; `type`: `string` }[] \| `TransformerFn`[]
#### Defined in
[packages/g6/src/types/spec.ts:73](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L73)
---
### transientCanvas
`Optional` **transientCanvas**: `Canvas`
#### Defined in
[packages/g6/src/types/spec.ts:39](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L39)
---
### width
`Optional` **width**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:40](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L40)
---
### zoom
`Optional` **zoom**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:49](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L49)

View File

@ -1,308 +0,0 @@
---
title: Specification
---
> 📋 中文文档还在翻译中... 欢迎 PR
[Overview - v5.0.0-beta.21](../../README.zh.md) / [Modules](../../modules.zh.md) / [graph](../../modules/graph.zh.md) / Specification
[graph](../../modules/graph.zh.md).Specification
## Type parameters
| Name | Type |
| :--- | :------------------------- |
| `B` | extends `BehaviorRegistry` |
| `T` | extends `ThemeRegistry` |
## Properties
### animate
`Optional` **animate**: `AnimateCfg`
global animate
#### Defined in
[packages/g6/src/types/spec.ts:114](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L114)
---
### autoFit
`Optional` **autoFit**: `"center"` \| `"view"` \| { `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `padding?`: `Padding` ; `rules?`: `FitViewRules` ; `type`: `"view"` } \| { `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `type`: `"center"` } \| { `alignment?`: `GraphAlignment` ; `effectTiming?`: `Partial`<`Pick`<`IAnimationEffectTiming`, `"duration"` \| `"easing"` \| `"easingFunction"`\>\> ; `position`: `Point` ; `type`: `"position"` }
#### Defined in
[packages/g6/src/types/spec.ts:50](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L50)
---
### backgroundCanvas
`Optional` **backgroundCanvas**: `Canvas`
#### Defined in
[packages/g6/src/types/spec.ts:37](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L37)
---
### canvas
`Optional` **canvas**: `Canvas`
#### Defined in
[packages/g6/src/types/spec.ts:38](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L38)
---
### combo
`Optional` **combo**: `ComboEncode` \| (`data`: `ComboModel`) => `ComboDisplayModel`
#### Defined in
[packages/g6/src/types/spec.ts:84](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L84)
---
### comboState
`Optional` **comboState**: `Object`
#### Index signature
▪ [stateName: `string`]: (`data`: `ComboModel`) => `ComboDisplayModel` \| `ComboShapesEncode`
#### Defined in
[packages/g6/src/types/spec.ts:97](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L97)
---
### container
`Optional` **container**: `string` \| `HTMLElement`
#### Defined in
[packages/g6/src/types/spec.ts:36](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L36)
---
### data
`Optional` **data**: `DataConfig`
data
#### Defined in
[packages/g6/src/types/spec.ts:72](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L72)
---
### edge
`Optional` **edge**: `EdgeEncode` \| (`data`: `EdgeModel`) => `EdgeDisplayModel`
#### Defined in
[packages/g6/src/types/spec.ts:83](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L83)
---
### edgeState
`Optional` **edgeState**: `Object`
#### Index signature
▪ [stateName: `string`]: (`data`: `EdgeModel`) => `EdgeDisplayModel` \| `EdgeShapesEncode`
#### Defined in
[packages/g6/src/types/spec.ts:92](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L92)
---
### enableStack
`Optional` **enableStack**: `boolean`
#### Defined in
[packages/g6/src/types/spec.ts:130](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L130)
---
### height
`Optional` **height**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:41](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L41)
---
### layout
`Optional` **layout**: `LayoutOptions` \| `LayoutOptions`[]
layout
#### Defined in
[packages/g6/src/types/spec.ts:104](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L104)
---
### mode
`Optional` **mode**: `string`
#### Defined in
[packages/g6/src/types/spec.ts:111](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L111)
---
### modes
`Optional` **modes**: `Object`
interaction
#### Index signature
▪ [mode: `string`]: `BehaviorOptionsOf`<`B`\>[]
#### Defined in
[packages/g6/src/types/spec.ts:107](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L107)
---
### node
`Optional` **node**: `NodeEncode` \| (`data`: `NodeModel`) => `NodeDisplayModel`
item
#### Defined in
[packages/g6/src/types/spec.ts:82](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L82)
---
### nodeState
`Optional` **nodeState**: `Object`
item state styles
#### Index signature
▪ [stateName: `string`]: (`data`: `NodeModel`) => `NodeDisplayModel` \| `NodeShapesEncode`
#### Defined in
[packages/g6/src/types/spec.ts:87](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L87)
---
### optimizeThreshold
`Optional` **optimizeThreshold**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:69](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L69)
---
### plugins
`Optional` **plugins**: (`string` \| `Plugin` \| { `[cfgName: string]`: `unknown`; `key`: `string` ; `type`: `string` })[]
free plugins
#### Defined in
[packages/g6/src/types/spec.ts:117](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L117)
---
### renderer
`Optional` **renderer**: `RendererName` \| { `headless`: `boolean` ; `pixelRatio`: `number` ; `type`: `RendererName` }
#### Defined in
[packages/g6/src/types/spec.ts:42](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L42)
---
### stackCfg
`Optional` **stackCfg**: `StackCfg`
#### Defined in
[packages/g6/src/types/spec.ts:132](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L132)
---
### theme
`Optional` **theme**: `ThemeOptionsOf`<`T`\>
theme
#### Defined in
[packages/g6/src/types/spec.ts:128](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L128)
---
### transforms
`Optional` **transforms**: `string`[] \| { `[param: string]`: `unknown`; `type`: `string` }[] \| `TransformerFn`[]
#### Defined in
[packages/g6/src/types/spec.ts:73](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L73)
---
### transientCanvas
`Optional` **transientCanvas**: `Canvas`
#### Defined in
[packages/g6/src/types/spec.ts:39](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L39)
---
### width
`Optional` **width**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:40](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L40)
---
### zoom
`Optional` **zoom**: `number`
#### Defined in
[packages/g6/src/types/spec.ts:49](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/spec.ts#L49)

View File

@ -1,188 +0,0 @@
---
title: NodeUserModelData
---
[Overview - v5.0.0-beta.21](../../README.en.md) / [Modules](../../modules.en.md) / [item](../../modules/item.en.md) / NodeUserModelData
[item](../../modules/item.en.md).NodeUserModelData
Data in user input model.
## Hierarchy
- `PlainObject`
**`NodeUserModelData`**
## Properties
### anchorPoints
`Optional` **anchorPoints**: `number`[][]
The ratio position of the keyShape for related edges linking into. e.g. `[[0,0.5],[1,0.5]]`
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:73](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L73)
---
### badges
`Optional` **badges**: { `position`: [`BadgePosition`](../../enums/item/BadgePosition.en.md) ; `text`: `string` ; `type`: `"text"` \| `"icon"` }[]
The badges to show on the node.
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:78](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L78)
---
### color
`Optional` **color**: `string`
The subject color of the node's keyShape and anchor points.
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:42](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L42)
---
### icon
`Optional` **icon**: `Object`
The icon to show on the node.
More styles should be configured in node mapper.
#### Type declaration
| Name | Type |
| :------ | :------------------- |
| `img?` | `string` |
| `text?` | `string` |
| `type` | `"text"` \| `"icon"` |
#### Defined in
[packages/g6/src/types/node.ts:64](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L64)
---
### isRoot
`Optional` **isRoot**: `boolean`
Whether to be a root at when used as a tree.
#### Defined in
[packages/g6/src/types/node.ts:59](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L59)
---
### label
`Optional` **label**: `string`
The text to show on the node.
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:47](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L47)
---
### parentId
`Optional` **parentId**: `ID`
The id of parent combo.
#### Defined in
[packages/g6/src/types/node.ts:55](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L55)
---
### preventPolylineEdgeOverlap
`Optional` **preventPolylineEdgeOverlap**: `boolean`
Whether to prevent overlap with unassociated edges.
- Used to preempt position.
- Defaults to false.
- Only valid for polyline
#### Defined in
[packages/g6/src/types/node.ts:89](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L89)
---
### type
`Optional` **type**: `string`
The type of node, e.g. `circle-node`.
#### Defined in
[packages/g6/src/types/node.ts:37](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L37)
---
### visible
`Optional` **visible**: `boolean`
Whether show the node by default.
#### Defined in
[packages/g6/src/types/node.ts:51](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L51)
---
### x
`Optional` **x**: `number`
The x-coordinate of node.
#### Defined in
[packages/g6/src/types/node.ts:25](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L25)
---
### y
`Optional` **y**: `number`
The y-coordinate of node.
#### Defined in
[packages/g6/src/types/node.ts:29](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L29)
---
### z
`Optional` **z**: `number`
The z-coordinate of node.
#### Defined in
[packages/g6/src/types/node.ts:33](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L33)

View File

@ -1,190 +0,0 @@
---
title: NodeUserModelData
---
> 📋 中文文档还在翻译中... 欢迎 PR
[Overview - v5.0.0-beta.21](../../README.zh.md) / [Modules](../../modules.zh.md) / [item](../../modules/item.zh.md) / NodeUserModelData
[item](../../modules/item.zh.md).NodeUserModelData
Data in user input model.
## Hierarchy
- `PlainObject`
**`NodeUserModelData`**
## Properties
### anchorPoints
`Optional` **anchorPoints**: `number`[][]
The ratio position of the keyShape for related edges linking into. e.g. `[[0,0.5],[1,0.5]]`
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:73](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L73)
---
### badges
`Optional` **badges**: { `position`: [`BadgePosition`](../../enums/item/BadgePosition.zh.md) ; `text`: `string` ; `type`: `"text"` \| `"icon"` }[]
The badges to show on the node.
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:78](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L78)
---
### color
`Optional` **color**: `string`
The subject color of the node's keyShape and anchor points.
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:42](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L42)
---
### icon
`Optional` **icon**: `Object`
The icon to show on the node.
More styles should be configured in node mapper.
#### Type declaration
| Name | Type |
| :------ | :------------------- |
| `img?` | `string` |
| `text?` | `string` |
| `type` | `"text"` \| `"icon"` |
#### Defined in
[packages/g6/src/types/node.ts:64](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L64)
---
### isRoot
`Optional` **isRoot**: `boolean`
Whether to be a root at when used as a tree.
#### Defined in
[packages/g6/src/types/node.ts:59](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L59)
---
### label
`Optional` **label**: `string`
The text to show on the node.
More styles should be configured in node mapper.
#### Defined in
[packages/g6/src/types/node.ts:47](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L47)
---
### parentId
`Optional` **parentId**: `ID`
The id of parent combo.
#### Defined in
[packages/g6/src/types/node.ts:55](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L55)
---
### preventPolylineEdgeOverlap
`Optional` **preventPolylineEdgeOverlap**: `boolean`
Whether to prevent overlap with unassociated edges.
- Used to preempt position.
- Defaults to false.
- Only valid for polyline
#### Defined in
[packages/g6/src/types/node.ts:89](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L89)
---
### type
`Optional` **type**: `string`
The type of node, e.g. `circle-node`.
#### Defined in
[packages/g6/src/types/node.ts:37](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L37)
---
### visible
`Optional` **visible**: `boolean`
Whether show the node by default.
#### Defined in
[packages/g6/src/types/node.ts:51](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L51)
---
### x
`Optional` **x**: `number`
The x-coordinate of node.
#### Defined in
[packages/g6/src/types/node.ts:25](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L25)
---
### y
`Optional` **y**: `number`
The y-coordinate of node.
#### Defined in
[packages/g6/src/types/node.ts:29](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L29)
---
### z
`Optional` **z**: `number`
The z-coordinate of node.
#### Defined in
[packages/g6/src/types/node.ts:33](https://github.com/antvis/G6/blob/61e525e59b/packages/g6/src/types/node.ts#L33)

View File

@ -66,7 +66,7 @@ An object that contains some new shapes to be added to the node.
### calculateAnchorPosition
**calculateAnchorPosition**(`keyShapeStyle`): [`IAnchorPositionMap`](../../interfaces/item/IAnchorPositionMap.en.md)
**calculateAnchorPosition**(`keyShapeStyle`): [`IAnchorPositionMap`](../shape/IAnchorPositionMap.en.md)
Configures the anchor positions based on the provided keyShapeStyle and returns the configuration.
e.g for a CircleNode, it returns: `{"right":keyShapeStyle.x+keyShapeStyle.r, keyShapeStyle.y}`
@ -79,7 +79,7 @@ e.g for a CircleNode, it returns: `{"right":keyShapeStyle.x+keyShapeStyle.r, key
#### Returns
[`IAnchorPositionMap`](../../interfaces/item/IAnchorPositionMap.en.md)
[`IAnchorPositionMap`](../shape/IAnchorPositionMap.en.md)
The anchor position configuration as an IAnchorPositionMap object.
@ -102,16 +102,16 @@ You should call `drawKeyShape` and `drawAnchorShape`,`drawLabelShape`,`drawIconS
#### Parameters
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :----------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -137,16 +137,16 @@ Draw the anchors shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -172,16 +172,16 @@ Draw the badges shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -207,16 +207,16 @@ Draw the halo shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -242,16 +242,16 @@ Draw the icon shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -278,16 +278,16 @@ Draw the key shape of the node based on the provided model and shape map.
#### Parameters
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :----------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -313,16 +313,16 @@ Draw the label background shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.newState` | `State`[] | - |
| `diffState.oldState` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.newState` | `State`[] | - |
| `diffState.oldState` | `State`[] | - |
#### Returns
@ -348,16 +348,16 @@ Draw the label shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -383,16 +383,16 @@ Draw other shapes(such as preRect,stateIcon) of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.en.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -412,7 +412,7 @@ The display object representing the other shapes of the node.
### getMergedStyles
**getMergedStyles**(`model`): [`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.en.md)
**getMergedStyles**(`model`): [`NodeShapeStyles`](../../shape/NodeShapeStyles.en.md)
Merge style
@ -424,7 +424,7 @@ Merge style
#### Returns
[`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.en.md)
[`NodeShapeStyles`](../../shape/NodeShapeStyles.en.md)
The merged styles as a NodeShapeStyles object.
@ -528,13 +528,13 @@ Create (if does not exit in shapeMap) or update the shape according to the confi
#### Parameters
| Name | Type | Description |
| :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| `type` | `SHAPE_TYPE` \| `SHAPE_TYPE_3D` | shape's type |
| `id` | `string` | unique string to indicates the shape |
| `style` | `Partial`<[`CircleStyleProps`](../../interfaces/item/CircleStyleProps.en.md) & [`RectStyleProps`](../../interfaces/item/RectStyleProps.en.md) & [`EllipseStyleProps`](../../interfaces/item/EllipseStyleProps.en.md) & [`PolygonStyleProps`](../../interfaces/item/PolygonStyleProps.en.md) & [`LineStyleProps`](../../interfaces/item/LineStyleProps.en.md) & [`PolylineStyleProps`](../../interfaces/item/PolylineStyleProps.en.md) & [`TextStyleProps`](../../interfaces/item/TextStyleProps.en.md) & [`ImageStyleProps`](../../interfaces/item/ImageStyleProps.en.md) & [`PathStyleProps`](../../interfaces/item/PathStyleProps.en.md) & [`SphereGeometryProps`](../../interfaces/item/SphereGeometryProps.en.md) & [`CubeGeometryProps`](../../interfaces/item/CubeGeometryProps.en.md) & [`PlaneGeometryProps`](../../interfaces/item/PlaneGeometryProps.en.md) & { `interactive?`: `boolean` } & { `animates?`: `IAnimates` ; `lod?`: `number` ; `visible?`: `boolean` }\> | style to be updated |
| `shapeMap` | `NodeShapeMap` | the shape map of a node / combo |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | data model of the node / combo |
| Name | Type | Description |
| :--------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| `type` | `SHAPE_TYPE` \| `SHAPE_TYPE_3D` | shape's type |
| `id` | `string` | unique string to indicates the shape |
| `style` | `Partial`<[`CircleStyleProps`](../../shape/CircleStyleProps.en.md) & [`RectStyleProps`](../../shape/RectStyleProps.en.md) & [`EllipseStyleProps`](../../shape/EllipseStyleProps.en.md) & [`PolygonStyleProps`](../../shape/PolygonStyleProps.en.md) & [`LineStyleProps`](../shape/LineStyleProps.en.md) & [`PolylineStyleProps`](../../shape/PolylineStyleProps.en.md) & [`TextStyleProps`](../../shape/TextStyleProps.en.md) & [`ImageStyleProps`](../../shape/ImageStyleProps.en.md) & [`PathStyleProps`](../../shape/PathStyleProps.en.md) & [`SphereGeometryProps`](../../shape/SphereGeometryProps.en.md) & [`CubeGeometryProps`](../../shape/CubeGeometryProps.en.md) & [`PlaneGeometryProps`](../../shape/PlaneGeometryProps.en.md) & { `interactive?`: `boolean` } & { `animates?`: `IAnimates` ; `lod?`: `number` ; `visible?`: `boolean` }\> | style to be updated |
| `shapeMap` | `NodeShapeMap` | the shape map of a node / combo |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | data model of the node / combo |
#### Returns
@ -612,7 +612,7 @@ The display object representing the shape.
### mergedStyles
**mergedStyles**: [`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.en.md)
**mergedStyles**: [`NodeShapeStyles`](../../shape/NodeShapeStyles.en.md)
#### Overrides
@ -658,7 +658,7 @@ Set the state for the node.
### themeStyles
**themeStyles**: [`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.en.md) \| `ComboShapeStyles`
**themeStyles**: [`NodeShapeStyles`](../../shape/NodeShapeStyles.en.md) \| `ComboShapeStyles`
#### Inherited from

View File

@ -68,7 +68,7 @@ An object that contains some new shapes to be added to the node.
### calculateAnchorPosition
**calculateAnchorPosition**(`keyShapeStyle`): [`IAnchorPositionMap`](../../interfaces/item/IAnchorPositionMap.zh.md)
**calculateAnchorPosition**(`keyShapeStyle`): [`IAnchorPositionMap`](../shape/IAnchorPositionMap.zh.md)
Configures the anchor positions based on the provided keyShapeStyle and returns the configuration.
e.g for a CircleNode, it returns: `{"right":keyShapeStyle.x+keyShapeStyle.r, keyShapeStyle.y}`
@ -81,7 +81,7 @@ e.g for a CircleNode, it returns: `{"right":keyShapeStyle.x+keyShapeStyle.r, key
#### Returns
[`IAnchorPositionMap`](../../interfaces/item/IAnchorPositionMap.zh.md)
[`IAnchorPositionMap`](../shape/IAnchorPositionMap.zh.md)
The anchor position configuration as an IAnchorPositionMap object.
@ -104,16 +104,16 @@ You should call `drawKeyShape` and `drawAnchorShape`,`drawLabelShape`,`drawIconS
#### Parameters
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :----------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -139,16 +139,16 @@ Draw the anchors shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -174,16 +174,16 @@ Draw the badges shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -209,16 +209,16 @@ Draw the halo shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -244,16 +244,16 @@ Draw the icon shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -280,16 +280,16 @@ Draw the key shape of the node based on the provided model and shape map.
#### Parameters
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :----------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -315,16 +315,16 @@ Draw the label background shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.newState` | `State`[] | - |
| `diffState.oldState` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.newState` | `State`[] | - |
| `diffState.oldState` | `State`[] | - |
#### Returns
@ -350,16 +350,16 @@ Draw the label shape of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -385,16 +385,16 @@ Draw other shapes(such as preRect,stateIcon) of the node
#### Parameters
| Name | Type | Description |
| :------------------- | :--------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../../interfaces/item/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
| Name | Type | Description |
| :------------------- | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | The displayed model of this node, only for drawing and not received by users. |
| `shapeMap` | `NodeShapeMap` | The shape map that contains all of the elements to show on the node. |
| `diffData?` | `Object` | An object that contains previous and current data. |
| `diffData.current` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffData.previous` | [`NodeUserModelData`](../data/NodeUserModelData.zh.md) \| `ComboModelData` | - |
| `diffState?` | `Object` | An object that contains previous and current node's state. |
| `diffState.current` | `State`[] | - |
| `diffState.previous` | `State`[] | - |
#### Returns
@ -414,7 +414,7 @@ The display object representing the other shapes of the node.
### getMergedStyles
**getMergedStyles**(`model`): [`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.zh.md)
**getMergedStyles**(`model`): [`NodeShapeStyles`](../../shape/NodeShapeStyles.zh.md)
Merge style
@ -426,7 +426,7 @@ Merge style
#### Returns
[`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.zh.md)
[`NodeShapeStyles`](../../shape/NodeShapeStyles.zh.md)
The merged styles as a NodeShapeStyles object.
@ -530,13 +530,13 @@ Create (if does not exit in shapeMap) or update the shape according to the confi
#### Parameters
| Name | Type | Description |
| :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| `type` | `SHAPE_TYPE` \| `SHAPE_TYPE_3D` | shape's type |
| `id` | `string` | unique string to indicates the shape |
| `style` | `Partial`<[`CircleStyleProps`](../../interfaces/item/CircleStyleProps.zh.md) & [`RectStyleProps`](../../interfaces/item/RectStyleProps.zh.md) & [`EllipseStyleProps`](../../interfaces/item/EllipseStyleProps.zh.md) & [`PolygonStyleProps`](../../interfaces/item/PolygonStyleProps.zh.md) & [`LineStyleProps`](../../interfaces/item/LineStyleProps.zh.md) & [`PolylineStyleProps`](../../interfaces/item/PolylineStyleProps.zh.md) & [`TextStyleProps`](../../interfaces/item/TextStyleProps.zh.md) & [`ImageStyleProps`](../../interfaces/item/ImageStyleProps.zh.md) & [`PathStyleProps`](../../interfaces/item/PathStyleProps.zh.md) & [`SphereGeometryProps`](../../interfaces/item/SphereGeometryProps.zh.md) & [`CubeGeometryProps`](../../interfaces/item/CubeGeometryProps.zh.md) & [`PlaneGeometryProps`](../../interfaces/item/PlaneGeometryProps.zh.md) & { `interactive?`: `boolean` } & { `animates?`: `IAnimates` ; `lod?`: `number` ; `visible?`: `boolean` }\> | style to be updated |
| `shapeMap` | `NodeShapeMap` | the shape map of a node / combo |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | data model of the node / combo |
| Name | Type | Description |
| :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| `type` | `SHAPE_TYPE` \| `SHAPE_TYPE_3D` | shape's type |
| `id` | `string` | unique string to indicates the shape |
| `style` | `Partial`<[`CircleStyleProps`](../../shape/CircleStyleProps.zh.md) & [`RectStyleProps`](../../shape/RectStyleProps.zh.md) & [`EllipseStyleProps`](../../shape/EllipseStyleProps.zh.md) & [`PolygonStyleProps`](../../shape/PolygonStyleProps.zh.md) & [`LineStyleProps`](../../shape/LineStyleProps.zh.md) & [`PolylineStyleProps`](../../shape/PolylineStyleProps.zh.md) & [`TextStyleProps`](../../shape/TextStyleProps.zh.md) & [`ImageStyleProps`](../../shape/ImageStyleProps.zh.md) & [`PathStyleProps`](../../shape/PathStyleProps.zh.md) & [`SphereGeometryProps`](../../shape/SphereGeometryProps.zh.md) & [`CubeGeometryProps`](../../shape/CubeGeometryProps.zh.md) & [`PlaneGeometryProps`](../../shape/PlaneGeometryProps.zh.md) & { `interactive?`: `boolean` } & { `animates?`: `IAnimates` ; `lod?`: `number` ; `visible?`: `boolean` }\> | style to be updated |
| `shapeMap` | `NodeShapeMap` | the shape map of a node / combo |
| `model` | `NodeDisplayModel` \| `ComboDisplayModel` | data model of the node / combo |
#### Returns
@ -614,7 +614,7 @@ The display object representing the shape.
### mergedStyles
**mergedStyles**: [`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.zh.md)
**mergedStyles**: [`NodeShapeStyles`](../../shape/NodeShapeStyles.zh.md)
#### Overrides
@ -660,7 +660,7 @@ Set the state for the node.
### themeStyles
**themeStyles**: [`NodeShapeStyles`](../../interfaces/item/NodeShapeStyles.zh.md) \| `ComboShapeStyles`
**themeStyles**: [`NodeShapeStyles`](../../shape/NodeShapeStyles.zh.md) \| `ComboShapeStyles`
#### Inherited from

Some files were not shown because too many files have changed in this diff Show More