Skip to content

Commit 8490804

Browse files
committed
fix test failures - and simplify handleArrayContainerDefaults even more 🎉
1 parent bc21cc8 commit 8490804

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/components/shapes/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function drawOne(gd, index) {
6666
.selectAll('.shapelayer [data-index="' + index + '"]')
6767
.remove();
6868

69-
var options = gd._fullLayout.shapes[index];
69+
var options = gd._fullLayout.shapes[index] || {};
7070

7171
// this shape is gone - quit now after deleting it
7272
// TODO: use d3 idioms instead of deleting and redrawing every time

src/components/sliders/defaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function sliderDefaults(sliderIn, sliderOut, layoutOut) {
9494
coerce('minorticklen');
9595
}
9696

97-
function stepDefaults(valueIn, valueOut, sliderOut, opts, itemOpts) {
97+
function stepDefaults(valueIn, valueOut) {
9898
function coerce(attr, dflt) {
9999
return Lib.coerce(valueIn, valueOut, stepAttrs, attr, dflt);
100100
}
@@ -108,7 +108,7 @@ function stepDefaults(valueIn, valueOut, sliderOut, opts, itemOpts) {
108108
if(visible) {
109109
coerce('method');
110110
coerce('args');
111-
var label = coerce('label', 'step-' + itemOpts.index);
111+
var label = coerce('label', 'step-' + valueOut._index);
112112
coerce('value', label);
113113
coerce('execute');
114114
}

src/plots/array_container_defaults.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ var Template = require('../plot_api/plot_template');
3636
* - itemOut {object} item in full layout
3737
* - parentObj {object} (as in closure)
3838
* - opts {object} (as in closure)
39-
* - itemOpts {object}
40-
* - index {integer}
4139
* N.B.
4240
*
4341
* - opts is passed to handleItemDefaults so it can also store
@@ -57,7 +55,6 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut
5755

5856
for(i = 0; i < contIn.length; i++) {
5957
var itemIn = contIn[i];
60-
var itemOpts = {};
6158

6259
if(!Lib.isPlainObject(itemIn)) {
6360
itemOut = templater.newItem({});
@@ -70,7 +67,7 @@ module.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut
7067
itemOut._index = i;
7168

7269
if(itemOut[inclusionAttr] !== false) {
73-
opts.handleItemDefaults(itemIn, itemOut, parentObjOut, opts, itemOpts);
70+
opts.handleItemDefaults(itemIn, itemOut, parentObjOut, opts);
7471
}
7572

7673
contOut.push(itemOut);

0 commit comments

Comments
 (0)