Skip to content

Commit 7b75100

Browse files
committed
Renamed parcats.marker -> parcats.line
Renamed shape categories to `linear` and `hspline` and made `linear` the default.
1 parent 0c9c75f commit 7b75100

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed

src/traces/parcats/attributes.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ var extendFlat = require('../../lib/extend').extendFlat;
1212
var colorAttributes = require('../../components/colorscale/attributes');
1313

1414
var scatterAttrs = require('../scatter/attributes');
15-
var scatterMarkerAttrs = scatterAttrs.marker;
15+
var scatterLineAttrs = scatterAttrs.line;
1616
var colorbarAttrs = require('../../components/colorbar/attributes');
1717

18-
var marker = extendFlat({
18+
var line = extendFlat({
1919
editType: 'calc'
20-
}, colorAttributes('marker', {editType: 'calc'}),
20+
}, colorAttributes('line', {editType: 'calc'}),
2121
{
22-
showscale: scatterMarkerAttrs.showscale,
22+
showscale: scatterLineAttrs.showscale,
2323
colorbar: colorbarAttrs,
2424
shape: {
2525
valType: 'enumerated',
26-
values: ['straight', 'curved'],
27-
dflt: 'curved',
26+
values: ['linear', 'hspline'],
27+
dflt: 'linear',
2828
role: 'info',
2929
editType: 'plot',
3030
description: 'Sets the shape of the paths'},
@@ -166,7 +166,7 @@ module.exports = {
166166
description: 'The dimensions (variables) of the parallel categories diagram.'
167167
},
168168

169-
marker: marker,
169+
line: line,
170170
counts: {
171171
valType: 'number',
172172
min: 0,

src/traces/parcats/calc.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,28 @@ module.exports = function calc(gd, trace) {
7171

7272
// Handle path colors
7373
// ------------------
74-
var marker = trace.marker;
74+
var line = trace.line;
7575
var markerColorscale;
7676

7777
// Process colorscale
78-
if(marker) {
79-
if(hasColorscale(trace, 'marker')) {
80-
colorscaleCalc(trace, trace.marker.color, 'marker', 'c');
78+
if(line) {
79+
if(hasColorscale(trace, 'line')) {
80+
colorscaleCalc(trace, trace.line.color, 'line', 'c');
8181
}
82-
markerColorscale = Drawing.tryColorscale(marker);
82+
markerColorscale = Drawing.tryColorscale(line);
8383
} else {
8484
markerColorscale = Lib.identity;
8585
}
8686

8787
// Build color generation function
8888
function getMarkerColorInfo(index) {
8989
var value;
90-
if(!marker) {
90+
if(!line) {
9191
value = parcatConstants.defaultColor;
92-
} else if(Array.isArray(marker.color)) {
93-
value = marker.color[index % marker.color.length];
92+
} else if(Array.isArray(line.color)) {
93+
value = line.color[index % line.color.length];
9494
} else {
95-
value = marker.color;
95+
value = line.color;
9696
}
9797

9898
return {color: markerColorscale(value), rawColor: value};

src/traces/parcats/defaults.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ var colorbarDefaults = require('../../components/colorbar/defaults');
1515

1616
function markerDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
1717

18-
coerce('marker.color', defaultColor);
19-
20-
if(traceIn.marker) {
21-
coerce('marker.cmin');
22-
coerce('marker.cmax');
23-
coerce('marker.cauto');
24-
coerce('marker.colorscale');
25-
coerce('marker.showscale');
26-
coerce('marker.shape');
27-
colorbarDefaults(traceIn.marker, traceOut.marker, layout);
18+
coerce('line.color', defaultColor);
19+
20+
if(traceIn.line) {
21+
coerce('line.cmin');
22+
coerce('line.cmax');
23+
coerce('line.cauto');
24+
coerce('line.colorscale');
25+
coerce('line.showscale');
26+
coerce('line.shape');
27+
colorbarDefaults(traceIn.line, traceOut.line, layout);
2828
}
2929
}
3030

@@ -64,7 +64,7 @@ function dimensionsDefaults(traceIn, traceOut) {
6464

6565
// Pass through catValues, catorder, and catlabels (validated in calc since this is where unique info is available)
6666

67-
// pass through marker (color, line)
67+
// pass through line (color)
6868
// Pass through font
6969

7070
commonLength = Math.min(commonLength, dimensionOut.values.length);

src/traces/parcats/parcats.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,10 +1318,10 @@ function createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) {
13181318
// Handle path shape
13191319
// -----------------
13201320
var pathShape;
1321-
if(trace.marker && trace.marker.shape) {
1322-
pathShape = trace.marker.shape;
1321+
if(trace.line && trace.line.shape) {
1322+
pathShape = trace.line.shape;
13231323
} else {
1324-
pathShape = 'curved';
1324+
pathShape = 'linear';
13251325
}
13261326

13271327
// Initialize parcatsViewModel
@@ -1582,7 +1582,7 @@ function updatePathViewModels(parcatsViewModel) {
15821582

15831583
// build svg path
15841584
var svgD;
1585-
if(parcatsViewModel.pathShape === 'curved') {
1585+
if(parcatsViewModel.pathShape === 'hspline') {
15861586
svgD = buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, 0.5);
15871587
} else {
15881588
svgD = buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, 0);
@@ -1791,7 +1791,7 @@ function createDimensionViewModel(parcatsViewModel, dimensionModel) {
17911791
* If 'forward' then sort paths based on dimensions from left to right. If 'backward' sort based on dimensions
17921792
* from right to left
17931793
* @property {String} pathShape
1794-
* The shape of the paths. Either 'straight' or 'curved'.
1794+
* The shape of the paths. Either 'linear' or 'hspline'.
17951795
* @property {DimensionViewModel|null} dragDimension
17961796
* Dimension currently being dragged. Null if no drag in progress
17971797
* @property {Margin} margin

test/image/mocks/parcats_bundled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"]},
88
{"label": "Three", "values": [11, 11, 11, 11, 11, 11, 11, 11, 11]}],
99
"bundlecolors": true,
10-
"marker": {
10+
"line": {
1111
"color": [0, 0, 1, 1, 0, 1, 0, 0, 0]
1212
}
1313
}

test/image/mocks/parcats_bundled_reversed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{"label": "Three", "values": [11, 11, 11, 11, 11, 11, 11, 11, 11]}],
99
"bundlecolors": true,
1010
"sortpaths": "backward",
11-
"marker": {
11+
"line": {
1212
"color": [0, 0, 1, 1, 0, 1, 0, 0, 0]
1313
}
1414
}

test/image/mocks/parcats_unbundled.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"]},
88
{"label": "Three", "values": [11, 11, 11, 11, 11, 11, 11, 11, 11]}],
99
"bundlecolors": false,
10-
"marker": {
10+
"line": {
1111
"color": [0, 0, 1, 1, 0, 1, 0, 0, 0],
12-
"shape": "straight"
12+
"shape": "hspline"
1313
}
1414
}
1515
],

0 commit comments

Comments
 (0)