Skip to content
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

translate tiles by -10 in z in default plot config #126

Closed
wants to merge 1 commit into from

Conversation

asinghvi17
Copy link
Member

@asinghvi17 asinghvi17 commented Dec 31, 2024

To ensure that plots will always remain above the map

# note that all translation / scaling is done by the arguments
# not by modifying the plot's transformation as was done in previous Tyler v0.1.5 and below
# so this should hold indefinitely
translate!(p, 0, 0, -10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be in the ElevationData dispatch ...

Copy link
Member Author

Choose a reason for hiding this comment

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

doh, yeah that should be in the imagedata dispatch

Copy link
Collaborator

Choose a reason for hiding this comment

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

Even in the right spot this approach doesnt seem to work, during zoom tiles cover e.g. a scatter plot anyway. But at least the scatter does come back after zooming

Copy link
Collaborator

Choose a reason for hiding this comment

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

And seems sometimes they dont come back after zooming either

Copy link
Collaborator

@rafaqz rafaqz Dec 31, 2024

Choose a reason for hiding this comment

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

We need to turn down the depth_shift to something like ´n / 100000f0´ and then it works on my branch. so some progress!

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, that's because the depth shift is a multiplier then. Makes sense.

How about n * 10*eps(1f0) instead? It's probably more obvious what we're trying to do and the values are similarly inconsequential.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Eps is for values at zero. It's obvious what you're doing but the scale will need to be much larger

Copy link
Member Author

Choose a reason for hiding this comment

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

The range is always (-1, 1) though, and eps with a number is actually the correct nextfloat epsilon:

julia> eps(1f0)
1.1920929f-7

julia> eps(10000f0)
0.0009765625f0

But either way works

Copy link
Collaborator

@rafaqz rafaqz Dec 31, 2024

Choose a reason for hiding this comment

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

The numbers are between 0 and 100 before scaling, or like 0 and 25 or whatever

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can review the PR ad edit the code inline if you really want to change it ;)

@rafaqz rafaqz closed this Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants