Skip to content

Added promise returns to Plotly.___ #77

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

Merged
merged 2 commits into from
Dec 7, 2015
Merged

Conversation

mdtusz
Copy link
Contributor

@mdtusz mdtusz commented Dec 4, 2015

Added promise returns for exposed methods in plot_api.js, and they will all be sent along with the gd.

#76

Tests on npm run test-image are not passing on my machine, but let's see if they pass on circle!

@@ -1640,7 +1650,7 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
}
else {
console.log('restyle fail',astr,val,traces);
return;
return new Promise.reject();
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@etpinard
Copy link
Contributor

etpinard commented Dec 4, 2015

Nice.

Let's get a test case in test/jasmine/tests/plot_api_test.js checking that the gd is in fact passed into the the Plotly.plot.then.


Plotly.addTraces(gd, [{'name': 'c'}, {'name': 'd'}]);
expect(gd).toEqual(expected);
expect(gd.data).toEqual(expectedData);
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI @bpostlethwaite no need to check the whole gd, just checking its data is more than enough here.

Copy link
Member

Choose a reason for hiding this comment

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

nice catch, agreed!

@etpinard
Copy link
Contributor

etpinard commented Dec 7, 2015

💃

mdtusz added a commit that referenced this pull request Dec 7, 2015
Added promise returns to Plotly.___
@mdtusz mdtusz merged commit 7c100f5 into master Dec 7, 2015
@mdtusz mdtusz deleted the patch-promise-returns branch December 7, 2015 21:00
@mdtusz mdtusz restored the patch-promise-returns branch December 14, 2015 21:14
@mdtusz mdtusz deleted the patch-promise-returns branch December 14, 2015 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants