Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
lint (mostly scoped variables)
  • Loading branch information
etpinard committed Feb 9, 2016
commit 05d8b1c2eeba1559d96a9d6f534a40e9e57670d8
14 changes: 9 additions & 5 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,16 @@ Plotly.plot = function(gd, data, layout, config) {

function getCdSubplot(calcdata, subplot) {
var cdSubplot = [];
var i, cd, trace;
for (i = 0; i < calcdata.length; i++) {
cd = calcdata[i];
trace = cd[0].trace;
if (trace.xaxis+trace.yaxis === subplot) cdSubplot.push(cd);

for(var i = 0; i < calcdata.length; i++) {
var cd = calcdata[i];
var trace = cd[0].trace;

if(trace.xaxis + trace.yaxis === subplot) {
cdSubplot.push(cd);
}
}

return cdSubplot;
}

Expand Down
19 changes: 10 additions & 9 deletions src/plots/gl3d/layout/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@

'use strict';

var Plotly = require('../../../plotly');
var Lib = require('../../../lib');
var Plots = require('../../plots');
var layoutAttributes = require('./layout_attributes');
var supplyGl3dAxisLayoutDefaults = require('./axis_defaults');


module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
if (!layoutOut._hasGL3D) return;
if(!layoutOut._hasGL3D) return;

var scenes = Plotly.Plots.getSubplotIdsInData(fullData, 'gl3d');
var i;
var scenes = Plots.getSubplotIdsInData(fullData, 'gl3d');

// Get number of scenes to compute default scene domain
var scenesLength = scenes.length;

var sceneLayoutIn, sceneLayoutOut;

function coerce(attr, dflt) {
return Plotly.Lib.coerce(sceneLayoutIn, sceneLayoutOut, layoutAttributes, attr, dflt);
return Lib.coerce(sceneLayoutIn, sceneLayoutOut, layoutAttributes, attr, dflt);
}

for (i = 0; i < scenesLength; ++i) {
for(var i = 0; i < scenesLength; i++) {
var scene = scenes[i];
/*
* Scene numbering proceeds as follows
Expand All @@ -41,7 +42,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
* Also write back a blank scene object to user layout so that some
* attributes like aspectratio can be written back dynamically.
*/
sceneLayoutIn;

if(layoutIn[scene] !== undefined) sceneLayoutIn = layoutIn[scene];
else layoutIn[scene] = sceneLayoutIn = {};

Expand Down Expand Up @@ -78,10 +79,10 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
* for the mode. In this case we must force change it here as the default coerce
* misses it above.
*/
if (!hasAspect) {
if(!hasAspect) {
sceneLayoutIn.aspectratio = sceneLayoutOut.aspectratio = {x: 1, y: 1, z: 1};

if (aspectMode === 'manual') sceneLayoutOut.aspectmode = 'auto';
if(aspectMode === 'manual') sceneLayoutOut.aspectmode = 'auto';
}

/*
Expand Down