Dictionary socket
Created by: Durman
Problem statement
Recently nodes have been starting to get face data sockets. Sense of this socket is to include all data which related with given face. After a node processing it rebuild this data according topological changes. The problem is that faces can have a whole bunch of related data. String socket (list socket) can't handle with this problem now.
Solution
One of the solutions can be adding one more list level. But it looks like that human brain does not design for handling with such data structures.)) My proposal is to add new socket type: dictionary.
Dictionary could have arbitrary number of keys. Values of cays can include any Sverchok data. Dictionary in node can looks in this way:
| dictionary in |
+------------------------+
| dict |
| item 1 name (editable) |
| item 2 name ... |
Vectorization of dictionary in node: If to plug list of values like this [[0,1,2,3,4]] it produces one dictionary [dict1]. If to plug several lists [[0,1,2,3,4],[5,6,7,8]] then output looks like this [dict1, dict2].
Nested dictionaries: Also dictionaries could include another dictionaries. Probably nested dictionaries could solve problem of handling data structures with arbitrary nestedness or at list to simplify solution of the problem.
For creating nested dictionary it will be enuff to plug dictionary socket to dictionary in
node. So it would possible to create complex data structures from tree of nodes. Most tricky thing is to make up how such data structure should me handled. Probably some recursive algorithm should be appropriate.
Appearance:
I think the socket should have different color from other type of sockets because it does not have compatibility with them. Also the nodes dictionary in
and dictionary out
looks like deserve to have own category right below list category. Also I expect more nodes handling dictionaries can fill this category.