8000 Match hist bins by alexcjohnson · Pull Request #1944 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Match hist bins #1944

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 8 commits into from
Aug 15, 2017
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
cut out duplicate setPositions calls (and loops)
  • Loading branch information
alexcjohnson committed Aug 14, 2017
commit e81fcb6dc4f469b80a4b722ebc4d3ffa13adf59d
27 changes: 19 additions & 8 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,32 @@ Plotly.plot = function(gd, data, layout, config) {
return;
}

var subplots = Plots.getSubplotIds(fullLayout, 'cartesian'),
modules = fullLayout._modules;
var subplots = Plots.getSubplotIds(fullLayout, 'cartesian');
var modules = fullLayout._modules;
var setPositionsArray = [];
var hasSetPositions = false;

// position and range calculations for traces that
// depend on each other ie bars (stacked or grouped)
// and boxes (grouped) push each other out of the way

var subplotInfo, _module;
var subplotInfo, setPositionsFunc, i, j;

for(var i = 0; i < subplots.length; i++) {
subplotInfo = fullLayout._plots[subplots[i]];
for(j = 0; j < modules.length; j++) {
setPositionsFunc = modules[j].setPositions;
if(setPositionsFunc && setPositionsArray.indexOf(setPositionsFunc) === -1) {
setPositionsArray.push(setPositionsFunc);
hasSetPositions = true;
}
}

for(var j = 0; j < modules.length; j++) {
_module = modules[j];
if(_module.setPositions) _module.setPositions(gd, subplotInfo);
if(hasSetPositions) {
for(i = 0; i < subplots.length; i++) {
subplotInfo = fullLayout._plots[subplots[i]];

for(j = 0; j < setPositionsArray.length; j++) {
setPositionsArray[j](gd, subplotInfo);
}
}
}

Expand Down
0