Blazor.Diagrams icon indicating copy to clipboard operation
Blazor.Diagrams copied to clipboard

Refactor Navigator

Open zHaytam opened this issue 3 years ago • 2 comments

Let's be honest, the current one is absolutely mediocre.

zHaytam avatar Jul 16 '22 23:07 zHaytam

Hi Zanid,

Navigator widget needs to be remade into a proper one,

When you say made into a proper one – I would be interested to know what features you think the navigator should have and what are its shortcomings of the current one?

TimDaborn avatar Jul 17 '22 21:07 TimDaborn

Hello!

Limitations:

  • The way it calculates the bbox is sometimes wrong. It tries to calculate the full view box (pan/movements + original canvas size), but that's not needed and can just be a headache to maintain. The library doesn't have "papers", so nothing is fixed size, which means while the user scrolls the navigator just gets distorted, which doesn't really help the user I believe.
  • Panning changes the size of the current view and the nodes, which lets you believe zooming happens when it doesn't.
  • There are a couple of bugs with the implementation that shows nodes in a different place and even exceptions for things not properly handled.

Better implementation:

  • The full view box = the boundary of all the nodes + a margin. This fixes everything in place while only the current view changes with the user's actions.
  • Add the possibility to draw multiple shapes, not just squares. We'll probably take the shape from the node's shape.

That's what I noticed in multiple libraries, and I feel that it makes sense. If I'm not moving the nodes, why are they moving in the minimap? Of course, I'm open to discussion!

zHaytam avatar Jul 18 '22 07:07 zHaytam