Skip to content

Add support for fast image rendering on any linear axes #5305

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

Closed
antoinerg opened this issue Nov 26, 2020 · 0 comments · Fixed by #5307
Closed

Add support for fast image rendering on any linear axes #5305

antoinerg opened this issue Nov 26, 2020 · 0 comments · Fixed by #5307
Labels
bug something broken feature something new

Comments

@antoinerg
Copy link
Contributor

antoinerg commented Nov 26, 2020

At the moment, image trace will only get fast rendering if axes are compatible as per:

var fastImage = supportsPixelatedImage && !trace._hasZ && trace._hasSource && compatibleAxis(xa) && compatibleAxis(ya);

However, compatibleAxis here is a bit too strict since there's no reason we couldn't support both reversed and normal linear axes:

function compatibleAxis(ax) {
return ax.type === 'linear' &&
// y axis must be reversed but x axis mustn't be
((ax.range[1] > ax.range[0]) === (ax._id.charAt(0) === 'x'));
}

Basically, we should 🔪 line 21 and then proceed to get the positioning right as well as the correct hover labels for any order of the axes 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken feature something new
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants