-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Even better cartesian trace updates and removal #2579
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
Changes from 10 commits
400bfe6
284c206
da63ed4
a1c76bc
fa38ca5
48ee0d8
362da1f
3bef9a9
d47276f
83422f7
8c9a7bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,15 +61,16 @@ module.exports = { | |
DFLTRANGEY: [-1, 4], | ||
|
||
// Layers to keep trace types in the right order | ||
// N.B. each 'unique' plot method must have its own layer | ||
traceLayerClasses: [ | ||
'imagelayer', | ||
'maplayer', | ||
'heatmaplayer', | ||
'contourcarpetlayer', 'contourlayer', | ||
'barlayer', | ||
'carpetlayer', | ||
'violinlayer', | ||
'boxlayer', | ||
'ohlclayer', | ||
'scatterlayer' | ||
'scattercarpetlayer', 'scatterlayer' | ||
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. N.B. On the other hand, trace modules (e.g. 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. is there a reason some of the new ones share lines? 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. I put modules that almost have the same |
||
], | ||
|
||
layerValue2layerClass: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,20 +17,26 @@ var orientText = require('./orient_text'); | |
var svgTextUtils = require('../../lib/svg_text_utils'); | ||
var Lib = require('../../lib'); | ||
var alignmentConstants = require('../../constants/alignment'); | ||
var getUidsFromCalcData = require('../../plots/get_data').getUidsFromCalcData; | ||
|
||
module.exports = function plot(gd, plotinfo, cdcarpet) { | ||
if(!cdcarpet.length) { | ||
plotinfo.plot.select('.carpetlayer') | ||
.selectAll('g.trace') | ||
.remove(); | ||
} | ||
module.exports = function plot(gd, plotinfo, cdcarpet, carpetLayer) { | ||
var uidLookup = getUidsFromCalcData(cdcarpet); | ||
|
||
carpetLayer.selectAll('g.trace').each(function() { | ||
var classString = d3.select(this).attr('class'); | ||
var oldUid = classString.split('carpet')[1].split(/\s/)[0]; | ||
|
||
if(!uidLookup[oldUid]) { | ||
d3.select(this).remove(); | ||
} | ||
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. 🌴 🐎 perhaps make a common helper 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. done in d47276f |
||
}); | ||
|
||
for(var i = 0; i < cdcarpet.length; i++) { | ||
plotOne(gd, plotinfo, cdcarpet[i]); | ||
plotOne(gd, plotinfo, cdcarpet[i], carpetLayer); | ||
} | ||
}; | ||
|
||
function plotOne(gd, plotinfo, cd) { | ||
function plotOne(gd, plotinfo, cd, carpetLayer) { | ||
var t = cd[0]; | ||
var trace = cd[0].trace, | ||
xa = plotinfo.xaxis, | ||
|
@@ -39,10 +45,9 @@ function plotOne(gd, plotinfo, cd) { | |
bax = trace.baxis, | ||
fullLayout = gd._fullLayout; | ||
|
||
var gridLayer = plotinfo.plot.select('.carpetlayer'); | ||
var clipLayer = fullLayout._clips; | ||
|
||
var axisLayer = Lib.ensureSingle(gridLayer, 'g', 'carpet' + trace.uid).classed('trace', true); | ||
var axisLayer = Lib.ensureSingle(carpetLayer, 'g', 'carpet' + trace.uid).classed('trace', true); | ||
var minorLayer = Lib.ensureSingle(axisLayer, 'g', 'minorlayer'); | ||
var majorLayer = Lib.ensureSingle(axisLayer, 'g', 'majorlayer'); | ||
var boundaryLayer = Lib.ensureSingle(axisLayer, 'g', 'boundarylayer'); | ||
|
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.
wait, then will tests marked
@flaky
AND@gl
run at all on CI?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.
reverted in 8c9a7bf