//tree自适应
const tree = echarts.init(document.getElementById('tree'));
const nodes = tree._chartsViews[0]._data._graphicEls;
let allNode = 0;
for (let index = 0; index < nodes.length; index++) {
const node = nodes[index];
if (node === undefined) {
continue
}
allNode++;
}
const height = window.innerHeight;
const width = window.innerWidth;
const currentHeight = 10 * allNode;
const currentWidth = 30 * allNode;
const newHeight = Math.max(currentHeight, height);
const newWidth = Math.max(currentWidth, width);
const tree_ele = document.getElementById('tree');
tree_ele.style.height = newHeight + 'px';
tree_ele.style.width = newWidth + 'px';
tree.resize();