Loading...
title: Built-in Extensions order: 4
The G6 built-in extensions and registered types are as follows:
| Extension | Registration Type |
|---|---|
| ComboCollapse | 'combo-collapse' |
| ComboExpand | 'combo-expand' |
| NodeCollapse | 'node-collapse' |
| NodeExpand | 'node-expand' |
| PathIn | 'path-in' |
| PathOut | 'path-out' |
| Fade | 'fade' |
| Translate | 'translate' |
Usage:
In GraphOptions.[node|edge|combo].animation.[stage], for example:
const graph = new Graph({// ... other optionsnode: {animation: {update: 'translate', // Only use translation animation in the update stage},},});
| Extension | Registration Type | Description |
|---|---|---|
| BrushSelect | 'brush-select' | / |
| ClickSelect | 'click-select' | / |
| CollapseExpand | 'collapse-expand' | / |
| CreateEdge | 'create-edge' | / |
| DragCanvas | 'drag-canvas' | / |
| DragElementForce | 'drag-element-force' | Drag element when use d3-force layout |
| DragElement | 'drag-element' | / |
| FixElementSize | 'fix-element-size' | Keep the size of element during zooming canvas |
| FocusElement | 'focus-element' | / |
| HoverActivate | 'hover-activate' | / |
| LassoSelect | 'lasso-select' | / |
| OptimizeViewportTransform | 'optimize-viewport-transform' | Hide elements during manipulate the canvas |
| ScrollCanvas | 'scroll-canvas' | / |
| ZoomCanvas | 'zoom-canvas' | / |
Usage:
In GraphOptions.behaviors, for example:
const graph = new Graph({// ... other optionsbehaviors: ['drag-canvas', 'zoom-canvas', 'drag-node'],});
| Extension | Registration Type |
|---|---|
| circle | Circle |
| diamond | Diamond |
| ellipse | Ellipse |
| hexagon | Hexagon |
| html | HTML |
| image | Image |
| rect | Rect |
| star | Star |
| donut | Donut |
| triangle | Triangle |
Usage:
1. In GraphOptions.data.nodes[number].type;
2. In GraphOptions.node.type;
const graph = new Graph({// ... other optionsdata: {nodes: [{ id: 'node-1', type: 'circle' }],},node: {type: 'circle',},});
| Extension | Registration Type | Description |
|---|---|---|
| Cubic | 'cubic' | Cubic Bezier Curve |
| Line | 'line' | / |
| Polyline | 'polyline' | / |
| Quadratic | 'quadratic' | Quadratic Bezier Curve |
| CubicHorizontal | 'cubic-horizontal' | Horizontal Cubic Bezier Curve |
| CubicVertical | 'cubic-vertical' | Vertical Cubic Bezier Curve |
| CubicRadial | 'cubic-radial' | Radial Cubic Bezier Curve |
Usage(like Nodes):
1. In GraphOptions.data.edges[number].type;
2. In GraphOptions.edge.type;
| Extension | Registration Type |
|---|---|
| CircleCombo | 'circle' |
| RectCombo | 'rect' |
Usage(like Nodes):
1. In GraphOptions.data.combos[number].type;
2. In GraphOptions.combo.type;
| Extension | Registration Type | Description |
|---|---|---|
| AntVDagreLayout | 'antv-dagre' | / |
| ComboCombinedLayout | 'combo-combined' | / |
| CompactBoxLayout | 'compact-box' | / |
| ForceAtlas2Layout | 'force-atlas2' | / |
| CircularLayout | 'circular' | / |
| ConcentricLayout | 'concentric' | / |
| D3ForceLayout | 'd3-force' | / |
| DagreLayout | 'dagre' | / |
| DendrogramLayout | 'dendrogram' | / |
| ForceLayout | 'force' | / |
| FruchtermanLayout | 'fruchterman' | / |
| GridLayout | 'grid' | / |
| IndentedLayout | 'indented' | / |
| MDSLayout | 'mds' | Multidimensional Scaling Layout |
| MindmapLayout | 'mindmap' | / |
| RadialLayout | 'radial' | / |
| RandomLayout | 'random' | / |
Usage:
In GraphOptions.layout, for example:
const graph = new Graph({// ... other optionslayout: {type: 'force',},});
Usage:
In GraphOptions.[node|edge|combo].palette, for example:
const graph = new Graph({// ... other optionsnode: {palette: 'tableau',},});
| Registration Type |
|---|
| dark |
| light |
Usage:
In GraphOptions.theme, for example:
const graph = new Graph({// ... other optionstheme: 'dark',});
| Extension | Registration Type |
|---|---|
| BubbleSets | 'bubble-sets' |
| EdgeFilterLens | 'edge-filter-lens' |
| GridLine | 'grid-line' |
| Background | 'background' |
| Contextmenu | 'contextmenu' |
| Fisheye | 'fisheye' |
| Fullscreen | 'fullscreen' |
| History | 'history' |
| Hull | 'hull' |
| Legend | 'legend' |
| Minimap | 'minimap' |
| Snapline | 'snapline' |
| Timebar | 'timebar' |
| Toolbar | 'toolbar' |
| Tooltip | 'tooltip' |
| Watermark | 'watermark' |
Usage:
In GraphOptions.plugins, for example:
const graph = new Graph({// ... other optionsplugins: ['minimap', 'contextmenu'],});
| Extension | Registration Type | Description |
|---|---|---|
| ProcessParallelEdges | 'process-parallel-edges' | / |
| PlaceRadialLabels | 'place-radial-labels' | 径向标签 |
Usage:
In GraphOptions.transform, for example:
const graph = new Graph({// ... other optionstransform: ['process-parallel-edges', 'place-radial-labels'],});
| Registration Type |
|---|
| circle |
| ellipse |
| group |
| html |
| image |
| line |
| path |
| polygon |
| polyline |
| rect |
| text |
| label |
| badge |
Usage:
In the upsert method of the element class when customizing the shape, pass the second parameter:
this.upsert('shape-key', 'text', { text: 'label', fontSize: 16 }, this);