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,11 +1,11 @@
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
7
7
  });
8
- exports.defaultProps = exports.propTypes = exports.default = void 0;
8
+ exports.propTypes = exports.defaultProps = exports.default = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -25,15 +25,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
25
25
 
26
26
  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); } }
27
27
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
29
 
30
- 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); }
30
+ 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); }
31
31
 
32
32
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
33
 
34
34
  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); }; }
35
35
 
36
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
36
+ 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); }
37
37
 
38
38
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
39
 
@@ -79,13 +79,6 @@ var DatePickerSingle = /*#__PURE__*/function (_Component) {
79
79
 
80
80
  exports.default = DatePickerSingle;
81
81
  DatePickerSingle.propTypes = {
82
- /**
83
- * The ID of this component, used to identify dash components
84
- * in callbacks. The ID needs to be unique across all of the
85
- * components in an app.
86
- */
87
- id: _propTypes.default.string,
88
-
89
82
  /**
90
83
  * Specifies the starting date for the component, best practice is to pass
91
84
  * value via datetime object
@@ -113,6 +106,13 @@ DatePickerSingle.propTypes = {
113
106
  */
114
107
  disabled_days: _propTypes.default.arrayOf(_propTypes.default.string),
115
108
 
109
+ /**
110
+ * Text that will be displayed in the input
111
+ * box of the date picker when no date is selected.
112
+ * Default value is 'Start Date'
113
+ */
114
+ placeholder: _propTypes.default.string,
115
+
116
116
  /**
117
117
  * Specifies the month that is initially presented when the user
118
118
  * opens the calendar. Accepts datetime.datetime objects or strings
@@ -122,89 +122,89 @@ DatePickerSingle.propTypes = {
122
122
  initial_visible_month: _propTypes.default.string,
123
123
 
124
124
  /**
125
- * Size of rendered calendar days, higher number
126
- * means bigger day size and larger calendar overall
125
+ * Whether or not the dropdown is "clearable", that is, whether or
126
+ * not a small "x" appears on the right of the dropdown that removes
127
+ * the selected value.
127
128
  */
128
- day_size: _propTypes.default.number,
129
+ clearable: _propTypes.default.bool,
129
130
 
130
131
  /**
131
- * Orientation of calendar, either vertical or horizontal.
132
- * Valid options are 'vertical' or 'horizontal'.
132
+ * If True, the calendar will automatically open when cleared
133
133
  */
134
- calendar_orientation: _propTypes.default.oneOf(['vertical', 'horizontal']),
134
+ reopen_calendar_on_clear: _propTypes.default.bool,
135
135
 
136
136
  /**
137
- * Determines whether the calendar and days operate
138
- * from left to right or from right to left
137
+ * Specifies the format that the selected dates will be displayed
138
+ * valid formats are variations of "MM YY DD". For example:
139
+ * "MM YY DD" renders as '05 10 97' for May 10th 1997
140
+ * "MMMM, YY" renders as 'May, 1997' for May 10th 1997
141
+ * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
142
+ * "MMMM" renders as 'May' for May 10 1997
139
143
  */
140
- is_RTL: _propTypes.default.bool,
144
+ display_format: _propTypes.default.string,
141
145
 
142
146
  /**
143
- * Text that will be displayed in the input
144
- * box of the date picker when no date is selected.
145
- * Default value is 'Start Date'
147
+ * Specifies the format that the month will be displayed in the calendar,
148
+ * valid formats are variations of "MM YY". For example:
149
+ * "MM YY" renders as '05 97' for May 1997
150
+ * "MMMM, YYYY" renders as 'May, 1997' for May 1997
151
+ * "MMM, YY" renders as 'Sep, 97' for September 1997
146
152
  */
147
- placeholder: _propTypes.default.string,
153
+ month_format: _propTypes.default.string,
148
154
 
149
155
  /**
150
- * If True, the calendar will automatically open when cleared
156
+ * Specifies what day is the first day of the week, values must be
157
+ * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday
151
158
  */
152
- reopen_calendar_on_clear: _propTypes.default.bool,
159
+ first_day_of_week: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6]),
153
160
 
154
161
  /**
155
- * Number of calendar months that are shown when calendar is opened
162
+ * If True the calendar will display days that rollover into
163
+ * the next month
156
164
  */
157
- number_of_months_shown: _propTypes.default.number,
165
+ show_outside_days: _propTypes.default.bool,
158
166
 
159
167
  /**
160
- * If True, calendar will open in a screen overlay portal,
161
- * not supported on vertical calendar
168
+ * If True the calendar will not close when the user has selected a value
169
+ * and will wait until the user clicks off the calendar
162
170
  */
163
- with_portal: _propTypes.default.bool,
171
+ stay_open_on_select: _propTypes.default.bool,
164
172
 
165
173
  /**
166
- * If True, calendar will open in a full screen overlay portal, will
167
- * take precedent over 'withPortal' if both are set to True,
168
- * not supported on vertical calendar
174
+ * Orientation of calendar, either vertical or horizontal.
175
+ * Valid options are 'vertical' or 'horizontal'.
169
176
  */
170
- with_full_screen_portal: _propTypes.default.bool,
177
+ calendar_orientation: _propTypes.default.oneOf(['vertical', 'horizontal']),
171
178
 
172
179
  /**
173
- * Specifies what day is the first day of the week, values must be
174
- * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday
180
+ * Number of calendar months that are shown when calendar is opened
175
181
  */
176
- first_day_of_week: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6]),
182
+ number_of_months_shown: _propTypes.default.number,
177
183
 
178
184
  /**
179
- * If True the calendar will not close when the user has selected a value
180
- * and will wait until the user clicks off the calendar
185
+ * If True, calendar will open in a screen overlay portal,
186
+ * not supported on vertical calendar
181
187
  */
182
- stay_open_on_select: _propTypes.default.bool,
188
+ with_portal: _propTypes.default.bool,
183
189
 
184
190
  /**
185
- * If True the calendar will display days that rollover into
186
- * the next month
191
+ * If True, calendar will open in a full screen overlay portal, will
192
+ * take precedent over 'withPortal' if both are set to True,
193
+ * not supported on vertical calendar
187
194
  */
188
- show_outside_days: _propTypes.default.bool,
195
+ with_full_screen_portal: _propTypes.default.bool,
189
196
 
190
197
  /**
191
- * Specifies the format that the month will be displayed in the calendar,
192
- * valid formats are variations of "MM YY". For example:
193
- * "MM YY" renders as '05 97' for May 1997
194
- * "MMMM, YYYY" renders as 'May, 1997' for May 1997
195
- * "MMM, YY" renders as 'Sep, 97' for September 1997
198
+ * Size of rendered calendar days, higher number
199
+ * means bigger day size and larger calendar overall
196
200
  */
197
- month_format: _propTypes.default.string,
201
+ day_size: _propTypes.default.number,
198
202
 
199
203
  /**
200
- * Specifies the format that the selected dates will be displayed
201
- * valid formats are variations of "MM YY DD". For example:
202
- * "MM YY DD" renders as '05 10 97' for May 10th 1997
203
- * "MMMM, YY" renders as 'May, 1997' for May 10th 1997
204
- * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
205
- * "MMMM" renders as 'May' for May 10 1997
204
+ * Determines whether the calendar and days operate
205
+ * from left to right or from right to left
206
206
  */
207
- display_format: _propTypes.default.string,
207
+ is_RTL: _propTypes.default.bool,
208
208
 
209
209
  /**
210
210
  * If True, no dates can be selected.
@@ -212,26 +212,26 @@ DatePickerSingle.propTypes = {
212
212
  disabled: _propTypes.default.bool,
213
213
 
214
214
  /**
215
- * Whether or not the dropdown is "clearable", that is, whether or
216
- * not a small "x" appears on the right of the dropdown that removes
217
- * the selected value.
215
+ * CSS styles appended to wrapper div
218
216
  */
219
- clearable: _propTypes.default.bool,
217
+ style: _propTypes.default.object,
220
218
 
221
219
  /**
222
- * Dash-assigned callback that gets fired when the value changes.
220
+ * Appends a CSS class to the wrapper div component.
223
221
  */
224
- setProps: _propTypes.default.func,
222
+ className: _propTypes.default.string,
225
223
 
226
224
  /**
227
- * CSS styles appended to wrapper div
225
+ * The ID of this component, used to identify dash components
226
+ * in callbacks. The ID needs to be unique across all of the
227
+ * components in an app.
228
228
  */
229
- style: _propTypes.default.object,
229
+ id: _propTypes.default.string,
230
230
 
231
231
  /**
232
- * Appends a CSS class to the wrapper div component.
232
+ * Dash-assigned callback that gets fired when the value changes.
233
233
  */
234
- className: _propTypes.default.string,
234
+ setProps: _propTypes.default.func,
235
235
 
236
236
  /**
237
237
  * Object that holds the loading state object coming from dash-renderer
@@ -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
@@ -21,15 +21,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
21
21
 
22
22
  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); } }
23
23
 
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
25
 
26
- 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); }
26
+ 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); }
27
27
 
28
28
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
29
 
30
30
  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); }; }
31
31
 
32
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
32
+ 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); }
33
33
 
34
34
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
35
 
@@ -1,11 +1,11 @@
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
7
7
  });
8
- exports.defaultProps = exports.propTypes = exports.default = void 0;
8
+ exports.propTypes = exports.defaultProps = exports.default = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -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
 
@@ -77,28 +77,37 @@ var Dropdown = /*#__PURE__*/function (_Component) {
77
77
  exports.default = Dropdown;
78
78
  Dropdown.propTypes = {
79
79
  /**
80
- * The ID of this component, used to identify dash components
81
- * in callbacks. The ID needs to be unique across all of the
82
- * components in an app.
80
+ * An array of options {label: [string|number], value: [string|number]},
81
+ * an optional disabled field can be used for each option
83
82
  */
84
- id: _propTypes.default.string,
85
-
83
+ options: _propTypes.default.oneOfType([
84
+ /**
85
+ * Array of options where the label and the value are the same thing - [string|number|bool]
86
+ */
87
+ _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool])),
88
+ /**
89
+ * Simpler `options` representation in dictionary format. The order is not guaranteed.
90
+ * {`value1`: `label1`, `value2`: `label2`, ... }
91
+ * which is equal to
92
+ * [{label: `label1`, value: `value1`}, {label: `label2`, value: `value2`}, ...]
93
+ */
94
+ _propTypes.default.object,
86
95
  /**
87
96
  * An array of options {label: [string|number], value: [string|number]},
88
97
  * an optional disabled field can be used for each option
89
98
  */
90
- options: _propTypes.default.arrayOf(_propTypes.default.exact({
99
+ _propTypes.default.arrayOf(_propTypes.default.exact({
91
100
  /**
92
- * The dropdown's label
101
+ * The option's label
93
102
  */
94
103
  label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
95
104
 
96
105
  /**
97
- * The value of the dropdown. This value
106
+ * The value of the option. This value
98
107
  * corresponds to the items specified in the
99
108
  * `value` property.
100
109
  */
101
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
110
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]).isRequired,
102
111
 
103
112
  /**
104
113
  * If true, this option is disabled and cannot be selected.
@@ -111,7 +120,7 @@ Dropdown.propTypes = {
111
120
  * see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
112
121
  */
113
122
  title: _propTypes.default.string
114
- })),
123
+ }))]),
115
124
 
116
125
  /**
117
126
  * The value of the input. If `multi` is false (the default)
@@ -121,17 +130,12 @@ Dropdown.propTypes = {
121
130
  * array of items with values corresponding to those in the
122
131
  * `options` prop.
123
132
  */
124
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))]),
125
-
126
- /**
127
- * height of each option. Can be increased when label lengths would wrap around
128
- */
129
- optionHeight: _propTypes.default.number,
133
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]))]),
130
134
 
131
135
  /**
132
- * className of the dropdown element
136
+ * If true, the user can select multiple values
133
137
  */
134
- className: _propTypes.default.string,
138
+ multi: _propTypes.default.bool,
135
139
 
136
140
  /**
137
141
  * Whether or not the dropdown is "clearable", that is, whether or
@@ -141,14 +145,14 @@ Dropdown.propTypes = {
141
145
  clearable: _propTypes.default.bool,
142
146
 
143
147
  /**
144
- * If true, this dropdown is disabled and the selection cannot be changed.
148
+ * Whether to enable the searching feature or not
145
149
  */
146
- disabled: _propTypes.default.bool,
150
+ searchable: _propTypes.default.bool,
147
151
 
148
152
  /**
149
- * If true, the user can select multiple values
153
+ * The value typed in the DropDown for searching.
150
154
  */
151
- multi: _propTypes.default.bool,
155
+ search_value: _propTypes.default.string,
152
156
 
153
157
  /**
154
158
  * The grey, default text shown when no option is selected
@@ -156,24 +160,36 @@ Dropdown.propTypes = {
156
160
  placeholder: _propTypes.default.string,
157
161
 
158
162
  /**
159
- * Whether to enable the searching feature or not
163
+ * If true, this dropdown is disabled and the selection cannot be changed.
160
164
  */
161
- searchable: _propTypes.default.bool,
165
+ disabled: _propTypes.default.bool,
162
166
 
163
167
  /**
164
- * The value typed in the DropDown for searching.
168
+ * height of each option. Can be increased when label lengths would wrap around
165
169
  */
166
- search_value: _propTypes.default.string,
170
+ optionHeight: _propTypes.default.number,
167
171
 
168
172
  /**
169
- * Dash-assigned callback that gets fired when the input changes
173
+ * Defines CSS styles which will override styles previously set.
170
174
  */
171
- setProps: _propTypes.default.func,
175
+ style: _propTypes.default.object,
172
176
 
173
177
  /**
174
- * Defines CSS styles which will override styles previously set.
178
+ * className of the dropdown element
175
179
  */
176
- style: _propTypes.default.object,
180
+ className: _propTypes.default.string,
181
+
182
+ /**
183
+ * The ID of this component, used to identify dash components
184
+ * in callbacks. The ID needs to be unique across all of the
185
+ * components in an app.
186
+ */
187
+ id: _propTypes.default.string,
188
+
189
+ /**
190
+ * Dash-assigned callback that gets fired when the input changes
191
+ */
192
+ setProps: _propTypes.default.func,
177
193
 
178
194
  /**
179
195
  * Object that holds the loading state object coming from dash-renderer
@@ -1,11 +1,11 @@
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
7
7
  });
8
- exports.default = exports.graphDefaultProps = exports.graphPropTypes = void 0;
8
+ exports.graphPropTypes = exports.graphDefaultProps = exports.default = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -17,6 +17,8 @@ var _graph = _interopRequireDefault(require("../utils/LazyLoader/graph"));
17
17
 
18
18
  var _plotly = _interopRequireDefault(require("../utils/LazyLoader/plotly"));
19
19
 
20
+ var _mathjax = _interopRequireDefault(require("../utils/LazyLoader/mathjax"));
21
+
20
22
  var _Graph = require("../fragments/Graph.privateprops");
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -25,9 +27,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
27
 
26
28
  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; }
27
29
 
28
- 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; }
30
+ 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; }
29
31
 
30
- 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; }
32
+ 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; }
31
33
 
32
34
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
35
 
@@ -49,15 +51,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
49
51
 
50
52
  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); } }
51
53
 
52
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
54
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
53
55
 
54
- 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); }
56
+ 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); }
55
57
 
56
58
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
57
59
 
58
60
  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); }; }
59
61
 
60
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
62
+ 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); }
61
63
 
62
64
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
63
65
 
@@ -84,6 +86,11 @@ var PlotlyGraph = /*#__PURE__*/function (_Component) {
84
86
  _classCallCheck(this, PlotlyGraph);
85
87
 
86
88
  _this = _super.call(this, props);
89
+
90
+ if (props.mathjax) {
91
+ PlotlyGraph._loadMathjax = true;
92
+ }
93
+
87
94
  _this.state = {
88
95
  prependData: [],
89
96
  extendData: []
@@ -178,9 +185,9 @@ var PlotlyGraph = /*#__PURE__*/function (_Component) {
178
185
  }(_react.Component);
179
186
 
180
187
  var RealPlotlyGraph = (0, _dashComponentPlugins.asyncDecorator)(PlotlyGraph, function () {
181
- return Promise.all([(0, _plotly.default)(), (0, _graph.default)()]).then(function (_ref2) {
182
- var _ref3 = _slicedToArray(_ref2, 2),
183
- graph = _ref3[1];
188
+ return Promise.all([(0, _graph.default)(), (0, _plotly.default)(), PlotlyGraph._loadMathjax ? (0, _mathjax.default)() : undefined]).then(function (_ref2) {
189
+ var _ref3 = _slicedToArray(_ref2, 1),
190
+ graph = _ref3[0];
184
191
 
185
192
  return graph;
186
193
  });
@@ -318,6 +325,11 @@ PlotlyGraph.propTypes = _objectSpread(_objectSpread({}, _Graph.privatePropTypes)
318
325
  */
319
326
  className: _propTypes.default.string,
320
327
 
328
+ /**
329
+ * If true, loads mathjax v3 (tex-svg) into the page and use it in the graph
330
+ */
331
+ mathjax: _propTypes.default.bool,
332
+
321
333
  /**
322
334
  * Beta: If true, animate between updates using
323
335
  * plotly.js's `animate` function
@@ -617,6 +629,7 @@ PlotlyGraph.defaultProps = _objectSpread(_objectSpread({}, _Graph.privateDefault
617
629
  frames: []
618
630
  },
619
631
  responsive: 'auto',
632
+ mathjax: false,
620
633
  animate: false,
621
634
  animation_options: {
622
635
  frame: {