react-flow-chart icon indicating copy to clipboard operation
react-flow-chart copied to clipboard

Out-of-bounds nodes can break FlowChart

Open jakubfaliszewski opened this issue 3 years ago • 5 comments

Hi @MrBlenny and everyone! While working with https://github.com/MrBlenny/react-flow-chart I encountered a problem with disappearing links between nodes. It occurs when nodes are far away from each other or when zoom factor is high enough so nodes are out of bounds. This causes children of InnerCanvas to not be rendered. It seems that nodesInView that contains of nodes that are only in view was designed to not render unnecessary nodes due to the performance issues, but it creates some problems. When nodes are removed links between them cannot exist which leads to hiding links that should be visible and to rendering errors.

Problem

Links that should be visible can be hidden because nodes are removed when they are positioned out of bounds. Demo - here you can see that links disappears after zooming in and everything goes wild after zooming out: demo

Solution

I propose two solutions here:

  • [ ] allowing to remove filtering of out of bounds nodes by additional configuration - if new prop is set to true nodesInView will be just Object.keys(nodes)
  • [ ] not removing nodes at all, just use some CSS styling to reduce performance impact (maybe visibility: hidden will do the job)

jakubfaliszewski avatar Oct 18 '22 09:10 jakubfaliszewski

@jakubfaliszewski seems like this is no longer maintained any libray out there you can suggest?

Derick1530 avatar Jan 01 '24 11:01 Derick1530

Has any lib replaced this?

williank avatar Mar 03 '24 17:03 williank

Yeah, react flow

Derick1530 avatar Mar 03 '24 18:03 Derick1530

Your have link repository ?

williank avatar Mar 03 '24 18:03 williank

Nop

On Sun, Mar 3, 2024 at 9:39 PM Willian Kevenis @.***> wrote:

Your have link repository ?

— Reply to this email directly, view it on GitHub https://github.com/MrBlenny/react-flow-chart/issues/256#issuecomment-1975256090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYCTR4PRLDPZ5BPQV3XN23YWNU4XAVCNFSM6AAAAAARH4HMYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZVGI2TMMBZGA . You are receiving this because you commented.Message ID: @.***>

Derick1530 avatar Mar 03 '24 18:03 Derick1530