Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Sep 14, 2023
1 parent 500541c commit eccc033
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions ReferenceTests/src/tests/primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,18 @@ end

fig
end

@reference_test "datashader" begin
airports = Point2f.(eachrow(readdlm(Makie.assetpath("airportlocations.csv"))))
fig, ax, ds = datashader(airports, async = false)
Colorbar(fig[1, 2], ds, width=100)
hidedecorations!(ax); hidespines!(ax)

normaldist = randn(Point2f, 1_000_000)
ds1 = normaldist .+ (Point2f(-1, 0),)
ds2 = normaldist .+ (Point2f(1, 0),)
ax, pl = datashader(fig[2, :], Dict("a" => ds1, "b" => ds2))
hidedecorations!(ax)
axislegend(ax)
fig
end
2 changes: 1 addition & 1 deletion docs/reference/plots/datashader.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using DelimitedFiles, GLMakie
GLMakie.activate!() # hide
# For saving/showing/inlining into documentation we need to disable async calculation.
Makie.set_theme!(DataShader = (; async_latest=false))
Makie.set_theme!(DataShader = (; async=false))
airports = Point2f.(eachrow(readdlm(assetpath("airportlocations.csv"))))
fig, ax, ds = datashader(airports,
colormap=[:white, :black],
Expand Down
1 change: 1 addition & 0 deletions src/basic_recipes/datashader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ end
!!! warning
This feature might change outside breaking releases, since the API is not yet finalized.
Please be vary of bugs in the implementation and open issues if you encounter odd behaviour.
Points can be any array type supporting iteration & getindex, including memory mapped arrays.
If you have separate arrays for x and y coordinates and want to avoid conversion and copy, consider using:
Expand Down

0 comments on commit eccc033

Please sign in to comment.