-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Introduce global contexts #2159
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 all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e6fcbf5
Introduce global contexts
dy f711cf1
Fix canvas counts
dy 0838c31
Scope regl creation by trace
dy 348e170
Fix interaction/image tests
dy 07ea384
Lintify
dy 1517ece
Remove data obj
dy f7fc8cb
Merge branch 'master' into global-context
dy 384b577
Recycle global canvases properly
dy 8346ce4
Fix container test
dy b8b8951
Simplify canvas removal
dy 4efe21e
Minor fixes
dy 83b7589
Fix parcoords tests
dy de9b1aa
Fix noCI tests
dy 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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -12,7 +12,6 @@ var d3 = require('d3'); | |
var Plots = require('../../plots/plots'); | ||
var parcoordsPlot = require('./plot'); | ||
var xmlnsNamespaces = require('../../constants/xmlns_namespaces'); | ||
var c = require('./constants'); | ||
|
||
exports.name = 'parcoords'; | ||
|
||
|
@@ -28,9 +27,6 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) | |
var hasParcoords = (newFullLayout._has && newFullLayout._has('parcoords')); | ||
|
||
if(hadParcoords && !hasParcoords) { | ||
oldFullLayout._paperdiv.selectAll('.parcoords-line-layers').remove(); | ||
oldFullLayout._paperdiv.selectAll('.parcoords-line-layers').remove(); | ||
oldFullLayout._paperdiv.selectAll('.parcoords').remove(); | ||
oldFullLayout._paperdiv.selectAll('.parcoords').remove(); | ||
oldFullLayout._glimages.selectAll('*').remove(); | ||
} | ||
|
@@ -41,22 +37,20 @@ exports.toSVG = function(gd) { | |
var imageRoot = gd._fullLayout._glimages; | ||
var root = d3.select(gd).selectAll('.svg-container'); | ||
var canvases = root.filter(function(d, i) {return i === root.size() - 1;}) | ||
.selectAll('.parcoords-lines.context, .parcoords-lines.focus'); | ||
.selectAll('.gl-canvas-context, .gl-canvas-focus'); | ||
|
||
function canvasToImage(d) { | ||
function canvasToImage() { | ||
var canvas = this; | ||
var imageData = canvas.toDataURL('image/png'); | ||
var image = imageRoot.append('svg:image'); | ||
var size = gd._fullLayout._size; | ||
var domain = gd._fullData[d.model.key].domain; | ||
|
||
image.attr({ | ||
xmlns: xmlnsNamespaces.svg, | ||
'xlink:href': imageData, | ||
x: size.l + size.w * domain.x[0] - c.overdrag, | ||
y: size.t + size.h * (1 - domain.y[1]), | ||
width: (domain.x[1] - domain.x[0]) * size.w + 2 * c.overdrag, | ||
height: (domain.y[1] - domain.y[0]) * size.h, | ||
x: 0, | ||
y: 0, | ||
width: canvas.width, | ||
height: canvas.height, | ||
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. Lovely cleanup ❤️ |
||
preserveAspectRatio: 'none' | ||
}); | ||
} | ||
|
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
Oops, something went wrong.
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.
brilliant ✨