Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Oct 5, 2023
2 parents f1cfcaa + 808a61d commit 42757b0
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 57 deletions.
8 changes: 8 additions & 0 deletions CairoMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name = "CairoMakie"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
author = ["Simon Danisch <sdanisch@gmail.com>"]
<<<<<<< HEAD
version = "0.11.0"
=======
version = "0.10.11"
>>>>>>> master

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -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"

Expand Down
8 changes: 8 additions & 0 deletions GLMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions MakieCore/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 3 additions & 0 deletions MakieCore/src/MakieCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions RPRMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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]
Expand Down
22 changes: 1 addition & 21 deletions WGLMakie/src/particles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)),
Expand Down
11 changes: 6 additions & 5 deletions src/basic_recipes/arrows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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
)
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/figureplotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/makielayout/blocks/colorbar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/utilities/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
50 changes: 50 additions & 0 deletions test/primitives.jl
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
25 changes: 0 additions & 25 deletions test/test_primitives.jl

This file was deleted.

0 comments on commit 42757b0

Please sign in to comment.