Skip to content

Commit ce48c02

Browse files
committed
proper keying for multiple parcoords
1 parent 6d9a24f commit ce48c02

File tree

5 files changed

+15
-112
lines changed

5 files changed

+15
-112
lines changed

src/traces/parcoords/attributes.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ module.exports = {
112112
description: 'The desired approximate tick distance (in pixels) between axis ticks on an axis.'
113113
},
114114

115+
padding: {
116+
valType: 'number',
117+
dflt: 80,
118+
min: 0,
119+
role: 'style',
120+
description: 'The desired space for displaying axis labels and domain ranges around the actual parcoords.'
121+
},
122+
115123
line: extendFlat({},
116124
colorAttributes('line'),
117125
{

src/traces/parcoords/calc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module.exports = function calc(gd, trace) {
7575
tickdistance: trace.tickdistance,
7676
lines: trace.lines,
7777
line: trace.line,
78+
padding: trace.padding,
7879
unitToColor: function(d) {
7980
return polylinearUnitScales.map(function(s) {
8081
return s(cScale(d));

src/traces/parcoords/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
7777
handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
7878

7979
coerce('tickdistance');
80+
coerce('padding');
8081

8182
coerce('domain.x');
8283
coerce('domain.y');

src/traces/parcoords/parcoords.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function domainToUnitScale(values) {
7070
return d3.scale.linear().domain(extent);
7171
}
7272

73-
function model(layout, d) {
73+
function model(layout, d, i) {
7474

7575
var data = d.dimensions;
7676

@@ -97,7 +97,7 @@ function model(layout, d) {
9797
var brushCaptureWidth = d.filterbar.capturewidth || Math.min(32, brushVisibleWidth + 16);
9898

9999
return {
100-
key: Math.random(),
100+
key: i,
101101
dimensions: data,
102102
tickDistance: d.tickdistance,
103103
unitToColor: d.unitToColor,

test/jasmine/tests/parcoords_test.js

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

0 commit comments

Comments
 (0)