1 | function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
2 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
3 | var TreeLayout = require('./layout/base');
|
4 | var nonLayeredTidyTree = require('./layout/non-layered-tidy');
|
5 | var doTreeLayout = require('./layout/do-layout');
|
6 | var util = require('./util');
|
7 | var CompactBoxTreeLayout = function (_TreeLayout) {
|
8 | _inheritsLoose(CompactBoxTreeLayout, _TreeLayout);
|
9 | function CompactBoxTreeLayout() {
|
10 | return _TreeLayout.apply(this, arguments) || this;
|
11 | }
|
12 | var _proto = CompactBoxTreeLayout.prototype;
|
13 | _proto.execute = function execute() {
|
14 | var me = this;
|
15 | return doTreeLayout(me.rootNode, me.options, nonLayeredTidyTree);
|
16 | };
|
17 | return CompactBoxTreeLayout;
|
18 | }(TreeLayout);
|
19 | var DEFAULT_OPTIONS = {};
|
20 | function compactBoxLayout(root, options) {
|
21 | options = util.assign({}, DEFAULT_OPTIONS, options);
|
22 | return new CompactBoxTreeLayout(root, options).execute();
|
23 | }
|
24 | module.exports = compactBoxLayout; |
\ | No newline at end of file |