feat!: ease the configuration to rotate the selected vertex#480
Merged
feat!: ease the configuration to rotate the selected vertex#480
Conversation
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
commented
Jun 30, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, it was hard to enable rotation, because the
VertexHandler.rotationEnabledproperty value was used in the constructor. The sole solution was to overrideVertexHandler.isRotationHandleVisibleto ignore the value ofrotationEnabled.In
mxGraphthis was advised to do change the value globally by updating the prototype of the VertexHandler rotationEnabled propertyThis no longer works in maxGraph (VertexHandler is defined as an ES6 class).
The
rotationEnabledproperty has been removed. Instead, the value is now stored in a global configuration state:VertexHandlerConfig.rotationEnabledIt is also possible to override a newVertexHandler.isRotationEnabledto enable the rotation for a single Graph implementation.Each of the 2 methods is used separately in the
HandlesandStencilsstories for demonstration. The Handles story has been migrated to TypeScript to ease the maintenanceIn addition, improve JSDoc and type usage in some other handlers
BREAKING CHANGES:
VertexHandler.rotationEnabledhas been removed as it was not possible to correctly change its value.Use
VertexHandlerConfig.rotationEnabledto configure the rotation behavior globally or override theVertexHandler.isRotationEnabledmethod.Notes
Closes #267
New behavior in the updated stories
Handles
story_handles.mp4
Stencils
story_stencils.mp4