@@ -55,13 +55,13 @@ function formular_widgets(variables)
5555end
5656
5757"""
58- get_ERP_data(model, widget_signal, channel )
58+ get_ERP_data(model, formula_toggle, channel_chosen )
5959Creates a dictionary with yhat values and more.\\
6060
6161Arguments:\\
6262- `model::UnfoldLinearModel{Float64}` - vector of key-value pairs with information about the model formula terms.\\
63- - `widget_signal ::Observable{Vector{Any}}` - a signal that emits a dictionary with the current values of the widgets.\\
64- - `channel ::Observable{Int64}` - number of selected channels.\\
63+ - `formula_toggle ::Observable{Vector{Any}}` - a signal that emits a dictionary with the current values of the widgets.\\
64+ - `channel_chosen ::Observable{Int64}` - number of selected channels.\\
6565
6666Actions:\\
6767- Compute predicted value (yhat) of the given model using `effects`.\\
@@ -70,28 +70,27 @@ Actions:\\
7070
7171**Return Value:** `yhats_signal::Observable{Any}` containing DataFrame with yhats.
7272"""
73- function get_ERP_data (model, widget_signal, channel)
73+ function get_ERP_data (model, formula_toggle, channel_chosen)
74+ ERP_data = Observable {Any} (nothing ; ignore_equal_values = true )
7475
75- yhats_signal = Observable {Any} (nothing ; ignore_equal_values = true )
76-
77- onany (widget_signal, channel; update = true ) do widget_values, chan
76+ onany (formula_toggle, channel_chosen; update = true ) do widget_values, chan
7877 yhat_dict = Dict (
7978 k => widget_value (wv[2 ]) for (k, wv) in widget_values if ! isempty (wv) && wv[1 ]
8079 )
8180 if isempty (yhat_dict)
8281 yhat_dict = Dict (:dummy => [" dummy" ])
8382 end
8483 yhats = effects (yhat_dict, model)
84+
8585
8686 for (k, wv) in widget_values
8787 if isempty (wv[2 ]) || ! wv[1 ]
8888 yhats[! , k] .= " typical_value"
8989 end
9090 end
91-
9291 filter! (x -> x. channel == chan, yhats)
93- yhats_signal [] = yhats
92+ ERP_data [] = yhats
9493 end
9594
96- return yhats_signal
95+ return ERP_data
9796end
0 commit comments