Skip to content

Commit

Permalink
Merge branch 'master' into sd/3dbarplob
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrumbiegel authored Feb 2, 2024
2 parents 15b82ff + 84c53a0 commit 96bc6f0
Show file tree
Hide file tree
Showing 25 changed files with 176 additions and 57 deletions.
1 change: 0 additions & 1 deletion .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
branches:
- master
- sd/beta-20
push:
tags:
- '*'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- '*.md'
branches:
- master
- sd/beta-20
push:
tags:
- '*'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/compilation-benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- '*.md'
branches:
- master
- sd/beta-20
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rprmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- '*.md'
branches:
- master
- sd/beta-20
push:
tags:
- '*'
Expand Down
4 changes: 2 additions & 2 deletions CairoMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CairoMakie"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
author = ["Simon Danisch <sdanisch@gmail.com>"]
version = "0.11.6"
version = "0.11.7"

[deps]
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
Expand All @@ -24,7 +24,7 @@ FileIO = "1.1"
FreeType = "3, 4.0"
GeometryBasics = "0.4.1"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.20.5"
Makie = "=0.20.6"
PrecompileTools = "1.0"
julia = "1.3"

Expand Down
4 changes: 2 additions & 2 deletions GLMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GLMakie"
uuid = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
version = "0.9.6"
version = "0.9.7"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand Down Expand Up @@ -30,7 +30,7 @@ FreeTypeAbstraction = "0.10"
GLFW = "3.3"
GeometryBasics = "0.4.1"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.20.5"
Makie = "=0.20.6"
Markdown = "1.0, 1.6"
MeshIO = "0.4"
ModernGL = "1"
Expand Down
2 changes: 1 addition & 1 deletion GLMakie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can find instructions to set that up in:
https://nextjournal.com/sdanisch/GLMakie-nogpu
And for a headless github action:

https://github.com/MakieOrg/Makie.jl/blob/master/.github/workflows/glmakie.yaml
https://github.com/MakieOrg/Makie.jl/blob/master/.github/workflows/reference_tests.yml
If none of these work for you, there is also a Cairo and WebGL backend
for Makie which you can use:

Expand Down
4 changes: 4 additions & 0 deletions GLMakie/src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ function Base.display(screen::Screen, scene::Scene; connect=true)
# So, the GLFW window events are not guarantee to fire
# when we close a window, so we ensure this here!
if !Makie.is_displayed(screen, scene)
if !isnothing(screen.root_scene)
delete!(screen, screen.root_scene)
screen.root_scene = nothing
end
display_scene!(screen, scene)
else
@assert screen.root_scene === scene "internal error. Scene already displayed by screen but not as root scene"
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# News

## master
## 0.20.6

- Fix issues with Camera3D not centering [#3582](https://github.com/MakieOrg/Makie.jl/pull/3582)
- Allowed creating legend entries from plot objects with scalar numbers as colors [#3587](https://github.com/MakieOrg/Makie.jl/pull/3587).

## 0.20.5

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Makie"
uuid = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
authors = ["Simon Danisch", "Julius Krumbiegel"]
version = "0.20.5"
version = "0.20.6"

[deps]
Animations = "27a7e980-b3e6-11e9-2bcd-0b925532e340"
Expand Down
8 changes: 4 additions & 4 deletions RPRMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RPRMakie"
uuid = "22d9f318-5e34-4b44-b769-6e3734a732a6"
authors = ["Simon Danisch"]
version = "0.6.5"
version = "0.6.6"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand All @@ -16,11 +16,11 @@ RadeonProRender = "27029320-176d-4a42-b57d-56729d2ad457"
Colors = "0.9, 0.10, 0.11, 0.12"
FileIO = "1.6"
GeometryBasics = "0.4.1"
Makie = "=0.20.5"
RadeonProRender = "0.3.0"
julia = "1.3"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.20.6"
Printf = "1.0, 1.6"
RadeonProRender = "0.3.0"
julia = "1.3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
8 changes: 8 additions & 0 deletions ReferenceTests/src/tests/examples2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,14 @@ end
fontsize = range(12, 24, length = 5),
)

# https://github.com/MakieOrg/Makie.jl/issues/3569
b = bracket!(ax,
[5, 6],
[1, 2],
[6, 7],
[1, 2],
)

f
end

Expand Down
2 changes: 2 additions & 0 deletions ReferenceTests/src/tests/examples3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
moon = loadasset("moon.png")
fig, ax, meshplot = mesh(Sphere(Point3f(0), 1f0), color=moon, shading=NoShading, axis = (;show_axis=false))
update_cam!(ax.scene, Vec3f(-2, 2, 2), Vec3f(0))
cameracontrols(ax).settings.center[] = false # avoid recenter on display
fig
end

Expand Down Expand Up @@ -585,6 +586,7 @@ end
cam = cameracontrols(ax.scene)
cam.fov[] = 22f0
update_cam!(ax.scene, cam, Vec3f(0.625, 0, 3.5), Vec3f(0.625, 0, 0), Vec3f(0, 1, 0))
cameracontrols(ax).settings.center[] = false # avoid recenter on display
fig
end

Expand Down
35 changes: 35 additions & 0 deletions ReferenceTests/src/tests/figures_and_makielayout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ end
f
end

# https://github.com/MakieOrg/Makie.jl/issues/3579
@reference_test "Axis yticksmirrored" begin
f = Figure(size = (200, 200))
Axis(f[1, 1], yticksmirrored = true, yticksize = 10, ytickwidth = 4)
Colorbar(f[1, 2])
f
end
@reference_test "Axis xticksmirrored" begin
f = Figure(size = (200, 200))
Axis(f[1, 1], xticksmirrored = true, xticksize = 10, xtickwidth = 4)
Colorbar(f[0, 1], vertical = false)
f
end

@reference_test "Legend draw order" begin
with_theme(Lines = (linewidth = 10,)) do
f = Figure()
Expand All @@ -133,6 +147,25 @@ end
end
end

@reference_test "Legend with scalar colors" begin
f = Figure()
ax = Axis(f[1, 1])
for i in 1:3
lines!(ax, (1:3) .+ i, color = i, colorrange = (0, 4), colormap = :Blues, label = "Line $i", linewidth = 3)
end
for i in 1:3
scatter!(ax, (1:3) .+ i .+ 3, color = i, colorrange = (0, 4), colormap = :plasma, label = "Scatter $i", markersize = 15)
end
for i in 1:3
barplot!(ax, (1:3) .+ i .+ 8, fillto = (1:3) .+ i .+ 7.5, color = i, colorrange = (0, 4), colormap = :tab10, label = "Barplot $i")
end
for i in 1:3
poly!(ax, [Rect2f((j, i .+ 12 + j), (0.5, 0.5)) for j in 1:3], color = i, colorrange = (0, 4), colormap = :heat, label = "Poly $i")
end
Legend(f[1, 2], ax)
f
end

@reference_test "LaTeXStrings in Axis3 plots" begin
xs = LinRange(-10, 10, 100)
ys = LinRange(0, 15, 100)
Expand Down Expand Up @@ -190,6 +223,7 @@ end
rticklabelstrokewidth = 1, rticklabelstrokecolor = :white,
thetaticklabelsize = 18, thetaticklabelcolor = :blue,
thetaticklabelstrokewidth = 1, thetaticklabelstrokecolor = :white,
thetaticks = ([0, π/2, π, 3π/2], ["A", "B", "C", rich("D", color = :orange)]), # https://github.com/MakieOrg/Makie.jl/issues/3583
)
f
end
Expand Down Expand Up @@ -291,3 +325,4 @@ end
axislegend(ax)
fig
end

8 changes: 4 additions & 4 deletions WGLMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name = "WGLMakie"
uuid = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"
authors = ["SimonDanisch <sdanisch@gmail.com>"]
version = "0.9.5"
version = "0.9.6"

[deps]
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FreeTypeAbstraction = "663a7486-cb36-511b-a19d-713bb74d65c9"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Hyperscript = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91"
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Observables = "510215fc-4207-5dde-b226-833fc4488ee2"
Expand All @@ -20,14 +20,14 @@ ShaderAbstractions = "65257c39-d410-5151-9873-9b3e5be5013e"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
Bonito = "3.0.0"
Colors = "0.11, 0.12"
FileIO = "1.1"
FreeTypeAbstraction = "0.10"
GeometryBasics = "0.4.1"
Hyperscript = "0.0.3, 0.0.4, 0.0.5"
Bonito = "3.0.0"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.20.5"
Makie = "=0.20.6"
Observables = "0.5.1"
PNGFiles = "0.3, 0.4"
PrecompileTools = "1.0"
Expand Down
19 changes: 7 additions & 12 deletions src/basic_recipes/bracket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ function Makie.plot!(pl::Bracket)

textoffset_vec = Observable(Vec2f[])
bp = Observable(BezierPath[])
textpoints = Observable(Point2f[])
text_tuples = Observable(Tuple{Any,Point2f}[])

realtextoffset = lift(pl, pl.textoffset, pl.fontsize) do to, fs
return to === automatic ? Float32.(0.75 .* fs) : Float32.(to)
end

onany(pl, points, scene.camera.projectionview, pl.model, transform_func(pl),
scene.viewport, pl.offset, pl.width, pl.orientation, realtextoffset,
pl.style) do points, _, _, _, _, offset, width, orientation, textoff, style
pl.style, pl.text) do points, _, _, _, _, offset, width, orientation, textoff, style, text

empty!(bp[])
empty!(textoffset_vec[])
empty!(textpoints[])
empty!(text_tuples[])

broadcast_foreach(points, offset, width, orientation, textoff, style) do (_p1, _p2), offset, width, orientation, textoff, style
broadcast_foreach(points, offset, width, orientation, textoff, style, text) do (_p1, _p2), offset, width, orientation, textoff, style, text
p1 = plot_to_screen(pl, _p1)
p2 = plot_to_screen(pl, _p2)

Expand All @@ -79,12 +79,12 @@ function Makie.plot!(pl::Bracket)
push!(textoffset_vec[], d2 * textoff)

b, textpoint = bracket_bezierpath(style, p1 + off, p2 + off, d2, width)
push!(textpoints[], textpoint)
push!(text_tuples[], (text, textpoint))
push!(bp[], b)
end

notify(bp)
notify(textpoints)
notify(text_tuples)
end

notify(points)
Expand All @@ -102,15 +102,10 @@ function Makie.plot!(pl::Bracket)
return rots
end

# TODO: this works around `text()` not being happy if text="xyz" comes with one-element vector attributes
texts = lift(pl, pl.text) do text
return text isa AbstractString ? [text] : text
end

# Avoid scale!() / translate!() / rotate!() to affect these
series!(pl, bp; space = :pixel, solid_color = pl.color, linewidth = pl.linewidth,
linestyle = pl.linestyle, transformation = Transformation())
text!(pl, textpoints, text = texts, space = :pixel, align = pl.align, offset = textoffset_vec,
text!(pl, text_tuples, space = :pixel, align = pl.align, offset = textoffset_vec,
fontsize = pl.fontsize, font = pl.font, rotation = autorotations, color = pl.textcolor,
justification = pl.justification, model = Mat4f(I))
pl
Expand Down
21 changes: 15 additions & 6 deletions src/basic_recipes/scatterlines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ $(ATTRIBUTES)
linestyle = l_theme.linestyle,
linewidth = l_theme.linewidth,
markercolor = automatic,
markercolormap = s_theme.colormap,
markercolorrange = get(s_theme.attributes, :colorrange, automatic),
markercolormap = automatic,
markercolorrange = automatic,
markersize = s_theme.markersize,
strokecolor = s_theme.strokecolor,
strokewidth = s_theme.strokewidth,
Expand All @@ -32,8 +32,7 @@ end
function plot!(p::Plot{scatterlines, <:NTuple{N, Any}}) where N

# markercolor is the same as linecolor if left automatic
# RGBColors -> union of all colortypes that `to_color` accepts + returns
real_markercolor = Observable{RGBColors}()
real_markercolor = Observable{Any}()
map!(real_markercolor, p.color, p.markercolor) do col, mcol
if mcol === automatic
return to_color(col)
Expand All @@ -42,6 +41,16 @@ function plot!(p::Plot{scatterlines, <:NTuple{N, Any}}) where N
end
end

real_markercolormap = Observable{Any}()
map!(real_markercolormap, p.colormap, p.markercolormap) do col, mcol
mcol === automatic ? col : mcol
end

real_markercolorrange = Observable{Any}()
map!(real_markercolorrange, p.colorrange, p.markercolorrange) do col, mcol
mcol === automatic ? col : mcol
end

lines!(p, p[1:N]...;
color = p.color,
linestyle = p.linestyle,
Expand All @@ -57,9 +66,9 @@ function plot!(p::Plot{scatterlines, <:NTuple{N, Any}}) where N
strokewidth = p.strokewidth,
marker = p.marker,
markersize = p.markersize,
colormap = p.markercolormap,
colormap = real_markercolormap,
colorscale = p.colorscale,
colorrange = p.markercolorrange,
colorrange = real_markercolorrange,
inspectable = p.inspectable
)
end
Loading

0 comments on commit 96bc6f0

Please sign in to comment.