antvis / S2

⚡️ A practical visualization library for tabular analysis.
https://s2.antv.antgroup.com
MIT License
1.47k stars 195 forks source link

树形结构自定义显示展开/折叠icon #2268

Open ctrlands opened 1 year ago

ctrlands commented 1 year ago

🏷 Version

Package Version
@antv/s2 1.47.1
@antv/s2-react
@antv/s2-vue

Sheet Type

🖋 Description

树形结构时,没有子集的节点也出现了展开/折叠的icon;在定义rows时确定了层级的字段,但每一层的层级其实不确定的,就会出现没有子集的节点也显示了icon;重新RowCell里面的showTreeIcon方法,从meta里面也拿不到相应的数据进行判断,每次展开/折叠后meta里面level和children的值是变化的,找不到一个合适可用的判断条件

🔗 Reproduce Link

https://codesandbox.io/embed/quiet-water-hxzmmj?fontsize=14&hidenavigation=1&theme=dark

😊 Expected Behavior

可以自行判断是否显示展开/折叠的icon

😅 Current Behavior

github-actions[bot] commented 1 year ago

你好 @ctrlands,经过我们的反复讨论, 你的需求现已被采纳, 我们会排期开发, 请关注后续发布日志。

Hello, @ctrlands, your feature request has been accepted after our repeated discussion. We will schedule the development, please pay attention to the follow-up release logs.

stone-lyl commented 1 year ago

因为底表是通过 判断是否为最后一个层级来确定是否展示 icon,丹东和吉林 不是 leafNode , 所以现有逻辑是会展示icon的