diff --git a/docs/example_data.jl b/docs/example_data.jl index ed27d0d6..81f66a06 100644 --- a/docs/example_data.jl +++ b/docs/example_data.jl @@ -22,14 +22,14 @@ function example_data(example = "pattern_detection_values"; mode = 1) else datapath = dirname(Base.current_project()) * "/data/evts_d.csv" end + evts_d = CSV.read(datapath, DataFrame) + evts_d.channel = 1:nrow(evts_d) if example == "pattern_detection_values" - evts_d = CSV.read(datapath, DataFrame) pattern_detection_values = stack(evts_d) rename!(pattern_detection_values, :variable => :condition, :value => :estimate) evts_d = nothing - return pattern_detection_values + return pattern_detection_value elseif example == "pattern_detection_values_32" - evts_d = CSV.read(datapath, DataFrame) pattern_detection_values = stack(evts_d[1:32, :]) rename!(pattern_detection_values, :variable => :condition, :value => :estimate) evts_d = nothing diff --git a/src/configs.jl b/src/configs.jl index 2ad8578c..f6db1159 100644 --- a/src/configs.jl +++ b/src/configs.jl @@ -22,7 +22,6 @@ function supportive_defaults(cfg_symb::Symbol) ), colorbar = (; label = "Pattern detection function value", - colorrange = (0, 1), height = 300, ), layout = (; use_colorbar = true), diff --git a/src/interactive_topoplots.jl b/src/interactive_topoplots.jl index b8882271..b2131fe8 100644 --- a/src/interactive_topoplots.jl +++ b/src/interactive_topoplots.jl @@ -143,6 +143,7 @@ function inter_toposeries_image( plot_topoplotseries!( f[1, 1:5], pattern_detection_values; + mapping = (; col = :condition), positions = positions, interactive_scatter = obs_tuple, toposeries_configs..., diff --git a/test/interactive_topoplots_test.jl b/test/interactive_topoplots_test.jl index f1773724..dc318ab9 100644 --- a/test/interactive_topoplots_test.jl +++ b/test/interactive_topoplots_test.jl @@ -7,15 +7,20 @@ pattern_detection_values_32 = example_data("pattern_detection_values_32"; mode = desired_conditions = ["duration", "fix_avgpos_x", "fix_avgpos_y", "fix_avgpupilsize"] @testset "inter_toposeries" begin - inter_toposeries( - filter(row -> row.condition in desired_conditions, pattern_detection_values); + filtered_data = filter(row -> row.condition in desired_conditions, pattern_detection_values) + plot_topoplotseries( + filtered_data; + nrows = 2, positions = positions_128, - ) + mapping = (; col = :condition), +) end @testset "inter_toposeries_image" begin + filtered_data = filter(row -> row.condition in desired_conditions, pattern_detection_values_32) + inter_toposeries_image( - filter(row -> row.condition in desired_conditions, pattern_detection_values_32), + filtered_data, evts, erps_fix_32, 1:151; @@ -25,8 +30,10 @@ end end @testset "inter_toposeries_image: toposeries_config" begin + filtered_data = filter(row -> row.condition in desired_conditions, pattern_detection_values_32) + inter_toposeries_image( - filter(row -> row.condition in desired_conditions, pattern_detection_values_32), + filtered_data, evts, erps_fix_32, 1:151;