Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Diagram Community Logo
KubaSCK

KubaSC

@KubaSC
About
Posts
3
Topics
2
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Proper Copy-Pasting of Disconnected Links in GoJS
    KubaSCK KubaSC

    Problem ๐Ÿ›

    In GoJS, when we try to perform a copy-paste operation on partially or fully disconnected links, they are not pasted onto the diagram.

    11.png

    Solution

    To enable pasting of such links, set the property:

    diagram.toolManager.draggingTool.dragsLink = true;
    

    This property allows links to be dragged, which may not be desirable in the project. To ensure that only copy/paste works, simply add the following code in the CommandHandler:

    override pasteFromClipboard(): go.Set<go.Part> {
        const oldDragsLink = this.diagram.toolManager.draggingTool.dragsLink;
        this.diagram.toolManager.draggingTool.dragsLink = true;
        const pastedParts = super.pasteFromClipboard();
        this.diagram.toolManager.draggingTool.dragsLink = oldDragsLink;
    }
    

    After overriding this method, both partially and fully disconnected links should be correctly pasted onto the diagram. ๐ŸŽ‰

    2.png


  • Introduce yourself
    KubaSCK KubaSC

    Hi!

    I'm Kuba. I'm a software developer specializing in data visualization. I've been working primarily with the GoJS and React Flow libraries for over 1.5 years. During this time, I have gained a lot of knowledge and solved many custom cases related to data visualization. If you'd like to learn more about these libraries or need help solving a specific problem, feel free to ask! ๐Ÿ™‚

  • Login

  • Don't have an account? Register

Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups