antvis/G2

[问题] shadowColor属性传参后续会像color属性支持函数吗? #4411

vobile-wangzhenfeng posted onGitHub

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/antvis/g2/blob/master/CONTRIBUTING.md 感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/antvis/g2/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • npm test passes
  • benchmarks are included
  • commit message follows commit guidelines
  • documents are updated
Description of change

<!-- Provide a description of the change below this comment. -->

问题

比如我想实现下面效果时, image 需要将每个部分的shadowColor与它本身的颜色相对应,但是目前shadowColor属性只能设置一种颜色。

期望

shadowColor: string | ((datum: Datum, defaultColor?: string) => string)


很好的 issue。

目前 4.x 对于 style 回调支持的不是很好,5.0 当前回调可以拿到更多的数据,但是依然没有 defaultColor 数据。如下:

image

我们会在 5.x 中考虑回调中给到更多的上下文信息。

posted by hustcc over 2 years ago

Fund this Issue

$0.00
Funded

Pull requests