feat!: ease the configuration to rotate the selected vertex by tbouffard · Pull Request #480 · maxGraph/maxGraph
Previously, it was hard to enable rotation, because the `VertexHandler.rotationEnabled` property value was used in the constructor. The sole solution was to override `VertexHandler.isRotationHandleVisible` to ignore the value of `rotationEnabled`. In `mxGraph` this was advised to do change the value globally by updating the prototype of the VertexHandler rotationEnabled property This no longer works in maxGraph (VertexHandler is defined as an ES6 class). The `rotationEnabled` property has been removed. Instead, the value is now stored in a global configuration state: `VertexHandlerConfig.rotationEnabled` It is also possible to override a new `VertexHandler.isRotationEnabled` to enable the rotation for a single Graph implementation. Each of the 2 methods is used separately in the `Handles` and `Stencils` stories for demonstration. The Handles story has been migrated to TypeScript to ease the maintenance In addition, improve JSDoc and type usage in some other handlers BREAKING CHANGES: `VertexHandler.rotationEnabled` has been removed as it was not possible to correctly change its value. Use the `VertexHandlerConfig` class to configure the rotation behavior globally or override the new `VertexHandler.isRotationEnabled` method.
This was referenced
Jun 29, 2024
tbouffard
marked this pull request as ready for review
tbouffard
deleted the
refactor/improve_type_VertexHandler
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters