Skip to content

Commit

Permalink
docs: add concentric demo (#5531)
Browse files Browse the repository at this point in the history
* docs: add Concentric demo

* chore: remove unused config

* chore: fix cr
  • Loading branch information
hustcc committed Mar 14, 2024
1 parent bdc3a6c commit b0804ab
Show file tree
Hide file tree
Showing 8 changed files with 8,177 additions and 35 deletions.
1,382 changes: 1,382 additions & 0 deletions packages/g6/__tests__/dataset/gene.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/g6/__tests__/demo/case/index.ts
Expand Up @@ -15,6 +15,7 @@ export * from './layout-circular-configuration-translate';
export * from './layout-circular-degree';
export * from './layout-circular-division';
export * from './layout-circular-spiral';
export * from './layout-concentric';
export * from './layout-fruchterman-basic';
export * from './layout-fruchterman-cluster';
export * from './layout-fruchterman-fix';
Expand Down
35 changes: 35 additions & 0 deletions packages/g6/__tests__/demo/case/layout-concentric.ts
@@ -0,0 +1,35 @@
import { Graph } from '@/src';
import data from '@@/dataset/gene.json';
import type { STDTestCase } from '../types';

export const layoutConcentric: STDTestCase = async (context) => {
const graph = new Graph({
...context,
autoFit: 'center',
data,
behaviors: ['zoom-canvas', 'drag-canvas', 'drag-node'],
layout: {
type: 'concentric',
maxLevelDiff: 0.5,
preventOverlap: true,
},
node: {
style: {
size: 5,
stroke: '#5B8FF9',
fill: '#C6E5FF',
lineWidth: 1,
},
},
edge: {
style: {
stroke: '#E2E2E2',
},
},
animation: false,
});

await graph.render();

return graph;
};

0 comments on commit b0804ab

Please sign in to comment.