antvis/G2

[docs]: 桑基图文档补充自定义tooltip方法 #6619

moayuisuda posted onGitHub

Describe the feature / 功能描述

当前桑基图会直接覆写用户配置的 tooltip items 配置 https://stackblitz.com/edit/react-chvm779o-idhbxuhn?file=src%2Findex.js src/mark/sankey.ts Image 需要支持用户传入的 tooltip items 配置

Are you willing to contribute? / 是否愿意参与贡献?

Please select / 请选择


感谢您提供有关桑基图的功能请求。您提到当前桑基图会直接覆写用户配置的 tooltip items 配置,并希望能够支持用户传入的 tooltip items 配置。

这确实是一个有意义的改进建议,能够增强用户自定义 tooltip 的能力。我会将您的请求记录下来,并提交给开发团队进行评估和考虑。

如果您有其他问题或需要进一步的帮助,请随时告诉我。

<details> <summary>🪧 Tips</summary> For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me. </details>

posted by petercat-assistant[bot] about 2 months ago

桑基图的tooltip包括nodes和links两部分,这里在用户自定义配置的时候还要看看是分开配置还是在item里自己根据条件做一个判断。

posted by interstellarmt about 2 months ago
  tooltip: {
    nodeItems: [
      (d, i, data, column) => {
        console.log('node', d, data);

        return {
          name: d.key + 'Node',
          value: d.value,
          content: 'Node',
        };
      },
    ],
    linkItems: [
      (d, i, data, column) => {
        console.log('link', d, data);

        return {
          name: d.key + 'Link',
          value: d.value,
          content: 'Link',
        };
      },
    ],
  },

有点隐蔽,可以在文档中提醒一下

posted by moayuisuda about 2 months ago

好的,我补充到文档中

posted by interstellarmt about 2 months ago

subObject这个函数来看,这里同理也可以用nodeXXX/linkXXX覆盖tooltip中的其他配置

posted by moayuisuda about 2 months ago

linkTitlenodeTitle也可以覆盖,我把这部分也补充进去

posted by interstellarmt about 2 months ago
posted by interstellarmt about 2 months ago

Fund this Issue

$0.00
Funded

Pull requests