Skip to content

fix gl2d replot #570

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 4 commits into from
May 26, 2016
Merged

fix gl2d replot #570

merged 4 commits into from
May 26, 2016

Conversation

etpinard
Copy link
Contributor

@mdtusz replotting from a blank graph is currently broken for gl2d plots.

For example,

Plotly.plot(gd, []);
Plotly.plot(gd, [{ type: 'scattergl', x: [1, 2, 3], y: [2, 1, 2] }];

is falling.

This PR fixes ⏫ , while robustifying the gl2d clean-plot step and adding a comprehensive test case.

etpinard added 3 commits May 26, 2016 15:02
- so that Plots.getSubplots('gl2d' or 'cartesian') does not fail
  on a blank (i.e. Plotly.plot(gd, [])) plot
- I am beginning to doubt that storing both 'cartesian' and 'gl2d'
  subplot objects in fullLayout._plots is the way to go.
- delete old 2d scenes that don't nest any 'gl2d' traces,
  instead of deleting 2d scenes that have no corresp. axes in
  new fullLayout.
- delete item in _plots, so that if a 'gl2d' -> 'cartesian' subplot
  conversion happens unhindered.
@etpinard etpinard added bug something broken status: reviewable labels May 26, 2016
it('should be able to replot from a blank graph', function(done) {
var gd = createGraphDiv();

function assert(cnt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe change the name of this. I know it's not really node code, but at a glance without seeing the function, it could be mistaken for the node assert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@mdtusz
Copy link
Contributor

mdtusz commented May 26, 2016

Small 🐄 with the naming, then 💃 .

@etpinard etpinard merged commit f170161 into master May 26, 2016
@etpinard etpinard deleted the gl2d-replot branch May 26, 2016 19:37
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.

2 participants