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

Better symlog scale ticks #2245

Merged
merged 24 commits into from Sep 14, 2023
Merged

Better symlog scale ticks #2245

merged 24 commits into from Sep 14, 2023

Conversation

cab404
Copy link
Collaborator

@cab404 cab404 commented Sep 1, 2023

After asking around, removed boundary values, and now rounding to a single significant digit
Always tries to display zero if in range

Switches to linear scale if log size of area is smaller than threshold (I think that's something that autoscale should do, but hell why not)

image

Fixes #2036

@changeset-bot
Copy link

changeset-bot bot commented Sep 1, 2023

🦋 Changeset detected

Latest commit: 2720d9b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@quri/squiggle-components Minor
vscode-squiggle Minor
@quri/squiggle-lang Minor
@quri/prettier-plugin-squiggle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2023 0:43am
quri-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2023 0:43am
squiggle-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2023 0:43am
squiggle-website ✅ Ready (Inspect) Visit Preview Sep 11, 2023 0:43am

@cab404 cab404 temporarily deployed to Preview September 1, 2023 10:03 — with GitHub Actions Inactive
Anyways, if it ever goes back:

```typescript
// Explicitly fixing rounding errors on zero, if exists
if (tLower < 0 && tUpper > 0) ticks[-Math.ceil(tLower / expStep)] = 0;
```
@OAGr
Copy link
Contributor

OAGr commented Sep 11, 2023

Seems much better!
image

@berekuk
Copy link
Collaborator

berekuk commented Sep 14, 2023

OEIS stuff is weird, but I can't find cases to trigger it because of linear scale fallback, so it doesn't seem important.

Thanks for the fixes!

@berekuk berekuk merged commit d4098ed into main Sep 14, 2023
7 of 8 checks passed
@berekuk berekuk deleted the cab/symlog-ticks branch September 14, 2023 19:06
@cab404
Copy link
Collaborator Author

cab404 commented Sep 14, 2023

OEIS stuff is weird, but I can't find cases to trigger it because of linear scale fallback, so it doesn't seem important.

It just a way of indexing in 1/2/5/10 with support for rounding function and without any conditionals. Basically, it maps number to index in that OEIS sequence, rounds, and gets back

@berekuk
Copy link
Collaborator

berekuk commented Sep 14, 2023

It just a way of indexing in 1/2/5/10 with support for rounding function and without any conditionals.

Yeah, I understood that part, but it wasn't clear to me if there's a combination of parameters where it returns any weird values beyond 10. I see now that it won't, since sqrt(9) = 3.

@github-actions github-actions bot mentioned this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Improve Scale.symlog ticks
3 participants