Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 705aed6

Browse filesBrowse 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
Copy full SHA for 705aed6

File tree

Expand file treeCollapse file tree

21 files changed

+51
-48
lines changed
Filter options
Expand file treeCollapse file tree

21 files changed

+51
-48
lines changed

‎src/components/annotations/click.js

Copy file name to clipboardExpand all lines: src/components/annotations/click.js
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/components/annotations/draw.js
+3-3Lines 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

Copy file name to clipboardExpand all lines: src/components/colorbar/draw.js
+2-2Lines 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

Copy file name to clipboardExpand all lines: src/components/dragelement/index.js
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/components/legend/draw.js
+2-2Lines 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

Copy file name to clipboardExpand all lines: src/components/legend/handle_click.js
+2-2Lines 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

Copy file name to clipboardExpand all lines: src/components/modebar/buttons.js
+8-8Lines 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

Copy file name to clipboardExpand all lines: src/components/rangeselector/draw.js
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/components/rangeslider/draw.js
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/components/shapes/draw.js
+1-1Lines 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) {

‎src/components/titles/index.js

Copy file name to clipboardExpand all lines: src/components/titles/index.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ Titles.draw = function(gd, titleClass, options) {
238238
el.call(svgTextUtils.makeEditable, {gd: gd})
239239
.on('edit', function(text) {
240240
if(traceIndex !== undefined) {
241-
Registry.call('restyle', [gd, prop, text, traceIndex]);
241+
Registry.call('restyle', gd, prop, text, traceIndex);
242242
} else {
243-
Registry.call('relayout', [gd, prop, text]);
243+
Registry.call('relayout', gd, prop, text);
244244
}
245245
})
246246
.on('cancel', function() {

‎src/plot_api/subroutines.js

Copy file name to clipboardExpand all lines: src/plot_api/subroutines.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ exports.doColorBars = function(gd) {
461461
exports.layoutReplot = function(gd) {
462462
var layout = gd.layout;
463463
gd.layout = undefined;
464-
return Registry.call('plot', [gd, '', layout]);
464+
return Registry.call('plot', gd, '', layout);
465465
};
466466

467467
exports.doLegend = function(gd) {

‎src/plots/cartesian/dragbox.js

Copy file name to clipboardExpand all lines: src/plots/cartesian/dragbox.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
212212
.on('edit', function(text) {
213213
var v = ax.d2r(text);
214214
if(v !== undefined) {
215-
Registry.call('relayout', [gd, attrStr, v]);
215+
Registry.call('relayout', gd, attrStr, v);
216216
}
217217
});
218218
}
@@ -654,7 +654,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
654654
}
655655

656656
gd.emit('plotly_doubleclick', null);
657-
Registry.call('relayout', [gd, attrs]);
657+
Registry.call('relayout', gd, attrs);
658658
}
659659

660660
// dragTail - finish a drag event with a redraw
@@ -668,7 +668,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
668668
// accumulated MathJax promises - wait for them before we relayout.
669669
Lib.syncOrAsync([
670670
Plots.previousPromises,
671-
function() { Registry.call('relayout', [gd, updates]); }
671+
function() { Registry.call('relayout', gd, updates); }
672672
], gd);
673673
}
674674

‎src/plots/cartesian/transition_axes.js

Copy file name to clipboardExpand all lines: src/plots/cartesian/transition_axes.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
272272
// Signal that this transition has completed:
273273
onComplete && onComplete();
274274

275-
return Registry.call('relayout', [gd, aobj]).then(function() {
275+
return Registry.call('relayout', gd, aobj).then(function() {
276276
for(var i = 0; i < affectedSubplots.length; i++) {
277277
unsetSubplotTransform(affectedSubplots[i]);
278278
}
@@ -289,7 +289,7 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
289289
axi.range = axi._r.slice();
290290
}
291291

292-
return Registry.call('relayout', [gd, aobj]).then(function() {
292+
return Registry.call('relayout', gd, aobj).then(function() {
293293
for(var i = 0; i < affectedSubplots.length; i++) {
294294
unsetSubplotTransform(affectedSubplots[i]);
295295
}

‎src/plots/command.js

Copy file name to clipboardExpand all lines: src/plots/command.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,15 @@ function bindingValueHasChanged(gd, binding, cache) {
263263
exports.executeAPICommand = function(gd, method, args) {
264264
if(method === 'skip') return Promise.resolve();
265265

266+
var _method = Registry.apiMethodRegistry[method];
266267
var allArgs = [gd];
267268
if(!Array.isArray(args)) args = [];
268269

269270
for(var i = 0; i < args.length; i++) {
270271
allArgs.push(args[i]);
271272
}
272273

273-
return Registry.call(method, allArgs).catch(function(err) {
274+
return _method.apply(null, allArgs).catch(function(err) {
274275
Lib.warn('API call to Plotly.' + method + ' rejected.', err);
275276
return Promise.reject(err);
276277
});

‎src/plots/geo/geo.js

Copy file name to clipboardExpand all lines: src/plots/geo/geo.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ proto.updateProjection = function(fullLayout, geoLayout) {
208208
this.viewInitial = null;
209209

210210
Lib.warn(msg);
211-
gd._promises.push(Registry.call('relayout', [gd, updateObj]));
211+
gd._promises.push(Registry.call('relayout', gd, updateObj));
212212
return msg;
213213
}
214214

@@ -365,7 +365,7 @@ proto.updateFx = function(fullLayout, geoLayout) {
365365
updateObj[_this.id + '.' + k] = viewInitial[k];
366366
}
367367

368-
Registry.call('relayout', [gd, updateObj]);
368+
Registry.call('relayout', gd, updateObj);
369369
gd.emit('plotly_doubleclick', null);
370370
}
371371

‎src/plots/plots.js

Copy file name to clipboardExpand all lines: src/plots/plots.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ plots.resize = function(gd) {
102102
// nor should it be included in the undo queue
103103
gd.autoplay = true;
104104

105-
Registry.call('relayout', [gd, { autosize: true }]).then(function() {
105+
Registry.call('relayout', gd, {autosize: true}).then(function() {
106106
gd.changed = oldchanged;
107107
resolve(gd);
108108
});
@@ -1670,7 +1670,7 @@ plots.doAutoMargin = function(gd) {
16701670
// if things changed and we're not already redrawing, trigger a redraw
16711671
if(!fullLayout._replotting && oldmargins !== '{}' &&
16721672
oldmargins !== JSON.stringify(fullLayout._size)) {
1673-
return Registry.call('plot', [gd]);
1673+
return Registry.call('plot', gd);
16741674
}
16751675
};
16761676

@@ -2162,7 +2162,7 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts)
21622162

21632163
if(frameOpts.redraw) {
21642164
gd._transitionData._interruptCallbacks.push(function() {
2165-
return Registry.call('redraw', [gd]);
2165+
return Registry.call('redraw', gd);
21662166
});
21672167
}
21682168

@@ -2234,7 +2234,7 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts)
22342234

22352235
return Promise.resolve().then(function() {
22362236
if(frameOpts.redraw) {
2237-
return Registry.call('redraw', [gd]);
2237+
return Registry.call('redraw', gd);
22382238
}
22392239
}).then(function() {
22402240
// Set transitioning false again once the redraw has occurred. This is used, for example,

‎src/plots/polar/polar.js

Copy file name to clipboardExpand all lines: src/plots/polar/polar.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
684684
radialRange[0] + r1 * drange / radius
685685
];
686686

687-
Registry.call('relayout', [gd, updateObj]);
687+
Registry.call('relayout', gd, updateObj);
688688
}
689689

690690
dragOpts.prepFn = function(evt, startX, startY) {
@@ -718,7 +718,7 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
718718
}
719719

720720
gd.emit('plotly_doubleclick', null);
721-
Registry.call('relayout', [gd, updateObj]);
721+
Registry.call('relayout', gd, updateObj);
722722
}
723723

724724
Fx.click(gd, evt, _this.id);
@@ -788,9 +788,9 @@ proto.updateRadialDrag = function(fullLayout, polarLayout) {
788788

789789
function doneFn() {
790790
if(angle1 !== null) {
791-
Registry.call('relayout', [gd, _this.id + '.radialaxis.angle', angle1]);
791+
Registry.call('relayout', gd, _this.id + '.radialaxis.angle', angle1);
792792
} else if(rng1 !== null) {
793-
Registry.call('relayout', [gd, _this.id + '.radialaxis.range[1]', rng1]);
793+
Registry.call('relayout', gd, _this.id + '.radialaxis.range[1]', rng1);
794794
}
795795
}
796796

@@ -970,7 +970,7 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
970970
scatterTextPoints.select('text').attr('transform', null);
971971
var updateObj = {};
972972
updateObj[_this.id + '.angularaxis.rotation'] = rot1;
973-
Registry.call('relayout', [gd, updateObj]);
973+
Registry.call('relayout', gd, updateObj);
974974
}
975975

976976
dragOpts.prepFn = function(evt, startX, startY) {

‎src/plots/ternary/ternary.js

Copy file name to clipboardExpand all lines: src/plots/ternary/ternary.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ proto.initInteractions = function() {
495495
attrs[_this.id + '.baxis.min'] = 0;
496496
attrs[_this.id + '.caxis.min'] = 0;
497497
gd.emit('plotly_doubleclick', null);
498-
Registry.call('relayout', [gd, attrs]);
498+
Registry.call('relayout', gd, attrs);
499499
}
500500
Fx.click(gd, evt, _this.id);
501501
}
@@ -600,7 +600,7 @@ proto.initInteractions = function() {
600600
attrs[_this.id + '.baxis.min'] = mins.b;
601601
attrs[_this.id + '.caxis.min'] = mins.c;
602602

603-
Registry.call('relayout', [gd, attrs]);
603+
Registry.call('relayout', gd, attrs);
604604

605605
if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {
606606
Lib.notifier(_(gd, 'Double-click to zoom back out'), 'long');
@@ -679,7 +679,7 @@ proto.initInteractions = function() {
679679
attrs[_this.id + '.baxis.min'] = mins.b;
680680
attrs[_this.id + '.caxis.min'] = mins.c;
681681

682-
Registry.call('relayout', [gd, attrs]);
682+
Registry.call('relayout', gd, attrs);
683683
}
684684

685685
function clearSelect() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.