Skip to content

Commit b1f549f

Browse files
committed
some wip comments
1 parent ffa6e34 commit b1f549f

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

Diff for: src/lib/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ lib.syncOrAsync = function(sequence, arg, finalStep) {
405405
fni = sequence.splice(0, 1)[0];
406406
ret = fni(arg);
407407

408+
// TODO https://github.com/plotly/plotly.js/issues/1705
408409
if(ret && ret.then) {
409410
return ret.then(continueAsync)
410411
.then(undefined, lib.promiseError);

Diff for: src/plot_api/plot_api.js

+3
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ function plot(gd, data, layout, config) {
319319
], gd);
320320
}
321321

322+
// potential TODO
323+
// - merge with positionAndAutorange ?
324+
// - rename positionAndAutorange (as we no longer call _module.setPositions here)
322325
function doAutoRangeAndConstraints() {
323326
if(gd._transitioning) return;
324327

Diff for: src/plot_api/subroutines.js

+42
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ function overlappingDomain(xDomain, yDomain, domains) {
5050
return false;
5151
}
5252

53+
// TODO
54+
// - split general pieces from Cartesian-only
5355
function lsInner(gd) {
5456
var fullLayout = gd._fullLayout;
5557
var gs = fullLayout._size;
@@ -72,6 +74,7 @@ function lsInner(gd) {
7274
// can still get here because it makes some of the SVG structure
7375
// for shared features like selections.
7476
if(!fullLayout._has('cartesian')) {
77+
// TODO why not Plots.previousPromises ??
7578
return gd._promises.length && Promise.all(gd._promises);
7679
}
7780

@@ -347,6 +350,7 @@ function lsInner(gd) {
347350

348351
Axes.makeClipPaths(gd);
349352

353+
// TODO why not Plots.previousPromises ??
350354
return gd._promises.length && Promise.all(gd._promises);
351355
}
352356

@@ -738,3 +742,41 @@ exports.drawMarginPushers = function(gd) {
738742
Registry.getComponentMethod('updatemenus', 'draw')(gd);
739743
Registry.getComponentMethod('colorbar', 'draw')(gd);
740744
};
745+
746+
exports.prerender = function(gd) {
747+
Axes.prerender(gd);
748+
Registry.getComponentMethod('legend', 'prerender')(gd);
749+
Registry.getComponentMethod('colorbar', 'prerender')(gd);
750+
Registry.getComponentMethod('updatemenus', 'prerender')(gd);
751+
Registry.getComponentMethod('sliders', 'prerender')(gd);
752+
Registry.getComponentMethod('rangeselector', 'prerender')(gd);
753+
return Plots.previousPromises(gd);
754+
};
755+
756+
exports.marginPushers = function(gd) {
757+
Plots.clearAutoMarginIds(gd);
758+
Axes.allowAutoMargin(gd);
759+
760+
Axes.pushMargin(gd);
761+
Registry.getComponentMethod('legend', 'pushMargin')(gd);
762+
Registry.getComponentMethod('colorbar', 'pushMargin')(gd);
763+
Registry.getComponentMethod('updatemenus', 'pushMargin')(gd);
764+
Registry.getComponentMethod('sliders', 'pushMargin')(gd);
765+
Registry.getComponentMethod('rangeselector', 'pushMargin')(gd);
766+
Plots.doAutoMargin(gd);
767+
};
768+
769+
exports.drawComponents = function(gd) {
770+
Registry.getComponentMethod('shapes', 'draw')(gd);
771+
Registry.getComponentMethod('images', 'draw')(gd);
772+
Registry.getComponentMethod('annotations', 'draw')(gd);
773+
774+
Registry.getComponentMethod('rangeselector', 'draw')(gd);
775+
Registry.getComponentMethod('rangeslider', 'draw')(gd);
776+
777+
Registry.getComponentMethod('legend', 'draw')(gd);
778+
Registry.getComponentMethod('colorbar', 'draw')(gd);
779+
780+
Registry.getComponentMethod('sliders', 'draw')(gd);
781+
Registry.getComponentMethod('updatemenus', 'draw')(gd);
782+
};

0 commit comments

Comments
 (0)