-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant plot empty vectors of LineString #2819
Comments
As I see it, there are two issues here (it's erroring on the first, but you'll run into the second):
|
Oh no, so not so easy to fix... The reason I want this is for MakieDraw.jl, where you really want to start with an empty plot and add things to it. Or sometimes want to delete everything and start from scratch. Currently I have to add a dummy geometry to everything so that they plot. |
Yeah, it's definitely a feature which should exist, we had something similar with some specially implemented buffer plot types but they weren't totally generic. |
That's not true, mostly these cases just hit type instabilities or reduce-over-empty-collection errors down the line. I fixed those for many cases where I needed them, for example you can easily set empty ticks on an Axis which gives you empty linesegments and text primitives. |
Yeah, we'd have to implement code to handle this kind of thing, without leaving observables undefined, in each recipe. For example - what would Backends would be an easier task in comparison, CairoMakie could do this pretty easily. |
In this specific case we just need to have a way to determine the type of the empty result vector correctly. Although Julia makes that tricky sometimes, for example function convert_arguments(PB::PointBased, linestring::Union{Array{<:LineString}, MultiLineString})
arr = copy(convert_arguments(PB, linestring[1])[1])
for ls in 2:length(linestring)
push!(arr, Point2f(NaN))
append!(arr, convert_arguments(PB, linestring[ls])[1])
end
return (arr,)
end |
It would be good if this worked so we don't have to plot dummy linestrings
The text was updated successfully, but these errors were encountered: