swimlane / ngx-graph

Graph visualization library for angular
https://swimlane.github.io/ngx-graph
MIT License
938 stars 287 forks source link

The more nodes are added the more the custom svg rect gets stretched #494

Open onra2 opened 1 year ago

onra2 commented 1 year ago

Describe the bug Making a graph with custom svg template (copied from the ngx graph doc) with +- 15 nodes works fine. Making the same graph but with 30+ nodes breaks it, the more nodes you add the more it gets stretched. Also i found that when calling fitGraph() it stretches the rectangle.

To Reproduce Steps to reproduce the behavior:

  1. Create a graph with custom svg as show in the documentation `

    {{node.label}} {{link.label}}

    `

  2. Make the same graph as shown in the screenshots below
  3. If you make a graph with 10 nodes it will be fine, make another with a lot more nodes
  4. See error

Expected behavior i expect the rectangle to not change size based on the number of nodes.

Screenshots 20 Nodes correct: https://i.imgur.com/p7Kgdp4.png

30+ Nodes incorrect: https://i.imgur.com/zy51dAw.png

ngx-graph version 8.0.3

bonnm commented 1 year ago

Same with ngx 8.0.2 But strange: The bug does not appear under Firefox, there everything looks good. But under Chrome-based Edge the rectangles are also broken...

UPCN-Nestor commented 11 months ago

Same here under Chrome

UPCN-Nestor commented 11 months ago

Also, with many nodes/edges, custom template edges disappear