Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
1.01k stars 205 forks source link

Use Controls to implement node resizing #393

Open Heathermcx opened 10 months ago

Heathermcx commented 10 months ago

I have added a ResizeControl which is an ExecutableControl and has an IResizerProvider. Each ResizeControl added to a node adds a 'resizer' which is by default, a small box at the corner of the node. When the resizer is dragged, the node resizes. IResizeProvider provides the position of the resizer and also the behavior for the node when the resizer is dragged. I have included four default implementations of IResizeProvider - one for each corner of a node.

JEDII29 commented 2 months ago

When can we expect merge this feature to develop?

kyctarnik commented 1 month ago

I don`t think it must be part of core. There is 2 reasons.

  1. You have leaked an abstraction in the line "public string? Class => _resizeProvider.Class;" in ResizerProvider. Your "provider" now know about view.
  2. You are introducing a new concept that this framework does not operate with
  3. You do not need provider to make resize. You need only one behavior.
  4. If you change the scale while changing the node size, you will catch a bug with the node size.
  5. The position should be determined by control, not behavior (in my understanding). Or, even better, it must be transmitted from the outside.
  6. You forgot about "Snap to grid" option.

@zHaytam am I right?