(scene, trace, bounds)
| 495 | var axisProperties = [ 'xaxis', 'yaxis', 'zaxis' ]; |
| 496 | |
| 497 | function computeTraceBounds(scene, trace, bounds) { |
| 498 | var fullSceneLayout = scene.fullSceneLayout; |
| 499 | |
| 500 | for(var d = 0; d < 3; d++) { |
| 501 | var axisName = axisProperties[d]; |
| 502 | var axLetter = axisName.charAt(0); |
| 503 | var ax = fullSceneLayout[axisName]; |
| 504 | var coords = trace[axLetter]; |
| 505 | var calendar = trace[axLetter + 'calendar']; |
| 506 | var len = trace['_' + axLetter + 'length']; |
| 507 | |
| 508 | if(!Lib.isArrayOrTypedArray(coords)) { |
| 509 | bounds[0][d] = Math.min(bounds[0][d], 0); |
| 510 | bounds[1][d] = Math.max(bounds[1][d], len - 1); |
| 511 | } else { |
| 512 | var v; |
| 513 | |
| 514 | for(var i = 0; i < (len || coords.length); i++) { |
| 515 | if(Lib.isArrayOrTypedArray(coords[i])) { |
| 516 | for(var j = 0; j < coords[i].length; ++j) { |
| 517 | v = ax.d2l(coords[i][j], 0, calendar); |
| 518 | if(!isNaN(v) && isFinite(v)) { |
| 519 | bounds[0][d] = Math.min(bounds[0][d], v); |
| 520 | bounds[1][d] = Math.max(bounds[1][d], v); |
| 521 | } |
| 522 | } |
| 523 | } else { |
| 524 | v = ax.d2l(coords[i], 0, calendar); |
| 525 | if(!isNaN(v) && isFinite(v)) { |
| 526 | bounds[0][d] = Math.min(bounds[0][d], v); |
| 527 | bounds[1][d] = Math.max(bounds[1][d], v); |
| 528 | } |
| 529 | } |
| 530 | } |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | function computeAnnotationBounds(scene, bounds) { |
| 536 | var fullSceneLayout = scene.fullSceneLayout; |
no outgoing calls
no test coverage detected
searching dependent graphs…