fix symbol cache

This commit is contained in:
Simon Christ 2021-10-18 15:14:20 +02:00
parent eb9766775c
commit 9a500d6be1
2 changed files with 16 additions and 3 deletions

View File

@ -564,9 +564,6 @@ function reset_axis_defaults_byletter!()
end end
reset_axis_defaults_byletter!() reset_axis_defaults_byletter!()
const _all_defaults = KW[_series_defaults, _plot_defaults, _subplot_defaults]
is_subplot_attr(k) = k in _all_subplot_args is_subplot_attr(k) = k in _all_subplot_args
is_series_attr(k) = k in _all_series_args is_series_attr(k) = k in _all_series_args
is_axis_attr(k) = Symbol(chop(string(k); head = 1, tail = 0)) in _all_axis_args is_axis_attr(k) = Symbol(chop(string(k); head = 1, tail = 0)) in _all_axis_args
@ -910,6 +907,7 @@ function parse_axis_kw(s::Symbol)
return nothing return nothing
end end
# update the defaults globally # update the defaults globally
""" """

View File

@ -49,3 +49,18 @@ for arg in _all_args
end end
# add all non_underscored forms to the _keyAliases # add all non_underscored forms to the _keyAliases
add_non_underscore_aliases!(_keyAliases) add_non_underscore_aliases!(_keyAliases)
# fill symbol cache
for letter in (:x, :y, :z)
_attrsymbolcache[letter] = Dict{Symbol, Symbol}()
for k in keys(_axis_defaults)
# populate attribute cache
lk = Symbol(letter, k)
_attrsymbolcache[letter][k] = lk
# allow the underscore version too: xguide or x_guide
add_aliases(lk, Symbol(letter, "_", k))
end
for k in (_magic_axis_args..., :(_discrete_indices))
_attrsymbolcache[letter][k] = Symbol(letter, k)
end
end