Files
lan-manager/web/node_modules/@antv/g6-pc/es/layout/tree-layout.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

34 lines
951 B
JavaScript

import Hierarchy from '@antv/hierarchy';
import Util from '../util';
var radialLayout = Util.radialLayout;
var TreeLayout = /** @class */function () {
function TreeLayout(cfg) {
this.type = cfg.type;
this.radial = cfg.radial;
this.config = cfg;
}
TreeLayout.prototype.init = function (data) {
var _this = this;
this.data = data;
if (this.radial) {
this.layoutMethod = function (data) {
var layoutData = Hierarchy[_this.type](data, _this.config);
radialLayout(layoutData);
return layoutData;
};
return;
}
this.layoutMethod = function (data) {
return Hierarchy[_this.type](data, _this.config);
};
};
TreeLayout.prototype.execute = function () {
return this.layoutMethod(this.data, this.config);
};
TreeLayout.prototype.layout = function (data) {
this.init(data);
return this.execute();
};
return TreeLayout;
}();
export default TreeLayout;