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

Weird float-rounding issue when tick size < 1 #1

Open
ivanistheone opened this issue Oct 24, 2014 · 0 comments
Open

Weird float-rounding issue when tick size < 1 #1

ivanistheone opened this issue Oct 24, 2014 · 0 comments

Comments

@ivanistheone
Copy link

When the axis ticks are decimals less than 1, a weird rounding issue arrises see
https://ka-perseus-graphie.s3.amazonaws.com/9cbe4e6fbccbd91363d0ec258336fd0f56508452.png

tick rounding

can be fixed on a case-by-case basis using toFixed:

graphInit({
    [...]
    labelFormat: function(s) {
        return "\\small{" + (s).toFixed(1) + "}";
    },

but maybe take a look for a general fix.

itsjohncs added a commit that referenced this issue Jun 11, 2015
Summary:
In January, some changes were made to Khan Exercises that breaks
an assumption that graphie-to-png makes. Namely that graphie will
always render everything into a single SVG.

This caused a regression that affected a number of content creators.
See https://app.asana.com/0/27216215224639/36842953088193 for the
support ticket.

This change brings us back to stable behavior in gaphie-to-png. But
now we're stuck. If we ever want to upgrade graphie-to-png to be up
to date with Khan Exercises again, we need to do a bunch of work. I've
added some warnings about this in the README that will hopefully
prevent us from upgrading Khan Exercises without considering this.

I've cherry picked in the color changes into a new graphie-to-png
branch of Khan Exercises to prevent regressions from that.

Test Plan:
A.1) Serve graphie-to-png locally
A.2) Go to http://localhost:5001/#27
A.3) See beautiful graph, and no errors

B.1) Serve graphie-to-png locally
B.2) Go to http://localhost:5001/#1
B.3) Change all references to `BLUE` to `GOLD_C`
B.4) Regraph
B.5) See the line turn gold

I cannot get "Convert to Image" to work locally, despite my best
efforts. I have confirmed that everything is being rendered into a
single SVG, which gives me high confidence. I will also test once this
is deployed to AWS (and rolling back is trivial), so I think this is
sufficient.

Reviewers: aria, emily

Reviewed By: emily

Differential Revision: https://phabricator.khanacademy.org/D18542
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

No branches or pull requests

1 participant