Skip to content

pie - problem with reversed domain ranges #4300

Closed
@archmoj

Description

@archmoj

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);
};

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions