plotly.js 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js v2.6.1
2
+ * plotly.js v2.6.2
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -97194,8 +97194,7 @@ var parseUnit = _dereq_('parse-unit')
97194
97194
 
97195
97195
  module.exports = toPX
97196
97196
 
97197
- var PIXELS_PER_INCH = getSizeBrutal('in', document.body) // 96
97198
-
97197
+ var PIXELS_PER_INCH = 96
97199
97198
 
97200
97199
  function getPropertyInPX(element, prop) {
97201
97200
  var parts = parseUnit(getComputedStyle(element).getPropertyValue(prop))
@@ -97205,22 +97204,19 @@ function getPropertyInPX(element, prop) {
97205
97204
  //This brutal hack is needed
97206
97205
  function getSizeBrutal(unit, element) {
97207
97206
  var testDIV = document.createElement('div')
97208
- testDIV.style['height'] = '128' + unit
97207
+ testDIV.style['font-size'] = '128' + unit
97209
97208
  element.appendChild(testDIV)
97210
- var size = getPropertyInPX(testDIV, 'height') / 128
97209
+ var size = getPropertyInPX(testDIV, 'font-size') / 128
97211
97210
  element.removeChild(testDIV)
97212
97211
  return size
97213
97212
  }
97214
97213
 
97215
97214
  function toPX(str, element) {
97216
- if (!str) return null
97217
-
97218
97215
  element = element || document.body
97219
- str = (str + '' || 'px').trim().toLowerCase()
97216
+ str = (str || 'px').trim().toLowerCase()
97220
97217
  if(element === window || element === document) {
97221
- element = document.body
97218
+ element = document.body
97222
97219
  }
97223
-
97224
97220
  switch(str) {
97225
97221
  case '%': //Ambiguous, not sure if we should use width or height
97226
97222
  return element.clientHeight / 100.0
@@ -97249,20 +97245,9 @@ function toPX(str, element) {
97249
97245
  return PIXELS_PER_INCH / 72
97250
97246
  case 'pc':
97251
97247
  return PIXELS_PER_INCH / 6
97252
- case 'px':
97253
- return 1
97254
- }
97255
-
97256
- // detect number of units
97257
- var parts = parseUnit(str)
97258
- if (!isNaN(parts[0]) && parts[1]) {
97259
- var px = toPX(parts[1], element)
97260
- return typeof px === 'number' ? parts[0] * px : null
97261
97248
  }
97262
-
97263
- return null
97249
+ return 1
97264
97250
  }
97265
-
97266
97251
  },{"parse-unit":251}],315:[function(_dereq_,module,exports){
97267
97252
  // https://github.com/topojson/topojson-client v3.1.0 Copyright 2019 Mike Bostock
97268
97253
  (function (global, factory) {
@@ -229834,7 +229819,7 @@ function getSortFunc(opts, d2c) {
229834
229819
  'use strict';
229835
229820
 
229836
229821
  // package version injected by `npm run preprocess`
229837
- exports.version = '2.6.1';
229822
+ exports.version = '2.6.2';
229838
229823
 
229839
229824
  },{}],1119:[function(_dereq_,module,exports){
229840
229825
  (function (global){(function (){
package/dist/plotly.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js v2.6.1
2
+ * plotly.js v2.6.2
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -97194,8 +97194,7 @@ var parseUnit = _dereq_('parse-unit')
97194
97194
 
97195
97195
  module.exports = toPX
97196
97196
 
97197
- var PIXELS_PER_INCH = getSizeBrutal('in', document.body) // 96
97198
-
97197
+ var PIXELS_PER_INCH = 96
97199
97198
 
97200
97199
  function getPropertyInPX(element, prop) {
97201
97200
  var parts = parseUnit(getComputedStyle(element).getPropertyValue(prop))
@@ -97205,22 +97204,19 @@ function getPropertyInPX(element, prop) {
97205
97204
  //This brutal hack is needed
97206
97205
  function getSizeBrutal(unit, element) {
97207
97206
  var testDIV = document.createElement('div')
97208
- testDIV.style['height'] = '128' + unit
97207
+ testDIV.style['font-size'] = '128' + unit
97209
97208
  element.appendChild(testDIV)
97210
- var size = getPropertyInPX(testDIV, 'height') / 128
97209
+ var size = getPropertyInPX(testDIV, 'font-size') / 128
97211
97210
  element.removeChild(testDIV)
97212
97211
  return size
97213
97212
  }
97214
97213
 
97215
97214
  function toPX(str, element) {
97216
- if (!str) return null
97217
-
97218
97215
  element = element || document.body
97219
- str = (str + '' || 'px').trim().toLowerCase()
97216
+ str = (str || 'px').trim().toLowerCase()
97220
97217
  if(element === window || element === document) {
97221
- element = document.body
97218
+ element = document.body
97222
97219
  }
97223
-
97224
97220
  switch(str) {
97225
97221
  case '%': //Ambiguous, not sure if we should use width or height
97226
97222
  return element.clientHeight / 100.0
@@ -97249,20 +97245,9 @@ function toPX(str, element) {
97249
97245
  return PIXELS_PER_INCH / 72
97250
97246
  case 'pc':
97251
97247
  return PIXELS_PER_INCH / 6
97252
- case 'px':
97253
- return 1
97254
- }
97255
-
97256
- // detect number of units
97257
- var parts = parseUnit(str)
97258
- if (!isNaN(parts[0]) && parts[1]) {
97259
- var px = toPX(parts[1], element)
97260
- return typeof px === 'number' ? parts[0] * px : null
97261
97248
  }
97262
-
97263
- return null
97249
+ return 1
97264
97250
  }
97265
-
97266
97251
  },{"parse-unit":251}],315:[function(_dereq_,module,exports){
97267
97252
  // https://github.com/topojson/topojson-client v3.1.0 Copyright 2019 Mike Bostock
97268
97253
  (function (global, factory) {
@@ -223435,7 +223420,7 @@ function getSortFunc(opts, d2c) {
223435
223420
  'use strict';
223436
223421
 
223437
223422
  // package version injected by `npm run preprocess`
223438
- exports.version = '2.6.1';
223423
+ exports.version = '2.6.2';
223439
223424
 
223440
223425
  },{}],1119:[function(_dereq_,module,exports){
223441
223426
  (function (global){(function (){