Skip to content

Commit f350521

Browse files
committed
relayout now works; test case; fixing an overdrag cleanup artifact (residual on right overdrag and snap)
1 parent 1c29f81 commit f350521

File tree

3 files changed

+58
-14
lines changed

3 files changed

+58
-14
lines changed

src/traces/parcoords/lines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ module.exports = function(canvasGL, lines, canvasWidth, canvasHeight, dimensions
341341
colorClamp: colorClamp,
342342
scatter: scatter || 0,
343343
scissorX: I === leftmostIndex ? 0 : x + overdrag,
344-
scissorWidth: I === rightmostIndex ? 2 * panelSizeX : panelSizeX + 1 + (I === leftmostIndex ? x + overdrag : 0)
344+
scissorWidth: I === rightmostIndex ? 2 * panelSizeX + overdrag : panelSizeX + 1 + (I === leftmostIndex ? x + overdrag : 0)
345345
};
346346
}
347347

src/traces/parcoords/parcoords.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function viewModel(model) {
139139
viewModel.panels = model.dimensions.filter(visible).map(function(dimension, i) {
140140
var domainToUnit = domainToUnitScale(dimension.values);
141141
return {
142-
key: dimension.id || (dimension.label + ' ' + Math.floor(1e6 * Math.random())),
142+
key: dimension.id || dimension.label,
143143
label: dimension.label,
144144
integer: dimension.integer,
145145
scatter: dimension.scatter,
@@ -240,29 +240,29 @@ module.exports = function(root, styledData, layout, callbacks) {
240240
});
241241
}, keyFun);
242242

243+
var tweakables = {renderers: [], dimensions: []};
244+
243245
parcoordsLineLayer.enter()
244246
.append('canvas')
245247
.classed('parcoordsLineLayer', true)
246248
.style('transform', 'translate(' + (-overdrag) + 'px, 0)')
247249
.style('float', 'left')
248250
.style('clear', 'both')
249-
.style('position', function(d, i) {return i > 0 ? 'absolute' : 'static';})
250251
.style('left', 0)
251-
.style('padding', function(d) {return d.viewModel.model.padding + 'px';})
252252
.style('overflow', 'visible')
253+
.style('position', function(d, i) {return i > 0 ? 'absolute' : 'static';});
254+
255+
parcoordsLineLayer
256+
.style('padding', function(d) {return d.viewModel.model.padding + 'px';})
253257
.attr('width', function(d) {return d.viewModel.model.canvasWidth;})
254258
.attr('height', function(d) {return d.viewModel.model.canvasHeight;})
255259
.style('width', function(d) {return (d.viewModel.model.width + 2 * overdrag) + 'px';})
256-
.style('height', function(d) {return d.viewModel.model.height + 'px';});
257-
258-
var tweakables = {renderers: [], dimensions: []};
259-
260-
parcoordsLineLayer
260+
.style('height', function(d) {return d.viewModel.model.height + 'px';})
261261
.each(function(d) {
262-
var lineLayer = lineLayerMaker(this, d.model.lines, d.model.canvasWidth, d.model.canvasHeight, d.viewModel.panels, d.model.unitToColor, d.context);
263-
d.viewModel[d.key] = lineLayer;
264-
tweakables.renderers.push(function() {lineLayer.render(d.viewModel.panels, true);});
265-
lineLayer.render(d.viewModel.panels, !d.context, d.context && !someFiltersActive(d.viewModel));
262+
d.lineLayer = lineLayerMaker(this, d.model.lines, d.model.canvasWidth, d.model.canvasHeight, d.viewModel.panels, d.model.unitToColor, d.context);
263+
d.viewModel[d.key] = d.lineLayer;
264+
tweakables.renderers.push(function() {d.lineLayer.render(d.viewModel.panels, true);});
265+
d.lineLayer.render(d.viewModel.panels, !d.context, d.context && !someFiltersActive(d.viewModel));
266266
});
267267

268268
var parcoordsControlOverlay = parcoordsViewModel.selectAll('.parcoordsControlOverlay')
@@ -475,7 +475,7 @@ module.exports = function(root, styledData, layout, callbacks) {
475475
.append('g')
476476
.classed('axisBrush', true);
477477

478-
axisBrushEnter
478+
axisBrush
479479
.each(function(d) {
480480
if(!d.brush) {
481481
d.brush = d3.svg.brush()

test/jasmine/tests/parcoords_test.js

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)