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

Make null/undefined a noop for addFrames #1013

Merged
merged 1 commit into from
Oct 5, 2016
Merged

Conversation

rreusser
Copy link
Contributor

@rreusser rreusser commented Oct 5, 2016

This PR makes passing either null or undefined to Plotly.addFrames a no-op. I didn't initially expect this would be a meaningful case, but this allows all plots to simply call

Plotly.plot(gd, x.data, x.layout, x.config).then(function () {
  return Plotly.addFrames(gd, x.frames))
});

without worrying about whether addFrames needs to be called. Ideally in v2.0 frames will be part of the initial plot call, but until then, at least you can call addFrames and let the method sort out whether it's a no-op or not.

@etpinard etpinard added this to the v1.18.0 milestone Oct 5, 2016
@etpinard
Copy link
Contributor

etpinard commented Oct 5, 2016

Ideally in v2.0 frames will be part of the initial plot

For the record, we could also add a new call signature to Plotly.plot e.g:

Plotly.plot(graphDiv, {
  data: [],
  layout: {},
  config: {},
  frames: []
});

}).catch(fail).then(done);
});

it('treats an empty list as a noop', function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

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

looking good 💃

@rreusser rreusser merged commit dd94b9f into master Oct 5, 2016
@rreusser rreusser deleted the add-frames-noop branch October 5, 2016 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants