From b41291776fbf2be23599cb23585e53790784b57f Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 9 Apr 2019 12:49:29 +0200 Subject: [PATCH 1/6] fix missing Set1 example --- examples/documentation.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/documentation.jl b/examples/documentation.jl index 5e9d4f1a..fc5a57e5 100644 --- a/examples/documentation.jl +++ b/examples/documentation.jl @@ -94,7 +94,7 @@ offset = 0.1 scene = Scene() cam2d!(scene) - plot = map(AbstractPlotting.all_gradient_names) do cmap + plot = map(collect(AbstractPlotting.all_gradient_names)) do cmap global h c = to_colormap(cmap) cbar = image!( @@ -231,12 +231,11 @@ end @cell "Stepper demo" [stepper, text, annotation] begin - function stepper_demo() scene = Scene() pos = (50, 50) steps = ["Step 1", "Step 2", "Step 3"] - colors = AbstractPlotting.to_colormap(:Set1, length(steps)) + colors = AbstractPlotting.ColorBrewer.palette("Set1", length(steps)) lines!(scene, Rect(0,0,500,500), linewidth = 0.0001) # initialize the stepper and give it an output destination st = Stepper(scene, @replace_with_a_path) From 924ab84f57733583202a3294eeaa81841d76eabb Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 9 Apr 2019 12:49:45 +0200 Subject: [PATCH 2/6] fix examples + add linesegment test with RGB --- examples/examples2d.jl | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/examples/examples2d.jl b/examples/examples2d.jl index 74ea4e4b..1da188c9 100644 --- a/examples/examples2d.jl +++ b/examples/examples2d.jl @@ -47,7 +47,7 @@ arrows!(x, y, u, v, arrowsize = 0.05) end @cell "image" [image] begin - hbox( + vbox( image(AbstractPlotting.logo(), scale_plot = false), image(rand(100, 500), scale_plot = false), ) @@ -303,6 +303,15 @@ step!(st) st end + + @cell "linesegments + colors" [linesegments] begin + using Colors + linesegments( + [rand(Point2f0) => rand(Point2f0) for i in 1:5], + color = rand(RGB{Float64}, 5) + ) + end + @cell "Parallel Prefix Sum" [lines, scatter] begin # credits to [jiahao chen](https://github.com/jiahao) @@ -440,21 +449,18 @@ end ) end - - end @block AnshulSinghvi ["Recipes"] begin - + @cell "Arc" [arc] begin - - arc( - [0, 0], # origin + s = arc( + Point2f0(0, 0), # origin 1, # radius 0, # start angle pi # end angle - ) - + ) + s end - + end From b7a83bed7096c72d3dfe7ba8d194d55e0a089620 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 9 Apr 2019 12:49:59 +0200 Subject: [PATCH 3/6] better errors --- src/database.jl | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/database.jl b/src/database.jl index d1303b47..5a6c3ec5 100644 --- a/src/database.jl +++ b/src/database.jl @@ -533,10 +533,26 @@ function eval_example( steps = split(source, "@substep", keepempty = false) Random.seed!(42) if length(steps) == 1 - return include_string(tmpmod, source, string(uname)) + try + return include_string(tmpmod, source, string(uname)) + catch e + println(stderr, "Example $(entry.title) failed with source:") + for line in split(source, "\n") + println(stderr, " ", line) + end + rethrow(e) + end else return map(enumerate(steps)) do (i, source) - include_string(tmpmod, source, string(uname, "_", i)) + try + return include_string(tmpmod, source, string(uname, "_", i)) + catch e + println(stderr, "Example $(entry.title) failed with source:") + for line in split(source, "\n") + println(stderr, " ", line) + end + rethrow(e) + end end end end From 147240e0ea8601485773d73b3ccb4b1ae2075171 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 9 Apr 2019 12:50:18 +0200 Subject: [PATCH 4/6] update reference images version --- src/testruns.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testruns.jl b/src/testruns.jl index ac38f6fb..ae10d203 100644 --- a/src/testruns.jl +++ b/src/testruns.jl @@ -3,7 +3,7 @@ const makiegallery_dir = abspath(first(Base.DEPOT_PATH), "makiegallery") """ Downloads the reference images from ReferenceImages for a specific version """ -function download_reference(version = v"0.1.5") +function download_reference(version = v"0.1.6") download_dir = joinpath(makiegallery_dir, "testimages") isdir(download_dir) || mkpath(download_dir) tarfile = joinpath(download_dir, "gallery.zip") From 27b14ce184bad1262e8b7bf5cf4cc0f4af376b07 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 9 Apr 2019 12:50:48 +0200 Subject: [PATCH 5/6] add commands for updating ref images --- test/runtests.jl | 2 ++ test/upgrade_recordings.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 0800bd60..2299a311 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,4 +17,6 @@ rm(test_record_path, force = true, recursive = true) mkpath(test_record_path) # THese examples download additional data - don't want to deal with that! examples = MakieGallery.record_examples(test_record_path) +# MakieGallery.generate_preview(test_record_path, joinpath(homedir(), "Desktop", "index.html")) +# MakieGallery.generate_thumbnails(test_record_path) MakieGallery.run_comparison(test_record_path, tested_diff_path) diff --git a/test/upgrade_recordings.jl b/test/upgrade_recordings.jl index 740a444f..74fabaf3 100644 --- a/test/upgrade_recordings.jl +++ b/test/upgrade_recordings.jl @@ -1,3 +1,5 @@ repo = joinpath(homedir(), "ReferenceImages", "gallery") +MakieGallery.generate_thumbnails(repo) + recordings = joinpath(@__DIR__, "test_recordings") cp(recordings, repo, force = true) From dcf7459e007969038a53466dd09a4e66d6b4f9cc Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Tue, 9 Apr 2019 13:07:21 +0200 Subject: [PATCH 6/6] bump version --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index f553e12f..063e2047 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -166,7 +166,7 @@ if !haskey(ENV, "DOCUMENTER_KEY") ENV["TRAVIS_BRANCH"] = "latest" ENV["TRAVIS_PULL_REQUEST"] = "false" ENV["TRAVIS_REPO_SLUG"] = "github.com/JuliaPlots/MakieGallery.jl.git" - ENV["TRAVIS_TAG"] = "v0.9.6" + ENV["TRAVIS_TAG"] = "v4" ENV["TRAVIS_OS_NAME"] = "" ENV["TRAVIS_JULIA_VERSION"] = "" ENV["PATH"] = string(ENV["PATH"], Sys.iswindows() ? ";" : ":", Conda.SCRIPTDIR)