refactor!: move `AbstractGraph.fit` to `FitPlugin` by tbouffard · Pull Request #734 · maxGraph/maxGraph

tbouffard

tbouffard

tbouffard

tbouffard

@tbouffard tbouffard marked this pull request as ready for review

April 17, 2025 13:11

coderabbitai[bot]

tbouffard

@tbouffard

This change better split responsibilities (reduce the amount of things done directly in Graph) and will improve the tree-shaking in the future.

Passing parameters to `Graph.fit` is now simpler. The previous implementation used several positional parameters, which could be hard to follow and maintain.
This change:
  - Improves the readability of the method call.
  - Minimizes the need to pass many default values.
  - Aligns the API with more modern, maintainable patterns.

In addition, the implementation simplify min/max scale management

BREAKING CHANGES: the `AbstractGraph.fit` method moved to `FitPlugin`, as well as the `minFitScale` and `maxFitScale` properties.
The method now accepts a single parameter, mainly to minimize the need to pass many default values.

@tbouffard tbouffard changed the title refactor!: move Graph.fit to FitPlugin refactor!: move AbstractGraph.fit to FitPlugin

May 19, 2025

@tbouffard tbouffard marked this pull request as ready for review

May 19, 2025 17:41

@tbouffard tbouffard deleted the refactor/move_Graph.fit_in_FitPlugin branch

May 19, 2025 17:46