Git Product home page Git Product logo

Comments (3)

dosubot avatar dosubot commented on August 25, 2024 2

It looks like the issue you're encountering with the drag-element and its effect on the associated edge (polyline) endpoint calculations in G6 might be due to how the framework calculates the endpoints based on the style.targetPort and style.sourcePort properties. These properties should reference the ports' placement information in the nodes' ports array, which determines the exact position of the port on the node's boundary.

To address the unexpected behavior when the target node moves below the source node, consider the following steps:

  1. Verify the placement values for the ports to ensure they are correctly set and interpreted. Incorrect placement values can lead to unexpected endpoint calculations.
  2. Ensure that the graph updates the edge paths correctly when nodes or their ports move. If the edge paths are not updated or are updated incorrectly, it could cause the endpoints to be calculated incorrectly.
  3. Simplify your graph to include only the source and target nodes involved in the issue for easier debugging.
  4. Add logging or breakpoints in the code that handles node movement and edge drawing to help identify if and when the edge paths are recalculated.

For more detailed guidance on handling edge calculation with ports, you might find the element-edge-port.ts demo file in the G6 repository helpful.

If you need further assistance or have more details to share, feel free to reach out.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

from g6.

yvonneyx avatar yvonneyx commented on August 25, 2024

看截图是自动吸附到距离更近的连接桩了,建议先检查一下连接桩设置是否正确。如果还是存在问题,请提供一个在线示例链接,方便排查定位问题~

from g6.

zzjjbbaa avatar zzjjbbaa commented on August 25, 2024

看截图是自动吸附到距离更近的连接桩了,建议先检查一下连接桩设置是否正确。如果还是存在问题,请提供一个在线示例链接,方便排查定位问题~

不好意思,在线没问题,没复现出来;我的估计问题出在我自定义node时,复写的getPortXY方法有问题,先关闭吧

from g6.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.