KnowledgeCanvas / knowledge

Knowledge is a tool for saving, searching, accessing, exploring and chatting with all of your favorite websites, documents and files.
Apache License 2.0
1.32k stars 92 forks source link

[Bug] Graph types fall apart if physics is enabled #89

Closed BigBoyBarney closed 1 year ago

BigBoyBarney commented 1 year ago

Hi! Having Physics - Simulate enabled disrupts graph ordering. Can reproduce 100% of the time.

Steps to reproduce: 1) Go to graph 2) Graph settings 3) Make sure Physics - Simulate is turned on 4) Select a graph type 5) Graph orders correctly and then falls apart (6, graph falls apart with physics even if animation is turned off)

Thanks!

RobRoyce commented 1 year ago

This is actually expected behavior.

When simulation is enabled, the graph type acts as a "base" layout. The simulator uses the base layout for initial conditions (and therefore you get different looking simulated layouts depending on your base layout).

For most layout types, with large enough graphs, disabling simulation will result in incoherent layouts, which was actually the reason why I added simulation in the first place. The takeaway is that, if you want to preserve the base layout, you must disable simulation.

However, it doesn't have to remain that way. What would you suggest as a solution to your issue?

BigBoyBarney commented 1 year ago

Aaaah, now that you mention it, after disabling animation, I do see how the physics would snap it back to the original form. Makes perfect sense now!

I think disabling the various graphs or adding a small warning / note to the physics option that lets users know that it needs to be disabled for the other graphs to work would a perfect solution.

My issue stems from the fact, that when both animation and physics are enabled, the snapping back to original layout at the end looks quite buggy, as if something were broken.

Thank you for clearing this up, it makes a lot of sense! Also the app is super cool!