{"action":"closed","issue":{"url":"https://api.github.com/repos/antvis/f2/issues/379","repository_url":"https://api.github.com/repos/antvis/f2","labels_url":"https://api.github.com/repos/antvis/f2/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/antvis/f2/issues/379/comments","events_url":"https://api.github.com/repos/antvis/f2/issues/379/events","html_url":"https://github.com/antvis/f2/issues/379","id":372404588,"node_id":"MDU6SXNzdWUzNzI0MDQ1ODg=","number":379,"title":"自定义interaction时，对于自定义shape，如何获取到该shape中的所有元素","user":{"login":"ZiQiangWang","id":11312811,"node_id":"MDQ6VXNlcjExMzEyODEx","avatar_url":"https://avatars0.githubusercontent.com/u/11312811?v=4","gravatar_id":"","url":"https://api.github.com/users/ZiQiangWang","html_url":"https://github.com/ZiQiangWang","followers_url":"https://api.github.com/users/ZiQiangWang/followers","following_url":"https://api.github.com/users/ZiQiangWang/following{/other_user}","gists_url":"https://api.github.com/users/ZiQiangWang/gists{/gist_id}","starred_url":"https://api.github.com/users/ZiQiangWang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZiQiangWang/subscriptions","organizations_url":"https://api.github.com/users/ZiQiangWang/orgs","repos_url":"https://api.github.com/users/ZiQiangWang/repos","events_url":"https://api.github.com/users/ZiQiangWang/events{/privacy}","received_events_url":"https://api.github.com/users/ZiQiangWang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-22T06:14:31Z","updated_at":"2018-10-30T01:57:18Z","closed_at":"2018-10-30T01:57:18Z","author_association":"NONE","body":"<!--\r\nThank you for reporting an issue.\r\n\r\n1. It's RECOMMENDED to submit PR for typo or tiny bug fix.\r\n2. If this's a FEATURE request, please provide: details, pseudo codes if necessary.\r\n3. If this's a BUG, please provide: course repetition, error log and configuration. Fill in as much of the template below as you're able.\r\n4. It will be nice to use to provide a CodePen Link which can reproduce the issue, we provide a CodePen template [f2-github-issue](https://codepen.io/Sima/pen/qVgdex).\r\n\r\n感谢您向我们反馈问题。\r\n\r\n1. 提交问题前，请先阅读 https://antv.alipay.com/zh-cn/f2/3.x/index.html 上的文档。\r\n2. 我们推荐如果是小问题（错别字修改，小的 bug fix）直接提交 PR。\r\n3. 如果是一个新需求，请提供：详细需求描述，最好是有伪代码实现。\r\n4. 如果是一个 BUG，请提供：复现步骤，错误日志以及相关配置，并尽量填写下面的模板中的条目。\r\n5. 如果可以，请提供尽可能精简的 CodePen 链接，可使用 CodePen 模板 https://codepen.io/Sima/pen/qVgdex，方便我们排查问题。\r\n6. 扩展阅读：[如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393)\r\n-->\r\n\r\n* **F2 Version**:\r\n* **Platform**:\r\n* **Mini Showcase(like screenshots)**:\r\n* **CodePen Link**:\r\n\r\n<!-- Enter your issue details below this comment. -->\r\n我定义了一个shape，point-text，由一个circle和一个text组成\r\n\r\n在interaction中，通过container.get('children')获取到的，是一个数组，里面由circle和text组成，但是自定义选中的事件时，参考了interval-select的实现方式，selectedShape只能确保一个shape选中状态，并且不能获取到circle对应的text\r\n\r\n我在自己实现时，采用如下的方案，不知道是否合理：\r\n自定义shape中，定义circle的className为point，text的className为point-text\r\n在_selectShapesByData中，child.get('className').indexOf('point')) !== -1来过滤，同时使用将\r\nselectedShape定义为数组，以保存选中的多个shape\r\n\r\n"}}
{"actor":{"display_login":"simaQ"}}