Blazor.Diagrams
Blazor.Diagrams copied to clipboard
Refactor Navigator
Let's be honest, the current one is absolutely mediocre.
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?
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!