Closed freestyledork closed 2 years ago
When testing out the functionality of this package I noticed the collapse wasn't working. I traced it to the core init not properly setting the enableCollapse param. Not sure if other versions are affected.
TreeVue.vue
init() { this.treeChartCore = new TreeChartCore({ svgElement: this.$refs.svg, domElement: this.$refs.domContainer, treeContainer: this.$refs.container, dataset: this.dataset, direction: this.direction, treeConfig: this.config, collapseEnabled: this.collapseEnabled, <---------- not present in TreeVue.vue }); this.treeChartCore.init(); this.nodeDataList = this.treeChartCore.getNodeDataList(); this.initialTransformStyle = this.treeChartCore.getInitialTransformStyle(); },
...tree-chart/index.js
this.treeConfig = { nodeWidth: DEFAULT_NODE_WIDTH, nodeHeight: DEFAULT_NODE_HEIGHT, levelHeight: DEFAULT_LEVEL_HEIGHT, }; this.linkStyle = TreeLinkStyle.CURVE; this.direction = Direction.VERTICAL; this.collapseEnabled = true; this.currentScale = 1; if (params.treeConfig) { this.treeConfig = params.treeConfig; } this.collapseEnabled = params.collapseEnabled; <------------ ends up being undefined. this.svgElement = params.svgElement; this.domElement = params.domElement; this.treeContainer = params.treeContainer; this.dataset = this.updatedInternalData(params.dataset); }
@freestyledork Hi, sorry for the late reply!
this issue has been fixed in version 0.6.6, please check.
0.6.6
When testing out the functionality of this package I noticed the collapse wasn't working. I traced it to the core init not properly setting the enableCollapse param. Not sure if other versions are affected.
TreeVue.vue
...tree-chart/index.js