retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.04k stars 652 forks source link

Programmatically added connection is not shown properly on the screen #715

Closed bullypb23 closed 3 weeks ago

bullypb23 commented 3 weeks ago

Describe the bug

Hi, I am trying to add connections between nodes programmatically. First, I am creating nodes also programmatically and after all nodes are created, I want to create a connection between them. But after I create connections, some connections are shown properly and others are shown as arrows on the screen on position (0, 0). I checked multiple times and node ids in connection objects are all ok. I am adding a screenshots of how my screen is looking after it, and also nodes and connections and a function that is creating connection.

If anybody has an ides why it is not showing properly for every connection, or what I am doing wrong, I would really appreciate the help. :)

Screenshot 2024-09-09 at 15 39 17 Screenshot 2024-09-09 at 15 40 48 Screenshot 2024-09-09 at 15 33 28 Screenshot 2024-09-09 at 15 33 36 Screenshot 2024-09-09 at 15 33 15

Example to reproduce

No response

How to reproduce

I don't have link where you can take a look and reproduce an issue.

Expected behavior

All connections are added to proper nodes on the screen.

Dependencies

├── @angular-devkit/build-angular@17.3.8 ├── @angular/animations@17.3.12 ├── @angular/cli@17.3.8 ├── @angular/common@17.3.12 ├── @angular/compiler-cli@17.3.12 ├── @angular/compiler@17.3.12 ├── @angular/core@17.3.12 ├── @angular/forms@17.3.12 ├── @angular/material@17.3.10 ├── @angular/platform-browser-dynamic@17.3.12 ├── @angular/platform-browser@17.3.12 ├── @angular/router@17.3.12 ├── @auth0/angular-jwt@5.2.0 ├── @swimlane/ngx-datatable@20.1.0 ├── @types/d3-shape@3.1.6 ├── @types/jasmine@5.1.4 ├── d3-shape@3.2.0 ├── date-fns@3.6.0 ├── jasmine-core@5.1.2 ├── karma-chrome-launcher@3.2.0 ├── karma-coverage@2.2.1 ├── karma-jasmine-html-reporter@2.1.0 ├── karma-jasmine@5.1.0 ├── karma@6.4.3 ├── ngx-cookie-service@17.1.0 ├── ngx-toastr@17.0.2 ├── rete-angular-plugin@2.1.1 ├── rete-area-plugin@2.0.4 ├── rete-auto-arrange-plugin@2.0.1 ├── rete-connection-path-plugin@2.0.3 ├── rete-connection-plugin@2.0.2 ├── rete-render-utils@2.0.2 ├── rete@2.0.3 ├── rxjs@7.8.1 ├── tslib@2.6.3 ├── typescript@5.4.5 └── zone.js@0.14.8

Platform

No response

Relevant log output

No response

Code of Conduct

bullypb23 commented 3 weeks ago

I found the solution, I was passing wrong sourceOutput to connection when creating.