Skip to content
Open
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
a7ad176
prototype infrastructure for direction, orientation and repeated dims
ffreyer Oct 3, 2025
5af58de
simplify if block a bit
ffreyer Oct 3, 2025
a0dd0c8
match argument_dims default to old behavior
ffreyer Oct 3, 2025
a9d7876
fix typo
ffreyer Oct 6, 2025
4bb89ec
add infrastructure for dim_converts in axis labels
ffreyer Oct 6, 2025
d14e326
control units in tick labels from Axis
ffreyer Oct 6, 2025
f4b617e
fix some errors with new Axis dim_converts
ffreyer Oct 6, 2025
e71ef49
add argument_dim_kwargs
ffreyer Oct 6, 2025
8f38f58
run add_attributes first so that dim_converts can include them
ffreyer Oct 6, 2025
22c00b6
fix/update hvlines
ffreyer Oct 7, 2025
6c607fc
get heatmap, surface, contour, contourf working
ffreyer Oct 7, 2025
7367313
update hist
ffreyer Oct 8, 2025
6fe3b7b
handle image
ffreyer Oct 8, 2025
57803d6
remove dynamic unit prefixes
ffreyer Oct 8, 2025
135ff68
update band, errorbars, rangebars, hspan, vspan
ffreyer Oct 9, 2025
4090b5b
update remaining basic_recipes plots that should work
ffreyer Oct 9, 2025
7962927
update stats recipes
ffreyer Oct 9, 2025
a6483f8
diy missing dim_convert discard
ffreyer Oct 9, 2025
27c8a94
cleanup print
ffreyer Oct 9, 2025
349c268
avoid errors for empty rich text
ffreyer Oct 9, 2025
9d8f40c
fix label typing
ffreyer Oct 9, 2025
7ffadab
fix voronoi 3 args, update timeseries
ffreyer Oct 10, 2025
9ed5906
add tests
ffreyer Oct 10, 2025
c064892
fix boxplot, 3D contour
ffreyer Oct 10, 2025
9c347e7
fix 3D surface convert, test remaining primitives
ffreyer Oct 11, 2025
946a61e
fix log units
ffreyer Oct 13, 2025
d8599eb
remove unused code
ffreyer Oct 13, 2025
75eb60a
fix triplot/poly conversion
ffreyer Oct 13, 2025
9c27eb2
revert deleted convert_arguments but remove recursion
ffreyer Oct 13, 2025
98517ff
fix empty rich text properly
ffreyer Oct 13, 2025
072c132
fix qqplot/qqnorm/early convert kwargs application
ffreyer Oct 13, 2025
3b75279
fix "]" from formatter ending up in superscript after a "^"
ffreyer Oct 13, 2025
9511d09
fix load order
ffreyer Oct 13, 2025
fb81392
rename attribute + docstrings
ffreyer Oct 13, 2025
d80f8d6
update Axis3
ffreyer Oct 14, 2025
2441b30
add long units
ffreyer Oct 14, 2025
d4d8ba6
fix Int error in Date resampling
ffreyer Oct 15, 2025
c7be144
fix/update tests
ffreyer Oct 15, 2025
ab33a0a
revert to late attribute adding and only add required attributes earl…
ffreyer Oct 15, 2025
c988fa9
fix tests missing parent_is_scene
ffreyer Oct 15, 2025
c471bbd
revert unnecessary change to add_convert_kwargs!()
ffreyer Oct 15, 2025
d6a2e0a
fix PlotSpec
ffreyer Oct 15, 2025
770b842
remove unused `try_dim_convert` and `should_dim_convert` (keep name f…
ffreyer Oct 16, 2025
6ea83c9
drop unnecessary method
ffreyer Oct 16, 2025
2deafe3
update docs
ffreyer Oct 16, 2025
7702f33
run formatter
ffreyer Oct 17, 2025
b3ef766
minor cleanup
ffreyer Oct 17, 2025
00ae1ae
get point-like data working
ffreyer Oct 17, 2025
b63bcce
remove prints
ffreyer Oct 18, 2025
a77f1e3
explicitly exclude Axis3D plots
ffreyer Oct 18, 2025
2d76f0a
allow ranges in argument_dims()
ffreyer Oct 18, 2025
649548a
update more point like arguments
ffreyer Oct 18, 2025
9d8c31d
fix getindex(nothing, idx)
ffreyer Oct 18, 2025
6f7f48b
fix failing dim converts tests
ffreyer Oct 18, 2025
874d04d
fix empty array application
ffreyer Oct 18, 2025
dcfc8d2
fix convert_arguments tests
ffreyer Oct 18, 2025
7b96f65
fix tooltip
ffreyer Oct 18, 2025
6165677
fix annotations
ffreyer Oct 18, 2025
eceebe5
fix tooltip
ffreyer Oct 18, 2025
6f8519e
make `force_dimconverts` settable to fix Axis3
ffreyer Oct 18, 2025
fc9e33a
fix mesh
ffreyer Oct 18, 2025
3ee11e8
fix tests
ffreyer Oct 18, 2025
0520d01
fix docs
ffreyer Oct 19, 2025
de9310e
avoid converting non data space
ffreyer Oct 19, 2025
6673a64
improve documentation of conversion logic and steps
ffreyer Oct 19, 2025
9223ac1
add refimg for label attributes
ffreyer Oct 19, 2025
934949f
avoid need for ::Automatic in show_dim_convert_in_...()
ffreyer Oct 20, 2025
767ab09
allow early conversions when dim converts are forced (+ some restruct…
ffreyer Oct 20, 2025
8891191
add tests for point-like data & fix conversions
ffreyer Oct 20, 2025
ff3a8bd
run formatter
ffreyer Oct 20, 2025
dfc5f6e
fix and test band with vectypes
ffreyer Oct 20, 2025
f2d6347
fix docs?
ffreyer Oct 20, 2025
75a793a
default units to axis labels only
ffreyer Oct 20, 2025
a4ebd24
default multiple point-like arguments
ffreyer Oct 20, 2025
7a9f0a3
make sure every recipe has dim convert exit paths
ffreyer Oct 21, 2025
7a8cb30
some cleanup + docstrings
ffreyer Oct 21, 2025
672c8d8
fix dodgy docs
ffreyer Oct 23, 2025
3f74daa
add section about conversion target types to recipe docs
ffreyer Oct 23, 2025
ff74ca2
update changelog
ffreyer Oct 23, 2025
7feb429
Merge branch 'master' into ff/dim-converts
ffreyer Nov 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Makie/ext/MakieDynamicQuantitiesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import DynamicQuantities as DQ

M.expand_dimensions(::M.PointBased, y::AbstractVector{<:DQ.UnionAbstractQuantity}) = (keys(y), y)
M.create_dim_conversion(::Type{<:DQ.UnionAbstractQuantity}) = M.DQConversion()
M.should_dim_convert(::Type{<:DQ.UnionAbstractQuantity}) = true

unit_string(quantity::DQ.UnionAbstractQuantity) = string(DQ.dimension(quantity))

Expand All @@ -24,18 +23,22 @@ function unit_convert(quantity::DQ.UnionAbstractQuantity, value)
end

needs_tick_update_observable(conversion::M.DQConversion) = conversion.quantity
show_dim_convert_in_ticklabel(::M.DQConversion) = false
show_dim_convert_in_axis_label(::M.DQConversion) = true

function M.get_ticks(conversion::M.DQConversion, ticks, scale, formatter, vmin, vmax)
function M.get_ticks(conversion::M.DQConversion, ticks, scale, formatter, vmin, vmax, show_in_label)
quantity = conversion.quantity[]
quantity isa M.Automatic && return [], []
unit_str = unit_string(quantity)
tick_vals, labels = M.get_ticks(ticks, scale, formatter, vmin, vmax)
if conversion.units_in_label[]
if show_in_label
labels = labels .* unit_str
end
return tick_vals, labels
end

M.get_label_suffix(conversion::M.DQConversion) = unit_string(conversion.quantity[])

function M.convert_dim_value(conversion::M.DQConversion, attr, values, last_values)
if conversion.quantity[] isa M.Automatic
conversion.quantity[] = oneunit(first(values))
Expand Down
1 change: 1 addition & 0 deletions Makie/src/Makie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ include("dim-converts/unitful-integration.jl")
include("dim-converts/dynamic-quantities-integration.jl")
include("dim-converts/categorical-integration.jl")
include("dim-converts/dates-integration.jl")
include("dim-converts/argument_dims.jl")

include("scenes.jl")
include("float32-scaling.jl")
Expand Down
17 changes: 8 additions & 9 deletions Makie/src/basic_plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,7 @@ All volume plots are derived from casting rays for each drawn pixel. These rays
intersect with the volume data to derive some color, usually based on the given
colormap. How exactly the color is derived depends on the algorithm used.
"""
@recipe Volume (
x::EndPoints,
y::EndPoints,
z::EndPoints,
# TODO: consider using RGB{N0f8}, RGBA{N0f8} instead of Vec/RGB(A){Float32}
volume::AbstractArray{<:Union{Float32, Vec3f, RGB{Float32}, Vec4f, RGBA{Float32}}, 3},
) begin
@recipe Volume (x, y, z, volume) begin
"""
Sets the volume algorithm that is used. Available algorithms are:
* `:iso`: Shows an isovalue surface within the given float data. For this only samples within `isovalue - isorange .. isovalue + isorange` are included in the final color of a pixel.
Expand Down Expand Up @@ -361,7 +355,7 @@ const VecOrMat{T} = Union{AbstractVector{T}, AbstractMatrix{T}}
Plots a surface, where `(x, y)` define a grid whose heights are the entries in `z`.
`x` and `y` may be `Vectors` which define a regular grid, **or** `Matrices` which define an irregular grid.
"""
@recipe Surface (x::VecOrMat{<:FloatType}, y::VecOrMat{<:FloatType}, z::VecOrMat{<:FloatType}) begin
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does z actually allow vectors? I didn't allow it in the conversion trait...

@recipe Surface (x, y, z) begin
"Can be set to an `Matrix{<: Union{Number, Colorant}}` to color surface independent of the `z` component. If `color=nothing`, it defaults to `color=z`. Can also be a `Makie.AbstractPattern`."
color = nothing
"""
Expand Down Expand Up @@ -713,7 +707,12 @@ representation and may behave a bit differently than usual.
Note that `voxels` is currently considered experimental and may still see breaking
changes in patch releases.
"""
@recipe Voxels (x, y, z, chunk) begin
@recipe Voxels (
x::EndPoints{Float32},
y::EndPoints{Float32},
z::EndPoints{Float32},
chunk::Array{<:Real, 3},
) begin
"A function that controls which values in the input data are mapped to invisible (air) voxels."
is_air = x -> isnothing(x) || ismissing(x) || isnan(x)
"""
Expand Down
2 changes: 2 additions & 0 deletions Makie/src/basic_recipes/ablines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ You can pass one or multiple intercepts or slopes.
documented_attributes(LineSegments)...
end

argument_dims(::Type{<:ABLines}, args...) = nothing

function Makie.plot!(p::ABLines)
scene = Makie.parent_scene(p)
transf = transform_func(scene)
Expand Down
47 changes: 29 additions & 18 deletions Makie/src/basic_recipes/annotation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ If no label positions are given, they will be determined automatically such
that overlaps between labels and data points are reduced. In this mode, the labels should
be very close to their associated data points so connection plots are typically not visible.
"""
@recipe Annotation begin
@recipe Annotation (merged_positions::VecTypesVector{4, <:Real},) begin
"""
The color of the text labels. If `automatic`, `textcolor` matches `color`.
"""
Expand Down Expand Up @@ -167,40 +167,51 @@ function closest_point_on_rectangle(r::Rect2, p)
return argmin(c -> norm(c - p), candidates)
end

function Makie.convert_arguments(::Type{<:Annotation}, x::Real, y::Real)
argument_dims(::Type{<:Annotation}, x, y) = (1, 2)
argument_dims(::Type{<:Annotation}, xy::VecTypes{2}) = ((1, 2),)
argument_dims(::Type{<:Annotation}, xy::VecTypesVector{2}) = ((1, 2),)
argument_dims(::Type{<:Annotation}, xy::VecTypes{4}) = ((1, 2, 1, 2),)
argument_dims(::Type{<:Annotation}, xy::VecTypesVector{4}) = ((1, 2, 1, 2),)
argument_dims(::Type{<:Annotation}, x, y, x2, y2) = (1, 2, 1, 2)

function convert_arguments(::Type{<:Annotation}, x::Real, y::Real)
return ([Vec4d(NaN, NaN, x, y)],)
end

function Makie.convert_arguments(::Type{<:Annotation}, p::VecTypes{2})
function convert_arguments(::Type{<:Annotation}, p::VecTypes{2, <:Real})
return ([Vec4d(NaN, NaN, p...)],)
end

function Makie.convert_arguments(::Type{<:Annotation}, x::Real, y::Real, x2::Real, y2::Real)
function convert_arguments(::Type{<:Annotation}, x::Real, y::Real, x2::Real, y2::Real)
return ([Vec4d(x, y, x2, y2)],)
end

function Makie.convert_arguments(::Type{<:Annotation}, p1::VecTypes{2}, p2::VecTypes{2})
function convert_arguments(::Type{<:Annotation}, p1::VecTypes{2, <:Real}, p2::VecTypes{2, <:Real})
return ([Vec4d(p1..., p2...)],)
end

function Makie.convert_arguments(::Type{<:Annotation}, v::AbstractVector{<:VecTypes{2}})
function convert_arguments(::Type{<:Annotation}, p1::VecTypes{2}, p2::VecTypes{2})
return ([Vec4(p1..., p2...)],)
end

function convert_arguments(::Type{<:Annotation}, v::AbstractVector{<:VecTypes{2, <:Real}})
return (Vec4d.(NaN, NaN, getindex.(v, 1), getindex.(v, 2)),)
end

function Makie.convert_arguments(::Type{<:Annotation}, v1::AbstractVector{<:VecTypes{2}}, v2::AbstractVector{<:VecTypes{2}})
return (Vec4d.(getindex.(v1, 1), getindex.(v1, 2), getindex.(v2, 1), getindex.(v2, 2)),)
function convert_arguments(::Type{<:Annotation}, v1::AbstractVector{<:VecTypes{2}}, v2::AbstractVector{<:VecTypes{2}})
return (Vec4.(getindex.(v1, 1), getindex.(v1, 2), getindex.(v2, 1), getindex.(v2, 2)),)
end

function Makie.convert_arguments(::Type{<:Annotation}, v1::AbstractVector{<:Real}, v2::AbstractVector{<:Real})
function convert_arguments(::Type{<:Annotation}, v1::AbstractVector{<:Real}, v2::AbstractVector{<:Real})
return (Vec4d.(NaN, NaN, v1, v2),)
end

function Makie.convert_arguments(::Type{<:Annotation}, v1::AbstractVector{<:Real}, v2::AbstractVector{<:Real}, v3::AbstractVector{<:Real}, v4::AbstractVector{<:Real})
function convert_arguments(::Type{<:Annotation}, v1::AbstractVector{<:Real}, v2::AbstractVector{<:Real}, v3::AbstractVector{<:Real}, v4::AbstractVector{<:Real})
return (Vec4d.(v1, v2, v3, v4),)
end

function Makie.plot!(p::Annotation{<:Tuple{<:AbstractVector{<:Vec4}}})
scene = Makie.get_scene(p)
function plot!(p::Annotation{<:Tuple{<:AbstractVector{<:VecTypes{4}}}})
scene = get_scene(p)

textpositions = lift(p[1]) do vecs
Point2d.(getindex.(vecs, 3), getindex.(vecs, 4))
Expand Down Expand Up @@ -538,8 +549,8 @@ function startpoint(::Ann.Paths.Corner, text_bb, p2)
return Point2d(x, y)
end

Makie.data_limits(p::Annotation) = Rect3f(Rect2f([Vec2f(x[3], x[4]) for x in p[1][]]))
Makie.boundingbox(p::Annotation, space::Symbol = :data) = Makie.apply_transform_and_model(p, Makie.data_limits(p))
data_limits(p::Annotation) = Rect3f(Rect2f([Vec2f(x[3], x[4]) for x in p[1][]]))
boundingbox(p::Annotation, space::Symbol = :data) = apply_transform_and_model(p, data_limits(p))

function connection_path(::Ann.Paths.Line, p1, p2)
return BezierPath(
Expand Down Expand Up @@ -966,7 +977,7 @@ function line_rectangle_intersection(p1::Point2, p2::Point2, rect::Rect2)
end
end

annotation_style_plotspecs(::Makie.Automatic, path, p1, p2; kwargs...) = annotation_style_plotspecs(Ann.Styles.Line(), path, p1, p2; kwargs...)
annotation_style_plotspecs(::Automatic, path, p1, p2; kwargs...) = annotation_style_plotspecs(Ann.Styles.Line(), path, p1, p2; kwargs...)

function annotation_style_plotspecs(l::Ann.Styles.LineArrow, path::BezierPath, p1, p2; color, linewidth)
length(path.commands) < 2 && return PlotSpec[]
Expand Down Expand Up @@ -1006,7 +1017,7 @@ function annotation_style_plotspecs(::Ann.Styles.Line, path::BezierPath, p1, p2;
]
end

_auto(x::Makie.Automatic, default) = default
_auto(x::Automatic, default) = default
_auto(x, default) = x

shrinksize(other) = 0.0
Expand All @@ -1024,7 +1035,7 @@ function plotspecs(l::Ann.Arrows.Line, pos; rotation, color, linewidth)
p1 = pos + dir1 * sidelen
p2 = pos + dir2 * sidelen
return [
Makie.PlotSpec(:Lines, [p1, pos, p2]; space = :pixel, color, linewidth),
PlotSpec(:Lines, [p1, pos, p2]; space = :pixel, color, linewidth),
]
end

Expand All @@ -1038,7 +1049,7 @@ function plotspecs(h::Ann.Arrows.Head, pos; rotation, color, linewidth)

marker = BezierPath([MoveTo(0, 0), LineTo(p1), LineTo(p2), LineTo(p3), ClosePath()])
return [
Makie.PlotSpec(:Scatter, pos; space = :pixel, rotation, color, marker, markersize = len),
PlotSpec(:Scatter, pos; space = :pixel, rotation, color, marker, markersize = len),
]
end

Expand Down
2 changes: 2 additions & 0 deletions Makie/src/basic_recipes/arc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Examples:
resolution = 361
end

argument_dims(::Type{<:Arc}, args...) = nothing

function plot!(p::Arc)
map!(p, [:origin, :radius, :start_angle, :stop_angle, :resolution], :positions) do origin, radius, start_angle, stop_angle, resolution
return map(range(start_angle, stop = stop_angle, length = resolution)) do angle
Expand Down
24 changes: 17 additions & 7 deletions Makie/src/basic_recipes/arrows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,41 @@

struct ArrowLike <: ConversionTrait end

function types_for_plot_arguments(::ArrowLike)
return Tuple{VecTypesVector{N, <:Real}, VecTypesVector{N, <:Real}} where {N}
end

argument_dims(::ArrowLike, x, y, f) = (1, 2)
argument_dims(::ArrowLike, x, y, z, f::Function) = (1, 2, 3)
argument_dims(::ArrowLike, x, y, u, v) = (1, 2, 1, 2)
argument_dims(::ArrowLike, x, y, z, u, v, w) = (1, 2, 3, 1, 2, 3)

# vec(::Point) and vec(::Vec) works (returns input), but vec(::Tuple) errors
convert_arguments(::ArrowLike, pos::VecTypes{N}, dir::VecTypes{N}) where {N} = ([pos], [dir])

function convert_arguments(::ArrowLike, pos::AbstractArray, dir::AbstractArray)
return (
convert_arguments(PointBased(), vec(pos))[1],
convert_arguments(PointBased(), vec(dir))[1],
convert_arguments(PointBased(), vec(pos))...,
convert_arguments(PointBased(), vec(dir))...,
)
end

function convert_arguments(::ArrowLike, x, y, u, v)
return (
convert_arguments(PointBased(), vec(x), vec(y))[1],
convert_arguments(PointBased(), vec(u), vec(v))[1],
convert_arguments(PointBased(), vec(x), vec(y))...,
convert_arguments(PointBased(), vec(u), vec(v))...,
)
end
function convert_arguments(::ArrowLike, x::AbstractVector, y::AbstractVector, u::AbstractMatrix, v::AbstractMatrix)
return (
vec(Point{2, float_type(x, y)}.(x, y')),
convert_arguments(PointBased(), vec(u), vec(v))[1],
convert_arguments(PointBased(), vec(u), vec(v))...,
)
end
function convert_arguments(::ArrowLike, x, y, z, u, v, w)
return (
convert_arguments(PointBased(), vec(x), vec(y), vec(z))[1],
convert_arguments(PointBased(), vec(u), vec(v), vec(w))[1],
convert_arguments(PointBased(), vec(x), vec(y), vec(z))...,
convert_arguments(PointBased(), vec(u), vec(v), vec(w))...,
)
end

Expand Down Expand Up @@ -314,6 +323,7 @@ end

conversion_trait(::Type{<:Arrows2D}) = ArrowLike()


function _get_arrow_shape(f::Function, length, width, metrics)
nt = NamedTuple{(:taillength, :tailwidth, :shaftlength, :shaftwidth, :tiplength, :tipwidth)}(metrics)
return poly_convert(f(length, width, nt))
Expand Down
3 changes: 3 additions & 0 deletions Makie/src/basic_recipes/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ $(ATTRIBUTES)
)
end

argument_dim_kwargs(::Type{<:Axis3D}) = tuple()
argument_dims(::Type{<:Axis3D}, args...) = nothing

isaxis(x) = false
isaxis(x::Axis3D) = true

Expand Down
22 changes: 17 additions & 5 deletions Makie/src/basic_recipes/band.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,39 @@ Plots a band from `ylower` to `yupper` along `x`. The form `band(lower, upper)`
between the points in `lower` and `upper`.
Both bounds can be passed together as `lowerupper`, a vector of intervals.
"""
@recipe Band (lowerpoints, upperpoints) begin
@recipe Band (
lowerpoints::VecTypesVector{N, <:Real} where {N},
upperpoints::VecTypesVector{N, <:Real} where {N},
) begin
documented_attributes(Mesh)...
"The direction of the band. If set to `:y`, x and y coordinates will be flipped, resulting in a vertical band. This setting applies only to 2D bands."
direction = :x
shading = NoShading
end

function convert_arguments(::Type{<:Band}, x, ylower, yupper)
argument_dim_kwargs(::Type{<:Band}) = (:direction,)
function argument_dims(::Type{<:Band}, x, ylower, yupper; direction)
return direction === :x ? (1, 2, 2) : (2, 1, 1)
end
function argument_dims(::Type{<:Band}, lower::VecTypesVector{N}, upper::VecTypesVector{N}; direction) where {N}
return direction === :x ? ((1, 2), (1, 2)) : ((2, 1), (2, 1))
end

function convert_arguments(::Type{<:Band}, x::RealVector, ylower::RealVector, yupper::RealVector)
return (Point2{float_type(x, ylower)}.(x, ylower), Point2{float_type(x, yupper)}.(x, yupper))
end

convert_arguments(P::Type{<:Band}, x::AbstractVector{<:Number}, y::AbstractVector{<:Interval}) =
convert_arguments(P, x, leftendpoint.(y), rightendpoint.(y))
function convert_arguments(P::Type{<:Band}, x::AbstractVector, y::AbstractVector{<:Interval})
return convert_arguments(P, x, leftendpoint.(y), rightendpoint.(y))
end

function band_connect(n)
ns = 1:(n - 1)
ns2 = (n + 1):(2n - 1)
return [GLTriangleFace.(ns, ns .+ 1, ns2); GLTriangleFace.(ns .+ 1, ns2 .+ 1, ns2)]
end

function Makie.plot!(plot::Band)
function plot!(plot::Band)
@extract plot (lowerpoints, upperpoints)
nanpoint(::Type{<:Point3}) = Point3(NaN)
nanpoint(::Type{<:Point2}) = Point2(NaN)
Expand Down
1 change: 1 addition & 0 deletions Makie/src/basic_recipes/barplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Plots bars of the given `heights` at the given (scalar) `positions`.
end

conversion_trait(::Type{<:BarPlot}) = PointBased()
argument_dim_kwargs(::Type{<:BarPlot}) = (:direction,)

function bar_rectangle(x, y, width, fillto, in_y_direction)
# y could be smaller than fillto...
Expand Down
10 changes: 8 additions & 2 deletions Makie/src/basic_recipes/bracket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Draws a bracket between each pair of points (x1, y1) and (x2, y2) with a text la

By default each label is rotated parallel to the line between the bracket points.
"""
@recipe Bracket (positions,) begin
@recipe Bracket (positions::Vector{<:Tuple{Point2{<:Real}, Point2{<:Real}}},) begin
"""
The offset of the bracket perpendicular to the line from start to end point in screen units.
The direction depends on the `orientation` attribute.
Expand Down Expand Up @@ -78,10 +78,16 @@ By default each label is rotated parallel to the line between the bracket points
space = :data
end

function convert_arguments(::Type{<:Bracket}, point1::VecTypes{2, T1}, point2::VecTypes{2, T2}) where {T1, T2}
argument_dims(::Type{<:Bracket}, x1, y1, x2, y2) = (1, 2, 1, 2)

function convert_arguments(::Type{<:Bracket}, point1::VecTypes{2, T1}, point2::VecTypes{2, T2}) where {T1 <: Real, T2 <: Real}
return ([(Point2{float_type(T1)}(point1), Point2{float_type(T2)}(point2))],)
end

function convert_arguments(::Type{<:Bracket}, point1::VecTypesVector{2, T1}, point2::VecTypesVector{2, T2}) where {T1 <: Real, T2 <: Real}
return (tuple.(Point2{float_type(T1)}.(point1), Point2{float_type(T2)}.(point2)),)
end

function convert_arguments(::Type{<:Bracket}, x1::Real, y1::Real, x2::Real, y2::Real)
return ([(Point2{float_type(x1, y1)}(x1, y1), Point2{float_type(x2, y2)}(x2, y2))],)
end
Expand Down
6 changes: 0 additions & 6 deletions Makie/src/basic_recipes/contourf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ similar to how [`surface`](@ref) works.
mixin_colormap_attributes(allow = (:colormap, :colorscale, :nan_color))...
end

# these attributes are computed dynamically and needed for colorbar e.g.
# _computed_levels
# _computed_colormap
# _computed_extendlow
# _computed_extendhigh

_get_isoband_levels(levels::Int, mi, ma) = collect(range(Float32(mi), nextfloat(Float32(ma)), length = levels + 1))

function _get_isoband_levels(levels::AbstractVector{<:Real}, mi, ma)
Expand Down
Loading
Loading