Skip to content

Commit 5f9b34c

Browse files
committed
remove references to transforms in comments, and some additional unneeded code
1 parent cd001e4 commit 5f9b34c

19 files changed

Lines changed: 24 additions & 48 deletions

File tree

src/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ lib.expandObjectPaths = function (data) {
910910
data[prop] = data[prop] || [];
911911

912912
if (match[3] === '.') {
913-
// This is the case where theere are subsequent properties into which
914-
// we must recurse, e.g. transforms[0].value
913+
// This is the case where there are subsequent properties into which
914+
// we must recurse, e.g. annotations[0].text
915915
trailingPath = match[4];
916916
dest = data[prop][idx] = data[prop][idx] || {};
917917

src/plot_api/plot_api.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,16 +1408,6 @@ function _restyle(gd, aobj, traces) {
14081408
return 'LAYOUT' + axName + '.range';
14091409
}
14101410

1411-
function getFullTrace(traceIndex) {
1412-
// usually fullData maps 1:1 onto data, but with groupby transforms
1413-
// the fullData index can be greater. Take the *first* matching trace.
1414-
for (var j = traceIndex; j < fullData.length; j++) {
1415-
if (fullData[j]._input === data[traceIndex]) return fullData[j];
1416-
}
1417-
// should never get here - and if we *do* it should cause an error
1418-
// later on undefined fullTrace is passed to nestedProperty.
1419-
}
1420-
14211411
// for attrs that interact (like scales & autoscales), save the
14221412
// old vals before making the change
14231413
// val=undefined will not set a value, just record what the value was.
@@ -1438,7 +1428,7 @@ function _restyle(gd, aobj, traces) {
14381428
extraparam = layoutNP(gd.layout, attr.replace('LAYOUT', ''));
14391429
} else {
14401430
var tracei = traces[i];
1441-
var preGUI = fullLayout._tracePreGUI[getFullTrace(tracei).uid];
1431+
var preGUI = fullLayout._tracePreGUI[fullData[tracei].uid];
14421432
extraparam = makeNP(preGUI, guiEditFlag)(data[tracei], attr);
14431433
}
14441434

@@ -1509,7 +1499,7 @@ function _restyle(gd, aobj, traces) {
15091499
undoit[ai] = a0();
15101500
for (i = 0; i < traces.length; i++) {
15111501
cont = data[traces[i]];
1512-
contFull = getFullTrace(traces[i]);
1502+
contFull = fullData[traces[i]];
15131503
var preGUI = fullLayout._tracePreGUI[contFull.uid];
15141504
param = makeNP(preGUI, guiEditFlag)(cont, ai);
15151505
oldVal = param.get();
@@ -2343,8 +2333,7 @@ var layoutUIControlPatterns = [
23432333
// or with no `attr` we use `trace.uirevision`
23442334
var traceUIControlPatterns = [
23452335
{ pattern: /^selectedpoints$/, attr: 'selectionrevision' },
2346-
// "visible" includes trace.transforms[i].styles[j].value.visible
2347-
{ pattern: /(^|value\.)visible$/, attr: 'legend.uirevision' },
2336+
{ pattern: /^visible$/, attr: 'legend.uirevision' },
23482337
{ pattern: /^dimensions\[\d+\]\.constraintrange/ },
23492338
{ pattern: /^node\.(x|y|groups)/ }, // for Sankey nodes
23502339
{ pattern: /^level$/ }, // for Sunburst, Treemap and Icicle traces
@@ -2354,8 +2343,7 @@ var traceUIControlPatterns = [
23542343
// reasonable or should these be `editrevision`?
23552344
// Also applies to axis titles up in the layout section
23562345

2357-
// "name" also includes transform.styles
2358-
{ pattern: /(^|value\.)name$/ },
2346+
{ pattern: /^name$/ },
23592347
// including nested colorbar attributes (ie marker.colorbar)
23602348
{ pattern: /colorbar\.title\.text$/ },
23612349
{ pattern: /colorbar\.(x|y)$/, attr: 'editrevision' }

src/plot_api/plot_schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ exports.findArrayAttributes = function(trace) {
218218
* @param {object} trace
219219
* full trace object that contains a reference to `_module.attributes`
220220
* @param {object} parts
221-
* an array of parts, like ['transforms', 1, 'value']
221+
* an array of parts, like ['dimensions', 1, 'values']
222222
* typically from nestedProperty(...).parts
223223
*
224224
* @return {object|false}

src/plot_api/template_api.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ exports.makeTemplate = function(figure) {
4949
data.forEach(function(trace) {
5050
// TODO: What if no style info is extracted for this trace. We may
5151
// not want an empty object as the null value.
52-
// TODO: allow transforms to contribute to templates?
53-
// as it stands they are ignored, which may be for the best...
5452

5553
var traceTemplate = {};
5654
walkStyleKeys(trace, traceTemplate, getTraceInfo.bind(null, trace));

src/plots/get_data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ exports.getModuleCalcData = function(calcdata, arg1, arg2) {
6565
var filterByZ = (trace.zorder !== undefined);
6666
// N.B.
6767
// - 'legendonly' traces do not make it past here
68-
// - skip over 'visible' traces that got trimmed completely during calc transforms
68+
// - skip over 'visible' traces with no data points
6969
if(trace.visible !== true || trace._length === 0) continue;
7070

7171
// group calcdata trace not by 'module' (as the name of this function

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ plots.layoutArrayContainers = Registry.layoutArrayContainers;
22322232
* Extend a trace definition. This method:
22332233
*
22342234
* 1. directly transfers any array references
2235-
* 2. manually recurses into container arrays like transforms
2235+
* 2. manually recurses into container arrays like dimensions
22362236
*
22372237
* The result is the original object reference with the new contents merged in.
22382238
*/

src/traces/cone/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
6363
coerce('yhoverformat');
6464
coerce('zhoverformat');
6565

66-
// disable 1D transforms (for now)
66+
// Ensure _length is defined
6767
traceOut._length = null;
6868
};

src/traces/contour/constraint_mapping.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
var filterOps = require('../../constants/filter_ops');
44
var isNumeric = require('fast-isnumeric');
55

6-
// This syntax conforms to the existing filter transform syntax, but we don't care
7-
// about open vs. closed intervals for simply drawing contours constraints:
6+
// This syntax uses the comparison and interval operations defined in
7+
// src/constants/filter_ops.js, but we don't care about open vs. closed intervals
8+
// for the purpose of drawing contours constraints
89
module.exports = {
910
'[]': makeRangeSettings('[]'),
1011
'][': makeRangeSettings(']['),
@@ -13,8 +14,7 @@ module.exports = {
1314
'=': makeInequalitySettings('=')
1415
};
1516

16-
// This does not in any way shape or form support calendars. It's adapted from
17-
// transforms/filter.js.
17+
// This does not in any way shape or form support calendars
1818
function coerceValue(operation, value) {
1919
var hasArrayValue = Array.isArray(value);
2020

src/traces/icicle/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
9595

9696
handleDomainDefaults(traceOut, layout, coerce);
9797

98-
// do not support transforms for now
98+
// Ensure _length is defined
9999
traceOut._length = null;
100100
};

src/traces/indicator/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
146146
traceOut._isAngular = traceOut._isBullet = false;
147147
}
148148

149-
// disable 1D transforms
149+
// Ensure _length is defined
150150
traceOut._length = null;
151151
}
152152

0 commit comments

Comments
 (0)