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

React + uirevision fixes #3394

Merged
merged 4 commits into from Jan 4, 2019

Conversation

Projects
None yet
2 participants
@etpinard
Copy link
Member

commented Jan 3, 2019

fixes #3378 - that is uirevision is now functional with subplots that do not call _guilRelayout at interactions' end (i.e. gl3d, geo and mapbox).

These subplots have to use _storeDirectGUIEdit to fill gd._fullLayout._preGUI and get uirevision to work correctly. On master, _preGUI was filled with the "new" values instead of the "old" (i.e. "pre-interaction") values that the restyle/relayout/update/react logic expects. In brief, fixing this bug was mostly just a matter of reordering things.

cc @plotly/plotly_js @alexcjohnson

etpinard added some commits Jan 3, 2019

fix uirevision behavior on mapbox subplots
... and remove `self.opts` use `self.gd._fullLayout[self.id]`
    instead, which always points to the correct container
    even on redraw-less updates
}

// mocking panning/scrolling is brittle,
// this here is enough to to trigger the relayoutCallback

This comment has been minimized.

Copy link
@alexcjohnson

alexcjohnson Jan 3, 2019

Contributor

but this presumably doesn't actually change camera.eye, right? Would it be possible to do something that changes the eye, even if it's not robust what it changes it to? Just "not the default", and verify that after another _react it's again "not the default"? Or is it so brittle we can't even ensure it will register anything at all?

This comment has been minimized.

Copy link
@etpinard

etpinard Jan 4, 2019

Author Member

but this presumably doesn't actually change camera.eye, right?

Yes, you were correct.

Would it be possible to do something that changes the eye, even if it's not robust what it changes it to? Just "not the default", and verify that after another _react it's again "not the default"?

Good call. Here's my attempt -> b880717

This comment has been minimized.

Copy link
@alexcjohnson

alexcjohnson Jan 4, 2019

Contributor

Ah clever! I'll take it :)

@@ -32,9 +32,6 @@ function Mapbox(opts) {
// unique id for this Mapbox instance
this.uid = fullLayout._uid + '-' + this.id;

// full mapbox options (N.B. needs to be updated on every updates)
this.opts = fullLayout[this.id];

This comment has been minimized.

Copy link
@alexcjohnson

alexcjohnson Jan 3, 2019

Contributor

Very nice simplification!

@alexcjohnson

This comment has been minimized.

Copy link
Contributor

commented Jan 4, 2019

Beautiful, thanks for cleaning all this up! 💃

@etpinard etpinard merged commit 364cdec into master Jan 4, 2019

8 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: publish Your tests passed on CircleCI!
Details
ci/circleci: test-image Your tests passed on CircleCI!
Details
ci/circleci: test-image2 Your tests passed on CircleCI!
Details
ci/circleci: test-jasmine Your tests passed on CircleCI!
Details
ci/circleci: test-jasmine2 Your tests passed on CircleCI!
Details
ci/circleci: test-syntax Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details

@etpinard etpinard deleted the uirevision-fixes branch Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.