diff --git a/CairoMakie/Project.toml b/CairoMakie/Project.toml index 0a312e09419..959145ea53b 100644 --- a/CairoMakie/Project.toml +++ b/CairoMakie/Project.toml @@ -1,7 +1,11 @@ name = "CairoMakie" uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" author = ["Simon Danisch "] +<<<<<<< HEAD version = "0.11.0" +======= +version = "0.10.11" +>>>>>>> master [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -23,7 +27,11 @@ FFTW = "1" FileIO = "1.1" FreeType = "3, 4.0" GeometryBasics = "0.4.1" +<<<<<<< HEAD Makie = "=0.20.0" +======= +Makie = "=0.19.11" +>>>>>>> master PrecompileTools = "1.0" julia = "1.3" diff --git a/GLMakie/Project.toml b/GLMakie/Project.toml index 67a28fdb260..4b08158e776 100644 --- a/GLMakie/Project.toml +++ b/GLMakie/Project.toml @@ -1,6 +1,10 @@ name = "GLMakie" uuid = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" +<<<<<<< HEAD version = "0.9.0" +======= +version = "0.8.11" +>>>>>>> master [deps] ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" @@ -29,7 +33,11 @@ FixedPointNumbers = "0.7, 0.8" FreeTypeAbstraction = "0.10" GLFW = "3.3" GeometryBasics = "0.4.1" +<<<<<<< HEAD Makie = "=0.20.0" +======= +Makie = "=0.19.11" +>>>>>>> master MeshIO = "0.4" ModernGL = "1" Observables = "0.5.1" diff --git a/MakieCore/Project.toml b/MakieCore/Project.toml index 35bff2415ed..98b07d16e10 100644 --- a/MakieCore/Project.toml +++ b/MakieCore/Project.toml @@ -1,10 +1,11 @@ -authors = ["Simon Danisch"] name = "MakieCore" uuid = "20f20a25-4f0e-4fdf-b5d1-57303727442b" -version = "0.6.7" +authors = ["Simon Danisch"] +version = "0.6.8" [deps] Observables = "510215fc-4207-5dde-b226-833fc4488ee2" +REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [compat] Observables = "0.5.1" diff --git a/MakieCore/src/MakieCore.jl b/MakieCore/src/MakieCore.jl index 30940b26b11..3d0c55d1eee 100644 --- a/MakieCore/src/MakieCore.jl +++ b/MakieCore/src/MakieCore.jl @@ -8,6 +8,9 @@ end using Observables using Observables: to_value using Base: RefValue +# Needing REPL for Base.Docs.doc on julia +# https://github.com/MakieOrg/Makie.jl/issues/3276 +using REPL include("types.jl") diff --git a/NEWS.md b/NEWS.md index c695bdf29fd..1c908df2374 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,12 @@ ## master +## v0.19.11 + +- Setup automatic colorbars for volumeslices [#3253](https://github.com/MakieOrg/Makie.jl/pull/3253). +- Colorbar for arrows [#3275](https://github.com/MakieOrg/Makie.jl/pull/3275). +- Small bugfixes [#3275](https://github.com/MakieOrg/Makie.jl/pull/3275). + ## v0.19.10 - Fix bugs with Colorbar in recipes, add new API for creating a recipe colorbar and introduce experimental support for Categorical colormaps [#3090](https://github.com/MakieOrg/Makie.jl/pull/3090). diff --git a/Project.toml b/Project.toml index 8fed06e1e89..a8b103ef16c 100644 --- a/Project.toml +++ b/Project.toml @@ -82,7 +82,7 @@ Isoband = "0.1" KernelDensity = "0.5, 0.6" LaTeXStrings = "1.2" MacroTools = "0.5" -MakieCore = "=0.6.7" +MakieCore = "=0.6.8" Match = "1.1" MathTeXEngine = "0.5" Observables = "0.5.3" diff --git a/RPRMakie/Project.toml b/RPRMakie/Project.toml index 6878df654fd..27f2fd9eba1 100644 --- a/RPRMakie/Project.toml +++ b/RPRMakie/Project.toml @@ -1,7 +1,11 @@ name = "RPRMakie" uuid = "22d9f318-5e34-4b44-b769-6e3734a732a6" authors = ["Simon Danisch"] +<<<<<<< HEAD version = "0.6.0" +======= +version = "0.5.11" +>>>>>>> master [deps] Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" @@ -17,7 +21,11 @@ julia = "1.3" Colors = "0.9, 0.10, 0.11, 0.12" FileIO = "1.6" GeometryBasics = "0.4.1" +<<<<<<< HEAD Makie = "=0.20.0" +======= +Makie = "=0.19.11" +>>>>>>> master RadeonProRender = "0.3.0" [extras] diff --git a/WGLMakie/src/particles.jl b/WGLMakie/src/particles.jl index f550ebdff4e..392e47ac164 100644 --- a/WGLMakie/src/particles.jl +++ b/WGLMakie/src/particles.jl @@ -231,31 +231,13 @@ value_or_first(x) = x function create_shader(scene::Scene, plot::Makie.Text{<:Tuple{<:Union{<:Makie.GlyphCollection, <:AbstractVector{<:Makie.GlyphCollection}}}}) glyphcollection = plot[1] - res = map(x->Vec2f(widths(x)), pixelarea(scene)) - projview = scene.camera.projectionview transfunc = Makie.transform_func_obs(plot) pos = plot.position space = plot.space - markerspace = plot.markerspace offset = plot.offset - # TODO: This is a hack before we get better updating of plot objects and attributes going. - # Here we only update the glyphs when the glyphcollection changes, if it's a singular glyphcollection. - # The if statement will be compiled away depending on the parameter of Text. - # This means that updates of a text vector and a separate position vector will still not work if only the text - # vector is triggered, but basically all internal objects use the vector of tuples version, and that triggers - # both glyphcollection and position, so it still works - if glyphcollection[] isa Makie.GlyphCollection - # here we use the glyph collection observable directly - gcollection = glyphcollection - else - # and here we wrap it into another observable - # so it doesn't trigger dimension mismatches - # the actual, new value gets then taken in the below lift with to_value - gcollection = Observable(glyphcollection) - end atlas = wgl_texture_atlas() - glyph_data = map(pos, gcollection, offset, transfunc, space) do pos, gc, offset, transfunc, space + glyph_data = map(pos, glyphcollection, offset, transfunc, space; ignore_equal_values=true) do pos, gc, offset, transfunc, space Makie.text_quads(atlas, pos, to_value(gc), offset, transfunc, space) end @@ -282,10 +264,8 @@ function create_shader(scene::Scene, plot::Makie.Text{<:Tuple{<:Union{<:Makie.Gl end end - cam = scene.camera plot_attributes = copy(plot.attributes) plot_attributes.attributes[:calculated_colors] = uniform_color - uniforms = Dict( :model => plot.model, :shape_type => Observable(Cint(3)), diff --git a/src/basic_recipes/arrows.jl b/src/basic_recipes/arrows.jl index 27fa6bfd7c3..83a2a38f76c 100644 --- a/src/basic_recipes/arrows.jl +++ b/src/basic_recipes/arrows.jl @@ -19,7 +19,7 @@ grid. `arrows` can also work in three dimensions. -If a `Function` is provided in place of `u, v, [w]`, then it must accept +If a `Function` is provided in place of `u, v, [w]`, then it must accept a `Point` as input, and return an appropriately dimensioned `Point`, `Vec`, or other array-like output. @@ -165,7 +165,8 @@ function plot!(arrowplot::Arrows{<: Tuple{AbstractVector{<: Point{N}}, V}}) wher linesegments!( arrowplot, headstart, - color = line_c, colormap = colormap, colorscale = colorscale, linestyle = linestyle, + color=line_c, colormap=colormap, colorscale=colorscale, linestyle=linestyle, + colorrange=arrowplot.colorrange, linewidth=lift(lw -> lw === automatic ? 1.0f0 : lw, arrowplot, linewidth), fxaa = fxaa_bool, inspectable = inspectable, transparency = transparency, visible = visible, @@ -176,7 +177,7 @@ function plot!(arrowplot::Arrows{<: Tuple{AbstractVector{<: Point{N}}, V}}) wher marker=marker_head, markersize = lift(as-> as === automatic ? theme(scene, :markersize)[] : as, arrowplot, arrowsize), color = arrow_c, rotations = rotations, strokewidth = 0.0, - colormap = colormap, markerspace = arrowplot.markerspace, + colormap=colormap, markerspace=arrowplot.markerspace, colorrange=arrowplot.colorrange, fxaa = fxaa_bool, inspectable = inspectable, transparency = transparency, visible = visible ) @@ -212,7 +213,7 @@ function plot!(arrowplot::Arrows{<: Tuple{AbstractVector{<: Point{N}}, V}}) wher start, rotations = directions, marker=marker_tail, markersize = msize, - color = line_c, colormap = colormap, colorscale = colorscale, + color=line_c, colormap=colormap, colorscale=colorscale, colorrange=arrowplot.colorrange, fxaa = fxaa_bool, ssao = ssao, diffuse = diffuse, specular = specular, shininess = shininess, inspectable = inspectable, @@ -223,7 +224,7 @@ function plot!(arrowplot::Arrows{<: Tuple{AbstractVector{<: Point{N}}, V}}) wher start, rotations = directions, marker=marker_head, markersize = markersize, - color = arrow_c, colormap = colormap, colorscale = colorscale, + color=arrow_c, colormap=colormap, colorscale=colorscale, colorrange=arrowplot.colorrange, fxaa = fxaa_bool, ssao = ssao, diffuse = diffuse, specular = specular, shininess = shininess, inspectable = inspectable, diff --git a/src/figureplotting.jl b/src/figureplotting.jl index 88d58cf3b52..1bf5588d0db 100644 --- a/src/figureplotting.jl +++ b/src/figureplotting.jl @@ -22,8 +22,7 @@ function _validate_nt_like_keyword(@nospecialize(kw), name) The $name keyword argument received an unexpected value $(repr(kw)). The $name keyword expects a collection of Symbol => value pairs, such as NamedTuple, Attributes, or AbstractDict{Symbol}. The most common cause of this error is trying to create a one-element NamedTuple like (key = value) which instead creates a variable `key` with value `value`. - Write (key = value,) or (; key = value) instead.""" - )) + Write (key = value,) or (; key = value) instead.""")) end end diff --git a/src/makielayout/blocks/colorbar.jl b/src/makielayout/blocks/colorbar.jl index 188d3435de9..1330308e364 100644 --- a/src/makielayout/blocks/colorbar.jl +++ b/src/makielayout/blocks/colorbar.jl @@ -43,7 +43,7 @@ function extract_colormap(@nospecialize(plot::AbstractPlot)) end end -function extract_colormap(plot::StreamPlot) +function extract_colormap(plot::Union{Arrows, StreamPlot}) return extract_colormap(plot.plots[1]) end diff --git a/src/utilities/utilities.jl b/src/utilities/utilities.jl index da389eaa385..18da1690e7a 100644 --- a/src/utilities/utilities.jl +++ b/src/utilities/utilities.jl @@ -172,6 +172,7 @@ attr_broadcast_length(x::ScalarOrVector) = x.sv isa Vector ? length(x.sv) : 1 attr_broadcast_getindex(x::NativeFont, i) = x attr_broadcast_getindex(x::VecTypes, i) = x # these are our rules, and for what we do, Vecs are usually scalars attr_broadcast_getindex(x::AbstractVector, i) = x[i] +attr_broadcast_getindex(x::AbstractArray{T, 0}, i) where T = x[1] attr_broadcast_getindex(x::AbstractPattern, i) = x attr_broadcast_getindex(x, i) = x attr_broadcast_getindex(x::Ref, i) = x[] # unwrap Refs just like in normal broadcasting, for protecting iterables diff --git a/test/pipeline.jl b/test/pipeline.jl index 08c6e627d9d..6ab9a701327 100644 --- a/test/pipeline.jl +++ b/test/pipeline.jl @@ -108,3 +108,12 @@ end end end + +@testset "Cycled" begin + # Test for https://github.com/MakieOrg/Makie.jl/issues/3266 + f, ax, pl = lines(1:4; color=Cycled(2)) + cpalette = ax.palette[:color][] + @test pl.calculated_colors[] == cpalette[2] + pl2 = lines!(ax, 1:4; color=Cycled(1)) + @test pl2.calculated_colors[] == cpalette[1] +end diff --git a/test/primitives.jl b/test/primitives.jl new file mode 100644 index 00000000000..17a2acaaacb --- /dev/null +++ b/test/primitives.jl @@ -0,0 +1,50 @@ +@testset "ablines" begin + # Test ablines with 0 dim arrays + f, ax, pl = ablines(fill(0), fill(1)) + reset_limits!(ax) + points = pl.plots[1][1] + @test points[] == [Point2f(0), Point2f(10)] + limits!(ax, 5, 15, 6, 17) + @test points[] == [Point2f(5), Point2f(15)] +end + + +@testset "arrows" begin + # Test for: + # https://github.com/MakieOrg/Makie.jl/issues/3273 + directions = decompose(Point2f, Circle(Point2f(0), 1)) + points = decompose(Point2f, Circle(Point2f(0), 0.5)) + color = range(0, 1, length=length(directions)) + fig, ax, pl = arrows(points, directions; color=color) + cbar = Colorbar(fig[1, 2], pl) + @test cbar.limits[] == Vec2f(0, 1) + pl.colorrange = (0.5, 0.6) + @test cbar.limits[] ≈ Vec2f(0.5, 0.6) +end + + +# TODO, test all primitives and argument conversions + +# text() +# fig, ax, p = meshscatter(1:5, (1:5) .+ 5, rand(5)) +# fig, ax, p = scatter(1:5, rand(5)) +# fig, ax, p = mesh(Sphere(Point3f(0), 1.0)) +# fig, ax, p = linesegments(1:5, rand(5)) +# fig, ax, p = lines(1:5, rand(5)) +# fig, ax, p = surface(rand(4, 7)) +# fig, ax, p = volume(rand(4, 4, 4)) +# begin +# fig, ax, p = heatmap(rand(4, 4)) +# scatter!(Makie.point_iterator(p) |> collect, color=:red, markersize=10) +# display(fig) +# end + +# fig, ax, p = image(rand(4, 5)) +# scatter!(Makie.point_iterator(p) |> collect, color=:red, markersize=10) +# display(fig) + +# begin +# fig, ax, p = scatter(1:5, rand(5)) +# linesegments!(Makie.data_limits(ax.scene), color=:red) +# display(fig) +# end diff --git a/test/runtests.jl b/test/runtests.jl index 3ade28d3d1b..6b0ce30ad40 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,6 +18,7 @@ using Makie: volume @test all(hi .>= (8,8,10)) end + include("primitives.jl") include("pipeline.jl") include("record.jl") include("scenes.jl") diff --git a/test/test_primitives.jl b/test/test_primitives.jl deleted file mode 100644 index 851d56866a4..00000000000 --- a/test/test_primitives.jl +++ /dev/null @@ -1,25 +0,0 @@ -using Makie - -text() -fig, ax, p = meshscatter(1:5, (1:5) .+ 5, rand(5)) -fig, ax, p = scatter(1:5, rand(5)) -fig, ax, p = mesh(Sphere(Point3f(0), 1.0)) -fig, ax, p = linesegments(1:5, rand(5)) -fig, ax, p = lines(1:5, rand(5)) -fig, ax, p = surface(rand(4, 7)) -fig, ax, p = volume(rand(4, 4, 4)) -begin - fig, ax, p = heatmap(rand(4, 4)) - scatter!(Makie.point_iterator(p) |> collect, color=:red, markersize=10) - display(fig) -end - -fig, ax, p = image(rand(4, 5)) -scatter!(Makie.point_iterator(p) |> collect, color=:red, markersize=10) -display(fig) - -begin - fig, ax, p = scatter(1:5, rand(5)) - linesegments!(Makie.data_limits(ax.scene), color=:red) - display(fig) -end