antvis/G6


The issue has been closed
请问jsx自定义image节点时,clipCfg怎么设置呢 #4511
gongpingwa00 posted onGitHub
问题描述
用jsx自定义节点,我希望图片在一个圆圈内,不要溢出,想到了图片的裁剪功能,但是配置clipCfg不生效,也没有找到相关的解决答案
重现链接
本地代码
重现步骤
组件初始化,执行registerNode方法 <rect style={{ width: 32, height: 32, stroke:'#ffffff', fill:#ffffff, radius: 16, marginLeft:5, marginTop:4, }} > <image cross-origin='anonymous' style={{ img:${cfg.icon},width: 30,height: 30,marginLeft:5,marginTop:1,clipCfg:{r:10,show:false,type:'circle'}}} /> </rect>
预期行为
用jsx自定义节点,我希望图片在一个圆圈内,不要溢出
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
- G6 版本: [4.5.1 ... ]
屏幕截图或视频(可选)
No response
补充说明(可选)
No response