-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cartesian subplot updates using data joins #946
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
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c877c27
move subplot creation from makePlotFramework -> Cartesian.plot
etpinard ff26691
rm some early-Plotly.plot logic regarding makePlotFramwork
etpinard 40fc7f9
plots: add linkSubplot method
etpinard 652b905
first try at making the new cartesian subplot paradigm work
etpinard e85a6c7
keep ref to subplot image/shape layers in main drawData
etpinard 43d227a
lint
etpinard 937c54b
add baseModule drawFramework step
etpinard 78faa3f
plots: add a cartesian subplot purge step
etpinard f8017f2
test: adapt relinkPrivateKeys test
etpinard c239602
test: adapt legend scroll test
etpinard f4aee1e
test: adapt gd._ keys ordering
etpinard ab96422
test: check clip path & dragger counts in cartesian plots
etpinard 8c09af2
Merge branch 'master' into cartesian-per-subplot
etpinard b00d716
Merge branch 'master' into cartesian-per-subplot
etpinard ae3ab55
replace plotinfo.x() -> plotinfo.xaxis
etpinard a708381
make makeSubplotLayer agnostic to fullLayout
etpinard e78b099
rm useless return in makePlotFramework
etpinard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rm some early-Plotly.plot logic regarding makePlotFramwork
- Loading branch information
commit ff26691c3cff92316c0af5daf758ff6b40f1ca4b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,28 +121,15 @@ Plotly.plot = function(gd, data, layout, config) { | |
// so we don't try to re-call Plotly.plot from inside | ||
// legend and colorbar, if margins changed | ||
gd._replotting = true; | ||
var hasData = gd._fullData.length > 0; | ||
|
||
var subplots = Plotly.Axes.getSubplots(gd).join(''), | ||
oldSubplots = Object.keys(gd._fullLayout._plots || {}).join(''), | ||
hasSameSubplots = (oldSubplots === subplots); | ||
// make or remake the framework if we need to | ||
if(graphWasEmpty) makePlotFramework(gd); | ||
|
||
// Make or remake the framework (ie container and axes) if we need to | ||
// note: if they container already exists and has data, | ||
// the new layout gets ignored (as it should) | ||
// but if there's no data there yet, it's just a placeholder... | ||
// then it should destroy and remake the plot | ||
if(hasData) { | ||
if(gd.framework !== makePlotFramework || graphWasEmpty || !hasSameSubplots) { | ||
gd.framework = makePlotFramework; | ||
makePlotFramework(gd); | ||
} | ||
} | ||
else if(!hasSameSubplots) { | ||
// polar need a different framework | ||
if(gd.framework !== makePlotFramework) { | ||
gd.framework = makePlotFramework; | ||
makePlotFramework(gd); | ||
} | ||
else if(graphWasEmpty) makePlotFramework(gd); | ||
|
||
// save initial axis range once per graph | ||
if(graphWasEmpty) Plotly.Axes.saveRangeInitial(gd); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alexcjohnson can you review these few lines? Can you think of any other (edge) cases that I could have missed? |
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is a bit confusing to me since framework = noun while makePlotFramework = verb, but this is probably nothing new and not a big deal.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is very strange. But, like pointed out by the comment above, the only reason this line is here is because of polar.
As polar is so broken at the moment, I prefer not changing things too much until we fully refactor it.