Closed bartbutenaers closed 4 years ago
The ability to change properties is an excellent feature. If a user can move things, hide things, adjust fill etc - it should satisfy most interactions. Adding/removing might be nice but perhaps make that a future feature (if heavily justified)?
I would like to see at least a command like "set_attribute".
The reason is quite simple: Current I'm trying to hide SVG Objects:
{"elementId":"rainspringler","attributeName":"visibility","attributeValue":"hidden"}
This works only, after adding visibility="visible" to every relevant svg-element in the svg-file. I'm using inkscape to create the svg and it is somewhat annoying to add this attribute to every relevant element, every time I'm changing something.
I'm not really sure, if both update_attributes and set_attributes are really necessary. is there anything against update_attribute automatically adding missing attributes?
Hi Sven (@littleyoda ),
is there anything against update_attribute automatically adding missing attributes?
I cannot think of anything that should be bad about your proposal. But to be certain that I don't forget anything: could you please ask this question on our discussion in the Node-RED forum? Perhaps anybody else has some extra input about this...
Adding and removing elements via input messages has currently be implemented in the "panzoom" branch, and will be part of the 2.0.0 version. Further discussions about it will be on the Node-RED forum
Currently attribute values of existing elements can be updated via an input message:
I'm not sure whether I should also support other topics ("create_element", "remove_element") because then my SVG editor is being replaced by JSON ...