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 (gl2d) v2.6.1
2
+ * plotly.js (gl2d) v2.6.2
3
3
  * Copyright 2012-2021, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -26790,8 +26790,7 @@ var parseUnit = _dereq_('parse-unit')
26790
26790
 
26791
26791
  module.exports = toPX
26792
26792
 
26793
- var PIXELS_PER_INCH = getSizeBrutal('in', document.body) // 96
26794
-
26793
+ var PIXELS_PER_INCH = 96
26795
26794
 
26796
26795
  function getPropertyInPX(element, prop) {
26797
26796
  var parts = parseUnit(getComputedStyle(element).getPropertyValue(prop))
@@ -26801,22 +26800,19 @@ function getPropertyInPX(element, prop) {
26801
26800
  //This brutal hack is needed
26802
26801
  function getSizeBrutal(unit, element) {
26803
26802
  var testDIV = document.createElement('div')
26804
- testDIV.style['height'] = '128' + unit
26803
+ testDIV.style['font-size'] = '128' + unit
26805
26804
  element.appendChild(testDIV)
26806
- var size = getPropertyInPX(testDIV, 'height') / 128
26805
+ var size = getPropertyInPX(testDIV, 'font-size') / 128
26807
26806
  element.removeChild(testDIV)
26808
26807
  return size
26809
26808
  }
26810
26809
 
26811
26810
  function toPX(str, element) {
26812
- if (!str) return null
26813
-
26814
26811
  element = element || document.body
26815
- str = (str + '' || 'px').trim().toLowerCase()
26812
+ str = (str || 'px').trim().toLowerCase()
26816
26813
  if(element === window || element === document) {
26817
- element = document.body
26814
+ element = document.body
26818
26815
  }
26819
-
26820
26816
  switch(str) {
26821
26817
  case '%': //Ambiguous, not sure if we should use width or height
26822
26818
  return element.clientHeight / 100.0
@@ -26845,20 +26841,9 @@ function toPX(str, element) {
26845
26841
  return PIXELS_PER_INCH / 72
26846
26842
  case 'pc':
26847
26843
  return PIXELS_PER_INCH / 6
26848
- case 'px':
26849
- return 1
26850
- }
26851
-
26852
- // detect number of units
26853
- var parts = parseUnit(str)
26854
- if (!isNaN(parts[0]) && parts[1]) {
26855
- var px = toPX(parts[1], element)
26856
- return typeof px === 'number' ? parts[0] * px : null
26857
26844
  }
26858
-
26859
- return null
26845
+ return 1
26860
26846
  }
26861
-
26862
26847
  },{"parse-unit":180}],207:[function(_dereq_,module,exports){
26863
26848
  "use strict";
26864
26849
 
@@ -100568,7 +100553,7 @@ function getSortFunc(opts, d2c) {
100568
100553
  'use strict';
100569
100554
 
100570
100555
  // package version injected by `npm run preprocess`
100571
- exports.version = '2.6.1';
100556
+ exports.version = '2.6.2';
100572
100557
 
100573
100558
  },{}],588:[function(_dereq_,module,exports){
100574
100559
  (function (global){(function (){