Skip to content

Commit

Permalink
re-enables correct spelling of 'colour'
Browse files Browse the repository at this point in the history
  • Loading branch information
rdboyes committed Apr 13, 2024
1 parent 91ce497 commit b70e3e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/TidierPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export scale_x_log10, scale_y_log10, scale_x_log2, scale_y_log2, scale_x_log, sc
export scale_x_logit, scale_y_logit
export scale_x_pseudolog10, scale_y_pseudolog10, scale_x_Symlog10, scale_y_Symlog10
export scale_x_reverse, scale_y_reverse, scale_x_sqrt, scale_y_sqrt
#export scale_colour_continuous, scale_colour_discrete, scale_colour_manual, scale_colour_binned
export scale_colour_continuous, scale_colour_discrete, scale_colour_manual, scale_colour_binned
export scale_color_continuous, scale_color_discrete, scale_color_manual, scale_color_binned

# transforms
Expand Down
7 changes: 6 additions & 1 deletion src/draw.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ function Makie.SpecApi.Axis(plot::GGPlot)
# inherit any unspecified column transforms
col_transforms = merge(geom.column_transformations, plot.column_transformations)

aes_dict_makie = Dict{Symbol, Symbol}()

for (aes_string, column_name) in aes_dict
# the name of the aes is translated to the makie term if needed
aes = haskey(ggplot_to_makie_geom, aes_string) ? Symbol(ggplot_to_makie_geom[aes_string]) : Symbol(aes_string)
push!(aes_dict_makie, aes => column_name)
end

for (aes, column_name) in aes_dict_makie
# if there is a specified column transformation, use it
# otherwise use cat_inseq for string-like columns and as_is for everything else
if haskey(col_transforms, aes)
source_cols = [aes_dict[String(source)] for source in col_transforms[aes][1]]
source_cols = [aes_dict_makie[source] for source in col_transforms[aes][1]]
plottable_data = col_transforms[aes][2](aes, source_cols, plot_data)
elseif eltype(plot_data[!, column_name]) <: Union{AbstractString, AbstractChar}
plottable_data = cat_inseq(aes, [column_name], plot_data)
Expand Down
8 changes: 4 additions & 4 deletions src/scales_colour.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ end

# scale definitions

#scale_colour_manual = color_scale_template("color", color_scale_to_ggoptions, "manual")
scale_colour_manual = color_scale_template("color", color_scale_to_ggoptions, "manual")
scale_color_manual = color_scale_template("color", color_scale_to_ggoptions, "manual")
#scale_colour_discrete = color_scale_template("color", color_scale_to_ggoptions, "discrete")
scale_colour_discrete = color_scale_template("color", color_scale_to_ggoptions, "discrete")
scale_color_discrete = color_scale_template("color", color_scale_to_ggoptions, "discrete")
#scale_colour_continuous = color_scale_template("color", color_scale_to_ggoptions, "continuous")
scale_colour_continuous = color_scale_template("color", color_scale_to_ggoptions, "continuous")
scale_color_continuous = color_scale_template("color", color_scale_to_ggoptions, "continuous")
#scale_colour_binned = color_scale_template("color", color_scale_to_ggoptions, "binned")
scale_colour_binned = color_scale_template("color", color_scale_to_ggoptions, "binned")
scale_color_binned = color_scale_template("color", color_scale_to_ggoptions, "binned")

0 comments on commit b70e3e6

Please # to comment.