Skip to content

Commit

Permalink
fixes bins option for geom_histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
rdboyes committed Mar 23, 2024
1 parent 7f22e32 commit eaabd2e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/draw.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ function Makie.SpecApi.Axis(plot::GGPlot)
"alpha" => Float32,
"markersize" => Float32,
"strokewidth" => Float32,
"glowwidth" => Float32
"glowwidth" => Float32,
# Integer
"bins" => Int64
)

plot_list = Makie.PlotSpec[]
Expand Down Expand Up @@ -110,7 +112,7 @@ function Makie.SpecApi.Axis(plot::GGPlot)
visual_args_list = []

for req_aes in required_aes

if eltype(plot_data[!, aes_dict[req_aes]]) <: Union{AbstractString, AbstractChar}
if haskey(plot.axis_options, "cat_inorder")
cat_column = plot_data[!, aes_dict[req_aes]]
Expand All @@ -126,14 +128,17 @@ function Makie.SpecApi.Axis(plot::GGPlot)
end
push!(visual_args_list, column_data)
end
args = Tuple(visual_args_list)
kwargs = (;merge(args_dict_makie, visual_optional_aes)...)

args = Tuple([geom.visual, visual_args_list...])
kwargs = merge(args_dict_makie, visual_optional_aes)

# push completed PlotSpec (type, args, and kwargs) to the list of plots
push!(plot_list, Makie.PlotSpec(geom.visual, args...; kwargs...))

push!(plot_list, Makie.PlotSpec(args...; kwargs...))
end

println(plot.axis_options)

# remove options from args_dict that are not meant for Makie

if haskey(plot.axis_options, "cat_inorder")
Expand Down

0 comments on commit eaabd2e

Please sign in to comment.