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

copy histogram autobinx/y back to the input trace #1901

Merged
merged 1 commit into from
Jul 20, 2017

Conversation

alexcjohnson
Copy link
Collaborator

on par with colors and axis ranges

fixes #24

@etpinard are you OK with this?

on par with colors and axis ranges
var autoBinAttr = 'autobin' + maindata;
var binspec = trace[binAttr];
if((trace[autoBinAttr] !== false) || !binspec ||
binspec.start === null || binspec.end === null) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note that cleanBins provides a size even if there are no start or end. This also doesn't allow you to specify a start and no end or things like that. So partial bin definition might do strange things... but that I would definitely consider a feature we could propose to add, rather than a bug to fix.

Also note that !(binAttr in trace) in the old version never failed, since we default to null for start and end (which might have been important to enable cleanBins?) - so in principle I could omit !binspec here, just thought it prudent in case there's some context I'm not aware of that can call this calc.

@etpinard etpinard added status: reviewable bug something broken labels Jul 20, 2017
expect(gd._fullData[0].autobiny).toBe(true);
});

it('respects explicit autobin: false as a one-time autobin', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

That's cool 👍

@etpinard
Copy link
Contributor

on par with colors and axis ranges

Nicely done and thanks for not forgetting about histogram2d 💃

@alexcjohnson alexcjohnson merged commit 783bdaa into master Jul 20, 2017
@alexcjohnson alexcjohnson deleted the autovals-restyle branch July 20, 2017 21:17
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.

Histogram does not scale to the range of new data on restyle
2 participants