11/**
2- * plotly.js v1.10.1
2+ * plotly.js v1.10.2
33* Copyright 2012-2016, Plotly, Inc.
44* All rights reserved.
55* Licensed under the MIT license
@@ -51023,7 +51023,7 @@ annotations.draw = function(gd, index, opt, value) {
5102351023
5102451024 var annX = Math.round(annPosPx.x - outerwidth / 2),
5102551025 annY = Math.round(annPosPx.y - outerheight / 2);
51026- ann.attr('transform', 'translate(' + annX + ', ' + annY + ')' );
51026+ ann.call(Lib.setTranslate, annX, annY);
5102751027
5102851028 var annbase = 'annotations['+index+']';
5102951029
@@ -51116,8 +51116,10 @@ annotations.draw = function(gd, index, opt, value) {
5111651116 dragElement.init({
5111751117 element: arrowdrag.node(),
5111851118 prepFn: function() {
51119- annx0 = Number(ann.attr('x'));
51120- anny0 = Number(ann.attr('y'));
51119+ var pos = Lib.getTranslate(ann);
51120+
51121+ annx0 = pos.x;
51122+ anny0 = pos.y;
5112151123 update = {};
5112251124 if(xa && xa.autorange) {
5112351125 update[xa._name+'.autorange'] = true;
@@ -51132,7 +51134,7 @@ annotations.draw = function(gd, index, opt, value) {
5113251134 var annxy0 = applyTransform(annx0, anny0),
5113351135 xcenter = annxy0[0] + dx,
5113451136 ycenter = annxy0[1] + dy;
51135- ann.call(Drawing.setPosition , xcenter, ycenter);
51137+ ann.call(Lib.setTranslate , xcenter, ycenter);
5113651138
5113751139 update[annbase+'.x'] = xa ?
5113851140 (options.x + dx / xa._m) :
@@ -51173,12 +51175,14 @@ annotations.draw = function(gd, index, opt, value) {
5117351175 dragElement.init({
5117451176 element: ann.node(),
5117551177 prepFn: function() {
51176- x0 = Number(ann.attr('x'));
51177- y0 = Number(ann.attr('y'));
51178+ var pos = Lib.getTranslate(ann);
51179+
51180+ x0 = pos.x;
51181+ y0 = pos.y;
5117851182 update = {};
5117951183 },
5118051184 moveFn: function(dx, dy) {
51181- ann.call(Drawing.setPosition , x0 + dx, y0 + dy);
51185+ ann.call(Lib.setTranslate , x0 + dx, y0 + dy);
5118251186 var csr = 'pointer';
5118351187 if(options.showarrow) {
5118451188 update[annbase+'.ax'] = options.ax + dx;
@@ -51204,7 +51208,7 @@ annotations.draw = function(gd, index, opt, value) {
5120451208 heightFraction, 0, 1, options.yanchor);
5120551209 }
5120651210 if(!xa || !ya) {
51207- csr = dragElement.cursor (
51211+ csr = dragElement.getCursor (
5120851212 xa ? 0.5 : update[annbase + '.x'],
5120951213 ya ? 0.5 : update[annbase + '.y'],
5121051214 options.xanchor, options.yanchor
@@ -51216,7 +51220,7 @@ annotations.draw = function(gd, index, opt, value) {
5121651220 x1 = xy1[0] + dx,
5121751221 y1 = xy1[1] + dy;
5121851222
51219- ann.call(Drawing.setPosition, x1, y1 );
51223+ ann.call(Lib.setTranslate, x0 + dx, y0 + dy );
5122051224
5122151225 anng.attr({
5122251226 transform: 'rotate(' + textangle + ',' +
@@ -58424,6 +58428,8 @@ function draw(gd) {
5842458428
5842558429'use strict';
5842658430
58431+ var d3 = require('d3');
58432+
5842758433var Symbols = require('../drawing/symbol_defs');
5842858434var Drawing = require('../drawing');
5842958435
@@ -58454,7 +58460,7 @@ module.exports = function rangePlot(gd, w, h) {
5845458460 clipDefs.appendChild(clip);
5845558461
5845658462 var rangePlot = document.createElementNS(svgNS, 'g');
58457- rangePlot.setAttribute('clip-path' , 'url(# range-clip-path) ');
58463+ d3.select( rangePlot).call(Drawing.setClipUrl , 'range-clip-path');
5845858464 rangePlot.appendChild(clipDefs);
5845958465
5846058466
@@ -58591,7 +58597,7 @@ function makeScatter(trace, pointPairs, w, h) {
5859158597 return [line, markers, fill];
5859258598}
5859358599
58594- },{"../../constants/xmlns_namespaces":366,"../drawing":325,"../drawing/symbol_defs":326,"./helpers":356}],359:[function(require,module,exports){
58600+ },{"../../constants/xmlns_namespaces":366,"../drawing":325,"../drawing/symbol_defs":326,"./helpers":356,"d3":72 }],359:[function(require,module,exports){
5859558601/**
5859658602* Copyright 2012-2016, Plotly, Inc.
5859758603* All rights reserved.
@@ -58647,7 +58653,11 @@ module.exports = {
5864758653 'refers to an x coordinate',
5864858654 'If set to *paper*, the `x` position refers to the distance from',
5864958655 'the left side of the plotting area in normalized coordinates',
58650- 'where *0* (*1*) corresponds to the left (right) side.'
58656+ 'where *0* (*1*) corresponds to the left (right) side.',
58657+ 'If the axis `type` is *log*, then you must take the',
58658+ 'log of your desired range.',
58659+ 'If the axis `type` is *date*, then you must convert',
58660+ 'the date to unix time in milliseconds.'
5865158661 ].join(' ')
5865258662 }),
5865358663 x0: {
@@ -58873,17 +58883,17 @@ shapes.add = function(gd) {
5887358883// if opt is blank, val can be 'add' or a full options object to add a new
5887458884// annotation at that point in the array, or 'remove' to delete this one
5887558885shapes.draw = function(gd, index, opt, value) {
58876- if(!isNumeric(index) || index===-1) {
58886+ if(!isNumeric(index) || index === -1) {
5887758887 // no index provided - we're operating on ALL shapes
5887858888 if(!index && Array.isArray(value)) {
5887958889 replaceAllShapes(gd, value);
5888058890 return;
5888158891 }
58882- else if(value==='remove') {
58892+ else if(value === 'remove') {
5888358893 deleteAllShapes(gd);
5888458894 return;
5888558895 }
58886- else if(opt && value!=='add') {
58896+ else if(opt && value !== 'add') {
5888758897 updateAllShapes(gd, opt, value);
5888858898 return;
5888958899 }
@@ -58895,11 +58905,11 @@ shapes.draw = function(gd, index, opt, value) {
5889558905 }
5889658906
5889758907 if(!opt && value) {
58898- if(value==='remove') {
58908+ if(value === 'remove') {
5889958909 deleteShape(gd, index);
5890058910 return;
5890158911 }
58902- else if(value==='add' || Lib.isPlainObject(value)) {
58912+ else if(value === 'add' || Lib.isPlainObject(value)) {
5890358913 insertShape(gd, index, value);
5890458914 }
5890558915 }
@@ -59799,7 +59809,7 @@ exports.svgAttrs = {
5979959809var Plotly = require('./plotly');
5980059810
5980159811// package version injected by `npm run preprocess`
59802- exports.version = '1.10.1 ';
59812+ exports.version = '1.10.2 ';
5980359813
5980459814// plot api
5980559815exports.plot = Plotly.plot;
@@ -65391,6 +65401,12 @@ Plotly.relayout = function relayout(gd, astr, val) {
6539165401 else if(/[xy]axis[0-9]*?$/.test(pleaf) && !Object.keys(vi || {}).length) {
6539265402 docalc = true;
6539365403 }
65404+ else if(/[xy]axis[0-9]*\.categoryorder$/.test(pleafPlus)) {
65405+ docalc = true;
65406+ }
65407+ else if(/[xy]axis[0-9]*\.categoryarray/.test(pleafPlus)) {
65408+ docalc = true;
65409+ }
6539465410
6539565411 if(pleafPlus.indexOf('rangeslider') !== -1) {
6539665412 docalc = true;
@@ -65822,8 +65838,10 @@ function makePlotFramework(gd) {
6582265838
6582365839 // lower shape layer
6582465840 // (only for shapes to be drawn below the whole plot)
65825- fullLayout._shapeLowerLayer = fullLayout._paper.append('g')
65826- .classed('shapelayer shapelayer-below', true);
65841+ var layerBelow = fullLayout._paper.append('g')
65842+ .classed('layer-below', true);
65843+ fullLayout._shapeLowerLayer = layerBelow.append('g')
65844+ .classed('shapelayer', true);
6582765845
6582865846 var subplots = Plotly.Axes.getSubplots(gd);
6582965847 if(subplots.join('') !== Object.keys(gd._fullLayout._plots || {}).join('')) {
@@ -65841,8 +65859,10 @@ function makePlotFramework(gd) {
6584165859
6584265860 // upper shape layer
6584365861 // (only for shapes to be drawn above the whole plot, including subplots)
65844- fullLayout._shapeUpperLayer = fullLayout._paper.append('g')
65845- .classed('shapelayer shapelayer-above', true);
65862+ var layerAbove = fullLayout._paper.append('g')
65863+ .classed('layer-above', true);
65864+ fullLayout._shapeUpperLayer = layerAbove.append('g')
65865+ .classed('shapelayer', true);
6584665866
6584765867 // single pie layer for the whole plot
6584865868 fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);
@@ -66089,10 +66109,8 @@ function lsInner(gd) {
6608966109 });
6609066110
6609166111
66092- plotinfo.plot.attr({
66093- 'transform': 'translate(' + xa._offset + ', ' + ya._offset + ')',
66094- 'clip-path': 'url(#' + clipId + ')'
66095- });
66112+ plotinfo.plot.call(Lib.setTranslate, xa._offset, ya._offset);
66113+ plotinfo.plot.call(Drawing.setClipUrl, clipId);
6609666114
6609766115 var xlw = Drawing.crispRound(gd, xa.linewidth, 1),
6609866116 ylw = Drawing.crispRound(gd, ya.linewidth, 1),
@@ -68987,10 +69005,6 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
6898769005 }
6898869006 }
6898969007
68990- containerOut._initialCategories = axType === 'category' ?
68991- orderedCategories(letter, containerIn.categoryorder, containerIn.categoryarray, options.data) :
68992- [];
68993-
6899469008 setConvert(containerOut);
6899569009
6899669010 var dfltColor = coerce('color');
@@ -69055,13 +69069,18 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
6905569069 delete containerOut.zerolinewidth;
6905669070 }
6905769071
69072+ // fill in categories
69073+ containerOut._initialCategories = axType === 'category' ?
69074+ orderedCategories(letter, containerOut.categoryorder, containerOut.categoryarray, options.data) :
69075+ [];
69076+
6905869077 return containerOut;
6905969078};
6906069079
6906169080function setAutoType(ax, data) {
6906269081 // new logic: let people specify any type they want,
6906369082 // only autotype if type is '-'
69064- if(ax.type!=='-') return;
69083+ if(ax.type !== '-') return;
6906569084
6906669085 var id = ax._id,
6906769086 axLetter = id.charAt(0);
@@ -69076,7 +69095,7 @@ function setAutoType(ax, data) {
6907669095 // should always default to a linear axis
6907769096 if(d0.type==='histogram' &&
6907869097 axLetter === {v: 'y', h: 'x'}[d0.orientation || 'v']) {
69079- ax.type= 'linear';
69098+ ax.type = 'linear';
6908069099 return;
6908169100 }
6908269101
@@ -69324,37 +69343,30 @@ exports.getFromTrace = function(gd, fullTrace, type) {
6932469343
6932569344'use strict';
6932669345
69327- var layoutAttributes = require('./layout_attributes');
6932869346
6932969347module.exports = function handleCategoryOrderDefaults(containerIn, containerOut, coerce) {
69348+ if(containerOut.type !== 'category') return;
6933069349
69331- if(containerIn.type !== 'category') return;
69332-
69333- var validCategories = layoutAttributes.categoryorder.values;
69334-
69335- var propercategoryarray = Array.isArray(containerIn.categoryarray) && containerIn.categoryarray.length > 0;
69336-
69337- if(validCategories.indexOf(containerIn.categoryorder) === -1 && propercategoryarray) {
69350+ var arrayIn = containerIn.categoryarray,
69351+ orderDefault;
6933869352
69339- // when unspecified or invalid, use the default, unless categoryarray implies 'array'
69340- coerce('categoryorder', 'array'); // promote to 'array'
69353+ var isValidArray = (Array.isArray(arrayIn) && arrayIn.length > 0);
6934169354
69342- } else if(containerIn.categoryorder === 'array' && !propercategoryarray) {
69355+ // override default 'categoryorder' value when non-empty array is supplied
69356+ if(isValidArray) orderDefault = 'array';
6934369357
69344- // when mode is 'array' but no list is given, revert to default
69345-
69346- containerIn.categoryorder = 'trace'; // revert to default
69347- coerce('categoryorder');
69348-
69349- } else {
69358+ var order = coerce('categoryorder', orderDefault);
6935069359
69351- // otherwise use the supplied mode, or the default one if unsupplied or invalid
69352- coerce('categoryorder ');
69360+ // coerce 'categoryarray' only in array order case
69361+ if(order === 'array') coerce('categoryarray ');
6935369362
69363+ // cannot set 'categoryorder' to 'array' with an invalid 'categoryarray'
69364+ if(!isValidArray && order === 'array') {
69365+ containerOut.categoryorder = 'trace';
6935469366 }
6935569367};
6935669368
69357- },{"./layout_attributes":408 }],403:[function(require,module,exports){
69369+ },{}],403:[function(require,module,exports){
6935869370/**
6935969371* Copyright 2012-2016, Plotly, Inc.
6936069372* All rights reserved.
0 commit comments