antvis/G6

自定义节点使用咨询 #6017

Aolef posted onGitHub

Describe the bug / 问题描述

请问现在是否支持,使用upsert画出来的图形,能够对某块区域进行单独的属性管理,比如基于Circle图形进行自定义节点,在右上角upsert几个元素,做成展开按钮的样子,然后只有在点击展开按钮的时候,点击事件会返回指定属性。如果能实现的话,能否指导下,如果自定义点击事件的属性?

No response

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

No response

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response


请重新修改标题,并描述清楚你的问题

posted by Aarebecca 10 months ago

您好,我目前使用的功能是自定义节点,使用upsert在Circle节点的右上方构建了一个展开按钮,我希望能在点击这个展开按钮的时候,click回调函数的参数可以自定义,这个该如何实现?目前点击Circle或者我upsert上去的新图形,click的回调参数都是节点的参数,我无法区分点击的是展开图标还是节点本身

posted by Aolef 10 months ago

事件回调参数中 originalTarget 是实际点击的图形

posted by Aarebecca 10 months ago

originalTarget中的id等属性可以在哪里自定义吗

posted by Aolef 10 months ago

原生事件不可自定义,如果你一定要自定义,那么请自行抛出自定义事件

posted by Aarebecca 10 months ago

Fund this Issue

$0.00
Funded

Pull requests