Skip to content

Commit 2092354

Browse files
committed
convert some stacked area TODOs to Notes since we've discussed them
1 parent 13b54da commit 2092354

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/traces/scatter/stack_defaults.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,23 @@ module.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce)
6565
}
6666

6767
if(traceHasAttr) {
68-
// TODO: this will show a value here even if it's invalid
69-
// in which case it will revert to default. Is that what we
70-
// want, or should we only take the first *valid* value?
68+
// Note: this will show a value here even if it's invalid
69+
// in which case it will revert to default.
7170
groupOpts[attrFound] = true;
7271

73-
// TODO: should we copy the new value to the first trace instead?
74-
// if we did that, the editor could show controls in the
75-
// first trace always; otherwise it would only show controls
76-
// in a later trace, if that trace happens to already have a value...
77-
// I think it's probably better to ignore the editor for this
78-
// purpose though, as it's probably going to have to use some
79-
// special logic anyway, it will likely want to just
80-
// take the value out of layout._scatterStackOpts, set the
81-
// new value into the first trace, and clear all later traces.
72+
// Note: only one trace in the stack will get a _fullData
73+
// entry for a given stack-wide attribute. If no traces
74+
// (or the first trace) specify that attribute, the
75+
// first trace will get it. If the first trace does NOT
76+
// specify it but some later trace does, then it gets
77+
// removed from the first trace and only included in the
78+
// one that specified it. This is mostly important for
79+
// editors (that want to see the full values to know
80+
// what settings are available) and Plotly.react diffing.
81+
// Editors may want to use fullLayout._scatterStackOpts
82+
// directly and make these settings available from all
83+
// traces in the stack... then set the new value into
84+
// the first trace, and clear all later traces.
8285
if(!firstTrace) {
8386
delete groupOpts.traces[0][attr];
8487

0 commit comments

Comments
 (0)