antvis/G6

【V5】5.0.9 combo updateComboData 更新 icon/badge 等不生效 #6053

MusicTen posted onGitHub

Describe the bug / 问题描述

combo收起时展示icon,展开后隐藏,通过collapse-expand behavior 的 onCollapse/onExpand 事件主动 调用 updateComboData 更新 combo 无效,调用 draw() 也未如期更新。

https://stackblitz.com/edit/react-1sfavs?file=index.js

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

双击展开收起 combo,观测 combo 的 icon/badge 是否 正确展示/隐藏

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS

Browser / 浏览器

Chrome

Additional context / 补充说明

当icon为图片时却能正常控制显隐


如果想实现 icon 在收起时展示,展开后隐藏,可以这样配置:

  combo: {
    style: {
      labelText: (d) => d.id,
      fill: 'skyblue',
      lineDash: 0,
      collapsedLineDash: [5, 5],
      collapsedMarker: true,
      collapsedMarkerType: undefined,
      collapsedMarkerText: 'icon',
      collapsedMarkerWidth: 16,
      collapsedMarkerHeight: 16,
      collapsedMarkerSrc:
        'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg',
    },
  },

我们现在将关闭此 issue。如果您后续还有任何疑问或需要进一步的帮助,请随时重新打开它~

posted by yvonneyx 9 months ago

Fund this Issue

$0.00
Funded

Pull requests