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]: If the node type is "image", createEdge will give an error while creating. #6754

Open
2 of 10 tasks
RackweLLizm opened this issue Feb 7, 2025 · 1 comment
Open
2 of 10 tasks
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer

Comments

@RackweLLizm
Copy link

RackweLLizm commented Feb 7, 2025

Describe the bug / 问题描述


rect.ts:72
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'src') at ImagePool2.getImageSync (rect.ts:72:51) at Canvas3.handleMounted2 (star.ts:39:19) at EventService2.notifyListeners (arc-2-cubic.ts:1037:25) at EventService2.notifyTarget (arc-2-cubic.ts:1007:10) at EventService2.propagate (arc-2-cubic.ts:682:12) at EventService2.dispatchEvent (arc-2-cubic.ts:641:12) at Image3.dispatchEvent (is-curve-array.ts:139:17) at Canvas3.mountChildren (animation.ts:674:19) at animation.ts:691:12 at Array.forEach (<anonymous>)
  | getImageSync | @ | rect.ts:72 -- | -- | -- | --   | handleMounted2 | @ | star.ts:39   | notifyListeners | @ | arc-2-cubic.ts:1037   | notifyTarget | @ | arc-2-cubic.ts:1007   | propagate | @ | arc-2-cubic.ts:682   | dispatchEvent | @ | arc-2-cubic.ts:641   | dispatchEvent | @ | is-curve-array.ts:139   | mountChildren | @ | animation.ts:674   | (anonymous) | @ | animation.ts:691   | mountChildren | @ | animation.ts:690   | appendChild | @ | segment-arc-factory.ts:230   | createElement | @ | element.ts:435   | (anonymous) | @ | element.ts:474   | (anonymous) | @ | element.ts:474   | createElements | @ | element.ts:473   | draw | @ | element.ts:299   | (anonymous) | @ | create-edge.ts:156   | (anonymous) | @ | collapse-expand.ts:71   | __awaiter4 | @ | collapse-expand.ts:71   | handleCreateEdge | @ | create-edge.ts:117   | doEmit | @ | index.ts:69   | EventEmitter3.emit | @ | index.ts:73   | BehaviorController.forwardCanvasEvents | @ | behavior.ts:102   | notifyListeners | @ | arc-2-cubic.ts:1026   | notifyTarget | @ | arc-2-cubic.ts:1007   | propagate | @ | arc-2-cubic.ts:682   | dispatchEvent | @ | arc-2-cubic.ts:641   | EventService2.onPointerUp | @ | arc-2-cubic.ts:335   | mapEvent | @ | arc-2-cubic.ts:210   | (anonymous) | @ | polyline.ts:115   | (anonymous) | @ | torgb.ts:15   | call | @ | torgb.ts:13   | onPointerUp2 | @ | html.ts:30

Reproduction link / 复现链接

No response

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

This error does not prevent the edge from being created. The edge is created, but when it fails, the animation of the edge does not work. In other words, the edge tip is not visible. After the edge is created, the edge becomes visible.

G6 Version / G6 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
@RackweLLizm RackweLLizm added the status: waiting for maintainer These issues have not yet been reviewed by a maintainer label Feb 7, 2025
Copy link

It seems you are experiencing an issue with antvis/G6 when using nodes of type "image" and creating edges. The error message indicates a TypeError related to reading the 'src' property, which might be causing issues with edge animations.

Here's a general approach to troubleshoot and potentially resolve this issue:

  1. Ensure Image Source is Defined: Make sure that the image node has a valid 'src' property defined. This property should point to a valid image URL or path.

  2. Check Node Configuration: Verify that the node configuration for the image type is correctly set up in your G6 graph instance. Ensure all necessary properties are provided.

  3. Debugging: Use console logs or breakpoints to inspect the node properties and ensure that the 'src' is being correctly assigned before the edge creation.

  4. Update G6: Ensure you are using the latest version of G6, as updates may contain bug fixes for issues like this.

  5. Error Handling: Implement error handling around the edge creation logic to catch and manage errors gracefully.

If the issue persists, it might be beneficial to look into the specific lines of code mentioned in the error stack trace to understand where the undefined property is being accessed.

If you need further assistance or if this is a potential bug in the library, you might consider reporting it to the maintainers of the antvis/G6 repository, providing them with detailed information and a minimal reproducible example.

🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues have not yet been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant