antvis/G6

树布局中如何在getWidth中获取节点的宽高 #6061

warriorhj posted onGitHub

Describe the bug / 问题描述

在layout初始化当中getWidth方法只能获取如下信息 image 我的目的是为了解决自定义节点时,不同节点具有不同宽度,在渲染后不会重叠

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

4.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response


根据 id 调用 graph api 获取即可

posted by Aarebecca 9 months ago

在初始化树图布局时是无法通过api来得到每个节点的宽高,对于自定义节点,具有不同的宽高,无论是CompactBox和Dendrogram都会存在节点相互遮挡问题

posted by warriorhj 9 months ago

Fund this Issue

$0.00
Funded

Pull requests