Skip to content

pie - problem with reversed domain ranges #4300

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
archmoj opened this issue Oct 24, 2019 · 1 comment · Fixed by #4304
Closed

pie - problem with reversed domain ranges #4300

archmoj opened this issue Oct 24, 2019 · 1 comment · Fixed by #4304
Assignees
Labels
bug something broken
Milestone

Comments

@archmoj
Copy link
Contributor

archmoj commented Oct 24, 2019

In this codepen the first pie graph (i.e. on the left) does not look right!
The graphs reversed and the text is presented outside as a result of bad input data where domain.x[1] is not greater than domain.x[0].

We shouldn't allow that here:

exports.defaults = function(containerOut, layout, coerce, dfltDomains) {
var dfltX = (dfltDomains && dfltDomains.x) || [0, 1];
var dfltY = (dfltDomains && dfltDomains.y) || [0, 1];
var grid = layout.grid;
if(grid) {
var column = coerce('domain.column');
if(column !== undefined) {
if(column < grid.columns) dfltX = grid._domains.x[column];
else delete containerOut.domain.column;
}
var row = coerce('domain.row');
if(row !== undefined) {
if(row < grid.rows) dfltY = grid._domains.y[row];
else delete containerOut.domain.row;
}
}
coerce('domain.x', dfltX);
coerce('domain.y', dfltY);
};

@archmoj archmoj added the bug something broken label Oct 24, 2019
@etpinard
Copy link
Contributor

Thanks for spotting. Presumably this bugs affects other traces that use plots/domain.js.

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

Successfully merging a pull request may close this issue.

2 participants