Skip to content

Commit 346a24d

Browse files
committed
merging line related attributes into their one place
(cherry picked from commit 2717ca6)
1 parent 69951cd commit 346a24d

File tree

5 files changed

+40
-42
lines changed

5 files changed

+40
-42
lines changed

src/traces/parcoords/attributes.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ module.exports = {
129129
},
130130

131131
line: extendFlat({},
132+
132133
colorAttributes('line'),
134+
133135
{
134136
showscale: {
135137
valType: 'boolean',
@@ -141,6 +143,35 @@ module.exports = {
141143
].join(' ')
142144
},
143145
colorbar: colorbarAttrs
146+
},
147+
148+
{
149+
contextopacity: {
150+
valType: 'number',
151+
dflt: 0.05,
152+
min: 0,
153+
max: 1,
154+
role: 'style',
155+
description: 'Opacity of the context lines, on a scale of 0 (invisible) to 1 (fully opaque).'
156+
},
157+
158+
pixelratio: {
159+
valType: 'number',
160+
dflt: 1,
161+
min: 0.25,
162+
max: 4,
163+
role: 'style',
164+
description: 'Line rendering pixel ratio. A lower value yields faster rendering but blockier lines.'
165+
},
166+
167+
focusalphablending: {
168+
valType: 'boolean',
169+
dflt: false,
170+
role: 'style',
171+
description: [
172+
'By default, the rendered lines are opaque. Setting it to `true` is necessary if opacity is needed.'
173+
].join(' ')
174+
}
144175
}
145176
),
146177

@@ -153,34 +184,5 @@ module.exports = {
153184
'The number of lines rendered in one 16ms rendering frame. Use 2000-5000 on low-end hardware to remain',
154185
'responsive, and 10000 .. 100000 on strong hardware for faster rendering.'
155186
].join(' ')
156-
},
157-
158-
lines: {
159-
contextopacity: {
160-
valType: 'number',
161-
dflt: 0.05,
162-
min: 0,
163-
max: 1,
164-
role: 'style',
165-
description: 'Opacity of the context lines, on a scale of 0 (invisible) to 1 (fully opaque).'
166-
},
167-
168-
pixelratio: {
169-
valType: 'number',
170-
dflt: 1,
171-
min: 0.25,
172-
max: 4,
173-
role: 'style',
174-
description: 'Line rendering pixel ratio. A lower value yields faster rendering but blockier lines.'
175-
},
176-
177-
focusalphablending: {
178-
valType: 'boolean',
179-
dflt: false,
180-
role: 'style',
181-
description: [
182-
'By default, the rendered lines are opaque. Setting it to `true` is necessary if opacity is needed.'
183-
].join(' ')
184-
}
185187
}
186188
};

src/traces/parcoords/calc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ module.exports = function calc(gd, trace) {
7575
dimensions: cd,
7676
tickdistance: trace.tickdistance,
7777
blocklinecount: trace.blocklinecount,
78-
lines: trace.lines,
7978
line: trace.line,
8079
padding: trace.padding,
8180
unitToColor: function(d) {

src/traces/parcoords/defaults.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
8484
coerce('domain.y');
8585

8686
coerce('line.color');
87-
88-
coerce('lines.contextopacity');
89-
coerce('lines.pixelratio');
90-
coerce('lines.focusalphablending');
87+
coerce('line.contextopacity');
88+
coerce('line.pixelratio');
89+
coerce('line.focusalphablending');
9190
};

src/traces/parcoords/parcoords.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ function integerScale(integerPadding, dimension) {
9393

9494
function model(layout, d, i) {
9595

96-
var canvasPixelRatio = d.lines.pixelratio;
96+
var canvasPixelRatio = d.line.pixelratio;
9797

98-
var lines = Lib.extendDeep(d.lines, {
98+
var lines = Lib.extendDeep(d.line, {
9999
color: d.line.color.map(domainToUnitScale({values: d.line.color})),
100100
blockLineCount: d.blocklinecount,
101101
canvasOverdrag: overdrag * canvasPixelRatio

test/jasmine/tests/parcoords_test.js

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

0 commit comments

Comments
 (0)