mirror of
https://gitee.com/antv/g6.git
synced 2024-12-04 20:59:15 +08:00
refactor: using extends layout with registerlayout
This commit is contained in:
parent
da7d439eea
commit
d12f7c94f9
@ -1,9 +0,0 @@
|
|||||||
import { CircularLayout } from '@antv/layout/lib/layout/circular';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('circular', CircularLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { ComboForceLayout } from '@antv/layout/lib/layout/comboForce';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('comboForce', ComboForceLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { ConcentricLayout } from '@antv/layout/lib/layout/concentric';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('concentric', ConcentricLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { DagreLayout } from '@antv/layout/lib/layout/dagre';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('dagre', DagreLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { ForceLayout } from '@antv/layout/lib/layout/force';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('force', ForceLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { FruchtermanLayout } from '@antv/layout/lib/layout/fruchterman';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('fruchterman', FruchtermanLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { GForceLayout } from '@antv/layout/lib/layout/gForce';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('gForce', GForceLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { GridLayout } from '@antv/layout/lib/layout/grid';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('grid', GridLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { MDSLayout } from '@antv/layout/lib/layout/mds';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('mds', MDSLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -1,9 +0,0 @@
|
|||||||
import { RadialLayout } from '@antv/layout/lib/layout/radial';
|
|
||||||
import { getExtender } from '../../util/extend';
|
|
||||||
|
|
||||||
function layoutExtender(option: any, G6: { registerLayout: Function; }) {
|
|
||||||
const { registerLayout } = G6;
|
|
||||||
registerLayout('radial', RadialLayout);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default getExtender(layoutExtender);
|
|
@ -39,7 +39,6 @@ const G6 = {
|
|||||||
registerCombo,
|
registerCombo,
|
||||||
registerEdge,
|
registerEdge,
|
||||||
registerNode,
|
registerNode,
|
||||||
extend,
|
|
||||||
Algorithm,
|
Algorithm,
|
||||||
Arrow,
|
Arrow,
|
||||||
Marker,
|
Marker,
|
||||||
|
@ -24,7 +24,7 @@ for (let i = 0; i < 10; i++) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BasicProps {}
|
export interface BasicProps { }
|
||||||
|
|
||||||
export const BasicDemo = () => {
|
export const BasicDemo = () => {
|
||||||
const ref = React.useRef(null);
|
const ref = React.useRef(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user