antvis/G6

节点上添加icon为img图片,想让图片呈圆形展示(类似于原生圆角属性) #5207

Yangyoung-max posted onGitHub

问题描述

节点上添加icon为img图片,想让图片呈圆形展示(类似于原生圆角属性)

重现链接

icon实现圆角效果

重现步骤

icon实现圆角效果

预期行为

icon实现圆角效果

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

image

补充说明(可选)

No response


hi @Yangyoung-max, welcome!

posted by github-actions[bot] over 1 year ago

Hi @Yangyoung-max, Please star this repo if you find it useful! Thanks :star:! 你好 @Yangyoung-max。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

你好,可以尝试使用 clipPath 来对图片进行裁切

posted by Aarebecca over 1 year ago

是circle节点上的icon。我试过图片(icon)onload之后利用canvas进行了裁剪,将icon变圆,但是icon量大还是不可行。 也不能运用image的节点,因为节点有的有icon的src,有的没有icon的src,而且src也会存在过期的情况,结合场景就是用circle节点比较好,但是这个icon没办法优雅的变圆。 !!!!!之间用的是cytoscape,现在用这个算是迁移了,可是这个icon连个圆角的配置都没有吗。。。

posted by Yangyoung-max over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests