Skip to content

Commit

Permalink
feat: add hover-element behavior (#5579)
Browse files Browse the repository at this point in the history
* feat: add hover-element behavior definition

* feat: add hover-element behavior

* test: add uts

* feat: add site demos

* feat: add unit test

* fix: cr issues

* fix: cr issues

* fix: cr issues
  • Loading branch information
yvonneyx authored Mar 25, 2024
1 parent 1885a29 commit 5566f74
Show file tree
Hide file tree
Showing 34 changed files with 22,969 additions and 295 deletions.
25 changes: 25 additions & 0 deletions packages/g6/__tests__/demo/case/behavior-hover-element.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Graph } from '@/src';
import data from '@@/dataset/cluster.json';
import type { STDTestCase } from '../types';

export const behaviorHoverElement: STDTestCase = async (context) => {
const graph = new Graph({
...context,
data: data,
layout: {
type: 'd3force',
linkDistance: 150,
},
node: {
style: {
size: 20,
},
},
zoomRange: [0.5, 5],
behaviors: [{ type: 'hover-element' }],
});

await graph.render();

return graph;
};
1 change: 1 addition & 0 deletions packages/g6/__tests__/demo/case/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './behavior-drag-canvas';
export * from './behavior-drag-element';
export * from './behavior-hover-element';
export * from './behavior-zoom-canvas';
export * from './combo';
export * from './combo-expand-collapse';
Expand Down
Loading

0 comments on commit 5566f74

Please sign in to comment.