-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Add a new API to reset the modified style of given elements via APIs #2458
Labels
BPMN diagram styling
Change the standard rendering: stroke color, thickness
enhancement
New feature or request
Milestone
Comments
tbouffard
changed the title
[FEAT] Add a new API to reset the modified style via APIs
[FEAT] Add a new API to reset the modified style of a givent element via APIs
Jan 16, 2023
tbouffard
added
the
BPMN diagram styling
Change the standard rendering: stroke color, thickness
label
Jan 16, 2023
tbouffard
changed the title
[FEAT] Add a new API to reset the modified style of a givent element via APIs
[FEAT] Add a new API to reset the modified style of given elements via APIs
Feb 22, 2023
This was referenced Feb 22, 2023
This was referenced Mar 2, 2023
csouchet
added a commit
that referenced
this issue
Jun 7, 2023
csouchet
added a commit
that referenced
this issue
Jun 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
BPMN diagram styling
Change the standard rendering: stroke color, thickness
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
#1030 lets change the style of an element. Some use cases requires to reset the whole modifications applied to the element
Describe the solution you'd like
Introduce a new API method that allows you to reset the style of an element or a list of elements as they were defined before any modification.
In the same class as for the "Update Style" API (see #1030)
Calling the method without argument will reset the style on all elements.
This signature matches the
removeAllCssClasses
signature (#2576) and theremoveAllOverlays
signature (#2577).Additional Context
The implementation will depend on how mxGraph stores the styles in the model.
Prerequisites:
Experimentation done in the POC #2539
Introduce a custom UndoManager to store the first style change of each cell to store the default style of them, at each call of updateStyle if is not stored.
It is deleted on each calling of resetStyle.
https://github.com/process-analytics/bpmn-visualization-js/pull/2539/files#diff-8d1211cbbc8caf5463e0a05fb2c4469e62dd5a966a1f4e0225474257cd3a05ef
https://github.com/process-analytics/bpmn-visualization-js/pull/2539/files#diff-5a78c9398ffd553bf04f09484ed9434cae1da4dcce9389b73930257e8e6558a9
https://github.com/process-analytics/bpmn-visualization-js/pull/2539/files#diff-6f664385f002a6733b3bf55ab1de337505fcf1665216f8d7d81b055eb413f555R301
https://github.com/process-analytics/bpmn-visualization-js/pull/2539/files#diff-6f664385f002a6733b3bf55ab1de337505fcf1665216f8d7d81b055eb413f555R321
https://github.com/process-analytics/bpmn-visualization-js/pull/2539/files#diff-6f664385f002a6733b3bf55ab1de337505fcf1665216f8d7d81b055eb413f555R335
https://github.com/process-analytics/bpmn-visualization-js/pull/2539/files#diff-6f664385f002a6733b3bf55ab1de337505fcf1665216f8d7d81b055eb413f555R473
Alternative
Use the same logic as in #2574
Set all properties to null in the mxGraph style.
As explained in #2574, this will cause side effects for the font if the BPMN diagram defined a LabelStyle for the BPMN element whose style is updated (could work if label style is ignored, see #2468).
In addition, this won't let support the reset on all elements: we wouldn't register the update elements so we would have to apply the reset to all elements of the diagram instead on only these that have actually been updated.
The text was updated successfully, but these errors were encountered: