-
Notifications
You must be signed in to change notification settings - Fork 39
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
Make expand_dimensions definitions non ambiguous #795
Conversation
I am now routing all This also gets rid of plots not converting correctly. The currently outstanding issue with this approach, is that updating plots created in this way isn't possible with traditional updating syntax ( |
This also fixes the convert_args for vertexgrid which was using the wrong array for lookup, causing y-flipped contourf for example.
Ah, categorical lookups have to be handled like regular ones. |
ext/DimensionalDataMakie.jl
Outdated
function _lookup_to_vertex_vector(l) | ||
if isintervals(l) | ||
bs = intervalbounds(l) | ||
return @. first(bs) + (last(bs) - first(bs)) / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just parent(shiftlocus(Center, l))
?
Then we don't need to check Points/Intervals either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it? If so that would be great. Does shiftlocus also handle converting point sampling to interval sampling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No you have to do that separatly: shiftlocus(Start(), set(lookup, Intervals()))
. Points will always turn into Intervals(Center())
by default.
(mostly because shifting Points() to Center() could still give Points, so its kind of ambiguous)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its good to always use the methods like shiftlocus
for things like this so we can centralise handling of the edge cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok people. I just tested this one in combination with rafaqz/Rasters.jl#723, and things seems to work really well. So, I would like to merge this one, so that we can also fix Rasters#main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot @asinghvi17 for bringing this up to the finish line. Great work!
Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>
ext/DimensionalDataMakie.jl
Outdated
The lookup was: | ||
$l | ||
|
||
You can solve this by resampling your raster, or by using a more permissive plot type like `heatmap`, `surface`, `contour`, or `contourf`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaqz I just hit this edge case for raster's volume-like cases. what would be the way to get a regular-spaced raster? a better suggestion is needed here. Maybe one-liner to resample a given raster A
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah a one liner would be good to add there. I should also add an option to customize the error message so this can be used in volume plots...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With image
or heatmap
? heatmap
should work Maybe we can just warn for image
and plot anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue I found was for something with X, Y, Ti
, creating a volume, where the axis for Ti is usually irregular, hence failing afterwards to plot, I just want say, treat this as a regular thing as well, it makes sense for daily data, but I'm sure there should be others where we should not do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha ok! Yeah I guess it's a bit restrictive to error all the time.
TODOs on my end are:
|
something went wrong with the latest |
Yeah it's just passing a bunch of axis kwargs to LScene when it shouldn't. Will look at that. |
Things look good enough to me. @rafaqz feel free to merge whenever. |
x=nothing, y=nothing, colorbarkw=(;), attributes... | ||
) | ||
replacements = _keywords2dimpairs(x, y) | ||
_, _, args, _ = _surface2(A, $f2, attributes, replacements) | ||
# No ColourBar in the ! in-place versions | ||
return Makie.$f2!(axis, args...; attributes...) | ||
# No Colorbar in the ! in-place versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey I'm Australian ;)
ext/DimensionalDataMakie.jl
Outdated
The lookup was: | ||
$l | ||
|
||
You can solve this by resampling your raster, or by using a more permissive plot type like `heatmap`, `surface`, `contour`, or `contourf`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With image
or heatmap
? heatmap
should work Maybe we can just warn for image
and plot anyway?
It semi works but the dimensions are still wrong, probably because of Makie converts..
Are the |
Yes, I'd say it's better than nothing. We can only fix the remaining issues on the Makie end. |
cc @lazarusA