-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add save callback and buttons to NAD viewer #121
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: massimo.ferraro <[email protected]>
button.style.height = '20px'; | ||
button.style.width = '20px'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25px would be better, and keeping 15px for the corresponding SVGs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
buttonsDiv.appendChild(saveSvgButton); | ||
saveSvgButton.addEventListener('click', () => { | ||
if (this.onSaveCallback != null) { | ||
this.onSaveCallback(this.getSvg(), this.getMetadata()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that, in a second version, we should differentiate the buttons which remain selected and the one which are clicked once only.
Signed-off-by: massimo.ferraro <[email protected]>
…ailable Signed-off-by: massimo.ferraro <[email protected]>
Signed-off-by: massimo.ferraro <[email protected]>
Signed-off-by: massimo.ferraro <[email protected]>
Signed-off-by: massimo.ferraro <[email protected]>
Quality Gate failedFailed conditions |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
no
What kind of change does this PR introduce?
feature
What is the current behavior?
In network area diagram viewer it is not possible to save updated SVG or metadata.
By default the mouse is used for moving nodes. For selecting nodes the SHIFT key must be used.
What is the new behavior (if this is a feature change)?
A callback for saving SVG and metadata has been added.
Three buttons can be added to the viewer, two buttons for changing between moving nodes and selecting nodes, and one button for calling the save callback
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
the constructor of the NetworkAreaDiagramViewer has 3 additional parameters:
Examples are provided in the demo/src/diagram-viewers/add-diagrams.js file