Skip to content

Commit 384c29a

Browse files
authored
Merge pull request #37 from s-ccs/docum
indentations
2 parents 783fc0e + d1ba0a3 commit 384c29a

File tree

5 files changed

+75
-74
lines changed

5 files changed

+75
-74
lines changed

src/explore.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
Run the dashboard for explorative ERP analysis.
44
55
Arguments:\\
6-
- `model::UnfoldLinearModel{Float64}` - Unfold linear model with categorical and continuous terms.
7-
- `positions::Vector{Point{2, Float32}}` - x an y coordinates of the channels.
8-
- `size::Tuple{Float64, Float64}` - size of the topoplot panel.
6+
- `model::UnfoldLinearModel{Float64}` - Unfold linear model with categorical and continuous terms.\\
7+
- `positions::Vector{Point{2, Float32}}` - x an y coordinates of the channels.\\
8+
- `size::Tuple{Float64, Float64}` - size of the topoplot panel.\\
99
10-
Actions:
11-
- Extract formula terms and itheir features.
12-
- Create interactive formula with checkboxes.
13-
- Arrange and map dropdown menus.
14-
- Create interactive topoplot.
15-
- Create Observable DataFrame with predicted values (yhats) and more.
16-
- Create `GridLayout`.
17-
- Use `Base.ReentrantLock`, a synchronization primitive_ to manage concurrent access to shared resources in multi-threaded programs
18-
- Create Figure.
10+
Actions:\\
11+
- Extract formula terms and itheir features.\\
12+
- Create interactive formula with checkboxes.\\
13+
- Arrange and map dropdown menus.\\
14+
- Create interactive topoplot.\\
15+
- Create Observable DataFrame with predicted values (yhats) and more.\\
16+
- Create `GridLayout`.\\
17+
- Use `Base.ReentrantLock`, a synchronization primitive_ to manage concurrent access to shared resources in multi-threaded programs\\
18+
- Create Figure.\\
1919
- Translate into into HTML code using DOMs.
2020
2121
**Return Value:** `Hyperscript.Node{Hyperscript.HTMLSVG}` - final HTML code of the dashboard.

src/functions_formular.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Arguments:\\
66
- `variables::Vector{Pair{Symbol}}` - vector of key-value pairs with information about the model formula terms.
77
88
Actions:
9-
- Extract ranges of term values.
10-
- Create widgets for each term (`Slider` for continuous, `SelectSet` for categorical).
11-
- Creating the formula with checkboxes and translating to HTML code.
12-
- Convert checkboxes to Observables.
13-
14-
**Return Values:**
15-
- `widget_checkbox`: Dictionary with the current values of the widgets (term => values).
16-
- `widget_signal`: widget_checkbox but as Observable, a signal that emits a dictionary with the current values of the widgets.
17-
- `formular_widget`: The HTML element that can be displayed to interact with the the widgets.
18-
- `value_ranges`: A dictionary containing the value ranges of each formula term.
9+
- Extract ranges of term values.\\
10+
- Create widgets for each term (`Slider` for continuous, `SelectSet` for categorical).\\
11+
- Creating the formula with checkboxes and translating to HTML code.\\
12+
- Convert checkboxes to Observables.\\
13+
14+
**Return Values:**\\
15+
- `widget_checkbox`: Dictionary with the current values of the widgets (term => values).\\
16+
- `widget_signal`: widget_checkbox but as Observable, a signal that emits a dictionary with the current values of the widgets.\\
17+
- `formular_widget`: The HTML element that can be displayed to interact with the the widgets.\\
18+
- `value_ranges`: A dictionary containing the value ranges of each formula term.\\
1919
"""
2020
function formular_widgets(variables)
2121
value_ranges = [k => value_range(v) for (k, v) in variables]
@@ -59,14 +59,14 @@ end
5959
Creates a dictionary with yhat values and more.\\
6060
6161
Arguments:\\
62-
- `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 channel-
65-
66-
Actions:
67-
- Compute predicted value (yhat) of the given model using `effects`.
68-
- Create `DataFrame` with columns: yhat, channel, dummy, time, eventname and unique columns for each formula term.
69-
- Make it Observable.
62+
- `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.\\
65+
66+
Actions:\\
67+
- Compute predicted value (yhat) of the given model using `effects`.\\
68+
- Create `DataFrame` with columns: yhat, channel, dummy, time, eventname and unique columns for each formula term.\\
69+
- Make it Observable.\\
7070
7171
**Return Value:** `yhats_signal::Observable{Any}` containing DataFrame with yhats.
7272
"""

src/functions_plotting.jl

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
plot_data(data, value_ranges, categorical_vars, continuous_vars, mapping_obs)
44
Plotting an interactive dashboard.
55
6-
Arguments:
7-
- `data::DataFrame` - the result of `effects(Dict(...), model) ` with columns: yhat, channel, dummy, time, eventname and unique columns for each formula term..
8-
- `value_ranges::Vector{Pair{Symbol}}` - value range for continuous variables, levels for categorical.
9-
- `categorical_vars::Vector{Symbol}` - categorical terms.
10-
- `continuous_vars::Vector{Symbol}` - continuous terms.
11-
- `mapping::Dict{Symbol, Symbol}` - dictionary with dropdown menus and their default values.
12-
13-
Action:
14-
- Create default palettes for colors, markers, line styles, and color styles for continuous values.
15-
- Check that the terms are not empty.
16-
- Plot the dashboard.
17-
- Define line and scatter styles for the line plot.
6+
Arguments:\\
7+
- `data::DataFrame` - the result of `effects(Dict(...), model) ` with columns: yhat, channel, dummy, time, eventname and unique columns for each formula term.\\
8+
- `value_ranges::Vector{Pair{Symbol}}` - value range for continuous variables, levels for categorical.\\
9+
- `categorical_vars::Vector{Symbol}` - categorical terms.\\
10+
- `continuous_vars::Vector{Symbol}` - continuous terms.\\
11+
- `mapping::Dict{Symbol, Symbol}` - dictionary with dropdown menus and their default values.\\
12+
13+
Action:\\
14+
- Create default palettes for colors, markers, line styles, and color styles for continuous values.\\
15+
- Check that the terms are not empty.\\
16+
- Plot the dashboard.\\
17+
- Define line and scatter styles for the line plot.\\
1818
- Add line and scatter styles to the legend.
1919
2020
**Return Value:** `Makie.GridLayoutSpec`.
@@ -141,16 +141,17 @@ end
141141
define_scatter_line_style!(plots, data, vars, scatter_styles, line_styles, continuous_vars)
142142
Define styling of lines and points (scatter).
143143
144-
- subset the data.
145-
- select points and plot scatter. Define scatter style: markersize and color.
146-
- plot lines and define line style: colormap, color range, color.
144+
Actions:\\
145+
- subset the data.\\
146+
- select points and plot scatter. Define scatter style: markersize and color.\\
147+
- plot lines and define line style: colormap, color range, color.\\
147148
148149
Arguments:\\
149150
- `plots::Vector{Makie.PlotSpec}` - an empty SpecApi list to push into parts of the layout.\\
150151
- `data::DataFrame` - a DataFrame with predicted values to be subsetted.\\
151152
- `vars::Dict{Any, Any}` contains the levels to be plotted.\\
152-
- `scatter_styles::Dict{Any, Any}` - define colors of scatter.
153-
- `line_styles:: Dict{Symbol, Pair{Symbol, Tuple{Tuple{String, String}, Symbol}}}` - define line styles: colormap, color range, color.
153+
- `scatter_styles::Dict{Any, Any}` - define colors of scatter.\\
154+
- `line_styles:: Dict{Symbol, Pair{Symbol, Tuple{Tuple{String, String}, Symbol}}}` - define line styles: colormap, color range, color.\\
154155
- `continuous_vars::Vector{Symbol}` - continuous terms.
155156
156157
**Return Value:** `Makie.GridLayoutSpec`.

src/functions_preprocessing.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Takes the Unfold model and extract variables from it for future functions.
1919
Arguments:\\
2020
- `model::UnfoldLinearModel{Float64}` - Unfold linear model with categorical and continuous terms.
2121
22-
These variables are:
23-
- `names` - all terms of the model.
24-
- `symbols`- non-numeric terms of the model.
22+
These variables are:\\
23+
- `names` - all terms of the model.\\
24+
- `symbols`- non-numeric terms of the model.\\
2525
- `types` - types of terms.\\
26-
- `vals` - min, max, variance, mean for continuous terms, levels for categorical terms.
26+
- `vals` - min, max, variance, mean for continuous terms, levels for categorical terms.\\
2727
2828
**Return Values:** `Vector{Pair{Symbol}}`.
2929
"""

src/widgets_long.jl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
Map and arrange dropdown menus on the left panel of the dashboard.\\
66
77
Arguments:\\
8-
- `varnames::Vector{Symbol}` - vector of the model formula terms.
9-
- `var_types::Vector{Symbol}` - vector of types of the model formula terms.
10-
11-
Actions:
12-
- Take categorical variables and put their values into dropdown menus.
13-
- There will be 5 menus for: color, markers, line styles, column and row facets.
14-
- Map each menu object with its name on the Figure.
15-
- Create HTML containers using Document Object Model (DOM) from Bonito.
16-
- Arrange containers on the panel using Col() and Row(). Specify their styling.
17-
18-
**Return Values:**
19-
- `mapping::Observable{Dict{Symbol, Symbol}}` - interactive dictionary with menus and their default value.
20-
- `mapping_dom::Hyperscript.Node{Hyperscript.HTMLSVG}` - dropdown menus in HTML code with styling and layout.
8+
- `varnames::Vector{Symbol}` - vector of the model formula terms.\\
9+
- `var_types::Vector{Symbol}` - vector of types of the model formula terms.\\
10+
11+
Actions:\\
12+
- Take categorical variables and put their values into dropdown menus.\\
13+
- There will be 5 menus for: color, markers, line styles, column and row facets.\\
14+
- Map each menu object with its name on the Figure.\\
15+
- Create HTML containers using Document Object Model (DOM) from Bonito.\\
16+
- Arrange containers on the panel using Col() and Row(). Specify their styling.\\
17+
18+
**Return Values:**\\
19+
- `mapping::Observable{Dict{Symbol, Symbol}}` - interactive dictionary with menus and their default value.\\
20+
- `mapping_dom::Hyperscript.Node{Hyperscript.HTMLSVG}` - dropdown menus in HTML code with styling and layout.\\
2121
"""
2222
function mapping_dropdowns(varnames, var_types)
2323
cats = [v for (ix, v) in enumerate(varnames) if var_types[ix] == :CategoricalTerm]
@@ -66,21 +66,21 @@ end
6666
"""
6767
topoplot_widget(positions; size = ())
6868
Controls the topoplot in the lower left panel of the figure.\\
69-
Highlight the location of the current electrode and allows electrode selection.
69+
Highlight the location of the current electrode and allows electrode selection.\\
7070
7171
Arguments:\\
72-
- `positions::Vector{Point{2, Float32}}` - x an y coordinates of the channels.
73-
- `size::Tuple{Float64, Float64}` - size of the topoplot panel.
72+
- `positions::Vector{Point{2, Float32}}` - x an y coordinates of the channels.\\
73+
- `size::Tuple{Float64, Float64}` - size of the topoplot panel.\\
7474
75-
Actions:
75+
Actions:\\
7676
- Create interactive scatter.
77-
- Highlight the selected electrode with white color, others are grayed out.
78-
- Create a topolot with a null interpolator and define its style and behavior.
79-
- Hide decorations and spines.
77+
- Highlight the selected electrode with white color, others are grayed out.\\
78+
- Create a topolot with a null interpolator and define its style and behavior.\\
79+
- Hide decorations and spines.\\
8080
81-
**Return Values:**
82-
- `h_topo::Makie.FigureAxisPlot` - topoplot widget.
83-
- `interactive_scatter::Observable{Int64}` - number of the selected channel.
81+
**Return Values:**\\
82+
- `h_topo::Makie.FigureAxisPlot` - topoplot widget.\\
83+
- `interactive_scatter::Observable{Int64}` - number of the selected channel.\\
8484
"""
8585
function topoplot_widget(positions; size = ())
8686
strokecolor = Observable(repeat([:red], length(to_value(positions)))) # crashing

0 commit comments

Comments
 (0)