1
1
/**
2
- * plotly.js v1.14.1
2
+ * plotly.js v1.14.2
3
3
* Copyright 2012-2016, Plotly, Inc.
4
4
* All rights reserved.
5
5
* Licensed under the MIT license
@@ -57082,7 +57082,6 @@ function stylePies(d) {
57082
57082
57083
57083
var Plotly = require('../../plotly');
57084
57084
var Lib = require('../../lib');
57085
- var setCursor = require('../../lib/setcursor');
57086
57085
var downloadImage = require('../../snapshot/download');
57087
57086
var Icons = require('../../../build/ploticon');
57088
57087
@@ -57242,13 +57241,6 @@ modeBarButtons.hoverCompareCartesian = {
57242
57241
click: handleCartesian
57243
57242
};
57244
57243
57245
- var DRAGCURSORS = {
57246
- pan: 'move',
57247
- zoom: 'crosshair',
57248
- select: 'crosshair',
57249
- lasso: 'crosshair'
57250
- };
57251
-
57252
57244
function handleCartesian(gd, ev) {
57253
57245
var button = ev.currentTarget,
57254
57246
astr = button.getAttribute('data-attr'),
@@ -57298,18 +57290,7 @@ function handleCartesian(gd, ev) {
57298
57290
aobj[astr] = val;
57299
57291
}
57300
57292
57301
- Plotly.relayout(gd, aobj).then(function() {
57302
- if(astr === 'dragmode') {
57303
- if(fullLayout._has('cartesian')) {
57304
- setCursor(
57305
- fullLayout._paper.select('.nsewdrag'),
57306
- DRAGCURSORS[val]
57307
- );
57308
- }
57309
- Plotly.Fx.supplyLayoutDefaults(gd.layout, fullLayout, gd._fullData);
57310
- Plotly.Fx.init(gd);
57311
- }
57312
- });
57293
+ Plotly.relayout(gd, aobj);
57313
57294
}
57314
57295
57315
57296
modeBarButtons.zoom3d = {
@@ -57595,7 +57576,7 @@ modeBarButtons.resetViews = {
57595
57576
}
57596
57577
};
57597
57578
57598
- },{"../../../build/ploticon":2,"../../lib":382,"../../lib/setcursor":391,"../../ plotly":402,"../../snapshot/download":469}],349:[function(require,module,exports){
57579
+ },{"../../../build/ploticon":2,"../../lib":382,"../../plotly":402,"../../snapshot/download":469}],349:[function(require,module,exports){
57599
57580
/**
57600
57581
* Copyright 2012-2016, Plotly, Inc.
57601
57582
* All rights reserved.
@@ -60704,7 +60685,7 @@ exports.svgAttrs = {
60704
60685
var Plotly = require('./plotly');
60705
60686
60706
60687
// package version injected by `npm run preprocess`
60707
- exports.version = '1.14.1 ';
60688
+ exports.version = '1.14.2 ';
60708
60689
60709
60690
// plot api
60710
60691
exports.plot = Plotly.plot;
@@ -65110,6 +65091,10 @@ Plotly.redraw = function(gd) {
65110
65091
*/
65111
65092
Plotly.newPlot = function(gd, data, layout, config) {
65112
65093
gd = getGraphDiv(gd);
65094
+
65095
+ // remove gl contexts
65096
+ Plots.cleanPlot([], {}, gd._fullData || {}, gd._fullLayout || {});
65097
+
65113
65098
Plots.purge(gd);
65114
65099
return Plotly.plot(gd, data, layout, config);
65115
65100
};
@@ -66700,6 +66685,9 @@ Plotly.relayout = function relayout(gd, astr, val) {
66700
66685
var subplotIds;
66701
66686
manageModeBar(gd);
66702
66687
66688
+ Plotly.Fx.supplyLayoutDefaults(gd.layout, fullLayout, gd._fullData);
66689
+ Plotly.Fx.init(gd);
66690
+
66703
66691
subplotIds = Plots.getSubplotIds(fullLayout, 'gl3d');
66704
66692
for(i = 0; i < subplotIds.length; i++) {
66705
66693
scene = fullLayout[subplotIds[i]]._scene;
@@ -70768,7 +70756,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
70768
70756
pw = xa[0]._length,
70769
70757
ph = ya[0]._length,
70770
70758
MINDRAG = constants.MINDRAG,
70771
- MINZOOM = constants.MINZOOM;
70759
+ MINZOOM = constants.MINZOOM,
70760
+ isMainDrag = (ns + ew === 'nsew');
70772
70761
70773
70762
for(var i = 1; i < subplots.length; i++) {
70774
70763
var subplotXa = subplots[i].x(),
@@ -70791,21 +70780,24 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
70791
70780
dragClass = ns + ew + 'drag';
70792
70781
70793
70782
var dragger3 = plotinfo.draglayer.selectAll('.' + dragClass).data([0]);
70783
+
70794
70784
dragger3.enter().append('rect')
70795
70785
.classed('drag', true)
70796
70786
.classed(dragClass, true)
70797
70787
.style({fill: 'transparent', 'stroke-width': 0})
70798
70788
.attr('data-subplot', plotinfo.id);
70789
+
70799
70790
dragger3.call(Drawing.setRect, x, y, w, h)
70800
70791
.call(setCursor, cursor);
70792
+
70801
70793
var dragger = dragger3.node();
70802
70794
70803
70795
// still need to make the element if the axes are disabled
70804
70796
// but nuke its events (except for maindrag which needs them for hover)
70805
70797
// and stop there
70806
- if(!yActive && !xActive) {
70798
+ if(!yActive && !xActive && !isSelectOrLasso(fullLayout.dragmode) ) {
70807
70799
dragger.onmousedown = null;
70808
- dragger.style.pointerEvents = (ns + ew === 'nsew') ? 'all' : 'none';
70800
+ dragger.style.pointerEvents = isMainDrag ? 'all' : 'none';
70809
70801
return dragger;
70810
70802
}
70811
70803
@@ -70823,7 +70815,8 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
70823
70815
doubleclick: doubleClick,
70824
70816
prepFn: function(e, startX, startY) {
70825
70817
var dragModeNow = gd._fullLayout.dragmode;
70826
- if(ns + ew === 'nsew') {
70818
+
70819
+ if(isMainDrag) {
70827
70820
// main dragger handles all drag modes, and changes
70828
70821
// to pan (or to zoom if it already is pan) on shift
70829
70822
if(e.shiftKey) {
@@ -70847,7 +70840,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
70847
70840
dragOptions.doneFn = dragDone;
70848
70841
clearSelect();
70849
70842
}
70850
- else if(dragModeNow === 'select' || dragModeNow === 'lasso' ) {
70843
+ else if(isSelectOrLasso( dragModeNow) ) {
70851
70844
prepSelect(e, startX, startY, dragOptions, dragModeNow);
70852
70845
}
70853
70846
}
@@ -71385,6 +71378,12 @@ function removeZoombox(gd) {
71385
71378
.remove();
71386
71379
}
71387
71380
71381
+ function isSelectOrLasso(dragmode) {
71382
+ var modes = ['lasso', 'select'];
71383
+
71384
+ return modes.indexOf(dragmode) !== -1;
71385
+ }
71386
+
71388
71387
},{"../../components/color":303,"../../components/dragelement":324,"../../components/drawing":326,"../../lib":382,"../../lib/setcursor":391,"../../lib/svg_text_utils":395,"../../plotly":402,"./axes":405,"./constants":410,"./select":418,"d3":113,"tinycolor2":274}],412:[function(require,module,exports){
71389
71388
/**
71390
71389
* Copyright 2012-2016, Plotly, Inc.
@@ -77478,6 +77477,16 @@ proto.cameraChanged = function() {
77478
77477
};
77479
77478
77480
77479
proto.destroy = function() {
77480
+
77481
+ var traces = this.traces;
77482
+
77483
+ if(traces) {
77484
+ Object.keys(traces).map(function(key) {
77485
+ traces[key].dispose();
77486
+ delete traces[key];
77487
+ });
77488
+ }
77489
+
77481
77490
this.glplot.dispose();
77482
77491
77483
77492
if(!this.staticPlot) this.container.removeChild(this.canvas);
@@ -84539,6 +84548,19 @@ var extendFlat = require('../../lib/extend').extendFlat;
84539
84548
var scatterMarkerAttrs = scatterAttrs.marker;
84540
84549
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
84541
84550
84551
+ var markerLineWidth = extendFlat({},
84552
+ scatterMarkerLineAttrs.width, { dflt: 0 });
84553
+
84554
+ var markerLine = extendFlat({}, {
84555
+ width: markerLineWidth
84556
+ }, colorAttributes('marker.line'));
84557
+
84558
+ var marker = extendFlat({}, {
84559
+ showscale: scatterMarkerAttrs.showscale,
84560
+ line: markerLine
84561
+ }, colorAttributes('marker'));
84562
+
84563
+
84542
84564
module.exports = {
84543
84565
x: scatterAttrs.x,
84544
84566
x0: scatterAttrs.x0,
@@ -84547,6 +84569,7 @@ module.exports = {
84547
84569
y0: scatterAttrs.y0,
84548
84570
dy: scatterAttrs.dy,
84549
84571
text: scatterAttrs.text,
84572
+
84550
84573
orientation: {
84551
84574
valType: 'enumerated',
84552
84575
role: 'info',
@@ -84557,14 +84580,8 @@ module.exports = {
84557
84580
'along the vertical (horizontal).'
84558
84581
].join(' ')
84559
84582
},
84560
- marker: extendFlat({}, {
84561
- showscale: scatterMarkerAttrs.showscale,
84562
- line: extendFlat({},
84563
- {width: scatterMarkerLineAttrs.width},
84564
- colorAttributes('marker.line')
84565
- )},
84566
- colorAttributes('marker')
84567
- ),
84583
+
84584
+ marker: marker,
84568
84585
84569
84586
r: scatterAttrs.r,
84570
84587
t: scatterAttrs.t,
@@ -84627,7 +84644,13 @@ module.exports = function calc(gd, trace) {
84627
84644
// create the "calculated data" to plot
84628
84645
var serieslen = Math.min(pos.length, size.length),
84629
84646
cd = [];
84647
+
84630
84648
for(i = 0; i < serieslen; i++) {
84649
+
84650
+ // add bars with non-numeric sizes to calcdata
84651
+ // so that ensure that traces with gaps are
84652
+ // plotted in the correct order
84653
+
84631
84654
if(isNumeric(pos[i])) {
84632
84655
cd.push({p: pos[i], s: size[i], b: 0});
84633
84656
}
@@ -85198,9 +85221,17 @@ module.exports = function setPositions(gd, plotinfo) {
85198
85221
for(i = 0; i < bl.length; i++) { // trace index
85199
85222
ti = gd.calcdata[bl[i]];
85200
85223
for(j = 0; j < ti.length; j++) {
85224
+
85225
+ // skip over bars with no size,
85226
+ // so that we don't try to stack them
85227
+ if(!isNumeric(ti[j].s)) continue;
85228
+
85201
85229
sv = Math.round(ti[j].p / sumround);
85202
- // store the negative sum value for p at the same key, with sign flipped
85203
- if(relative && ti[j].s < 0) sv = -sv;
85230
+
85231
+ // store the negative sum value for p at the same key,
85232
+ // with sign flipped using string to ensure -0 !== 0.
85233
+ if(relative && ti[j].s < 0) sv = '-' + sv;
85234
+
85204
85235
var previousSum = sums[sv] || 0;
85205
85236
if(stack || relative) ti[j].b = previousSum;
85206
85237
barEnd = ti[j].b + ti[j].s;
@@ -85218,20 +85249,29 @@ module.exports = function setPositions(gd, plotinfo) {
85218
85249
}
85219
85250
85220
85251
if(norm) {
85221
- padded = false;
85222
85252
var top = norm === 'fraction' ? 1 : 100,
85223
85253
relAndNegative = false,
85224
85254
tiny = top / 1e9; // in case of rounding error in sum
85255
+
85256
+ padded = false;
85225
85257
sMin = 0;
85226
85258
sMax = stack ? top : 0;
85259
+
85227
85260
for(i = 0; i < bl.length; i++) { // trace index
85228
85261
ti = gd.calcdata[bl[i]];
85262
+
85229
85263
for(j = 0; j < ti.length; j++) {
85230
- relAndNegative = relative && ti[j].s < 0;
85264
+ relAndNegative = (relative && ti[j].s < 0);
85265
+
85231
85266
sv = Math.round(ti[j].p / sumround);
85232
- if(relAndNegative) sv = -sv; // locate negative sum amount for this p val
85267
+
85268
+ // locate negative sum amount for this p val
85269
+ if(relAndNegative) sv = '-' + sv;
85270
+
85233
85271
scale = top / sums[sv];
85234
- if(relAndNegative) scale *= -1; // preserve sign if negative
85272
+
85273
+ // preserve sign if negative
85274
+ if(relAndNegative) scale *= -1;
85235
85275
ti[j].b *= scale;
85236
85276
ti[j].s *= scale;
85237
85277
barEnd = ti[j].b + ti[j].s;
@@ -89393,12 +89433,7 @@ function isValidZ(z) {
89393
89433
'use strict';
89394
89434
89395
89435
var barAttrs = require('../bar/attributes');
89396
- var colorAttributes = require('../../components/colorscale/color_attributes');
89397
89436
89398
- var extendFlat = require('../../lib/extend').extendDeep;
89399
-
89400
- var barMarkerAttrs = barAttrs.marker;
89401
- var barMarkerLineAttrs = barMarkerAttrs.line;
89402
89437
89403
89438
module.exports = {
89404
89439
x: {
@@ -89508,14 +89543,7 @@ module.exports = {
89508
89543
},
89509
89544
ybins: makeBinsAttr('y'),
89510
89545
89511
- marker: extendFlat({}, {
89512
- showscale: barMarkerAttrs.showscale,
89513
- line: extendFlat({},
89514
- {width: extendFlat({}, barMarkerLineAttrs.width, {dflt: 0})},
89515
- colorAttributes('marker.line'))
89516
- },
89517
- colorAttributes('marker')
89518
- ),
89546
+ marker: barAttrs.marker,
89519
89547
89520
89548
_nestedModules: {
89521
89549
'error_y': 'ErrorBars',
@@ -89560,7 +89588,7 @@ function makeBinsAttr(axLetter) {
89560
89588
};
89561
89589
}
89562
89590
89563
- },{"../../components/colorscale/color_attributes":311,"../../lib/extend":377,"../ bar/attributes":476}],525:[function(require,module,exports){
89591
+ },{"../bar/attributes":476}],525:[function(require,module,exports){
89564
89592
/**
89565
89593
* Copyright 2012-2016, Plotly, Inc.
89566
89594
* All rights reserved.
0 commit comments