dash-core-components 2.0.0 → 2.3.0

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.
Files changed (74) hide show
  1. package/README.md +7 -28
  2. package/dash_core_components/async-datepicker.js +1 -1
  3. package/dash_core_components/async-datepicker.js.map +1 -1
  4. package/dash_core_components/async-dropdown.js +1 -1
  5. package/dash_core_components/async-dropdown.js.map +1 -1
  6. package/dash_core_components/async-graph.js +1 -1
  7. package/dash_core_components/async-graph.js.map +1 -1
  8. package/dash_core_components/async-highlight.js +1 -1
  9. package/dash_core_components/async-highlight.js.map +1 -1
  10. package/dash_core_components/async-markdown.js +1 -1
  11. package/dash_core_components/async-markdown.js.map +1 -1
  12. package/dash_core_components/async-mathjax.js +1 -0
  13. package/dash_core_components/async-plotlyjs.js +1 -1
  14. package/dash_core_components/async-slider.js +1 -1
  15. package/dash_core_components/async-slider.js.map +1 -1
  16. package/dash_core_components/async-upload.js +1 -1
  17. package/dash_core_components/async-upload.js.map +1 -1
  18. package/dash_core_components/dash_core_components-shared.js +1 -1
  19. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  20. package/dash_core_components/dash_core_components.js +1 -1
  21. package/dash_core_components/dash_core_components.js.map +1 -1
  22. package/dash_core_components/mathjax.js +1 -0
  23. package/dash_core_components/plotly.min.js +29 -22
  24. package/lib/components/Checklist.react.js +59 -23
  25. package/lib/components/Clipboard.react.js +4 -4
  26. package/lib/components/ConfirmDialog.react.js +4 -4
  27. package/lib/components/ConfirmDialogProvider.react.js +4 -4
  28. package/lib/components/DatePickerRange.react.js +85 -85
  29. package/lib/components/DatePickerSingle.react.js +68 -68
  30. package/lib/components/Download.react.js +4 -4
  31. package/lib/components/Dropdown.react.js +51 -35
  32. package/lib/components/Graph.react.js +23 -10
  33. package/lib/components/Input.react.js +83 -83
  34. package/lib/components/Interval.react.js +4 -4
  35. package/lib/components/Link.react.js +21 -21
  36. package/lib/components/Loading.react.js +4 -4
  37. package/lib/components/Location.react.js +4 -4
  38. package/lib/components/LogoutButton.react.js +4 -4
  39. package/lib/components/Markdown.react.js +46 -9
  40. package/lib/components/RadioItems.react.js +59 -23
  41. package/lib/components/RangeSlider.react.js +44 -44
  42. package/lib/components/Slider.react.js +35 -35
  43. package/lib/components/Store.react.js +4 -4
  44. package/lib/components/Tab.react.js +1 -1
  45. package/lib/components/Tabs.react.js +10 -10
  46. package/lib/components/Textarea.react.js +4 -4
  47. package/lib/components/Tooltip.react.js +2 -2
  48. package/lib/components/Upload.react.js +5 -5
  49. package/lib/components/css/Dropdown.css +1 -1
  50. package/lib/fragments/DatePickerRange.react.js +6 -6
  51. package/lib/fragments/DatePickerSingle.react.js +6 -6
  52. package/lib/fragments/Dropdown.react.js +13 -11
  53. package/lib/fragments/Graph.privateprops.js +1 -1
  54. package/lib/fragments/Graph.react.js +125 -68
  55. package/lib/fragments/Markdown.react.js +22 -4
  56. package/lib/fragments/Math.react.js +101 -0
  57. package/lib/fragments/RangeSlider.react.js +24 -13
  58. package/lib/fragments/Slider.react.js +22 -11
  59. package/lib/fragments/Upload.react.js +4 -4
  60. package/lib/utils/LazyLoader/datePickerRange.js +1 -1
  61. package/lib/utils/LazyLoader/datePickerSingle.js +1 -1
  62. package/lib/utils/LazyLoader/dropdown.js +1 -1
  63. package/lib/utils/LazyLoader/graph.js +1 -1
  64. package/lib/utils/LazyLoader/hljs.js +1 -1
  65. package/lib/utils/LazyLoader/markdown.js +1 -1
  66. package/lib/utils/LazyLoader/mathjax.js +22 -0
  67. package/lib/utils/LazyLoader/plotly.js +2 -2
  68. package/lib/utils/LazyLoader/rangeSlider.js +1 -1
  69. package/lib/utils/LazyLoader/slider.js +1 -1
  70. package/lib/utils/LazyLoader/upload.js +1 -1
  71. package/lib/utils/computeSliderMarkers.js +230 -0
  72. package/lib/utils/mathjax.js +5 -0
  73. package/lib/utils/optionTypes.js +52 -0
  74. package/package.json +36 -34
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -17,6 +17,8 @@ var _computeSliderStyle = _interopRequireDefault(require("../utils/computeSlider
17
17
 
18
18
  require("rc-slider/assets/index.css");
19
19
 
20
+ var _computeSliderMarkers = require("../utils/computeSliderMarkers");
21
+
20
22
  var _Slider = require("../components/Slider.react");
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -27,9 +29,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
27
29
 
28
30
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
31
 
30
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
32
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
33
 
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
34
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
35
 
34
36
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
37
 
@@ -37,15 +39,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
37
39
 
38
40
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
39
41
 
40
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
42
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
41
43
 
42
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
44
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
45
 
44
46
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
47
 
46
48
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
47
49
 
48
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
50
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
49
51
 
50
52
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
51
53
 
@@ -115,6 +117,10 @@ var Slider = /*#__PURE__*/function (_Component) {
115
117
  setProps = _this$props.setProps,
116
118
  tooltip = _this$props.tooltip,
117
119
  updatemode = _this$props.updatemode,
120
+ min = _this$props.min,
121
+ max = _this$props.max,
122
+ marks = _this$props.marks,
123
+ step = _this$props.step,
118
124
  vertical = _this$props.vertical,
119
125
  verticalHeight = _this$props.verticalHeight;
120
126
  var value = this.state.value;
@@ -132,9 +138,6 @@ var Slider = /*#__PURE__*/function (_Component) {
132
138
  tipProps = tooltip;
133
139
  }
134
140
 
135
- var truncatedMarks = this.props.marks ? (0, _ramda.pickBy)(function (k, mark) {
136
- return mark >= _this2.props.min && mark <= _this2.props.max;
137
- }, this.props.marks) : this.props.marks;
138
141
  return /*#__PURE__*/_react.default.createElement("div", {
139
142
  id: id,
140
143
  "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
@@ -178,8 +181,16 @@ var Slider = /*#__PURE__*/function (_Component) {
178
181
  position: 'relative'
179
182
  },
180
183
  value: value,
181
- marks: truncatedMarks
182
- }, (0, _ramda.omit)(['className', 'setProps', 'updatemode', 'value', 'drag_value', 'marks', 'verticalHeight'], this.props))));
184
+ marks: (0, _computeSliderMarkers.sanitizeMarks)({
185
+ min: min,
186
+ max: max,
187
+ marks: marks,
188
+ step: step
189
+ }),
190
+ max: (0, _computeSliderMarkers.setUndefined)(min, max, marks).max_mark,
191
+ min: (0, _computeSliderMarkers.setUndefined)(min, max, marks).min_mark,
192
+ step: step === null && !(0, _ramda.isNil)(marks) ? null : (0, _computeSliderMarkers.calcStep)(min, max, step)
193
+ }, (0, _ramda.omit)(['className', 'setProps', 'updatemode', 'value', 'drag_value', 'marks', 'verticalHeight', 'step'], this.props))));
183
194
  }
184
195
  }]);
185
196
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -23,15 +23,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
23
23
 
24
24
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
25
25
 
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
26
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
27
 
28
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
29
 
30
30
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
31
 
32
32
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
33
33
 
34
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
34
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
35
35
 
36
36
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
37
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
+
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+
14
+ var _default = function _default(mathjax) {
15
+ return Promise.resolve(window.MathJax || (mathjax === false ? undefined : Promise.resolve().then(function () {
16
+ return _interopRequireWildcard(require('../mathjax'));
17
+ }).then(function () {
18
+ return window.MathJax;
19
+ })));
20
+ };
21
+
22
+ exports.default = _default;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -13,7 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
13
13
 
14
14
  var _default = function _default() {
15
15
  return Promise.resolve(window.Plotly || Promise.resolve().then(function () {
16
- return _interopRequireWildcard(require('plotly.js'));
16
+ return _interopRequireWildcard(require('plotly.js-dist-min'));
17
17
  }).then(function (_ref) {
18
18
  var Plotly = _ref.default;
19
19
  window.Plotly = Plotly;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
 
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
 
@@ -0,0 +1,230 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setUndefined = exports.sanitizeMarks = exports.calcValue = exports.calcStep = exports.autoGenerateMarks = exports.applyD3Format = void 0;
7
+
8
+ var _ramda = require("ramda");
9
+
10
+ var _d3Format = require("d3-format");
11
+
12
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
+
14
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+
16
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
17
+
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+
20
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
21
+
22
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
+
24
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
+
26
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
27
+
28
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
29
+
30
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
31
+
32
+ /**
33
+ * Truncate marks if they are out of Slider interval
34
+ */
35
+ var truncateMarks = function truncateMarks(min, max, marks) {
36
+ return (0, _ramda.pickBy)(function (k, mark) {
37
+ return mark >= min && mark <= max;
38
+ }, marks);
39
+ };
40
+
41
+ var truncateNumber = function truncateNumber(num) {
42
+ return parseInt(num.toString().match(/^-?\d+(?:\.\d{0,0})?/)[0], 10);
43
+ };
44
+
45
+ var decimalCount = function decimalCount(d) {
46
+ return String(d).split('.').length > 1 ? String(d).split('.')[1].length : 0;
47
+ };
48
+
49
+ var alignIntValue = function alignIntValue(v, d) {
50
+ return d < 10 ? v : parseInt((truncateNumber(v / d) * d).toFixed(decimalCount(d)), 10);
51
+ };
52
+
53
+ var alignDecimalValue = function alignDecimalValue(v, d) {
54
+ return d < 10 ? parseFloat(v.toFixed(decimalCount(d))) : parseFloat(((v / d).toFixed(0) * d).toFixed(decimalCount(d)));
55
+ };
56
+
57
+ var alignValue = function alignValue(v, d) {
58
+ return decimalCount(d) < 1 ? alignIntValue(v, d) : alignDecimalValue(v, d);
59
+ };
60
+
61
+ var log = function log(v) {
62
+ return Math.floor(Math.log10(v));
63
+ };
64
+
65
+ var getNearByStep = function getNearByStep(v) {
66
+ return v < 10 ? [v] : [Math.pow(10, Math.floor(Math.log10(v))), Math.pow(10, Math.ceil(Math.log10(v))) / 2, alignValue(v, Math.pow(10, log(v))), Math.pow(10, Math.ceil(Math.log10(v)))].sort(function (a, b) {
67
+ return Math.abs(a - v) - Math.abs(b - v);
68
+ });
69
+ };
70
+
71
+ var estimateBestSteps = function estimateBestSteps(minValue, maxValue, stepValue) {
72
+ var desiredCountMin = 2 + (maxValue / stepValue <= 10 ? 3 : 3); // including start, end
73
+
74
+ var desiredCountMax = 2 + (maxValue / stepValue <= 10 ? 4 : 6);
75
+ var min = minValue / stepValue;
76
+ var max = maxValue / stepValue;
77
+ var rangeLength = max - min;
78
+ var leastMarksInterval = Math.max(Math.round(rangeLength / (desiredCountMin - 1)), 1);
79
+ var possibleValues = getNearByStep(leastMarksInterval);
80
+ var finalStep = possibleValues.find(function (step) {
81
+ var expectedSteps = Math.ceil(rangeLength / step) + 1;
82
+ return expectedSteps >= desiredCountMin - 1 && expectedSteps <= desiredCountMax + 1;
83
+ }) || possibleValues[0];
84
+ return [alignValue(min, finalStep) * stepValue, alignValue(finalStep * stepValue, stepValue), stepValue];
85
+ };
86
+ /**
87
+ * Calculate default step if not defined
88
+ */
89
+
90
+
91
+ var calcStep = function calcStep(min, max, step) {
92
+ if (step) {
93
+ return step;
94
+ }
95
+
96
+ var diff = max > min ? max - min : min - max;
97
+ var v = (Math.abs(diff) + Number.EPSILON) / 100;
98
+ var N = Math.floor(Math.log10(v));
99
+ return [Number(Math.pow(10, N)), 2 * Math.pow(10, N), 5 * Math.pow(10, N)].sort(function (a, b) {
100
+ return Math.abs(a - v) - Math.abs(b - v);
101
+ })[0];
102
+ };
103
+ /**
104
+ * Set min and max if they are undefined and marks are defined
105
+ */
106
+
107
+
108
+ exports.calcStep = calcStep;
109
+
110
+ var setUndefined = function setUndefined(min, max, marks) {
111
+ var definedMarks = {
112
+ min_mark: min,
113
+ max_mark: max
114
+ };
115
+
116
+ if ((0, _ramda.isNil)(marks)) {
117
+ return definedMarks;
118
+ }
119
+
120
+ var marksObject = Object.keys(marks).map(Number);
121
+
122
+ if ((0, _ramda.isNil)(min)) {
123
+ definedMarks.min_mark = Math.min.apply(Math, _toConsumableArray(marksObject));
124
+ }
125
+
126
+ if ((0, _ramda.isNil)(max)) {
127
+ definedMarks.max_mark = Math.max.apply(Math, _toConsumableArray(marksObject));
128
+ }
129
+
130
+ return definedMarks;
131
+ };
132
+
133
+ exports.setUndefined = setUndefined;
134
+
135
+ var applyD3Format = function applyD3Format(mark, min, max) {
136
+ var mu_ten_factor = -3;
137
+ var k_ten_factor = 3;
138
+ var ten_factor = Math.log10(Math.abs(mark));
139
+
140
+ if (mark === 0 || ten_factor > mu_ten_factor && ten_factor < k_ten_factor) {
141
+ return String(mark);
142
+ }
143
+
144
+ var max_min_mean = (Math.abs(max) + Math.abs(min)) / 2;
145
+ var si_formatter = (0, _d3Format.formatPrefix)(',.0', max_min_mean);
146
+ return String(si_formatter(mark));
147
+ };
148
+
149
+ exports.applyD3Format = applyD3Format;
150
+
151
+ var autoGenerateMarks = function autoGenerateMarks(min, max, step) {
152
+ var marks = [];
153
+
154
+ var _ref = step ? [min, step, step] : estimateBestSteps(min, max, calcStep(min, max, step)),
155
+ _ref2 = _slicedToArray(_ref, 3),
156
+ start = _ref2[0],
157
+ interval = _ref2[1],
158
+ chosenStep = _ref2[2];
159
+
160
+ var cursor = start + interval; // make sure we don't step into infinite loop
161
+
162
+ if ((max - cursor) / interval > 0) {
163
+ do {
164
+ marks.push(alignValue(cursor, chosenStep));
165
+ cursor += interval;
166
+ } while (cursor < max); // do some cosmetic
167
+
168
+
169
+ var discardThreshold = 1.5;
170
+
171
+ if (marks.length >= 2 && max - marks[marks.length - 2] <= interval * discardThreshold) {
172
+ marks.pop();
173
+ }
174
+ }
175
+
176
+ var marksObject = {};
177
+ marks.forEach(function (mark) {
178
+ marksObject[mark] = applyD3Format(mark, min, max);
179
+ });
180
+ marksObject[min] = applyD3Format(min, min, max);
181
+ marksObject[max] = applyD3Format(max, min, max);
182
+ return marksObject;
183
+ };
184
+ /**
185
+ * - Auto generate marks if not given,
186
+ * - Not generate anything at all when explicit null is given to marks
187
+ * - Then truncate marks so no out of range marks
188
+ */
189
+
190
+
191
+ exports.autoGenerateMarks = autoGenerateMarks;
192
+
193
+ var sanitizeMarks = function sanitizeMarks(_ref3) {
194
+ var min = _ref3.min,
195
+ max = _ref3.max,
196
+ marks = _ref3.marks,
197
+ step = _ref3.step;
198
+
199
+ if (marks === null) {
200
+ return undefined;
201
+ }
202
+
203
+ var _setUndefined = setUndefined(min, max, marks),
204
+ min_mark = _setUndefined.min_mark,
205
+ max_mark = _setUndefined.max_mark;
206
+
207
+ var truncated_marks = marks && (0, _ramda.isEmpty)(marks) === false ? truncateMarks(min_mark, max_mark, marks) : marks;
208
+
209
+ if (truncated_marks && (0, _ramda.isEmpty)(truncated_marks) === false) {
210
+ return truncated_marks;
211
+ }
212
+
213
+ return autoGenerateMarks(min_mark, max_mark, step);
214
+ };
215
+ /**
216
+ * Calculate default value if not defined
217
+ */
218
+
219
+
220
+ exports.sanitizeMarks = sanitizeMarks;
221
+
222
+ var calcValue = function calcValue(min, max, value) {
223
+ if (value !== undefined) {
224
+ return value;
225
+ }
226
+
227
+ return [min, max];
228
+ };
229
+
230
+ exports.calcValue = calcValue;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ require("mathjax/es5/tex-svg");
4
+
5
+ window.MathJax.config.startup.typeset = false;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sanitizeOptions = void 0;
7
+
8
+ var _ramda = require("ramda");
9
+
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+
18
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19
+
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+
22
+ var sanitizeOptions = function sanitizeOptions(options) {
23
+ if ((0, _ramda.type)(options) === 'Object') {
24
+ return Object.entries(options).map(function (_ref) {
25
+ var _ref2 = _slicedToArray(_ref, 2),
26
+ value = _ref2[0],
27
+ label = _ref2[1];
28
+
29
+ return {
30
+ label: String(label),
31
+ value: value
32
+ };
33
+ });
34
+ }
35
+
36
+ if ((0, _ramda.type)(options) === 'Array') {
37
+ if (options.length > 0 && ['String', 'Number', 'Bool'].includes((0, _ramda.type)(options[0]))) {
38
+ return options.map(function (option) {
39
+ return {
40
+ label: String(option),
41
+ value: option
42
+ };
43
+ });
44
+ }
45
+
46
+ return options;
47
+ }
48
+
49
+ return options;
50
+ };
51
+
52
+ exports.sanitizeOptions = sanitizeOptions;