Skip to content

Commit 705aed6

Browse files
committed
replace Registry.call('', []) with Registry.call('', ...[])
... everywhere except for plots/command.js where and fn.apply would work better, for now just grab api method for registry cache.
1 parent e05f4f0 commit 705aed6

File tree

21 files changed

+51
-48
lines changed

21 files changed

+51
-48
lines changed

src/components/annotations/click.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function onClick(gd, hoverData) {
5757
update['annotations[' + offSet[i] + '].visible'] = false;
5858
}
5959

60-
return Registry.call('update', [gd, {}, update]);
60+
return Registry.call('update', gd, {}, update);
6161
}
6262

6363
/*

src/components/annotations/draw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
591591
});
592592
},
593593
doneFn: function() {
594-
Registry.call('relayout', [gd, update]);
594+
Registry.call('relayout', gd, update);
595595
var notesBox = document.querySelector('.js-notes-box-panel');
596596
if(notesBox) notesBox.redraw(notesBox.selectedObj);
597597
}
@@ -673,7 +673,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
673673
},
674674
doneFn: function() {
675675
setCursor(annTextGroupInner);
676-
Registry.call('relayout', [gd, update]);
676+
Registry.call('relayout', gd, update);
677677
var notesBox = document.querySelector('.js-notes-box-panel');
678678
if(notesBox) notesBox.redraw(notesBox.selectedObj);
679679
}
@@ -698,7 +698,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
698698
update[ya._name + '.autorange'] = true;
699699
}
700700

701-
Registry.call('relayout', [gd, update]);
701+
Registry.call('relayout', gd, update);
702702
});
703703
}
704704
else annText.call(textLayout);

src/components/colorbar/draw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,11 @@ module.exports = function draw(gd, id) {
587587
setCursor(container);
588588

589589
if(xf !== undefined && yf !== undefined) {
590-
Registry.call('restyle', [
590+
Registry.call('restyle',
591591
gd,
592592
{'colorbar.x': xf, 'colorbar.y': yf},
593593
getTrace().index
594-
]);
594+
);
595595
}
596596
}
597597
});

src/components/dragelement/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ dragElement.coverSlip = coverSlip;
278278

279279
function finishDrag(gd) {
280280
gd._dragging = false;
281-
if(gd._replotPending) Registry.call('plot', [gd]);
281+
if(gd._replotPending) Registry.call('plot', gd);
282282
}
283283

284284
function pointerOffset(e) {

src/components/legend/draw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ module.exports = function draw(gd) {
338338
},
339339
doneFn: function() {
340340
if(xf !== undefined && yf !== undefined) {
341-
Registry.call('relayout', [gd, {'legend.x': xf, 'legend.y': yf}]);
341+
Registry.call('relayout', gd, {'legend.x': xf, 'legend.y': yf});
342342
}
343343
},
344344
clickFn: function(numClicks, e) {
@@ -430,7 +430,7 @@ function drawTexts(g, gd) {
430430
update.name = text;
431431
}
432432

433-
return Registry.call('restyle', [gd, update, traceIndex]);
433+
return Registry.call('restyle', gd, update, traceIndex);
434434
});
435435
} else {
436436
text.call(textLayout);

src/components/legend/handle_click.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module.exports = function handleClick(g, gd, numClicks) {
111111
}
112112
}
113113

114-
Registry.call('relayout', [gd, 'hiddenlabels', hiddenSlices]);
114+
Registry.call('relayout', gd, 'hiddenlabels', hiddenSlices);
115115
} else {
116116
var hasLegendgroup = legendgroup && legendgroup.length;
117117
var traceIndicesInGroup = [];
@@ -217,6 +217,6 @@ module.exports = function handleClick(g, gd, numClicks) {
217217
}
218218
}
219219

220-
Registry.call('restyle', [gd, attrUpdate, attrIndices]);
220+
Registry.call('restyle', gd, attrUpdate, attrIndices);
221221
}
222222
};

src/components/modebar/buttons.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function handleCartesian(gd, ev) {
249249
aobj[astr] = val;
250250
}
251251

252-
Registry.call('relayout', [gd, aobj]);
252+
Registry.call('relayout', gd, aobj);
253253
}
254254

255255
modeBarButtons.zoom3d = {
@@ -305,7 +305,7 @@ function handleDrag3d(gd, ev) {
305305
var val2d = (val === 'pan') ? val : 'zoom';
306306
layoutUpdate.dragmode = val2d;
307307

308-
Registry.call('relayout', [gd, layoutUpdate]);
308+
Registry.call('relayout', gd, layoutUpdate);
309309
}
310310

311311
modeBarButtons.resetCameraDefault3d = {
@@ -344,7 +344,7 @@ function handleCamera3d(gd, ev) {
344344
}
345345
}
346346

347-
Registry.call('relayout', [gd, aobj]);
347+
Registry.call('relayout', gd, aobj);
348348
}
349349

350350
modeBarButtons.hoverClosest3d = {
@@ -405,7 +405,7 @@ function handleHover3d(gd, ev) {
405405
button._previousVal = Lib.extendDeep({}, currentSpikes);
406406
}
407407

408-
Registry.call('relayout', [gd, layoutUpdate]);
408+
Registry.call('relayout', gd, layoutUpdate);
409409
}
410410

411411
modeBarButtons.zoomInGeo = {
@@ -461,7 +461,7 @@ function handleGeo(gd, ev) {
461461
var scale = geoLayout.projection.scale;
462462
var newScale = (val === 'in') ? 2 * scale : 0.5 * scale;
463463

464-
Registry.call('relayout', [gd, id + '.projection.scale', newScale]);
464+
Registry.call('relayout', gd, id + '.projection.scale', newScale);
465465
} else if(attr === 'reset') {
466466
resetView(gd, 'geo');
467467
}
@@ -500,7 +500,7 @@ function toggleHover(gd) {
500500

501501
var newHover = gd._fullLayout.hovermode ? false : onHoverVal;
502502

503-
Registry.call('relayout', [gd, 'hovermode', newHover]);
503+
Registry.call('relayout', gd, 'hovermode', newHover);
504504
}
505505

506506
// buttons when more then one plot types are present
@@ -555,7 +555,7 @@ modeBarButtons.toggleSpikelines = {
555555

556556
var aobj = setSpikelineVisibility(gd);
557557

558-
Registry.call('relayout', [gd, aobj]);
558+
Registry.call('relayout', gd, aobj);
559559
}
560560
};
561561

@@ -602,5 +602,5 @@ function resetView(gd, subplotType) {
602602
}
603603
}
604604

605-
Registry.call('relayout', [gd, aObj]);
605+
Registry.call('relayout', gd, aObj);
606606
}

src/components/rangeselector/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = function draw(gd) {
6868
button.on('click', function() {
6969
if(gd._dragged) return;
7070

71-
Registry.call('relayout', [gd, update]);
71+
Registry.call('relayout', gd, update);
7272
});
7373

7474
button.on('mouseover', function() {

src/components/rangeslider/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function setDataRange(rangeSlider, gd, axisOpts, opts) {
261261
dataMax = clamp(opts.p2d(opts._pixelMax));
262262

263263
window.requestAnimationFrame(function() {
264-
Registry.call('relayout', [gd, axisOpts._name + '.range', [dataMin, dataMax]]);
264+
Registry.call('relayout', gd, axisOpts._name + '.range', [dataMin, dataMax]);
265265
});
266266
}
267267

src/components/shapes/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function setupDragElement(gd, shapePath, shapeOptions, index) {
213213

214214
function endDrag() {
215215
setCursor(shapePath);
216-
Registry.call('relayout', [gd, update]);
216+
Registry.call('relayout', gd, update);
217217
}
218218

219219
function moveShape(dx, dy) {

0 commit comments

Comments
 (0)