I have a lot of settings in the following format:
{
key1: {
cat1: [choices_k1c1],
cat2: [choices_k1c2],
...
},
key2: {
cat1: [choices_k2c1],
cat2: [choices_k2c2],
...
}
}
On top of that, the inner choices can have multiple selections (not the single select that NestedSelect requires), so what I have right now is using a NestedSelect to let the user choose the top two levels, and then a function bound to the NestedSelect that returns the appropriate inner MultiSelect widget. I correspondingly store all the widgets in a dictionary of dictionaries for retrieval.
The challenge for me now is that I have other analysis code that takes in all the user settings, but in a dictionary format, i.e. that inner level should be a list instead of a MultiSelect widget, i.e. I call f(dict_of_dict_of_lists)
.
How do I properly hook/bind this function up to all the user selections? My first instinct is that I should make a reactive dictionary that the widgets “write to” using callbacks, but I haven’t been able to get a d = param.Dict
working. When I try to use it (e.g. d[label] = value
, as I saw in other posts), I get errors like 'Dict' object does not support item assignment
Note, I can get widget.param.watch
to write properly to a regular dictionary and print the changes to the terminal in a callback. I just don’t know how to write to a reactive object that other functions can be bound to.
Downstream, I’m also doing a lot of more complex data transformations (e.g. manipulating columns, storing results processing in a column etc.). One problem that I’ve been running into is that rx(data frame) does not allow for setting values, only filtering. Am I missing something?
Thanks in advance!