Skip to content

Commit 3cbd484

Browse files
move aliases
1 parent f324f36 commit 3cbd484

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

src/args.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function make_non_underscore(s::Symbol)
66
end
77

88
const _keyAliases = Dict{Symbol,Symbol}()
9-
const _generalAliases = ("background" => "bg", "foreground" => "fg", "pointsize" => "size", "yfill" => "fill")
9+
const _generalAliases = ("background" => "bg", "foreground" => "fg", "pointsize" => "size", "yfill" => "fill", "alpha" => "a", "alpha" => "opacity", "alpha" => "α")
1010

1111
function add_aliases(sym::Symbol, aliases::Symbol...)
1212
for alias in aliases
@@ -559,7 +559,6 @@ aliases(aliasMap::Dict{Symbol,Symbol}, val) =
559559
filter((x) -> x.second == val, aliasMap) |> keys |> collect |> sort
560560

561561
# -----------------------------------------------------------------------------
562-
add_aliases(:legend_title_font_pointsize, :legendtitlefontsize)
563562
# margin
564563
add_aliases(:left_margin, :leftmargin)
565564

@@ -569,11 +568,6 @@ add_aliases(:right_margin, :rightmargin)
569568

570569
# colors
571570
add_aliases(:seriescolor, :c, :color, :colour)
572-
add_aliases(:line_color, :lc, :lcolor, :lcolour, :linecolour)
573-
add_aliases(:marker_color, :mc, :mcolor, :mcolour, :markercolour)
574-
add_aliases(:marker_stroke_color, :msc, :mscolor, :mscolour, :markerstrokecolour)
575-
add_aliases(:marker_stroke_width, :msw, :mswidth)
576-
add_aliases(:yfill_color, :fc, :fcolor, :fcolour, :fillcolour)
577571

578572
add_aliases(
579573
:background_color,
@@ -788,10 +782,6 @@ add_aliases(
788782

789783
# alphas
790784
add_aliases(:seriesalpha, :alpha, , :opacity)
791-
add_aliases(:line_alpha, :la, :lalpha, :lα, :lineopacity, :lopacity)
792-
add_aliases(:marker_alpha, :ma, :malpha, :mα, :markeropacity, :mopacity)
793-
add_aliases(:marker_stroke_alpha, :msa, :msalpha, :msα, :markerstrokeopacity, :msopacity)
794-
add_aliases(:yfill_alpha, :fa, :falpha, :fα, :fillopacity, :fopacity)
795785

796786
# axes attributes
797787
add_axes_aliases(:guide, :label, :lab, :l; generic = false)
@@ -871,15 +861,10 @@ add_axes_aliases(
871861
add_aliases(:seriestype, :st, :t, :typ, :linetype, :lt)
872862
add_aliases(:label, :lab)
873863
add_aliases(:line, :l)
874-
add_aliases(:line_width, :w, :width, :lw)
875-
add_aliases(:line_style, :style, :s, :ls)
876864
add_aliases(:marker, :m, :mark)
877-
add_aliases(:marker_shape, :shape)
878-
add_aliases(:marker_size, :ms, :msize)
879865
add_aliases(:marker_z, :markerz, :zcolor, :mz)
880866
add_aliases(:line_z, :linez, :zline, :lz)
881867
add_aliases(:fill, :f, :area)
882-
add_aliases(:yfill_range, :fillrng, :frange, :fillto, :fill_between)
883868
add_aliases(:group, :g, :grouping)
884869
add_aliases(:bins, :bin, :nbin, :nbins, :nb)
885870
add_aliases(:ribbon, :rib)

src/components.jl

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,13 @@ end :match = (
845845
width = :auto
846846
color = :auto
847847
alpha = nothing
848-
end
848+
end :aliases = Dict(
849+
:line_color => (:lc, :lcolor, :lcolour, :line_colour),
850+
:line_alpha => (:lalpha,),
851+
:line_width => (:w, :width, :lw),
852+
:line_style => (:s, :style, :ls),
853+
854+
)
849855

850856
### Marker
851857

@@ -855,7 +861,15 @@ end
855861
alpha = nothing
856862
stroke::Line = Line(:solid, 1, :match, nothing)
857863
size = 4
858-
end
864+
end :aliases = Dict(
865+
:marker_color => (:mc, :mcolor, :mcolour, :marker_colour),
866+
:marker_alpha => (:malpha,),
867+
:marker_shape => (:shape,),
868+
:marker_size => (:ms, :msize),
869+
:marker_stroke_color => (:msc, :mscolor, :mscolour),
870+
:marker_stroke_alpha => (:msalpha,),
871+
:marker_stroke_width => (:msw, :mswidth),
872+
)
859873

860874
### Errorbars
861875

@@ -872,4 +886,8 @@ end
872886
color = :match
873887
alpha = nothing
874888
style = nothing
875-
end
889+
end aliases = Dict(
890+
:yfill_color => (:fc, :fcolor, :fcolour,),
891+
:yfill_alpha => (:falpha,),
892+
:yfill_range => (:yfill_rng, :frange, :yfill_to, :yfill_between)
893+
)

0 commit comments

Comments
 (0)