What kind of change does this PR introduce? (check one with "x")
[X] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[X] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
What is the current behavior? (You can also link to an open issue here)
User has no way to accurately detect state of the graph on load. Suppose the use case where the user wants to zoom to fit and center on load. This depends on the graph having accurate dimensions, all the nodes having accurate dimensions, but there is no way to tell. This PR adds several outward facing methods to detect if elements have dimension. In addition, a new @Output named stateChanges allows users to listen for changes to the graph. Combined with the being able to check dimensions, a user should now be able to call zoomToFit accurately.
zoomToFit results in two updates to the transform, introducing a flicker when combined with calls to center(). A new optional ZoomOptions can be used to call next() on zoomToFit$ with the option autoCenter, reducing the need to call a second time and introducing a flicker. autoCenter also defers updating the transform on panTo.
Sometimes zoomToFit$ fails because of an internal check of the zoom value and nothing happens except the graph flickers in place. A new ZoomOption named force allows users to bypass the check and zoom to fit anyways.
subscriptions is deprecated in favor of listening for a destroy$ Subject. This matches other Component style.
New enablePreUpdateTransform @Input allows users to disable an update to the transform that happens before another update, reducing the chance of a flicker.
Does this PR introduce a breaking change? (check one with "x")
[ ] Yes
[X] No
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
@Output
namedstateChanges
allows users to listen for changes to the graph. Combined with the being able to check dimensions, a user should now be able to callzoomToFit
accurately.zoomToFit
results in two updates to the transform, introducing a flicker when combined with calls tocenter()
. A new optionalZoomOptions
can be used to callnext()
onzoomToFit$
with the optionautoCenter
, reducing the need to call a second time and introducing a flicker.autoCenter
also defers updating the transform onpanTo
.zoomToFit$
fails because of an internal check of the zoom value and nothing happens except the graph flickers in place. A newZoomOption
namedforce
allows users to bypass the check and zoom to fit anyways.subscriptions
is deprecated in favor of listening for adestroy$ Subject
. This matches otherComponent
style.enablePreUpdateTransform @Input
allows users to disable an update to the transform that happens before another update, reducing the chance of a flicker.Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: