mirror of
https://gitee.com/antv/g6.git
synced 2024-12-15 01:51:00 +08:00
27 lines
516 B
JavaScript
27 lines
516 B
JavaScript
/**
|
|
* @fileOverview 阿基米德螺线布局
|
|
* @author huangtonger@aliyun.com
|
|
*/
|
|
|
|
const G6 = require('@antv/g6');
|
|
const Layout = require('./layout');
|
|
|
|
G6.Layouts.ArchimeddeanSpiral = Layout;
|
|
|
|
class Plugin {
|
|
constructor(options) {
|
|
this.options = options;
|
|
}
|
|
init() {
|
|
const graph = this.graph;
|
|
graph.on('beforeinit', () => {
|
|
const layout = new Layout(this.options);
|
|
graph.set('layout', layout);
|
|
});
|
|
}
|
|
}
|
|
|
|
G6.Plugins['layout.archimeddeanSpiral'] = Plugin;
|
|
|
|
module.exports = Plugin;
|