ssthouse / tree-chart

Flexible tree chart using Canvas and Svg, powered by D3.js; ✅Support Vue, Vue3 and React;
https://ssthouse.github.io/tree-chart/#/svgTree
MIT License
435 stars 96 forks source link

节点位置 #86

Closed shanEr-f closed 2 years ago

shanEr-f commented 2 years ago

bug:如果节点宽度在宽的情况下会紧凑一起,后来我在源码中发现,您在组件中 new TreeChartCore 中少传了 treeConfig 的配置,导致组件一直都是默认的配置

VueTree.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
      })
      this.treeChartCore.init()
      this.nodeDataList = this.treeChartCore.getNodeDataList()

      this.initialTransformStyle = this.treeChartCore.getInitialTransformStyle()
    }
ssthouse commented 2 years ago

@xiaoGe-f Hi, 感谢你的提醒,在这个版本fix了:

@ssthouse/vue-tree-chart@0.6.5