Skip to content

Commit

Permalink
fix #472 as long Dictioanry.jl isn't fixed (#484)
Browse files Browse the repository at this point in the history
* fix #472 as long Dictioanry.jl isn't fixed

* fix without regression
  • Loading branch information
SimonDanisch authored Jan 2, 2024
1 parent 138051c commit 37819b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/algebra/layer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ ProcessedLayer(layer::Layer) = process(layer)
unnest(vs::AbstractArray, indices) = map(k -> [el[k] for el in vs], indices)

unnest_arrays(vs) = unnest(vs, keys(first(vs)))
unnest_dictionaries(vs) = unnest(vs, Indices(keys(first(vs))))

function unnest_dictionaries(vs)
return Dictionary(Dict((k => [el[k] for el in vs] for k in collect(keys(first(vs))))))
end
slice(v, c) = map(el -> getnewindex(el, c), v)

function slice(processedlayer::ProcessedLayer, c)
Expand Down Expand Up @@ -198,7 +199,7 @@ function rescale(p::ProcessedLayer, categoricalscales::MixedArguments)
return ProcessedLayer(p; primary, positional, attributes)
end

# Determine whether entries from a `ProcessedLayer` should be merged
# Determine whether entries from a `ProcessedLayer` should be merged
function mergeable(processedlayer::ProcessedLayer)
plottype, primary = processedlayer.plottype, processedlayer.primary
# merge violins for correct renormalization
Expand Down Expand Up @@ -300,6 +301,6 @@ function compute_attributes(pl::ProcessedLayer,
colorscale = get(continuousscales, :color, nothing)
!isnothing(colorscale) && set!(attrs, :colorrange, colorscale.extrema)

# remove unnecessary information
# remove unnecessary information
return filterkeys(!in((:col, :row, :layout, :alpha)), attrs)
end

0 comments on commit 37819b6

Please sign in to comment.