-
Notifications
You must be signed in to change notification settings - Fork 27
Mechanism to exchange 'widgets' #12
Comments
Suppose somebody has developed a "sprinkler" svg widget, to visualize water spraying his lawn. Such a widget will have properties, e.g. a sprinkler will typically have following properties:
Would be nice if the users can specify these properties, without having to change the svg shapes used for this widget. Seems to me that this can be achieved using CSS variables. In the following sprinkler demo, the spray angle is a CSS variable "--spray-angle" which can have different values every time the widget is being used:
Resulting in this: Now we need to figure out how to share those widget 'group' elements between users (just copy paste, or make them available via our repository, or via our node somehow ...) |
P.S. I also tried to add a '--start-angle' property, but for some reason that doesn't work:
Have also tried a default value Got following error in the Chrome console log: |
Hi bart, this works for me...
Perhaps the double quote
For many environments being isolated / offline, a local repository would be good however this is gonna take some doing. We could simplify this in V1 by having a JSON file containing items. e.g.
.. then a user could at least add his own (albeit without a fancy editor or perhaps an ace instance to permit JSON editing of the widgets) future... Perhaps make use of github gists for a public repository which can perhaps be sync'd down to the node-red installation for new and future widgets? Again, I hope I have at least provided a 💡 moment for us 🙂 |
Hi bart, this actually doesnt works for me (sorry)...
... I get the same error in chrome dev tools. Another thought on how to provide a library of widgets...
..so perhaps we could have a resources directory with a collection of SVGs or a master SVG with multiple ID'd widgets? We could enumerate the widgets, provide a multi-level dropdown menu (with svg previews in-line?) to "Insert at cursor" when selected? e.g.
|
Hi Steve,
Other ideas? |
I wonder, does the clipboard allow pasting of SVG code? if so, we could have our own toolbar to insert into the editor? |
we could see if it is possible to add a custom library like the libraries already in DrawSVG? not sure how or if possible. perhaps contact the author? |
When somebody creates e.g. a nice SVG animation (e.g. sprinkler rotating with water), it would be nice if we could share this somehow...
Perhaps somehow with SVG definitions???
[EDIT 19/8] For Inkscape they use symbols containing a single path, which is being used to draw all required shapes. But I would like to have multiple shapes, each with their own customizable attributes. Perhaps CSS variables can solve this, like here explained.
The text was updated successfully, but these errors were encountered: