-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
antv
committed
Aug 9, 2024
1 parent
556b315
commit 65b3901
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Graph } from '@antv/g6'; | ||
|
||
export const pluginMinimapImage: TestCase = async (context) => { | ||
const graph = new Graph({ | ||
...context, | ||
data: { | ||
nodes: Array.from({ length: 20 }).map((_, i) => ({ | ||
id: `node${i}`, | ||
style: { | ||
src: 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_Do9Tq7MxFQAAAAAAAAAAAAADmJ7AQ/original', | ||
}, | ||
})), | ||
}, | ||
behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element', 'hover-activate'], | ||
plugins: [ | ||
{ | ||
key: 'minimap', | ||
type: 'minimap', | ||
size: [240, 160], | ||
}, | ||
], | ||
node: { | ||
type: 'image', | ||
style: { | ||
opacity: 0.5, | ||
}, | ||
state: { | ||
active: { | ||
opacity: 1, | ||
}, | ||
}, | ||
}, | ||
layout: { type: 'circular' }, | ||
autoFit: 'view', | ||
}); | ||
|
||
await graph.render(); | ||
|
||
pluginMinimapImage.form = (panel) => { | ||
return []; | ||
}; | ||
|
||
return graph; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters