|
1 | 1 | /**
|
2 |
| -* plotly.js (basic) v1.23.0 |
| 2 | +* plotly.js (basic) v1.23.1 |
3 | 3 | * Copyright 2012-2017, Plotly, Inc.
|
4 | 4 | * All rights reserved.
|
5 | 5 | * Licensed under the MIT license
|
@@ -20233,20 +20233,23 @@ function handleCamera3d(gd, ev) {
|
20233 | 20233 | var button = ev.currentTarget,
|
20234 | 20234 | attr = button.getAttribute('data-attr'),
|
20235 | 20235 | fullLayout = gd._fullLayout,
|
20236 |
| - sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d'); |
| 20236 | + sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d'), |
| 20237 | + aobj = {}; |
20237 | 20238 |
|
20238 | 20239 | for(var i = 0; i < sceneIds.length; i++) {
|
20239 | 20240 | var sceneId = sceneIds[i],
|
20240 |
| - fullSceneLayout = fullLayout[sceneId], |
20241 |
| - scene = fullSceneLayout._scene; |
| 20241 | + key = sceneId + '.camera', |
| 20242 | + scene = fullLayout[sceneId]._scene; |
20242 | 20243 |
|
20243 |
| - if(attr === 'resetDefault') scene.setCameraToDefault(); |
| 20244 | + if(attr === 'resetDefault') { |
| 20245 | + aobj[key] = null; |
| 20246 | + } |
20244 | 20247 | else if(attr === 'resetLastSave') {
|
20245 |
| - // This handler looks in the un-updated fullLayout.scene.camera object to reset the camera |
20246 |
| - // to the last saved position. |
20247 |
| - scene.setCamera(fullSceneLayout.camera); |
| 20248 | + aobj[key] = Lib.extendDeep({}, scene.cameraInitial); |
20248 | 20249 | }
|
20249 | 20250 | }
|
| 20251 | + |
| 20252 | + Plotly.relayout(gd, aobj); |
20250 | 20253 | }
|
20251 | 20254 |
|
20252 | 20255 | modeBarButtons.hoverClosest3d = {
|
@@ -26272,7 +26275,7 @@ exports.svgAttrs = {
|
26272 | 26275 | var Plotly = require('./plotly');
|
26273 | 26276 |
|
26274 | 26277 | // package version injected by `npm run preprocess`
|
26275 |
| -exports.version = '1.23.0'; |
| 26278 | +exports.version = '1.23.1'; |
26276 | 26279 |
|
26277 | 26280 | // inject promise polyfill
|
26278 | 26281 | require('es6-promise').polyfill();
|
@@ -32436,6 +32439,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
|
32436 | 32439 | if(flags.dolayoutstyle) seq.push(subroutines.layoutStyles);
|
32437 | 32440 | if(flags.doticks) seq.push(subroutines.doTicksRelayout);
|
32438 | 32441 | if(flags.domodebar) seq.push(subroutines.doModeBar);
|
| 32442 | + if(flags.docamera) seq.push(subroutines.doCamera); |
32439 | 32443 | }
|
32440 | 32444 |
|
32441 | 32445 | Queue.add(gd,
|
@@ -32483,6 +32487,7 @@ function _relayout(gd, aobj) {
|
32483 | 32487 | doplot: false,
|
32484 | 32488 | docalc: false,
|
32485 | 32489 | domodebar: false,
|
| 32490 | + docamera: false, |
32486 | 32491 | layoutReplot: false
|
32487 | 32492 | };
|
32488 | 32493 |
|
@@ -32679,7 +32684,10 @@ function _relayout(gd, aobj) {
|
32679 | 32684 | var pp1 = String(p.parts[1] || '');
|
32680 | 32685 | // check whether we can short-circuit a full redraw
|
32681 | 32686 | // 3d or geo at this point just needs to redraw.
|
32682 |
| - if(p.parts[0].indexOf('scene') === 0) flags.doplot = true; |
| 32687 | + if(p.parts[0].indexOf('scene') === 0) { |
| 32688 | + if(p.parts[1] === 'camera') flags.docamera = true; |
| 32689 | + else flags.doplot = true; |
| 32690 | + } |
32683 | 32691 | else if(p.parts[0].indexOf('geo') === 0) flags.doplot = true;
|
32684 | 32692 | else if(p.parts[0].indexOf('ternary') === 0) flags.doplot = true;
|
32685 | 32693 | else if(ai === 'paper_bgcolor') flags.doplot = true;
|
@@ -32831,6 +32839,7 @@ Plotly.update = function update(gd, traceUpdate, layoutUpdate, traces) {
|
32831 | 32839 | if(relayoutFlags.dolayoutstyle) seq.push(subroutines.layoutStyles);
|
32832 | 32840 | if(relayoutFlags.doticks) seq.push(subroutines.doTicksRelayout);
|
32833 | 32841 | if(relayoutFlags.domodebar) seq.push(subroutines.doModeBar);
|
| 32842 | + if(relayoutFlags.doCamera) seq.push(subroutines.doCamera); |
32834 | 32843 | }
|
32835 | 32844 |
|
32836 | 32845 | Queue.add(gd,
|
@@ -34501,6 +34510,18 @@ exports.doModeBar = function(gd) {
|
34501 | 34510 | return Plots.previousPromises(gd);
|
34502 | 34511 | };
|
34503 | 34512 |
|
| 34513 | +exports.doCamera = function(gd) { |
| 34514 | + var fullLayout = gd._fullLayout, |
| 34515 | + sceneIds = Plots.getSubplotIds(fullLayout, 'gl3d'); |
| 34516 | + |
| 34517 | + for(var i = 0; i < sceneIds.length; i++) { |
| 34518 | + var sceneLayout = fullLayout[sceneIds[i]], |
| 34519 | + scene = sceneLayout._scene; |
| 34520 | + |
| 34521 | + scene.setCamera(sceneLayout.camera); |
| 34522 | + } |
| 34523 | +}; |
| 34524 | + |
34504 | 34525 | },{"../components/color":24,"../components/drawing":47,"../components/modebar":70,"../components/titles":98,"../lib":118,"../plotly":142,"../plots/plots":171,"../registry":178}],140:[function(require,module,exports){
|
34505 | 34526 | /**
|
34506 | 34527 | * Copyright 2012-2017, Plotly, Inc.
|
@@ -37782,10 +37803,13 @@ function getBoxPosLetter(trace) {
|
37782 | 37803 | }
|
37783 | 37804 |
|
37784 | 37805 | function isBoxWithoutPositionCoords(trace, axLetter) {
|
37785 |
| - var posLetter = getBoxPosLetter(trace); |
| 37806 | + var posLetter = getBoxPosLetter(trace), |
| 37807 | + isBox = Registry.traceIs(trace, 'box'), |
| 37808 | + isCandlestick = Registry.traceIs(trace._fullInput || {}, 'candlestick'); |
37786 | 37809 |
|
37787 | 37810 | return (
|
37788 |
| - Registry.traceIs(trace, 'box') && |
| 37811 | + isBox && |
| 37812 | + !isCandlestick && |
37789 | 37813 | axLetter === posLetter &&
|
37790 | 37814 | trace[posLetter] === undefined &&
|
37791 | 37815 | trace[posLetter + '0'] === undefined
|
@@ -38752,7 +38776,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
|
38752 | 38776 | // This is specifically directed at scatter traces, applying an inverse
|
38753 | 38777 | // scale to individual points to counteract the scale of the trace
|
38754 | 38778 | // as a whole:
|
38755 |
| - .selectAll('.points').selectAll('.point') |
| 38779 | + .select('.scatterlayer').selectAll('.points').selectAll('.point') |
38756 | 38780 | .call(Drawing.setPointGroupScale, 1 / xScaleFactor, 1 / yScaleFactor);
|
38757 | 38781 | }
|
38758 | 38782 | }
|
@@ -48350,8 +48374,9 @@ module.exports = function plot(gd, plotinfo, cdbar) {
|
48350 | 48374 |
|
48351 | 48375 | var bartraces = plotinfo.plot.select('.barlayer')
|
48352 | 48376 | .selectAll('g.trace.bars')
|
48353 |
| - .data(cdbar) |
48354 |
| - .enter().append('g') |
| 48377 | + .data(cdbar); |
| 48378 | + |
| 48379 | + bartraces.enter().append('g') |
48355 | 48380 | .attr('class', 'trace bars');
|
48356 | 48381 |
|
48357 | 48382 | bartraces.append('g')
|
@@ -48871,7 +48896,8 @@ module.exports = function setPositions(gd, plotinfo) {
|
48871 | 48896 | fullTrace.visible === true &&
|
48872 | 48897 | Registry.traceIs(fullTrace, 'bar') &&
|
48873 | 48898 | fullTrace.xaxis === xa._id &&
|
48874 |
| - fullTrace.yaxis === ya._id |
| 48899 | + fullTrace.yaxis === ya._id && |
| 48900 | + !calcTraces[i][0].placeholder |
48875 | 48901 | ) {
|
48876 | 48902 | if(fullTrace.orientation === 'h') {
|
48877 | 48903 | calcTracesHorizontal.push(calcTraces[i]);
|
|
0 commit comments