Skip to content

Colorbar refactor #3786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ plots.hasSimpleAPICommandBindings = commandModule.hasSimpleAPICommandBindings;
plots.redrawText = function(gd) {
gd = Lib.getGraphDiv(gd);

var fullLayout = gd._fullLayout || {};
var hasPolar = fullLayout._has && fullLayout._has('polar');
var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;

// do not work if polar is present
if((gd.data && gd.data[0] && gd.data[0].r)) return;
if(hasLegacyPolar) return;

return new Promise(function(resolve) {
setTimeout(function() {
Registry.getComponentMethod('annotations', 'draw')(gd);
Registry.getComponentMethod('legend', 'draw')(gd);

(gd.calcdata || []).forEach(function(d) {
if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();
});

Registry.getComponentMethod('colorbar', 'draw')(gd);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit essentially reverts 84c9708

No need to update the baselines!

resolve(plots.previousPromises(gd));
}, 300);
});
Expand Down
20 changes: 9 additions & 11 deletions src/snapshot/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
* LICENSE file in the root directory of this source tree.
*/


'use strict';

var Registry = require('../registry');

exports.getDelay = function(fullLayout) {
if(!fullLayout._has) return 0;

Expand All @@ -20,16 +21,13 @@ exports.getDelay = function(fullLayout) {
};

exports.getRedrawFunc = function(gd) {
var fullLayout = gd._fullLayout || {};
var hasPolar = fullLayout._has && fullLayout._has('polar');
var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;

// do not work for legacy polar
if(hasLegacyPolar) return;

return function() {
(gd.calcdata || []).forEach(function(d) {
if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();
});
var fullLayout = gd._fullLayout || {};
var hasPolar = fullLayout._has && fullLayout._has('polar');
var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;

if(!hasLegacyPolar) {
Registry.getComponentMethod('colorbar', 'draw')(gd);
}
};
};
Binary file modified test/image/baselines/geo_choropleth-usa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/image/baselines/gl3d_surface_contour_start-end-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.