Skip to content

do not accept domain ranges where end is not greater than start#4304

Merged
archmoj merged 2 commits intomasterfrom
fix4300-handle-bad-plots-domain
Oct 25, 2019
Merged

do not accept domain ranges where end is not greater than start#4304
archmoj merged 2 commits intomasterfrom
fix4300-handle-bad-plots-domain

Conversation

@archmoj
Copy link
Copy Markdown
Contributor

@archmoj archmoj commented Oct 25, 2019

Fix #4300

Before
After

@plotly/plotly_js

@archmoj archmoj added bug something broken status: reviewable labels Oct 25, 2019
var y = coerce('domain.y', dfltY);

// don't accept bad input data
if(!(x[0] < x[1])) containerOut.domain.x = dfltX;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would dfltX.slice() here. I'm sure it ever happens for traces calling plots/domain.js, but we do mutate the domain sometimes (e.g. when applying scaleanchor constraints), so I would keep things on the safe side.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done in 74773fb

@etpinard
Copy link
Copy Markdown
Contributor

Thanks very much 💃

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 this pull request may close these issues.

pie - problem with reversed domain ranges

2 participants