Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The fillOpacity of the custom node is invalid #6582

Open
1 of 10 tasks
xieyangxing opened this issue Nov 29, 2024 · 5 comments
Open
1 of 10 tasks

[Bug]: The fillOpacity of the custom node is invalid #6582

xieyangxing opened this issue Nov 29, 2024 · 5 comments

Comments

@xieyangxing
Copy link

Describe the bug / 问题描述

79E3F8E0-0411-4548-8145-A159E601B278

Reproduction link / 复现链接

No response

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

No response

G6 Version / G6 版本

Please select / 请选择

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@github-actions github-actions bot changed the title [Bug]: 自定义节点的fillOpacity失效 [Bug]: The fillOpacity of the custom node is invalid Nov 29, 2024
@yvonneyx
Copy link
Contributor

yvonneyx commented Dec 2, 2024

jsx 直接修改样式即可

@yvonneyx yvonneyx removed the bug label Dec 2, 2024
@xieyangxing
Copy link
Author

xieyangxing commented Dec 2, 2024

@yvonneyx 其实不单单这个属性不生效,追踪原因会发现自定义元素的很多属性都不生效。在往上会导致方法都也不生效,比如自定义元素的setElementState。,getEdgeData(获取边信息)都不生效

@hustcc
Copy link
Member

hustcc commented Dec 2, 2024

使用自定义的节点的时候,配置的 style 会透传给节点,但是自定义的节点不一定会消费,比如 fillOpacity 属性是给 canvas 中节点使用的。

@yvonneyx
Copy link
Contributor

yvonneyx commented Dec 2, 2024

@yvonneyx 其实不单单这个属性不生效,追踪原因会发现自定义元素的很多属性都不生效。在往上会导致方法都也不生效,比如自定义元素的setElementState。,getEdgeData(获取边信息)都不生效

嗯嗯,html 节点目前只支持 dx, dy, innerHTML, pointerEvents, cursor 属性,其他样式属性不生效。比如说想修改填充色透明度,可以直接修改 innerHTML 的 div 元素样式,对应的应该是background 字段用rgba赋值。

另外状态也是基于数据驱动,可以从 innerHTML 回调的参数中获取到实时的状态标识,自定义对应的样式配置

image

@xieyangxing
Copy link
Author

@yvonneyx 感谢您耐心细致的回答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants