diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1128781..e22f721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: [master] pull_request: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/Project.toml b/Project.toml index c2ef6ce..61b1747 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PlotUtils" uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" -version = "1.4.1" +version = "2.0.0" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/src/PlotUtils.jl b/src/PlotUtils.jl index e2b7161..9c7c2a6 100644 --- a/src/PlotUtils.jl +++ b/src/PlotUtils.jl @@ -36,7 +36,7 @@ export optimize_ticks, optimize_datetime_ticks include("ticks.jl") -const _default_colorscheme = generate_colorscheme() +const _default_colorscheme = ColorSchemes.colorschemes[:seaborn_colorblind] if VERSION ≥ v"1.8.0" @compile_workload begin diff --git a/src/colorschemes.jl b/src/colorschemes.jl index 8a44379..b2c7703 100644 --- a/src/colorschemes.jl +++ b/src/colorschemes.jl @@ -237,7 +237,7 @@ function cgrad( end function cgrad(colors, args...; kwargs...) - colors ≡ :default && (colors = :inferno) + colors ≡ :default && (colors = DEFAULT_COLOR_GRADIENT[]) cgrad(get_colorscheme(colors), args...; kwargs...) end @@ -335,7 +335,7 @@ is_colorscheme(sym) = sym ∈ keys(COLORSCHEME_ALIASES) || sym ∈ keys(MISC_COLORSCHEMES) -const DEFAULT_COLOR_GRADIENT = Ref(cgrad(ColorSchemes.colorschemes[:inferno])) +const DEFAULT_COLOR_GRADIENT = Ref(cgrad(ColorSchemes.colorschemes[:haline])) ## Compat @@ -422,6 +422,7 @@ const TEST_COLORS = RGBA{Float64}[ ] const MISC_COLORSCHEMES = Dict{Symbol,ColorScheme}( + :plots_v1 => generate_colorscheme(), :blues => ColorScheme(RGBA{Float64}[colorant"lightblue", colorant"darkblue"]), :reds => ColorScheme(RGBA{Float64}[colorant"lightpink", colorant"darkred"]), :greens => ColorScheme(RGBA{Float64}[colorant"lightgreen", colorant"darkgreen"]), diff --git a/test/downstream.jl b/test/downstream.jl index 702eaf1..54c9ce3 100644 --- a/test/downstream.jl +++ b/test/downstream.jl @@ -3,7 +3,7 @@ using Pkg, PlotUtils, Test LibGit2 = Pkg.GitTools.LibGit2 TOML = Pkg.TOML -failsafe_clone_checkout(path, url) = begin +failsafe_clone_checkout(path, url; version = :stable) = begin local repo for i ∈ 1:6 try @@ -27,10 +27,13 @@ failsafe_clone_checkout(path, url) = begin end @assert isfile(versions) - stable = maximum(VersionNumber.(keys(TOML.parse(read(versions, String))))) - tag = LibGit2.GitObject(repo, "v$stable") - hash = string(LibGit2.target(tag)) - LibGit2.checkout!(repo, hash) + if version === :stable + stable = maximum(VersionNumber.(keys(TOML.parse(read(versions, String))))) + vrs = "v$stable" + tag = LibGit2.GitObject(repo, vrs) + hash = string(LibGit2.target(tag)) + LibGit2.checkout!(repo, hash) + end nothing end @@ -50,11 +53,27 @@ end develop_stable_Plots() = begin tmpd = mktempdir() Plots_jl = joinpath(tmpd, "Plots.jl") - - failsafe_clone_checkout(Plots_jl, "https://github.com/JuliaPlots/Plots.jl") - fake_supported_version!(Plots_jl) - - Pkg.develop(path = Plots_jl) + PlotThemes_jl = joinpath(tmpd, "PlotThemes.jl") + PlotsBase_jl = joinpath(Plots_jl, "PlotsBase") + RecipesPipeline_jl = joinpath(Plots_jl, "RecipesPipeline") + + failsafe_clone_checkout( + Plots_jl, + "https://github.com/JuliaPlots/Plots.jl", + version = :default, + ) + fake_supported_version!(RecipesPipeline_jl) + fake_supported_version!(PlotsBase_jl) + + failsafe_clone_checkout(PlotThemes_jl, "https://github.com/JuliaPlots/PlotThemes.jl") + fake_supported_version!(PlotThemes_jl) + + Pkg.develop([ + PackageSpec(path = Plots_jl), + PackageSpec(path = RecipesPipeline_jl), + PackageSpec(path = PlotsBase_jl), + PackageSpec(path = PlotThemes_jl), + ]) Pkg.status(["PlotUtils", "Plots"]) nothing end