Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
e6fcbf5f711cf10838c31348e17007ea3841517ecef7fc8cb384b5778346ce4b8b89514efe21e83b7589de9b1aaFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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, | ||
Contributor 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' | ||
| }); | ||
| } | ||
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.
brilliant ✨