gwchq-textjam 0.2.1 → 0.2.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.
package/dist/index.js CHANGED
@@ -68209,7 +68209,7 @@ __webpack_require__.d(__webpack_exports__, {
68209
68209
  });
68210
68210
 
68211
68211
  ;// ./src/assets/editor/pyodide/shims/pygal.js?url
68212
- const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalef3b78a56cb1d66beb61.js";
68212
+ const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalc0b4f32d2d2cc5a0c638.js";
68213
68213
  ;// ./src/assets/editor/pyodide/packages/turtle-0.0.1-py3-none-any.whl?url
68214
68214
  const turtle_0_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "assets/turtle-0.0.1-py3-none-any0c3147a3e0c3188b2544.whl";
68215
68215
  ;// ./src/assets/editor/pyodide/packages/p5-0.0.1-py3-none-any.whl?url
@@ -68347,8 +68347,8 @@ __webpack_require__.r(__webpack_exports__);
68347
68347
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68348
68348
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68349
68349
  /* harmony export */ });
68350
- /* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
68351
- /* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
68350
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
68351
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
68352
68352
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
68353
68353
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
68354
68354
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
@@ -68372,7 +68372,7 @@ var DraggableTab = _ref => {
68372
68372
  panelIndex,
68373
68373
  fileIndex
68374
68374
  } = _ref,
68375
- otherProps = (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
68375
+ otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
68376
68376
  var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
68377
68377
  var openFilesCount = openFiles[panelIndex].length;
68378
68378
  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
@@ -68389,7 +68389,7 @@ var DraggableTab = _ref => {
68389
68389
  switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
68390
68390
  }
68391
68391
  };
68392
- var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68392
+ var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68393
68393
  onClick: e => {
68394
68394
  e.stopPropagation();
68395
68395
  switchToFileTab(panelIndex, fileIndex);
@@ -68407,7 +68407,7 @@ var DraggableTab = _ref => {
68407
68407
  draggableProps,
68408
68408
  dragHandleProps
68409
68409
  } = _ref2;
68410
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68410
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68411
68411
  className: "draggable-tab",
68412
68412
  ref: innerRef
68413
68413
  }, draggableProps), dragHandleProps), {}, {
@@ -68429,8 +68429,8 @@ __webpack_require__.r(__webpack_exports__);
68429
68429
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68430
68430
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68431
68431
  /* harmony export */ });
68432
- /* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
68433
- /* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
68432
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
68433
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
68434
68434
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
68435
68435
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
68436
68436
  /* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
@@ -68449,8 +68449,8 @@ var DroppableTabList = _ref => {
68449
68449
  children: _children,
68450
68450
  index
68451
68451
  } = _ref,
68452
- otherProps = (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
68453
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
68452
+ otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
68453
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
68454
68454
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
68455
68455
  direction: "horizontal",
68456
68456
  droppableId: index.toString(),
@@ -68460,7 +68460,7 @@ var DroppableTabList = _ref => {
68460
68460
  droppableProps,
68461
68461
  placeholder
68462
68462
  } = _ref2;
68463
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
68463
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
68464
68464
  className: "droppable-tab-list"
68465
68465
  }, droppableProps), {}, {
68466
68466
  ref: innerRef,
@@ -102221,8 +102221,8 @@ __webpack_require__.r(__webpack_exports__);
102221
102221
 
102222
102222
 
102223
102223
  // TODO: refactor existing modals
102224
- /** !deprecated!
102225
- * use BaseModal from `index.tsx` instead
102224
+ /** !deprecated!
102225
+ * use BaseModal from `index.tsx` instead
102226
102226
  */
102227
102227
 
102228
102228
  var BaseModal = _ref => {
@@ -102918,7 +102918,7 @@ __webpack_require__.r(__webpack_exports__);
102918
102918
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
102919
102919
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
102920
102920
  /* harmony export */ });
102921
- /* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
102921
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
102922
102922
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
102923
102923
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
102924
102924
  /* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
@@ -102998,7 +102998,7 @@ var ProjectName = _ref => {
102998
102998
  id: "project_name_label",
102999
102999
  className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
103000
103000
  children: "Project Name"
103001
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
103001
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
103002
103002
  className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
103003
103003
  }, hoverProps), {}, {
103004
103004
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
@@ -103113,13 +103113,13 @@ var RunButton = _ref => {
103113
103113
  }, props));
103114
103114
  };
103115
103115
  /* harmony default export */ const RunButton_RunButton = (RunButton);
103116
- // EXTERNAL MODULE: ./node_modules/react-i18next/dist/es/index.js + 17 modules
103117
- var es = __webpack_require__(56576);
103118
103116
  // EXTERNAL MODULE: ./node_modules/classnames/index.js
103119
103117
  var classnames = __webpack_require__(46942);
103120
103118
  var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
103121
103119
  // EXTERNAL MODULE: ./src/components/RunButton/styles.module.scss
103122
103120
  var styles_module = __webpack_require__(26413);
103121
+ // EXTERNAL MODULE: ./src/components/SpinnerDotted/SpinnerDotted.tsx
103122
+ var SpinnerDotted = __webpack_require__(79458);
103123
103123
  ;// ./src/components/RunButton/StopButton.jsx
103124
103124
 
103125
103125
 
@@ -103132,6 +103132,10 @@ var StopButton_excluded = ["embedded", "className"];
103132
103132
 
103133
103133
 
103134
103134
 
103135
+ var stoppingButtonText = /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
103136
+ className: styles_module/* default */.A.stopBtnContent,
103137
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SpinnerDotted.SpinnerDotted, {}), " Stopping..."]
103138
+ });
103135
103139
  var StopButton = _ref => {
103136
103140
  var {
103137
103141
  embedded = false,
@@ -103141,9 +103145,6 @@ var StopButton = _ref => {
103141
103145
  var codeRunStopped = (0,external_react_redux_.useSelector)(state => state.editor.codeRunStopped);
103142
103146
  var codeRunTriggered = (0,external_react_redux_.useSelector)(state => state.editor.codeRunTriggered);
103143
103147
  var dispatch = (0,external_react_redux_.useDispatch)();
103144
- var {
103145
- t
103146
- } = (0,es.useTranslation)();
103147
103148
  var onClickStop = () => {
103148
103149
  if (codeRunTriggered) {
103149
103150
  dispatch((0,EditorSlice.stopCodeRun)());
@@ -103160,15 +103161,16 @@ var StopButton = _ref => {
103160
103161
  (0,external_react_.useEffect)(() => {
103161
103162
  if (codeRunStopped) {
103162
103163
  var stopping = /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], {
103163
- className: "".concat(className ? " ".concat(className) : ""),
103164
- buttonText: t("runButton.stopping"),
103164
+ className: styles_module/* default */.A.stopping,
103165
+ buttonText: stoppingButtonText,
103166
+ variant: "primary",
103165
103167
  disabled: true
103166
103168
  });
103167
103169
  setTimeout(() => {
103168
103170
  setButton(stopping);
103169
103171
  }, 100);
103170
103172
  }
103171
- }, [className, codeRunStopped, t]);
103173
+ }, [className, codeRunStopped]);
103172
103174
  return button;
103173
103175
  };
103174
103176
  /* harmony default export */ const RunButton_StopButton = (StopButton);
@@ -116559,6 +116561,115 @@ function escapeName(str, charsToEscape) {
116559
116561
 
116560
116562
 
116561
116563
 
116564
+ /***/ }),
116565
+
116566
+ /***/ 16450:
116567
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
116568
+
116569
+
116570
+
116571
+ var isValue = __webpack_require__(48175)
116572
+ , ensureValue = __webpack_require__(34809)
116573
+ , ensurePlainFunction = __webpack_require__(90251)
116574
+ , copy = __webpack_require__(30203)
116575
+ , normalizeOptions = __webpack_require__(90148)
116576
+ , map = __webpack_require__(30498);
116577
+
116578
+ var bind = Function.prototype.bind
116579
+ , defineProperty = Object.defineProperty
116580
+ , hasOwnProperty = Object.prototype.hasOwnProperty
116581
+ , define;
116582
+
116583
+ define = function (name, desc, options) {
116584
+ var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
116585
+ dgs = copy(desc);
116586
+ delete dgs.writable;
116587
+ delete dgs.value;
116588
+ dgs.get = function () {
116589
+ if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
116590
+ desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
116591
+ defineProperty(this, name, desc);
116592
+ return this[name];
116593
+ };
116594
+ return dgs;
116595
+ };
116596
+
116597
+ module.exports = function (props/*, options*/) {
116598
+ var options = normalizeOptions(arguments[1]);
116599
+ if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
116600
+ return map(props, function (desc, name) { return define(name, desc, options); });
116601
+ };
116602
+
116603
+
116604
+ /***/ }),
116605
+
116606
+ /***/ 58263:
116607
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
116608
+
116609
+
116610
+
116611
+ var isValue = __webpack_require__(48175)
116612
+ , isPlainFunction = __webpack_require__(6873)
116613
+ , assign = __webpack_require__(16596)
116614
+ , normalizeOpts = __webpack_require__(90148)
116615
+ , contains = __webpack_require__(70214);
116616
+
116617
+ var d = (module.exports = function (dscr, value/*, options*/) {
116618
+ var c, e, w, options, desc;
116619
+ if (arguments.length < 2 || typeof dscr !== "string") {
116620
+ options = value;
116621
+ value = dscr;
116622
+ dscr = null;
116623
+ } else {
116624
+ options = arguments[2];
116625
+ }
116626
+ if (isValue(dscr)) {
116627
+ c = contains.call(dscr, "c");
116628
+ e = contains.call(dscr, "e");
116629
+ w = contains.call(dscr, "w");
116630
+ } else {
116631
+ c = w = true;
116632
+ e = false;
116633
+ }
116634
+
116635
+ desc = { value: value, configurable: c, enumerable: e, writable: w };
116636
+ return !options ? desc : assign(normalizeOpts(options), desc);
116637
+ });
116638
+
116639
+ d.gs = function (dscr, get, set/*, options*/) {
116640
+ var c, e, options, desc;
116641
+ if (typeof dscr !== "string") {
116642
+ options = set;
116643
+ set = get;
116644
+ get = dscr;
116645
+ dscr = null;
116646
+ } else {
116647
+ options = arguments[3];
116648
+ }
116649
+ if (!isValue(get)) {
116650
+ get = undefined;
116651
+ } else if (!isPlainFunction(get)) {
116652
+ options = get;
116653
+ get = set = undefined;
116654
+ } else if (!isValue(set)) {
116655
+ set = undefined;
116656
+ } else if (!isPlainFunction(set)) {
116657
+ options = set;
116658
+ set = undefined;
116659
+ }
116660
+ if (isValue(dscr)) {
116661
+ c = contains.call(dscr, "c");
116662
+ e = contains.call(dscr, "e");
116663
+ } else {
116664
+ c = true;
116665
+ e = false;
116666
+ }
116667
+
116668
+ desc = { get: get, set: set, configurable: c, enumerable: e };
116669
+ return !options ? desc : assign(normalizeOpts(options), desc);
116670
+ };
116671
+
116672
+
116562
116673
  /***/ }),
116563
116674
 
116564
116675
  /***/ 83999:
@@ -131387,115 +131498,6 @@ year.every = function(k) {
131387
131498
  var years = year.range;
131388
131499
 
131389
131500
 
131390
- /***/ }),
131391
-
131392
- /***/ 16450:
131393
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
131394
-
131395
-
131396
-
131397
- var isValue = __webpack_require__(48175)
131398
- , ensureValue = __webpack_require__(34809)
131399
- , ensurePlainFunction = __webpack_require__(90251)
131400
- , copy = __webpack_require__(30203)
131401
- , normalizeOptions = __webpack_require__(90148)
131402
- , map = __webpack_require__(30498);
131403
-
131404
- var bind = Function.prototype.bind
131405
- , defineProperty = Object.defineProperty
131406
- , hasOwnProperty = Object.prototype.hasOwnProperty
131407
- , define;
131408
-
131409
- define = function (name, desc, options) {
131410
- var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
131411
- dgs = copy(desc);
131412
- delete dgs.writable;
131413
- delete dgs.value;
131414
- dgs.get = function () {
131415
- if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
131416
- desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
131417
- defineProperty(this, name, desc);
131418
- return this[name];
131419
- };
131420
- return dgs;
131421
- };
131422
-
131423
- module.exports = function (props/*, options*/) {
131424
- var options = normalizeOptions(arguments[1]);
131425
- if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
131426
- return map(props, function (desc, name) { return define(name, desc, options); });
131427
- };
131428
-
131429
-
131430
- /***/ }),
131431
-
131432
- /***/ 58263:
131433
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
131434
-
131435
-
131436
-
131437
- var isValue = __webpack_require__(48175)
131438
- , isPlainFunction = __webpack_require__(6873)
131439
- , assign = __webpack_require__(16596)
131440
- , normalizeOpts = __webpack_require__(90148)
131441
- , contains = __webpack_require__(70214);
131442
-
131443
- var d = (module.exports = function (dscr, value/*, options*/) {
131444
- var c, e, w, options, desc;
131445
- if (arguments.length < 2 || typeof dscr !== "string") {
131446
- options = value;
131447
- value = dscr;
131448
- dscr = null;
131449
- } else {
131450
- options = arguments[2];
131451
- }
131452
- if (isValue(dscr)) {
131453
- c = contains.call(dscr, "c");
131454
- e = contains.call(dscr, "e");
131455
- w = contains.call(dscr, "w");
131456
- } else {
131457
- c = w = true;
131458
- e = false;
131459
- }
131460
-
131461
- desc = { value: value, configurable: c, enumerable: e, writable: w };
131462
- return !options ? desc : assign(normalizeOpts(options), desc);
131463
- });
131464
-
131465
- d.gs = function (dscr, get, set/*, options*/) {
131466
- var c, e, options, desc;
131467
- if (typeof dscr !== "string") {
131468
- options = set;
131469
- set = get;
131470
- get = dscr;
131471
- dscr = null;
131472
- } else {
131473
- options = arguments[3];
131474
- }
131475
- if (!isValue(get)) {
131476
- get = undefined;
131477
- } else if (!isPlainFunction(get)) {
131478
- options = get;
131479
- get = set = undefined;
131480
- } else if (!isValue(set)) {
131481
- set = undefined;
131482
- } else if (!isPlainFunction(set)) {
131483
- options = set;
131484
- set = undefined;
131485
- }
131486
- if (isValue(dscr)) {
131487
- c = contains.call(dscr, "c");
131488
- e = contains.call(dscr, "e");
131489
- } else {
131490
- c = true;
131491
- e = false;
131492
- }
131493
-
131494
- desc = { get: get, set: set, configurable: c, enumerable: e };
131495
- return !options ? desc : assign(normalizeOpts(options), desc);
131496
- };
131497
-
131498
-
131499
131501
  /***/ }),
131500
131502
 
131501
131503
  /***/ 30041:
@@ -142888,7 +142890,7 @@ __webpack_require__.r(__webpack_exports__);
142888
142890
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
142889
142891
  /* harmony export */ });
142890
142892
  // extracted by mini-css-extract-plugin
142891
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","runBar":"styles-module__runBar--JA+8h","pressed":"styles-module__pressed--iQjvR"});
142893
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","runBar":"styles-module__runBar--JA+8h","stopping":"styles-module__stopping--ilJAu","stopBtnContent":"styles-module__stopBtnContent--wcJNY","pressed":"styles-module__pressed--iQjvR"});
142892
142894
 
142893
142895
  /***/ }),
142894
142896
 
@@ -148087,324 +148089,6 @@ function hsl2rgb(hsl) {
148087
148089
  }
148088
148090
 
148089
148091
 
148090
- /***/ }),
148091
-
148092
- /***/ 9793:
148093
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148094
-
148095
-
148096
-
148097
- var annAttrs = __webpack_require__(84676);
148098
- var overrideAll = (__webpack_require__(70756).overrideAll);
148099
- var templatedArray = (__webpack_require__(79338).templatedArray);
148100
-
148101
- module.exports = overrideAll(templatedArray('annotation', {
148102
- visible: annAttrs.visible,
148103
- x: {
148104
- valType: 'any',
148105
- description: [
148106
- 'Sets the annotation\'s x position.'
148107
- ].join(' ')
148108
- },
148109
- y: {
148110
- valType: 'any',
148111
- description: [
148112
- 'Sets the annotation\'s y position.'
148113
- ].join(' ')
148114
- },
148115
- z: {
148116
- valType: 'any',
148117
- description: [
148118
- 'Sets the annotation\'s z position.'
148119
- ].join(' ')
148120
- },
148121
- ax: {
148122
- valType: 'number',
148123
- description: [
148124
- 'Sets the x component of the arrow tail about the arrow head (in pixels).'
148125
- ].join(' ')
148126
- },
148127
- ay: {
148128
- valType: 'number',
148129
- description: [
148130
- 'Sets the y component of the arrow tail about the arrow head (in pixels).'
148131
- ].join(' ')
148132
- },
148133
-
148134
- xanchor: annAttrs.xanchor,
148135
- xshift: annAttrs.xshift,
148136
- yanchor: annAttrs.yanchor,
148137
- yshift: annAttrs.yshift,
148138
-
148139
- text: annAttrs.text,
148140
- textangle: annAttrs.textangle,
148141
- font: annAttrs.font,
148142
- width: annAttrs.width,
148143
- height: annAttrs.height,
148144
- opacity: annAttrs.opacity,
148145
- align: annAttrs.align,
148146
- valign: annAttrs.valign,
148147
- bgcolor: annAttrs.bgcolor,
148148
- bordercolor: annAttrs.bordercolor,
148149
- borderpad: annAttrs.borderpad,
148150
- borderwidth: annAttrs.borderwidth,
148151
- showarrow: annAttrs.showarrow,
148152
- arrowcolor: annAttrs.arrowcolor,
148153
- arrowhead: annAttrs.arrowhead,
148154
- startarrowhead: annAttrs.startarrowhead,
148155
- arrowside: annAttrs.arrowside,
148156
- arrowsize: annAttrs.arrowsize,
148157
- startarrowsize: annAttrs.startarrowsize,
148158
- arrowwidth: annAttrs.arrowwidth,
148159
- standoff: annAttrs.standoff,
148160
- startstandoff: annAttrs.startstandoff,
148161
- hovertext: annAttrs.hovertext,
148162
- hoverlabel: annAttrs.hoverlabel,
148163
- captureevents: annAttrs.captureevents,
148164
-
148165
- // maybes later?
148166
- // clicktoshow: annAttrs.clicktoshow,
148167
- // xclick: annAttrs.xclick,
148168
- // yclick: annAttrs.yclick,
148169
-
148170
- // not needed!
148171
- // axref: 'pixel'
148172
- // ayref: 'pixel'
148173
- // xref: 'x'
148174
- // yref: 'y
148175
- // zref: 'z'
148176
- }), 'calc', 'from-root');
148177
-
148178
-
148179
- /***/ }),
148180
-
148181
- /***/ 58121:
148182
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148183
-
148184
-
148185
-
148186
- var Lib = __webpack_require__(30991);
148187
- var Axes = __webpack_require__(15076);
148188
-
148189
- module.exports = function convert(scene) {
148190
- var fullSceneLayout = scene.fullSceneLayout;
148191
- var anns = fullSceneLayout.annotations;
148192
-
148193
- for(var i = 0; i < anns.length; i++) {
148194
- mockAnnAxes(anns[i], scene);
148195
- }
148196
-
148197
- scene.fullLayout._infolayer
148198
- .selectAll('.annotation-' + scene.id)
148199
- .remove();
148200
- };
148201
-
148202
- function mockAnnAxes(ann, scene) {
148203
- var fullSceneLayout = scene.fullSceneLayout;
148204
- var domain = fullSceneLayout.domain;
148205
- var size = scene.fullLayout._size;
148206
-
148207
- var base = {
148208
- // this gets fill in on render
148209
- pdata: null,
148210
-
148211
- // to get setConvert to not execute cleanly
148212
- type: 'linear',
148213
-
148214
- // don't try to update them on `editable: true`
148215
- autorange: false,
148216
-
148217
- // set infinite range so that annotation draw routine
148218
- // does not try to remove 'outside-range' annotations,
148219
- // this case is handled in the render loop
148220
- range: [-Infinity, Infinity]
148221
- };
148222
-
148223
- ann._xa = {};
148224
- Lib.extendFlat(ann._xa, base);
148225
- Axes.setConvert(ann._xa);
148226
- ann._xa._offset = size.l + domain.x[0] * size.w;
148227
- ann._xa.l2p = function() {
148228
- return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
148229
- };
148230
-
148231
- ann._ya = {};
148232
- Lib.extendFlat(ann._ya, base);
148233
- Axes.setConvert(ann._ya);
148234
- ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
148235
- ann._ya.l2p = function() {
148236
- return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
148237
- };
148238
- }
148239
-
148240
-
148241
- /***/ }),
148242
-
148243
- /***/ 41926:
148244
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148245
-
148246
-
148247
-
148248
- var Lib = __webpack_require__(30991);
148249
- var Axes = __webpack_require__(15076);
148250
- var handleArrayContainerDefaults = __webpack_require__(21238);
148251
- var handleAnnotationCommonDefaults = __webpack_require__(84081);
148252
- var attributes = __webpack_require__(9793);
148253
-
148254
- module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
148255
- handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
148256
- name: 'annotations',
148257
- handleItemDefaults: handleAnnotationDefaults,
148258
- fullLayout: opts.fullLayout
148259
- });
148260
- };
148261
-
148262
- function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
148263
- function coerce(attr, dflt) {
148264
- return Lib.coerce(annIn, annOut, attributes, attr, dflt);
148265
- }
148266
-
148267
- function coercePosition(axLetter) {
148268
- var axName = axLetter + 'axis';
148269
-
148270
- // mock in such way that getFromId grabs correct 3D axis
148271
- var gdMock = { _fullLayout: {} };
148272
- gdMock._fullLayout[axName] = sceneLayout[axName];
148273
-
148274
- return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
148275
- }
148276
-
148277
-
148278
- var visible = coerce('visible');
148279
- if(!visible) return;
148280
-
148281
- handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
148282
-
148283
- coercePosition('x');
148284
- coercePosition('y');
148285
- coercePosition('z');
148286
-
148287
- // if you have one coordinate you should all three
148288
- Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
148289
-
148290
- // hard-set here for completeness
148291
- annOut.xref = 'x';
148292
- annOut.yref = 'y';
148293
- annOut.zref = 'z';
148294
-
148295
- coerce('xanchor');
148296
- coerce('yanchor');
148297
- coerce('xshift');
148298
- coerce('yshift');
148299
-
148300
- if(annOut.showarrow) {
148301
- annOut.axref = 'pixel';
148302
- annOut.ayref = 'pixel';
148303
-
148304
- // TODO maybe default values should be bigger than the 2D case?
148305
- coerce('ax', -10);
148306
- coerce('ay', -30);
148307
-
148308
- // if you have one part of arrow length you should have both
148309
- Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
148310
- }
148311
- }
148312
-
148313
-
148314
- /***/ }),
148315
-
148316
- /***/ 13802:
148317
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148318
-
148319
-
148320
-
148321
- var drawRaw = (__webpack_require__(47995).drawRaw);
148322
- var project = __webpack_require__(51344);
148323
- var axLetters = ['x', 'y', 'z'];
148324
-
148325
- module.exports = function draw(scene) {
148326
- var fullSceneLayout = scene.fullSceneLayout;
148327
- var dataScale = scene.dataScale;
148328
- var anns = fullSceneLayout.annotations;
148329
-
148330
- for(var i = 0; i < anns.length; i++) {
148331
- var ann = anns[i];
148332
- var annotationIsOffscreen = false;
148333
-
148334
- for(var j = 0; j < 3; j++) {
148335
- var axLetter = axLetters[j];
148336
- var pos = ann[axLetter];
148337
- var ax = fullSceneLayout[axLetter + 'axis'];
148338
- var posFraction = ax.r2fraction(pos);
148339
-
148340
- if(posFraction < 0 || posFraction > 1) {
148341
- annotationIsOffscreen = true;
148342
- break;
148343
- }
148344
- }
148345
-
148346
- if(annotationIsOffscreen) {
148347
- scene.fullLayout._infolayer
148348
- .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
148349
- .remove();
148350
- } else {
148351
- ann._pdata = project(scene.glplot.cameraParams, [
148352
- fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
148353
- fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
148354
- fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
148355
- ]);
148356
-
148357
- drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
148358
- }
148359
- }
148360
- };
148361
-
148362
-
148363
- /***/ }),
148364
-
148365
- /***/ 86578:
148366
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148367
-
148368
-
148369
-
148370
- var Registry = __webpack_require__(13936);
148371
- var Lib = __webpack_require__(30991);
148372
-
148373
- module.exports = {
148374
- moduleType: 'component',
148375
- name: 'annotations3d',
148376
-
148377
- schema: {
148378
- subplots: {
148379
- scene: {annotations: __webpack_require__(9793)}
148380
- }
148381
- },
148382
-
148383
- layoutAttributes: __webpack_require__(9793),
148384
- handleDefaults: __webpack_require__(41926),
148385
- includeBasePlot: includeGL3D,
148386
-
148387
- convert: __webpack_require__(58121),
148388
- draw: __webpack_require__(13802)
148389
- };
148390
-
148391
- function includeGL3D(layoutIn, layoutOut) {
148392
- var GL3D = Registry.subplotsRegistry.gl3d;
148393
- if(!GL3D) return;
148394
-
148395
- var attrRegex = GL3D.attrRegex;
148396
-
148397
- var keys = Object.keys(layoutIn);
148398
- for(var i = 0; i < keys.length; i++) {
148399
- var k = keys[i];
148400
- if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
148401
- Lib.pushUnique(layoutOut._basePlotModules, GL3D);
148402
- Lib.pushUnique(layoutOut._subplots.gl3d, k);
148403
- }
148404
- }
148405
- }
148406
-
148407
-
148408
148092
  /***/ }),
148409
148093
 
148410
148094
  /***/ 2595:
@@ -150378,6 +150062,324 @@ module.exports = {
150378
150062
  };
150379
150063
 
150380
150064
 
150065
+ /***/ }),
150066
+
150067
+ /***/ 9793:
150068
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150069
+
150070
+
150071
+
150072
+ var annAttrs = __webpack_require__(84676);
150073
+ var overrideAll = (__webpack_require__(70756).overrideAll);
150074
+ var templatedArray = (__webpack_require__(79338).templatedArray);
150075
+
150076
+ module.exports = overrideAll(templatedArray('annotation', {
150077
+ visible: annAttrs.visible,
150078
+ x: {
150079
+ valType: 'any',
150080
+ description: [
150081
+ 'Sets the annotation\'s x position.'
150082
+ ].join(' ')
150083
+ },
150084
+ y: {
150085
+ valType: 'any',
150086
+ description: [
150087
+ 'Sets the annotation\'s y position.'
150088
+ ].join(' ')
150089
+ },
150090
+ z: {
150091
+ valType: 'any',
150092
+ description: [
150093
+ 'Sets the annotation\'s z position.'
150094
+ ].join(' ')
150095
+ },
150096
+ ax: {
150097
+ valType: 'number',
150098
+ description: [
150099
+ 'Sets the x component of the arrow tail about the arrow head (in pixels).'
150100
+ ].join(' ')
150101
+ },
150102
+ ay: {
150103
+ valType: 'number',
150104
+ description: [
150105
+ 'Sets the y component of the arrow tail about the arrow head (in pixels).'
150106
+ ].join(' ')
150107
+ },
150108
+
150109
+ xanchor: annAttrs.xanchor,
150110
+ xshift: annAttrs.xshift,
150111
+ yanchor: annAttrs.yanchor,
150112
+ yshift: annAttrs.yshift,
150113
+
150114
+ text: annAttrs.text,
150115
+ textangle: annAttrs.textangle,
150116
+ font: annAttrs.font,
150117
+ width: annAttrs.width,
150118
+ height: annAttrs.height,
150119
+ opacity: annAttrs.opacity,
150120
+ align: annAttrs.align,
150121
+ valign: annAttrs.valign,
150122
+ bgcolor: annAttrs.bgcolor,
150123
+ bordercolor: annAttrs.bordercolor,
150124
+ borderpad: annAttrs.borderpad,
150125
+ borderwidth: annAttrs.borderwidth,
150126
+ showarrow: annAttrs.showarrow,
150127
+ arrowcolor: annAttrs.arrowcolor,
150128
+ arrowhead: annAttrs.arrowhead,
150129
+ startarrowhead: annAttrs.startarrowhead,
150130
+ arrowside: annAttrs.arrowside,
150131
+ arrowsize: annAttrs.arrowsize,
150132
+ startarrowsize: annAttrs.startarrowsize,
150133
+ arrowwidth: annAttrs.arrowwidth,
150134
+ standoff: annAttrs.standoff,
150135
+ startstandoff: annAttrs.startstandoff,
150136
+ hovertext: annAttrs.hovertext,
150137
+ hoverlabel: annAttrs.hoverlabel,
150138
+ captureevents: annAttrs.captureevents,
150139
+
150140
+ // maybes later?
150141
+ // clicktoshow: annAttrs.clicktoshow,
150142
+ // xclick: annAttrs.xclick,
150143
+ // yclick: annAttrs.yclick,
150144
+
150145
+ // not needed!
150146
+ // axref: 'pixel'
150147
+ // ayref: 'pixel'
150148
+ // xref: 'x'
150149
+ // yref: 'y
150150
+ // zref: 'z'
150151
+ }), 'calc', 'from-root');
150152
+
150153
+
150154
+ /***/ }),
150155
+
150156
+ /***/ 58121:
150157
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150158
+
150159
+
150160
+
150161
+ var Lib = __webpack_require__(30991);
150162
+ var Axes = __webpack_require__(15076);
150163
+
150164
+ module.exports = function convert(scene) {
150165
+ var fullSceneLayout = scene.fullSceneLayout;
150166
+ var anns = fullSceneLayout.annotations;
150167
+
150168
+ for(var i = 0; i < anns.length; i++) {
150169
+ mockAnnAxes(anns[i], scene);
150170
+ }
150171
+
150172
+ scene.fullLayout._infolayer
150173
+ .selectAll('.annotation-' + scene.id)
150174
+ .remove();
150175
+ };
150176
+
150177
+ function mockAnnAxes(ann, scene) {
150178
+ var fullSceneLayout = scene.fullSceneLayout;
150179
+ var domain = fullSceneLayout.domain;
150180
+ var size = scene.fullLayout._size;
150181
+
150182
+ var base = {
150183
+ // this gets fill in on render
150184
+ pdata: null,
150185
+
150186
+ // to get setConvert to not execute cleanly
150187
+ type: 'linear',
150188
+
150189
+ // don't try to update them on `editable: true`
150190
+ autorange: false,
150191
+
150192
+ // set infinite range so that annotation draw routine
150193
+ // does not try to remove 'outside-range' annotations,
150194
+ // this case is handled in the render loop
150195
+ range: [-Infinity, Infinity]
150196
+ };
150197
+
150198
+ ann._xa = {};
150199
+ Lib.extendFlat(ann._xa, base);
150200
+ Axes.setConvert(ann._xa);
150201
+ ann._xa._offset = size.l + domain.x[0] * size.w;
150202
+ ann._xa.l2p = function() {
150203
+ return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
150204
+ };
150205
+
150206
+ ann._ya = {};
150207
+ Lib.extendFlat(ann._ya, base);
150208
+ Axes.setConvert(ann._ya);
150209
+ ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
150210
+ ann._ya.l2p = function() {
150211
+ return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
150212
+ };
150213
+ }
150214
+
150215
+
150216
+ /***/ }),
150217
+
150218
+ /***/ 41926:
150219
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150220
+
150221
+
150222
+
150223
+ var Lib = __webpack_require__(30991);
150224
+ var Axes = __webpack_require__(15076);
150225
+ var handleArrayContainerDefaults = __webpack_require__(21238);
150226
+ var handleAnnotationCommonDefaults = __webpack_require__(84081);
150227
+ var attributes = __webpack_require__(9793);
150228
+
150229
+ module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
150230
+ handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
150231
+ name: 'annotations',
150232
+ handleItemDefaults: handleAnnotationDefaults,
150233
+ fullLayout: opts.fullLayout
150234
+ });
150235
+ };
150236
+
150237
+ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
150238
+ function coerce(attr, dflt) {
150239
+ return Lib.coerce(annIn, annOut, attributes, attr, dflt);
150240
+ }
150241
+
150242
+ function coercePosition(axLetter) {
150243
+ var axName = axLetter + 'axis';
150244
+
150245
+ // mock in such way that getFromId grabs correct 3D axis
150246
+ var gdMock = { _fullLayout: {} };
150247
+ gdMock._fullLayout[axName] = sceneLayout[axName];
150248
+
150249
+ return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
150250
+ }
150251
+
150252
+
150253
+ var visible = coerce('visible');
150254
+ if(!visible) return;
150255
+
150256
+ handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
150257
+
150258
+ coercePosition('x');
150259
+ coercePosition('y');
150260
+ coercePosition('z');
150261
+
150262
+ // if you have one coordinate you should all three
150263
+ Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
150264
+
150265
+ // hard-set here for completeness
150266
+ annOut.xref = 'x';
150267
+ annOut.yref = 'y';
150268
+ annOut.zref = 'z';
150269
+
150270
+ coerce('xanchor');
150271
+ coerce('yanchor');
150272
+ coerce('xshift');
150273
+ coerce('yshift');
150274
+
150275
+ if(annOut.showarrow) {
150276
+ annOut.axref = 'pixel';
150277
+ annOut.ayref = 'pixel';
150278
+
150279
+ // TODO maybe default values should be bigger than the 2D case?
150280
+ coerce('ax', -10);
150281
+ coerce('ay', -30);
150282
+
150283
+ // if you have one part of arrow length you should have both
150284
+ Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
150285
+ }
150286
+ }
150287
+
150288
+
150289
+ /***/ }),
150290
+
150291
+ /***/ 13802:
150292
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150293
+
150294
+
150295
+
150296
+ var drawRaw = (__webpack_require__(47995).drawRaw);
150297
+ var project = __webpack_require__(51344);
150298
+ var axLetters = ['x', 'y', 'z'];
150299
+
150300
+ module.exports = function draw(scene) {
150301
+ var fullSceneLayout = scene.fullSceneLayout;
150302
+ var dataScale = scene.dataScale;
150303
+ var anns = fullSceneLayout.annotations;
150304
+
150305
+ for(var i = 0; i < anns.length; i++) {
150306
+ var ann = anns[i];
150307
+ var annotationIsOffscreen = false;
150308
+
150309
+ for(var j = 0; j < 3; j++) {
150310
+ var axLetter = axLetters[j];
150311
+ var pos = ann[axLetter];
150312
+ var ax = fullSceneLayout[axLetter + 'axis'];
150313
+ var posFraction = ax.r2fraction(pos);
150314
+
150315
+ if(posFraction < 0 || posFraction > 1) {
150316
+ annotationIsOffscreen = true;
150317
+ break;
150318
+ }
150319
+ }
150320
+
150321
+ if(annotationIsOffscreen) {
150322
+ scene.fullLayout._infolayer
150323
+ .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
150324
+ .remove();
150325
+ } else {
150326
+ ann._pdata = project(scene.glplot.cameraParams, [
150327
+ fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
150328
+ fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
150329
+ fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
150330
+ ]);
150331
+
150332
+ drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
150333
+ }
150334
+ }
150335
+ };
150336
+
150337
+
150338
+ /***/ }),
150339
+
150340
+ /***/ 86578:
150341
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150342
+
150343
+
150344
+
150345
+ var Registry = __webpack_require__(13936);
150346
+ var Lib = __webpack_require__(30991);
150347
+
150348
+ module.exports = {
150349
+ moduleType: 'component',
150350
+ name: 'annotations3d',
150351
+
150352
+ schema: {
150353
+ subplots: {
150354
+ scene: {annotations: __webpack_require__(9793)}
150355
+ }
150356
+ },
150357
+
150358
+ layoutAttributes: __webpack_require__(9793),
150359
+ handleDefaults: __webpack_require__(41926),
150360
+ includeBasePlot: includeGL3D,
150361
+
150362
+ convert: __webpack_require__(58121),
150363
+ draw: __webpack_require__(13802)
150364
+ };
150365
+
150366
+ function includeGL3D(layoutIn, layoutOut) {
150367
+ var GL3D = Registry.subplotsRegistry.gl3d;
150368
+ if(!GL3D) return;
150369
+
150370
+ var attrRegex = GL3D.attrRegex;
150371
+
150372
+ var keys = Object.keys(layoutIn);
150373
+ for(var i = 0; i < keys.length; i++) {
150374
+ var k = keys[i];
150375
+ if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
150376
+ Lib.pushUnique(layoutOut._basePlotModules, GL3D);
150377
+ Lib.pushUnique(layoutOut._subplots.gl3d, k);
150378
+ }
150379
+ }
150380
+ }
150381
+
150382
+
150381
150383
  /***/ }),
150382
150384
 
150383
150385
  /***/ 27639:
@@ -248610,595 +248612,6 @@ function isValidZ(z) {
248610
248612
  }
248611
248613
 
248612
248614
 
248613
- /***/ }),
248614
-
248615
- /***/ 42124:
248616
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248617
-
248618
-
248619
-
248620
- var histogramAttrs = __webpack_require__(71250);
248621
- var makeBinAttrs = __webpack_require__(9284);
248622
- var heatmapAttrs = __webpack_require__(68300);
248623
- var baseAttrs = __webpack_require__(35667);
248624
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
248625
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
248626
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
248627
- var colorScaleAttrs = __webpack_require__(17957);
248628
-
248629
- var extendFlat = (__webpack_require__(91307).extendFlat);
248630
-
248631
- module.exports = extendFlat(
248632
- {
248633
- x: histogramAttrs.x,
248634
- y: histogramAttrs.y,
248635
-
248636
- z: {
248637
- valType: 'data_array',
248638
- editType: 'calc',
248639
- description: 'Sets the aggregation data.'
248640
- },
248641
- marker: {
248642
- color: {
248643
- valType: 'data_array',
248644
- editType: 'calc',
248645
- description: 'Sets the aggregation data.'
248646
- },
248647
- editType: 'calc'
248648
- },
248649
-
248650
- histnorm: histogramAttrs.histnorm,
248651
- histfunc: histogramAttrs.histfunc,
248652
- nbinsx: histogramAttrs.nbinsx,
248653
- xbins: makeBinAttrs('x'),
248654
- nbinsy: histogramAttrs.nbinsy,
248655
- ybins: makeBinAttrs('y'),
248656
- autobinx: histogramAttrs.autobinx,
248657
- autobiny: histogramAttrs.autobiny,
248658
-
248659
- bingroup: extendFlat({}, histogramAttrs.bingroup, {
248660
- description: [
248661
- 'Set the `xbingroup` and `ybingroup` default prefix',
248662
- 'For example, setting a `bingroup` of *1* on two histogram2d traces',
248663
- 'will make them their x-bins and y-bins match separately.'
248664
- ].join(' ')
248665
- }),
248666
- xbingroup: extendFlat({}, histogramAttrs.bingroup, {
248667
- description: [
248668
- 'Set a group of histogram traces which will have compatible x-bin settings.',
248669
- 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
248670
- '(on axes of the same axis type) can have compatible x-bin settings.',
248671
- 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
248672
- ].join(' ')
248673
- }),
248674
- ybingroup: extendFlat({}, histogramAttrs.bingroup, {
248675
- description: [
248676
- 'Set a group of histogram traces which will have compatible y-bin settings.',
248677
- 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
248678
- '(on axes of the same axis type) can have compatible y-bin settings.',
248679
- 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
248680
- ].join(' ')
248681
- }),
248682
-
248683
- xgap: heatmapAttrs.xgap,
248684
- ygap: heatmapAttrs.ygap,
248685
- zsmooth: heatmapAttrs.zsmooth,
248686
- xhoverformat: axisHoverFormat('x'),
248687
- yhoverformat: axisHoverFormat('y'),
248688
- zhoverformat: axisHoverFormat('z', 1),
248689
- hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
248690
- texttemplate: texttemplateAttrs({
248691
- arrayOk: false,
248692
- editType: 'plot'
248693
- }, {
248694
- keys: 'z'
248695
- }),
248696
- textfont: heatmapAttrs.textfont,
248697
- showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
248698
- },
248699
- colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
248700
- );
248701
-
248702
-
248703
- /***/ }),
248704
-
248705
- /***/ 32492:
248706
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248707
-
248708
-
248709
-
248710
- var Lib = __webpack_require__(30991);
248711
- var Axes = __webpack_require__(15076);
248712
-
248713
- var binFunctions = __webpack_require__(47260);
248714
- var normFunctions = __webpack_require__(855);
248715
- var doAvg = __webpack_require__(26756);
248716
- var getBinSpanLabelRound = __webpack_require__(41574);
248717
- var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
248718
-
248719
- module.exports = function calc(gd, trace) {
248720
- var xa = Axes.getFromId(gd, trace.xaxis);
248721
- var ya = Axes.getFromId(gd, trace.yaxis);
248722
-
248723
- var xcalendar = trace.xcalendar;
248724
- var ycalendar = trace.ycalendar;
248725
- var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
248726
- var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
248727
- var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
248728
- var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
248729
-
248730
- var i, j, n, m;
248731
-
248732
- // calculate the bins
248733
- var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
248734
- var xBinSpec = xBinsAndPos[0];
248735
- var xPos0 = xBinsAndPos[1];
248736
- var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
248737
- var yBinSpec = yBinsAndPos[0];
248738
- var yPos0 = yBinsAndPos[1];
248739
-
248740
- var serieslen = trace._length;
248741
- if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
248742
- if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
248743
-
248744
- // make the empty bin array & scale the map
248745
- var z = [];
248746
- var onecol = [];
248747
- var zerocol = [];
248748
- var nonuniformBinsX = typeof xBinSpec.size === 'string';
248749
- var nonuniformBinsY = typeof yBinSpec.size === 'string';
248750
- var xEdges = [];
248751
- var yEdges = [];
248752
- var xbins = nonuniformBinsX ? xEdges : xBinSpec;
248753
- var ybins = nonuniformBinsY ? yEdges : yBinSpec;
248754
- var total = 0;
248755
- var counts = [];
248756
- var inputPoints = [];
248757
- var norm = trace.histnorm;
248758
- var func = trace.histfunc;
248759
- var densitynorm = norm.indexOf('density') !== -1;
248760
- var extremefunc = func === 'max' || func === 'min';
248761
- var sizeinit = extremefunc ? null : 0;
248762
- var binfunc = binFunctions.count;
248763
- var normfunc = normFunctions[norm];
248764
- var doavg = false;
248765
- var xinc = [];
248766
- var yinc = [];
248767
-
248768
- // set a binning function other than count?
248769
- // for binning functions: check first for 'z',
248770
- // then 'mc' in case we had a colored scatter plot
248771
- // and want to transfer these colors to the 2D histo
248772
- // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
248773
- var rawCounterData = ('z' in trace) ?
248774
- trace.z :
248775
- (('marker' in trace && Array.isArray(trace.marker.color)) ?
248776
- trace.marker.color : '');
248777
- if(rawCounterData && func !== 'count') {
248778
- doavg = func === 'avg';
248779
- binfunc = binFunctions[func];
248780
- }
248781
-
248782
- // decrease end a little in case of rounding errors
248783
- var xBinSize = xBinSpec.size;
248784
- var xBinStart = xr2c(xBinSpec.start);
248785
- var xBinEnd = xr2c(xBinSpec.end) +
248786
- (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
248787
-
248788
- for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
248789
- onecol.push(sizeinit);
248790
- xEdges.push(i);
248791
- if(doavg) zerocol.push(0);
248792
- }
248793
- xEdges.push(i);
248794
-
248795
- var nx = onecol.length;
248796
- var dx = (i - xBinStart) / nx;
248797
- var x0 = xc2r(xBinStart + dx / 2);
248798
-
248799
- var yBinSize = yBinSpec.size;
248800
- var yBinStart = yr2c(yBinSpec.start);
248801
- var yBinEnd = yr2c(yBinSpec.end) +
248802
- (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
248803
-
248804
- for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
248805
- z.push(onecol.slice());
248806
- yEdges.push(i);
248807
- var ipCol = new Array(nx);
248808
- for(j = 0; j < nx; j++) ipCol[j] = [];
248809
- inputPoints.push(ipCol);
248810
- if(doavg) counts.push(zerocol.slice());
248811
- }
248812
- yEdges.push(i);
248813
-
248814
- var ny = z.length;
248815
- var dy = (i - yBinStart) / ny;
248816
- var y0 = yc2r(yBinStart + dy / 2);
248817
-
248818
- if(densitynorm) {
248819
- xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
248820
- yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
248821
- }
248822
-
248823
- // for date axes we need bin bounds to be calcdata. For nonuniform bins
248824
- // we already have this, but uniform with start/end/size they're still strings.
248825
- if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
248826
- if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
248827
-
248828
- // put data into bins
248829
- var uniqueValsPerX = true;
248830
- var uniqueValsPerY = true;
248831
- var xVals = new Array(nx);
248832
- var yVals = new Array(ny);
248833
- var xGapLow = Infinity;
248834
- var xGapHigh = Infinity;
248835
- var yGapLow = Infinity;
248836
- var yGapHigh = Infinity;
248837
- for(i = 0; i < serieslen; i++) {
248838
- var xi = xPos0[i];
248839
- var yi = yPos0[i];
248840
- n = Lib.findBin(xi, xbins);
248841
- m = Lib.findBin(yi, ybins);
248842
- if(n >= 0 && n < nx && m >= 0 && m < ny) {
248843
- total += binfunc(n, i, z[m], rawCounterData, counts[m]);
248844
- inputPoints[m][n].push(i);
248845
-
248846
- if(uniqueValsPerX) {
248847
- if(xVals[n] === undefined) xVals[n] = xi;
248848
- else if(xVals[n] !== xi) uniqueValsPerX = false;
248849
- }
248850
- if(uniqueValsPerY) {
248851
- if(yVals[m] === undefined) yVals[m] = yi;
248852
- else if(yVals[m] !== yi) uniqueValsPerY = false;
248853
- }
248854
-
248855
- xGapLow = Math.min(xGapLow, xi - xEdges[n]);
248856
- xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
248857
- yGapLow = Math.min(yGapLow, yi - yEdges[m]);
248858
- yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
248859
- }
248860
- }
248861
- // normalize, if needed
248862
- if(doavg) {
248863
- for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
248864
- }
248865
- if(normfunc) {
248866
- for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
248867
- }
248868
-
248869
- return {
248870
- x: xPos0,
248871
- xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
248872
- x0: x0,
248873
- dx: dx,
248874
- y: yPos0,
248875
- yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
248876
- y0: y0,
248877
- dy: dy,
248878
- z: z,
248879
- pts: inputPoints
248880
- };
248881
- };
248882
-
248883
- function makeIncrements(len, bins, dv, nonuniform) {
248884
- var out = new Array(len);
248885
- var i;
248886
- if(nonuniform) {
248887
- for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
248888
- } else {
248889
- var inc = 1 / dv;
248890
- for(i = 0; i < len; i++) out[i] = inc;
248891
- }
248892
- return out;
248893
- }
248894
-
248895
- function binsToCalc(r2c, bins) {
248896
- return {
248897
- start: r2c(bins.start),
248898
- end: r2c(bins.end),
248899
- size: bins.size
248900
- };
248901
- }
248902
-
248903
- function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
248904
- var i;
248905
- var len = edges.length - 1;
248906
- var out = new Array(len);
248907
- var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
248908
-
248909
- for(i = 0; i < len; i++) {
248910
- var v = (uniqueVals || [])[i];
248911
- out[i] = v === undefined ?
248912
- [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
248913
- [v, v];
248914
- }
248915
- return out;
248916
- }
248917
-
248918
-
248919
- /***/ }),
248920
-
248921
- /***/ 15611:
248922
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248923
-
248924
-
248925
-
248926
- var Lib = __webpack_require__(30991);
248927
-
248928
- var handleSampleDefaults = __webpack_require__(6236);
248929
- var handleStyleDefaults = __webpack_require__(25157);
248930
- var colorscaleDefaults = __webpack_require__(13682);
248931
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
248932
- var attributes = __webpack_require__(42124);
248933
-
248934
-
248935
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
248936
- function coerce(attr, dflt) {
248937
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
248938
- }
248939
-
248940
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
248941
- if(traceOut.visible === false) return;
248942
-
248943
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
248944
- colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
248945
- coerce('hovertemplate');
248946
-
248947
- handleHeatmapLabelDefaults(coerce, layout);
248948
-
248949
- coerce('xhoverformat');
248950
- coerce('yhoverformat');
248951
- };
248952
-
248953
-
248954
- /***/ }),
248955
-
248956
- /***/ 94587:
248957
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248958
-
248959
-
248960
-
248961
- var heatmapHover = __webpack_require__(85243);
248962
- var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
248963
-
248964
- module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
248965
- var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
248966
-
248967
- if(!pts) return;
248968
-
248969
- pointData = pts[0];
248970
- var indices = pointData.index;
248971
- var ny = indices[0];
248972
- var nx = indices[1];
248973
- var cd0 = pointData.cd[0];
248974
- var trace = cd0.trace;
248975
- var xRange = cd0.xRanges[nx];
248976
- var yRange = cd0.yRanges[ny];
248977
-
248978
- pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
248979
- pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
248980
-
248981
- return pts;
248982
- };
248983
-
248984
-
248985
- /***/ }),
248986
-
248987
- /***/ 3617:
248988
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248989
-
248990
-
248991
-
248992
- module.exports = {
248993
- attributes: __webpack_require__(42124),
248994
- supplyDefaults: __webpack_require__(15611),
248995
- crossTraceDefaults: __webpack_require__(34294),
248996
- calc: __webpack_require__(91980),
248997
- plot: __webpack_require__(29406),
248998
- layerName: 'heatmaplayer',
248999
- colorbar: __webpack_require__(90165),
249000
- style: __webpack_require__(58756),
249001
- hoverPoints: __webpack_require__(94587),
249002
- eventData: __webpack_require__(63870),
249003
-
249004
- moduleType: 'trace',
249005
- name: 'histogram2d',
249006
- basePlotModule: __webpack_require__(47885),
249007
- categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
249008
- meta: {
249009
- hrName: 'histogram_2d',
249010
- description: [
249011
- 'The sample data from which statistics are computed is set in `x`',
249012
- 'and `y` (where `x` and `y` represent marginal distributions,',
249013
- 'binning is set in `xbins` and `ybins` in this case)',
249014
- 'or `z` (where `z` represent the 2D distribution and binning set,',
249015
- 'binning is set by `x` and `y` in this case).',
249016
- 'The resulting distribution is visualized as a heatmap.'
249017
- ].join(' ')
249018
- }
249019
- };
249020
-
249021
-
249022
- /***/ }),
249023
-
249024
- /***/ 6236:
249025
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249026
-
249027
-
249028
-
249029
- var Registry = __webpack_require__(13936);
249030
- var Lib = __webpack_require__(30991);
249031
-
249032
- module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
249033
- var x = coerce('x');
249034
- var y = coerce('y');
249035
- var xlen = Lib.minRowLength(x);
249036
- var ylen = Lib.minRowLength(y);
249037
-
249038
- // we could try to accept x0 and dx, etc...
249039
- // but that's a pretty weird use case.
249040
- // for now require both x and y explicitly specified.
249041
- if(!xlen || !ylen) {
249042
- traceOut.visible = false;
249043
- return;
249044
- }
249045
-
249046
- traceOut._length = Math.min(xlen, ylen);
249047
-
249048
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
249049
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
249050
-
249051
- // if marker.color is an array, we can use it in aggregation instead of z
249052
- var hasAggregationData = coerce('z') || coerce('marker.color');
249053
-
249054
- if(hasAggregationData) coerce('histfunc');
249055
- coerce('histnorm');
249056
-
249057
- // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
249058
- // autobin(x|y) are only included here to appease Plotly.validate
249059
- coerce('autobinx');
249060
- coerce('autobiny');
249061
- };
249062
-
249063
-
249064
- /***/ }),
249065
-
249066
- /***/ 34872:
249067
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249068
-
249069
-
249070
-
249071
- var histogram2dAttrs = __webpack_require__(42124);
249072
- var contourAttrs = __webpack_require__(70318);
249073
- var colorScaleAttrs = __webpack_require__(17957);
249074
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
249075
-
249076
- var extendFlat = (__webpack_require__(91307).extendFlat);
249077
-
249078
- module.exports = extendFlat({
249079
- x: histogram2dAttrs.x,
249080
- y: histogram2dAttrs.y,
249081
- z: histogram2dAttrs.z,
249082
- marker: histogram2dAttrs.marker,
249083
-
249084
- histnorm: histogram2dAttrs.histnorm,
249085
- histfunc: histogram2dAttrs.histfunc,
249086
- nbinsx: histogram2dAttrs.nbinsx,
249087
- xbins: histogram2dAttrs.xbins,
249088
- nbinsy: histogram2dAttrs.nbinsy,
249089
- ybins: histogram2dAttrs.ybins,
249090
- autobinx: histogram2dAttrs.autobinx,
249091
- autobiny: histogram2dAttrs.autobiny,
249092
-
249093
- bingroup: histogram2dAttrs.bingroup,
249094
- xbingroup: histogram2dAttrs.xbingroup,
249095
- ybingroup: histogram2dAttrs.ybingroup,
249096
-
249097
- autocontour: contourAttrs.autocontour,
249098
- ncontours: contourAttrs.ncontours,
249099
- contours: contourAttrs.contours,
249100
- line: {
249101
- color: contourAttrs.line.color,
249102
- width: extendFlat({}, contourAttrs.line.width, {
249103
- dflt: 0.5,
249104
- description: 'Sets the contour line width in (in px)'
249105
- }),
249106
- dash: contourAttrs.line.dash,
249107
- smoothing: contourAttrs.line.smoothing,
249108
- editType: 'plot'
249109
- },
249110
- xhoverformat: axisHoverFormat('x'),
249111
- yhoverformat: axisHoverFormat('y'),
249112
- zhoverformat: axisHoverFormat('z', 1),
249113
- hovertemplate: histogram2dAttrs.hovertemplate,
249114
- texttemplate: contourAttrs.texttemplate,
249115
- textfont: contourAttrs.textfont
249116
- },
249117
- colorScaleAttrs('', {
249118
- cLetter: 'z',
249119
- editTypeOverride: 'calc'
249120
- })
249121
- );
249122
-
249123
-
249124
- /***/ }),
249125
-
249126
- /***/ 14319:
249127
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249128
-
249129
-
249130
-
249131
- var Lib = __webpack_require__(30991);
249132
-
249133
- var handleSampleDefaults = __webpack_require__(6236);
249134
- var handleContoursDefaults = __webpack_require__(657);
249135
- var handleStyleDefaults = __webpack_require__(74619);
249136
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
249137
- var attributes = __webpack_require__(34872);
249138
-
249139
-
249140
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
249141
- function coerce(attr, dflt) {
249142
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
249143
- }
249144
-
249145
- function coerce2(attr) {
249146
- return Lib.coerce2(traceIn, traceOut, attributes, attr);
249147
- }
249148
-
249149
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
249150
- if(traceOut.visible === false) return;
249151
-
249152
- handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
249153
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
249154
- coerce('xhoverformat');
249155
- coerce('yhoverformat');
249156
- coerce('hovertemplate');
249157
- if(
249158
- traceOut.contours &&
249159
- traceOut.contours.coloring === 'heatmap'
249160
- ) {
249161
- handleHeatmapLabelDefaults(coerce, layout);
249162
- }
249163
- };
249164
-
249165
-
249166
- /***/ }),
249167
-
249168
- /***/ 60613:
249169
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249170
-
249171
-
249172
-
249173
- module.exports = {
249174
- attributes: __webpack_require__(34872),
249175
- supplyDefaults: __webpack_require__(14319),
249176
- crossTraceDefaults: __webpack_require__(34294),
249177
- calc: __webpack_require__(3274),
249178
- plot: (__webpack_require__(32664).plot),
249179
- layerName: 'contourlayer',
249180
- style: __webpack_require__(72690),
249181
- colorbar: __webpack_require__(70307),
249182
- hoverPoints: __webpack_require__(52353),
249183
-
249184
- moduleType: 'trace',
249185
- name: 'histogram2dcontour',
249186
- basePlotModule: __webpack_require__(47885),
249187
- categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
249188
- meta: {
249189
- hrName: 'histogram_2d_contour',
249190
- description: [
249191
- 'The sample data from which statistics are computed is set in `x`',
249192
- 'and `y` (where `x` and `y` represent marginal distributions,',
249193
- 'binning is set in `xbins` and `ybins` in this case)',
249194
- 'or `z` (where `z` represent the 2D distribution and binning set,',
249195
- 'binning is set by `x` and `y` in this case).',
249196
- 'The resulting distribution is visualized as a contour plot.'
249197
- ].join(' ')
249198
- }
249199
- };
249200
-
249201
-
249202
248615
  /***/ }),
249203
248616
 
249204
248617
  /***/ 71250:
@@ -250907,6 +250320,595 @@ module.exports = {
250907
250320
  };
250908
250321
 
250909
250322
 
250323
+ /***/ }),
250324
+
250325
+ /***/ 42124:
250326
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250327
+
250328
+
250329
+
250330
+ var histogramAttrs = __webpack_require__(71250);
250331
+ var makeBinAttrs = __webpack_require__(9284);
250332
+ var heatmapAttrs = __webpack_require__(68300);
250333
+ var baseAttrs = __webpack_require__(35667);
250334
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
250335
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
250336
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
250337
+ var colorScaleAttrs = __webpack_require__(17957);
250338
+
250339
+ var extendFlat = (__webpack_require__(91307).extendFlat);
250340
+
250341
+ module.exports = extendFlat(
250342
+ {
250343
+ x: histogramAttrs.x,
250344
+ y: histogramAttrs.y,
250345
+
250346
+ z: {
250347
+ valType: 'data_array',
250348
+ editType: 'calc',
250349
+ description: 'Sets the aggregation data.'
250350
+ },
250351
+ marker: {
250352
+ color: {
250353
+ valType: 'data_array',
250354
+ editType: 'calc',
250355
+ description: 'Sets the aggregation data.'
250356
+ },
250357
+ editType: 'calc'
250358
+ },
250359
+
250360
+ histnorm: histogramAttrs.histnorm,
250361
+ histfunc: histogramAttrs.histfunc,
250362
+ nbinsx: histogramAttrs.nbinsx,
250363
+ xbins: makeBinAttrs('x'),
250364
+ nbinsy: histogramAttrs.nbinsy,
250365
+ ybins: makeBinAttrs('y'),
250366
+ autobinx: histogramAttrs.autobinx,
250367
+ autobiny: histogramAttrs.autobiny,
250368
+
250369
+ bingroup: extendFlat({}, histogramAttrs.bingroup, {
250370
+ description: [
250371
+ 'Set the `xbingroup` and `ybingroup` default prefix',
250372
+ 'For example, setting a `bingroup` of *1* on two histogram2d traces',
250373
+ 'will make them their x-bins and y-bins match separately.'
250374
+ ].join(' ')
250375
+ }),
250376
+ xbingroup: extendFlat({}, histogramAttrs.bingroup, {
250377
+ description: [
250378
+ 'Set a group of histogram traces which will have compatible x-bin settings.',
250379
+ 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
250380
+ '(on axes of the same axis type) can have compatible x-bin settings.',
250381
+ 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
250382
+ ].join(' ')
250383
+ }),
250384
+ ybingroup: extendFlat({}, histogramAttrs.bingroup, {
250385
+ description: [
250386
+ 'Set a group of histogram traces which will have compatible y-bin settings.',
250387
+ 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
250388
+ '(on axes of the same axis type) can have compatible y-bin settings.',
250389
+ 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
250390
+ ].join(' ')
250391
+ }),
250392
+
250393
+ xgap: heatmapAttrs.xgap,
250394
+ ygap: heatmapAttrs.ygap,
250395
+ zsmooth: heatmapAttrs.zsmooth,
250396
+ xhoverformat: axisHoverFormat('x'),
250397
+ yhoverformat: axisHoverFormat('y'),
250398
+ zhoverformat: axisHoverFormat('z', 1),
250399
+ hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
250400
+ texttemplate: texttemplateAttrs({
250401
+ arrayOk: false,
250402
+ editType: 'plot'
250403
+ }, {
250404
+ keys: 'z'
250405
+ }),
250406
+ textfont: heatmapAttrs.textfont,
250407
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
250408
+ },
250409
+ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
250410
+ );
250411
+
250412
+
250413
+ /***/ }),
250414
+
250415
+ /***/ 32492:
250416
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250417
+
250418
+
250419
+
250420
+ var Lib = __webpack_require__(30991);
250421
+ var Axes = __webpack_require__(15076);
250422
+
250423
+ var binFunctions = __webpack_require__(47260);
250424
+ var normFunctions = __webpack_require__(855);
250425
+ var doAvg = __webpack_require__(26756);
250426
+ var getBinSpanLabelRound = __webpack_require__(41574);
250427
+ var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
250428
+
250429
+ module.exports = function calc(gd, trace) {
250430
+ var xa = Axes.getFromId(gd, trace.xaxis);
250431
+ var ya = Axes.getFromId(gd, trace.yaxis);
250432
+
250433
+ var xcalendar = trace.xcalendar;
250434
+ var ycalendar = trace.ycalendar;
250435
+ var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
250436
+ var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
250437
+ var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
250438
+ var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
250439
+
250440
+ var i, j, n, m;
250441
+
250442
+ // calculate the bins
250443
+ var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
250444
+ var xBinSpec = xBinsAndPos[0];
250445
+ var xPos0 = xBinsAndPos[1];
250446
+ var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
250447
+ var yBinSpec = yBinsAndPos[0];
250448
+ var yPos0 = yBinsAndPos[1];
250449
+
250450
+ var serieslen = trace._length;
250451
+ if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
250452
+ if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
250453
+
250454
+ // make the empty bin array & scale the map
250455
+ var z = [];
250456
+ var onecol = [];
250457
+ var zerocol = [];
250458
+ var nonuniformBinsX = typeof xBinSpec.size === 'string';
250459
+ var nonuniformBinsY = typeof yBinSpec.size === 'string';
250460
+ var xEdges = [];
250461
+ var yEdges = [];
250462
+ var xbins = nonuniformBinsX ? xEdges : xBinSpec;
250463
+ var ybins = nonuniformBinsY ? yEdges : yBinSpec;
250464
+ var total = 0;
250465
+ var counts = [];
250466
+ var inputPoints = [];
250467
+ var norm = trace.histnorm;
250468
+ var func = trace.histfunc;
250469
+ var densitynorm = norm.indexOf('density') !== -1;
250470
+ var extremefunc = func === 'max' || func === 'min';
250471
+ var sizeinit = extremefunc ? null : 0;
250472
+ var binfunc = binFunctions.count;
250473
+ var normfunc = normFunctions[norm];
250474
+ var doavg = false;
250475
+ var xinc = [];
250476
+ var yinc = [];
250477
+
250478
+ // set a binning function other than count?
250479
+ // for binning functions: check first for 'z',
250480
+ // then 'mc' in case we had a colored scatter plot
250481
+ // and want to transfer these colors to the 2D histo
250482
+ // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
250483
+ var rawCounterData = ('z' in trace) ?
250484
+ trace.z :
250485
+ (('marker' in trace && Array.isArray(trace.marker.color)) ?
250486
+ trace.marker.color : '');
250487
+ if(rawCounterData && func !== 'count') {
250488
+ doavg = func === 'avg';
250489
+ binfunc = binFunctions[func];
250490
+ }
250491
+
250492
+ // decrease end a little in case of rounding errors
250493
+ var xBinSize = xBinSpec.size;
250494
+ var xBinStart = xr2c(xBinSpec.start);
250495
+ var xBinEnd = xr2c(xBinSpec.end) +
250496
+ (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
250497
+
250498
+ for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
250499
+ onecol.push(sizeinit);
250500
+ xEdges.push(i);
250501
+ if(doavg) zerocol.push(0);
250502
+ }
250503
+ xEdges.push(i);
250504
+
250505
+ var nx = onecol.length;
250506
+ var dx = (i - xBinStart) / nx;
250507
+ var x0 = xc2r(xBinStart + dx / 2);
250508
+
250509
+ var yBinSize = yBinSpec.size;
250510
+ var yBinStart = yr2c(yBinSpec.start);
250511
+ var yBinEnd = yr2c(yBinSpec.end) +
250512
+ (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
250513
+
250514
+ for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
250515
+ z.push(onecol.slice());
250516
+ yEdges.push(i);
250517
+ var ipCol = new Array(nx);
250518
+ for(j = 0; j < nx; j++) ipCol[j] = [];
250519
+ inputPoints.push(ipCol);
250520
+ if(doavg) counts.push(zerocol.slice());
250521
+ }
250522
+ yEdges.push(i);
250523
+
250524
+ var ny = z.length;
250525
+ var dy = (i - yBinStart) / ny;
250526
+ var y0 = yc2r(yBinStart + dy / 2);
250527
+
250528
+ if(densitynorm) {
250529
+ xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
250530
+ yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
250531
+ }
250532
+
250533
+ // for date axes we need bin bounds to be calcdata. For nonuniform bins
250534
+ // we already have this, but uniform with start/end/size they're still strings.
250535
+ if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
250536
+ if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
250537
+
250538
+ // put data into bins
250539
+ var uniqueValsPerX = true;
250540
+ var uniqueValsPerY = true;
250541
+ var xVals = new Array(nx);
250542
+ var yVals = new Array(ny);
250543
+ var xGapLow = Infinity;
250544
+ var xGapHigh = Infinity;
250545
+ var yGapLow = Infinity;
250546
+ var yGapHigh = Infinity;
250547
+ for(i = 0; i < serieslen; i++) {
250548
+ var xi = xPos0[i];
250549
+ var yi = yPos0[i];
250550
+ n = Lib.findBin(xi, xbins);
250551
+ m = Lib.findBin(yi, ybins);
250552
+ if(n >= 0 && n < nx && m >= 0 && m < ny) {
250553
+ total += binfunc(n, i, z[m], rawCounterData, counts[m]);
250554
+ inputPoints[m][n].push(i);
250555
+
250556
+ if(uniqueValsPerX) {
250557
+ if(xVals[n] === undefined) xVals[n] = xi;
250558
+ else if(xVals[n] !== xi) uniqueValsPerX = false;
250559
+ }
250560
+ if(uniqueValsPerY) {
250561
+ if(yVals[m] === undefined) yVals[m] = yi;
250562
+ else if(yVals[m] !== yi) uniqueValsPerY = false;
250563
+ }
250564
+
250565
+ xGapLow = Math.min(xGapLow, xi - xEdges[n]);
250566
+ xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
250567
+ yGapLow = Math.min(yGapLow, yi - yEdges[m]);
250568
+ yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
250569
+ }
250570
+ }
250571
+ // normalize, if needed
250572
+ if(doavg) {
250573
+ for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
250574
+ }
250575
+ if(normfunc) {
250576
+ for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
250577
+ }
250578
+
250579
+ return {
250580
+ x: xPos0,
250581
+ xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
250582
+ x0: x0,
250583
+ dx: dx,
250584
+ y: yPos0,
250585
+ yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
250586
+ y0: y0,
250587
+ dy: dy,
250588
+ z: z,
250589
+ pts: inputPoints
250590
+ };
250591
+ };
250592
+
250593
+ function makeIncrements(len, bins, dv, nonuniform) {
250594
+ var out = new Array(len);
250595
+ var i;
250596
+ if(nonuniform) {
250597
+ for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
250598
+ } else {
250599
+ var inc = 1 / dv;
250600
+ for(i = 0; i < len; i++) out[i] = inc;
250601
+ }
250602
+ return out;
250603
+ }
250604
+
250605
+ function binsToCalc(r2c, bins) {
250606
+ return {
250607
+ start: r2c(bins.start),
250608
+ end: r2c(bins.end),
250609
+ size: bins.size
250610
+ };
250611
+ }
250612
+
250613
+ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
250614
+ var i;
250615
+ var len = edges.length - 1;
250616
+ var out = new Array(len);
250617
+ var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
250618
+
250619
+ for(i = 0; i < len; i++) {
250620
+ var v = (uniqueVals || [])[i];
250621
+ out[i] = v === undefined ?
250622
+ [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
250623
+ [v, v];
250624
+ }
250625
+ return out;
250626
+ }
250627
+
250628
+
250629
+ /***/ }),
250630
+
250631
+ /***/ 15611:
250632
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250633
+
250634
+
250635
+
250636
+ var Lib = __webpack_require__(30991);
250637
+
250638
+ var handleSampleDefaults = __webpack_require__(6236);
250639
+ var handleStyleDefaults = __webpack_require__(25157);
250640
+ var colorscaleDefaults = __webpack_require__(13682);
250641
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
250642
+ var attributes = __webpack_require__(42124);
250643
+
250644
+
250645
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
250646
+ function coerce(attr, dflt) {
250647
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
250648
+ }
250649
+
250650
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
250651
+ if(traceOut.visible === false) return;
250652
+
250653
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
250654
+ colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
250655
+ coerce('hovertemplate');
250656
+
250657
+ handleHeatmapLabelDefaults(coerce, layout);
250658
+
250659
+ coerce('xhoverformat');
250660
+ coerce('yhoverformat');
250661
+ };
250662
+
250663
+
250664
+ /***/ }),
250665
+
250666
+ /***/ 94587:
250667
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250668
+
250669
+
250670
+
250671
+ var heatmapHover = __webpack_require__(85243);
250672
+ var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
250673
+
250674
+ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
250675
+ var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
250676
+
250677
+ if(!pts) return;
250678
+
250679
+ pointData = pts[0];
250680
+ var indices = pointData.index;
250681
+ var ny = indices[0];
250682
+ var nx = indices[1];
250683
+ var cd0 = pointData.cd[0];
250684
+ var trace = cd0.trace;
250685
+ var xRange = cd0.xRanges[nx];
250686
+ var yRange = cd0.yRanges[ny];
250687
+
250688
+ pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
250689
+ pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
250690
+
250691
+ return pts;
250692
+ };
250693
+
250694
+
250695
+ /***/ }),
250696
+
250697
+ /***/ 3617:
250698
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250699
+
250700
+
250701
+
250702
+ module.exports = {
250703
+ attributes: __webpack_require__(42124),
250704
+ supplyDefaults: __webpack_require__(15611),
250705
+ crossTraceDefaults: __webpack_require__(34294),
250706
+ calc: __webpack_require__(91980),
250707
+ plot: __webpack_require__(29406),
250708
+ layerName: 'heatmaplayer',
250709
+ colorbar: __webpack_require__(90165),
250710
+ style: __webpack_require__(58756),
250711
+ hoverPoints: __webpack_require__(94587),
250712
+ eventData: __webpack_require__(63870),
250713
+
250714
+ moduleType: 'trace',
250715
+ name: 'histogram2d',
250716
+ basePlotModule: __webpack_require__(47885),
250717
+ categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
250718
+ meta: {
250719
+ hrName: 'histogram_2d',
250720
+ description: [
250721
+ 'The sample data from which statistics are computed is set in `x`',
250722
+ 'and `y` (where `x` and `y` represent marginal distributions,',
250723
+ 'binning is set in `xbins` and `ybins` in this case)',
250724
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
250725
+ 'binning is set by `x` and `y` in this case).',
250726
+ 'The resulting distribution is visualized as a heatmap.'
250727
+ ].join(' ')
250728
+ }
250729
+ };
250730
+
250731
+
250732
+ /***/ }),
250733
+
250734
+ /***/ 6236:
250735
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250736
+
250737
+
250738
+
250739
+ var Registry = __webpack_require__(13936);
250740
+ var Lib = __webpack_require__(30991);
250741
+
250742
+ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
250743
+ var x = coerce('x');
250744
+ var y = coerce('y');
250745
+ var xlen = Lib.minRowLength(x);
250746
+ var ylen = Lib.minRowLength(y);
250747
+
250748
+ // we could try to accept x0 and dx, etc...
250749
+ // but that's a pretty weird use case.
250750
+ // for now require both x and y explicitly specified.
250751
+ if(!xlen || !ylen) {
250752
+ traceOut.visible = false;
250753
+ return;
250754
+ }
250755
+
250756
+ traceOut._length = Math.min(xlen, ylen);
250757
+
250758
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
250759
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
250760
+
250761
+ // if marker.color is an array, we can use it in aggregation instead of z
250762
+ var hasAggregationData = coerce('z') || coerce('marker.color');
250763
+
250764
+ if(hasAggregationData) coerce('histfunc');
250765
+ coerce('histnorm');
250766
+
250767
+ // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
250768
+ // autobin(x|y) are only included here to appease Plotly.validate
250769
+ coerce('autobinx');
250770
+ coerce('autobiny');
250771
+ };
250772
+
250773
+
250774
+ /***/ }),
250775
+
250776
+ /***/ 34872:
250777
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250778
+
250779
+
250780
+
250781
+ var histogram2dAttrs = __webpack_require__(42124);
250782
+ var contourAttrs = __webpack_require__(70318);
250783
+ var colorScaleAttrs = __webpack_require__(17957);
250784
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
250785
+
250786
+ var extendFlat = (__webpack_require__(91307).extendFlat);
250787
+
250788
+ module.exports = extendFlat({
250789
+ x: histogram2dAttrs.x,
250790
+ y: histogram2dAttrs.y,
250791
+ z: histogram2dAttrs.z,
250792
+ marker: histogram2dAttrs.marker,
250793
+
250794
+ histnorm: histogram2dAttrs.histnorm,
250795
+ histfunc: histogram2dAttrs.histfunc,
250796
+ nbinsx: histogram2dAttrs.nbinsx,
250797
+ xbins: histogram2dAttrs.xbins,
250798
+ nbinsy: histogram2dAttrs.nbinsy,
250799
+ ybins: histogram2dAttrs.ybins,
250800
+ autobinx: histogram2dAttrs.autobinx,
250801
+ autobiny: histogram2dAttrs.autobiny,
250802
+
250803
+ bingroup: histogram2dAttrs.bingroup,
250804
+ xbingroup: histogram2dAttrs.xbingroup,
250805
+ ybingroup: histogram2dAttrs.ybingroup,
250806
+
250807
+ autocontour: contourAttrs.autocontour,
250808
+ ncontours: contourAttrs.ncontours,
250809
+ contours: contourAttrs.contours,
250810
+ line: {
250811
+ color: contourAttrs.line.color,
250812
+ width: extendFlat({}, contourAttrs.line.width, {
250813
+ dflt: 0.5,
250814
+ description: 'Sets the contour line width in (in px)'
250815
+ }),
250816
+ dash: contourAttrs.line.dash,
250817
+ smoothing: contourAttrs.line.smoothing,
250818
+ editType: 'plot'
250819
+ },
250820
+ xhoverformat: axisHoverFormat('x'),
250821
+ yhoverformat: axisHoverFormat('y'),
250822
+ zhoverformat: axisHoverFormat('z', 1),
250823
+ hovertemplate: histogram2dAttrs.hovertemplate,
250824
+ texttemplate: contourAttrs.texttemplate,
250825
+ textfont: contourAttrs.textfont
250826
+ },
250827
+ colorScaleAttrs('', {
250828
+ cLetter: 'z',
250829
+ editTypeOverride: 'calc'
250830
+ })
250831
+ );
250832
+
250833
+
250834
+ /***/ }),
250835
+
250836
+ /***/ 14319:
250837
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250838
+
250839
+
250840
+
250841
+ var Lib = __webpack_require__(30991);
250842
+
250843
+ var handleSampleDefaults = __webpack_require__(6236);
250844
+ var handleContoursDefaults = __webpack_require__(657);
250845
+ var handleStyleDefaults = __webpack_require__(74619);
250846
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
250847
+ var attributes = __webpack_require__(34872);
250848
+
250849
+
250850
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
250851
+ function coerce(attr, dflt) {
250852
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
250853
+ }
250854
+
250855
+ function coerce2(attr) {
250856
+ return Lib.coerce2(traceIn, traceOut, attributes, attr);
250857
+ }
250858
+
250859
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
250860
+ if(traceOut.visible === false) return;
250861
+
250862
+ handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
250863
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
250864
+ coerce('xhoverformat');
250865
+ coerce('yhoverformat');
250866
+ coerce('hovertemplate');
250867
+ if(
250868
+ traceOut.contours &&
250869
+ traceOut.contours.coloring === 'heatmap'
250870
+ ) {
250871
+ handleHeatmapLabelDefaults(coerce, layout);
250872
+ }
250873
+ };
250874
+
250875
+
250876
+ /***/ }),
250877
+
250878
+ /***/ 60613:
250879
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250880
+
250881
+
250882
+
250883
+ module.exports = {
250884
+ attributes: __webpack_require__(34872),
250885
+ supplyDefaults: __webpack_require__(14319),
250886
+ crossTraceDefaults: __webpack_require__(34294),
250887
+ calc: __webpack_require__(3274),
250888
+ plot: (__webpack_require__(32664).plot),
250889
+ layerName: 'contourlayer',
250890
+ style: __webpack_require__(72690),
250891
+ colorbar: __webpack_require__(70307),
250892
+ hoverPoints: __webpack_require__(52353),
250893
+
250894
+ moduleType: 'trace',
250895
+ name: 'histogram2dcontour',
250896
+ basePlotModule: __webpack_require__(47885),
250897
+ categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
250898
+ meta: {
250899
+ hrName: 'histogram_2d_contour',
250900
+ description: [
250901
+ 'The sample data from which statistics are computed is set in `x`',
250902
+ 'and `y` (where `x` and `y` represent marginal distributions,',
250903
+ 'binning is set in `xbins` and `ybins` in this case)',
250904
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
250905
+ 'binning is set by `x` and `y` in this case).',
250906
+ 'The resulting distribution is visualized as a contour plot.'
250907
+ ].join(' ')
250908
+ }
250909
+ };
250910
+
250911
+
250910
250912
  /***/ }),
250911
250913
 
250912
250914
  /***/ 48223:
@@ -267096,993 +267098,6 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
267096
267098
  };
267097
267099
 
267098
267100
 
267099
- /***/ }),
267100
-
267101
- /***/ 1015:
267102
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267103
-
267104
-
267105
-
267106
- var scatterAttrs = __webpack_require__(86854);
267107
- var fontAttrs = __webpack_require__(70827);
267108
- var colorAttributes = __webpack_require__(17957);
267109
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
267110
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
267111
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
267112
- var baseAttrs = __webpack_require__(35667);
267113
- var DASHES = __webpack_require__(68828);
267114
-
267115
- var MARKER_SYMBOLS = __webpack_require__(98993);
267116
- var extendFlat = (__webpack_require__(91307).extendFlat);
267117
- var overrideAll = (__webpack_require__(70756).overrideAll);
267118
- var sortObjectKeys = __webpack_require__(99124);
267119
-
267120
- var scatterLineAttrs = scatterAttrs.line;
267121
- var scatterMarkerAttrs = scatterAttrs.marker;
267122
- var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
267123
-
267124
- var lineAttrs = extendFlat({
267125
- width: scatterLineAttrs.width,
267126
- dash: {
267127
- valType: 'enumerated',
267128
- values: sortObjectKeys(DASHES),
267129
- dflt: 'solid',
267130
- description: 'Sets the dash style of the lines.'
267131
- }
267132
- }, colorAttributes('line'));
267133
-
267134
- function makeProjectionAttr(axLetter) {
267135
- return {
267136
- show: {
267137
- valType: 'boolean',
267138
- dflt: false,
267139
- description: [
267140
- 'Sets whether or not projections are shown along the',
267141
- axLetter, 'axis.'
267142
- ].join(' ')
267143
- },
267144
- opacity: {
267145
- valType: 'number',
267146
- min: 0,
267147
- max: 1,
267148
- dflt: 1,
267149
- description: 'Sets the projection color.'
267150
- },
267151
- scale: {
267152
- valType: 'number',
267153
- min: 0,
267154
- max: 10,
267155
- dflt: 2 / 3,
267156
- description: [
267157
- 'Sets the scale factor determining the size of the',
267158
- 'projection marker points.'
267159
- ].join(' ')
267160
- }
267161
- };
267162
- }
267163
-
267164
- var attrs = module.exports = overrideAll({
267165
- x: scatterAttrs.x,
267166
- y: scatterAttrs.y,
267167
- z: {
267168
- valType: 'data_array',
267169
- description: 'Sets the z coordinates.'
267170
- },
267171
-
267172
- text: extendFlat({}, scatterAttrs.text, {
267173
- description: [
267174
- 'Sets text elements associated with each (x,y,z) triplet.',
267175
- 'If a single string, the same string appears over',
267176
- 'all the data points.',
267177
- 'If an array of string, the items are mapped in order to the',
267178
- 'this trace\'s (x,y,z) coordinates.',
267179
- 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
267180
- 'these elements will be seen in the hover labels.'
267181
- ].join(' ')
267182
- }),
267183
- texttemplate: texttemplateAttrs({}, {
267184
-
267185
- }),
267186
- hovertext: extendFlat({}, scatterAttrs.hovertext, {
267187
- description: [
267188
- 'Sets text elements associated with each (x,y,z) triplet.',
267189
- 'If a single string, the same string appears over',
267190
- 'all the data points.',
267191
- 'If an array of string, the items are mapped in order to the',
267192
- 'this trace\'s (x,y,z) coordinates.',
267193
- 'To be seen, trace `hoverinfo` must contain a *text* flag.'
267194
- ].join(' ')
267195
- }),
267196
- hovertemplate: hovertemplateAttrs(),
267197
-
267198
- xhoverformat: axisHoverFormat('x'),
267199
- yhoverformat: axisHoverFormat('y'),
267200
- zhoverformat: axisHoverFormat('z'),
267201
-
267202
- mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
267203
- {dflt: 'lines+markers'}),
267204
- surfaceaxis: {
267205
- valType: 'enumerated',
267206
- values: [-1, 0, 1, 2],
267207
- dflt: -1,
267208
- description: [
267209
- 'If *-1*, the scatter points are not fill with a surface',
267210
- 'If *0*, *1*, *2*, the scatter points are filled with',
267211
- 'a Delaunay surface about the x, y, z respectively.'
267212
- ].join(' ')
267213
- },
267214
- surfacecolor: {
267215
- valType: 'color',
267216
- description: 'Sets the surface fill color.'
267217
- },
267218
- projection: {
267219
- x: makeProjectionAttr('x'),
267220
- y: makeProjectionAttr('y'),
267221
- z: makeProjectionAttr('z')
267222
- },
267223
-
267224
- connectgaps: scatterAttrs.connectgaps,
267225
- line: lineAttrs,
267226
-
267227
- marker: extendFlat({ // Parity with scatter.js?
267228
- symbol: {
267229
- valType: 'enumerated',
267230
- values: sortObjectKeys(MARKER_SYMBOLS),
267231
- dflt: 'circle',
267232
- arrayOk: true,
267233
- description: 'Sets the marker symbol type.'
267234
- },
267235
- size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
267236
- sizeref: scatterMarkerAttrs.sizeref,
267237
- sizemin: scatterMarkerAttrs.sizemin,
267238
- sizemode: scatterMarkerAttrs.sizemode,
267239
- opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
267240
- arrayOk: false,
267241
- description: [
267242
- 'Sets the marker opacity.',
267243
- 'Note that the marker opacity for scatter3d traces',
267244
- 'must be a scalar value for performance reasons.',
267245
- 'To set a blending opacity value',
267246
- '(i.e. which is not transparent), set *marker.color*',
267247
- 'to an rgba color and use its alpha channel.'
267248
- ].join(' ')
267249
- }),
267250
- colorbar: scatterMarkerAttrs.colorbar,
267251
-
267252
- line: extendFlat({
267253
- width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
267254
- },
267255
- colorAttributes('marker.line')
267256
- )
267257
- },
267258
- colorAttributes('marker')
267259
- ),
267260
-
267261
- textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
267262
- textfont: fontAttrs({
267263
- noFontShadow: true,
267264
- noFontLineposition: true,
267265
- noFontTextcase: true,
267266
- editType: 'calc',
267267
- colorEditType: 'style',
267268
- arrayOk: true,
267269
- variantValues: ['normal', 'small-caps'],
267270
- description: 'Sets the text font.'
267271
- }),
267272
-
267273
- opacity: baseAttrs.opacity,
267274
-
267275
- hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
267276
- }, 'calc', 'nested');
267277
-
267278
- attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
267279
-
267280
-
267281
- /***/ }),
267282
-
267283
- /***/ 30935:
267284
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267285
-
267286
-
267287
-
267288
- var arraysToCalcdata = __webpack_require__(47213);
267289
- var calcColorscale = __webpack_require__(59498);
267290
-
267291
- /**
267292
- * This is a kludge to put the array attributes into
267293
- * calcdata the way Scatter.plot does, so that legends and
267294
- * popovers know what to do with them.
267295
- */
267296
- module.exports = function calc(gd, trace) {
267297
- var cd = [{x: false, y: false, trace: trace, t: {}}];
267298
-
267299
- arraysToCalcdata(cd, trace);
267300
- calcColorscale(gd, trace);
267301
-
267302
- return cd;
267303
- };
267304
-
267305
-
267306
- /***/ }),
267307
-
267308
- /***/ 77681:
267309
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267310
-
267311
-
267312
-
267313
- var Registry = __webpack_require__(13936);
267314
-
267315
- function calculateAxisErrors(data, params, scaleFactor, axis) {
267316
- if(!params || !params.visible) return null;
267317
-
267318
- var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
267319
- var result = new Array(data.length);
267320
-
267321
- for(var i = 0; i < data.length; i++) {
267322
- var errors = computeError(+data[i], i);
267323
-
267324
- if(axis.type === 'log') {
267325
- var point = axis.c2l(data[i]);
267326
- var min = data[i] - errors[0];
267327
- var max = data[i] + errors[1];
267328
-
267329
- result[i] = [
267330
- (axis.c2l(min, true) - point) * scaleFactor,
267331
- (axis.c2l(max, true) - point) * scaleFactor
267332
- ];
267333
-
267334
- // Keep track of the lower error bound which isn't negative!
267335
- if(min > 0) {
267336
- var lower = axis.c2l(min);
267337
- if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
267338
- axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
267339
- }
267340
- } else {
267341
- result[i] = [
267342
- -errors[0] * scaleFactor,
267343
- errors[1] * scaleFactor
267344
- ];
267345
- }
267346
- }
267347
-
267348
- return result;
267349
- }
267350
-
267351
- function dataLength(array) {
267352
- for(var i = 0; i < array.length; i++) {
267353
- if(array[i]) return array[i].length;
267354
- }
267355
- return 0;
267356
- }
267357
-
267358
- function calculateErrors(data, scaleFactor, sceneLayout) {
267359
- var errors = [
267360
- calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
267361
- calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
267362
- calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
267363
- ];
267364
-
267365
- var n = dataLength(errors);
267366
- if(n === 0) return null;
267367
-
267368
- var errorBounds = new Array(n);
267369
-
267370
- for(var i = 0; i < n; i++) {
267371
- var bound = [[0, 0, 0], [0, 0, 0]];
267372
-
267373
- for(var j = 0; j < 3; j++) {
267374
- if(errors[j]) {
267375
- for(var k = 0; k < 2; k++) {
267376
- bound[k][j] = errors[j][i][k];
267377
- }
267378
- }
267379
- }
267380
-
267381
- errorBounds[i] = bound;
267382
- }
267383
-
267384
- return errorBounds;
267385
- }
267386
-
267387
- module.exports = calculateErrors;
267388
-
267389
-
267390
- /***/ }),
267391
-
267392
- /***/ 93219:
267393
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267394
-
267395
-
267396
-
267397
- var createLinePlot = (__webpack_require__(46000).gl_line3d);
267398
- var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
267399
- var createErrorBars = (__webpack_require__(46000).gl_error3d);
267400
- var createMesh = (__webpack_require__(46000).gl_mesh3d);
267401
- var triangulate = (__webpack_require__(46000).delaunay_triangulate);
267402
-
267403
- var Lib = __webpack_require__(30991);
267404
- var str2RgbaArray = __webpack_require__(44960);
267405
- var formatColor = (__webpack_require__(592).formatColor);
267406
- var makeBubbleSizeFn = __webpack_require__(42581);
267407
- var DASH_PATTERNS = __webpack_require__(68828);
267408
- var MARKER_SYMBOLS = __webpack_require__(98993);
267409
-
267410
- var Axes = __webpack_require__(15076);
267411
- var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
267412
-
267413
- var calculateError = __webpack_require__(77681);
267414
-
267415
- function LineWithMarkers(scene, uid) {
267416
- this.scene = scene;
267417
- this.uid = uid;
267418
- this.linePlot = null;
267419
- this.scatterPlot = null;
267420
- this.errorBars = null;
267421
- this.textMarkers = null;
267422
- this.delaunayMesh = null;
267423
- this.color = null;
267424
- this.mode = '';
267425
- this.dataPoints = [];
267426
- this.axesBounds = [
267427
- [-Infinity, -Infinity, -Infinity],
267428
- [Infinity, Infinity, Infinity]
267429
- ];
267430
- this.textLabels = null;
267431
- this.data = null;
267432
- }
267433
-
267434
- var proto = LineWithMarkers.prototype;
267435
-
267436
- proto.handlePick = function(selection) {
267437
- if(selection.object &&
267438
- (selection.object === this.linePlot ||
267439
- selection.object === this.delaunayMesh ||
267440
- selection.object === this.textMarkers ||
267441
- selection.object === this.scatterPlot)
267442
- ) {
267443
- var ind = selection.index = selection.data.index;
267444
-
267445
- if(selection.object.highlight) {
267446
- selection.object.highlight(null);
267447
- }
267448
- if(this.scatterPlot) {
267449
- selection.object = this.scatterPlot;
267450
- this.scatterPlot.highlight(selection.data);
267451
- }
267452
-
267453
- selection.textLabel = '';
267454
- if(this.textLabels) {
267455
- if(Lib.isArrayOrTypedArray(this.textLabels)) {
267456
- if(this.textLabels[ind] || this.textLabels[ind] === 0) {
267457
- selection.textLabel = this.textLabels[ind];
267458
- }
267459
- } else {
267460
- selection.textLabel = this.textLabels;
267461
- }
267462
- }
267463
-
267464
- selection.traceCoordinate = [
267465
- this.data.x[ind],
267466
- this.data.y[ind],
267467
- this.data.z[ind]
267468
- ];
267469
-
267470
- return true;
267471
- }
267472
- };
267473
-
267474
- function constructDelaunay(points, color, axis) {
267475
- var u = (axis + 1) % 3;
267476
- var v = (axis + 2) % 3;
267477
- var filteredPoints = [];
267478
- var filteredIds = [];
267479
- var i;
267480
-
267481
- for(i = 0; i < points.length; ++i) {
267482
- var p = points[i];
267483
- if(isNaN(p[u]) || !isFinite(p[u]) ||
267484
- isNaN(p[v]) || !isFinite(p[v])) {
267485
- continue;
267486
- }
267487
- filteredPoints.push([p[u], p[v]]);
267488
- filteredIds.push(i);
267489
- }
267490
- var cells = triangulate(filteredPoints);
267491
- for(i = 0; i < cells.length; ++i) {
267492
- var c = cells[i];
267493
- for(var j = 0; j < c.length; ++j) {
267494
- c[j] = filteredIds[c[j]];
267495
- }
267496
- }
267497
- return {
267498
- positions: points,
267499
- cells: cells,
267500
- meshColor: color
267501
- };
267502
- }
267503
-
267504
- function calculateErrorParams(errors) {
267505
- var capSize = [0.0, 0.0, 0.0];
267506
- var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
267507
- var lineWidth = [1.0, 1.0, 1.0];
267508
-
267509
- for(var i = 0; i < 3; i++) {
267510
- var e = errors[i];
267511
-
267512
- if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
267513
- if(!e || !e.visible) continue;
267514
-
267515
- capSize[i] = e.width / 2; // ballpark rescaling
267516
- color[i] = str2RgbaArray(e.color);
267517
- lineWidth[i] = e.thickness;
267518
- }
267519
-
267520
- return {capSize: capSize, color: color, lineWidth: lineWidth};
267521
- }
267522
-
267523
- function parseAlignmentX(a) {
267524
- if(a === null || a === undefined) return 0;
267525
-
267526
- return (a.indexOf('left') > -1) ? -1 :
267527
- (a.indexOf('right') > -1) ? 1 : 0;
267528
- }
267529
-
267530
- function parseAlignmentY(a) {
267531
- if(a === null || a === undefined) return 0;
267532
-
267533
- return (a.indexOf('top') > -1) ? -1 :
267534
- (a.indexOf('bottom') > -1) ? 1 : 0;
267535
- }
267536
-
267537
- function calculateTextOffset(tp) {
267538
- // Read out text properties
267539
-
267540
- var defaultAlignmentX = 0;
267541
- var defaultAlignmentY = 0;
267542
-
267543
- var textOffset = [
267544
- defaultAlignmentX,
267545
- defaultAlignmentY
267546
- ];
267547
-
267548
- if(Array.isArray(tp)) {
267549
- for(var i = 0; i < tp.length; i++) {
267550
- textOffset[i] = [
267551
- defaultAlignmentX,
267552
- defaultAlignmentY
267553
- ];
267554
- if(tp[i]) {
267555
- textOffset[i][0] = parseAlignmentX(tp[i]);
267556
- textOffset[i][1] = parseAlignmentY(tp[i]);
267557
- }
267558
- }
267559
- } else {
267560
- textOffset[0] = parseAlignmentX(tp);
267561
- textOffset[1] = parseAlignmentY(tp);
267562
- }
267563
-
267564
- return textOffset;
267565
- }
267566
-
267567
-
267568
- function calculateSize(sizeIn, sizeFn) {
267569
- // rough parity with Plotly 2D markers
267570
- return sizeFn(sizeIn * 4);
267571
- }
267572
-
267573
- function calculateSymbol(symbolIn) {
267574
- return MARKER_SYMBOLS[symbolIn];
267575
- }
267576
-
267577
- function formatParam(paramIn, len, calculate, dflt, extraFn) {
267578
- var paramOut = null;
267579
-
267580
- if(Lib.isArrayOrTypedArray(paramIn)) {
267581
- paramOut = [];
267582
-
267583
- for(var i = 0; i < len; i++) {
267584
- if(paramIn[i] === undefined) paramOut[i] = dflt;
267585
- else paramOut[i] = calculate(paramIn[i], extraFn);
267586
- }
267587
- } else paramOut = calculate(paramIn, Lib.identity);
267588
-
267589
- return paramOut;
267590
- }
267591
-
267592
-
267593
- function convertPlotlyOptions(scene, data) {
267594
- var points = [];
267595
- var sceneLayout = scene.fullSceneLayout;
267596
- var scaleFactor = scene.dataScale;
267597
- var xaxis = sceneLayout.xaxis;
267598
- var yaxis = sceneLayout.yaxis;
267599
- var zaxis = sceneLayout.zaxis;
267600
- var marker = data.marker;
267601
- var line = data.line;
267602
- var x = data.x || [];
267603
- var y = data.y || [];
267604
- var z = data.z || [];
267605
- var len = x.length;
267606
- var xcalendar = data.xcalendar;
267607
- var ycalendar = data.ycalendar;
267608
- var zcalendar = data.zcalendar;
267609
- var xc, yc, zc;
267610
- var params, i;
267611
- var text;
267612
-
267613
- // Convert points
267614
- for(i = 0; i < len; i++) {
267615
- // sanitize numbers and apply transforms based on axes.type
267616
- xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
267617
- yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
267618
- zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
267619
-
267620
- points[i] = [xc, yc, zc];
267621
- }
267622
-
267623
- // convert text
267624
- if(Array.isArray(data.text)) {
267625
- text = data.text;
267626
- } else if(Lib.isTypedArray(data.text)) {
267627
- text = Array.from(data.text);
267628
- } else if(data.text !== undefined) {
267629
- text = new Array(len);
267630
- for(i = 0; i < len; i++) text[i] = data.text;
267631
- }
267632
-
267633
- function formatter(axName, val) {
267634
- var ax = sceneLayout[axName];
267635
- return Axes.tickText(ax, ax.d2l(val), true).text;
267636
- }
267637
-
267638
- // check texttemplate
267639
- var texttemplate = data.texttemplate;
267640
- if(texttemplate) {
267641
- var fullLayout = scene.fullLayout;
267642
- var d3locale = fullLayout._d3locale;
267643
- var isArray = Array.isArray(texttemplate);
267644
- var N = isArray ? Math.min(texttemplate.length, len) : len;
267645
- var txt = isArray ?
267646
- function(i) { return texttemplate[i]; } :
267647
- function() { return texttemplate; };
267648
-
267649
- text = new Array(N);
267650
-
267651
- for(i = 0; i < N; i++) {
267652
- var d = {x: x[i], y: y[i], z: z[i]};
267653
- var labels = {
267654
- xLabel: formatter('xaxis', x[i]),
267655
- yLabel: formatter('yaxis', y[i]),
267656
- zLabel: formatter('zaxis', z[i])
267657
- };
267658
- var pointValues = {};
267659
- appendArrayPointValue(pointValues, data, i);
267660
- var meta = data._meta || {};
267661
- text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
267662
- }
267663
- }
267664
-
267665
- // Build object parameters
267666
- params = {
267667
- position: points,
267668
- mode: data.mode,
267669
- text: text
267670
- };
267671
-
267672
- if('line' in data) {
267673
- params.lineColor = formatColor(line, 1, len);
267674
- params.lineWidth = line.width;
267675
- params.lineDashes = line.dash;
267676
- }
267677
-
267678
- if('marker' in data) {
267679
- var sizeFn = makeBubbleSizeFn(data);
267680
-
267681
- params.scatterColor = formatColor(marker, 1, len);
267682
- params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
267683
- params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
267684
- params.scatterLineWidth = marker.line.width; // arrayOk === false
267685
- params.scatterLineColor = formatColor(marker.line, 1, len);
267686
- params.scatterAngle = 0;
267687
- }
267688
-
267689
- if('textposition' in data) {
267690
- params.textOffset = calculateTextOffset(data.textposition);
267691
- params.textColor = formatColor(data.textfont, 1, len);
267692
- params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
267693
- params.textFontFamily = data.textfont.family;
267694
- params.textFontWeight = data.textfont.weight;
267695
- params.textFontStyle = data.textfont.style;
267696
- params.textFontVariant = data.textfont.variant;
267697
- params.textAngle = 0;
267698
- }
267699
-
267700
- var dims = ['x', 'y', 'z'];
267701
- params.project = [false, false, false];
267702
- params.projectScale = [1, 1, 1];
267703
- params.projectOpacity = [1, 1, 1];
267704
- for(i = 0; i < 3; ++i) {
267705
- var projection = data.projection[dims[i]];
267706
- if((params.project[i] = projection.show)) {
267707
- params.projectOpacity[i] = projection.opacity;
267708
- params.projectScale[i] = projection.scale;
267709
- }
267710
- }
267711
-
267712
- params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
267713
-
267714
- var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
267715
- params.errorColor = errorParams.color;
267716
- params.errorLineWidth = errorParams.lineWidth;
267717
- params.errorCapSize = errorParams.capSize;
267718
-
267719
- params.delaunayAxis = data.surfaceaxis;
267720
- params.delaunayColor = str2RgbaArray(data.surfacecolor);
267721
-
267722
- return params;
267723
- }
267724
-
267725
- function _arrayToColor(color) {
267726
- if(Lib.isArrayOrTypedArray(color)) {
267727
- var c = color[0];
267728
-
267729
- if(Lib.isArrayOrTypedArray(c)) color = c;
267730
-
267731
- return 'rgb(' + color.slice(0, 3).map(function(x) {
267732
- return Math.round(x * 255);
267733
- }) + ')';
267734
- }
267735
-
267736
- return null;
267737
- }
267738
-
267739
- function arrayToColor(colors) {
267740
- if(!Lib.isArrayOrTypedArray(colors)) {
267741
- return null;
267742
- }
267743
-
267744
- if((colors.length === 4) && (typeof colors[0] === 'number')) {
267745
- return _arrayToColor(colors);
267746
- }
267747
-
267748
- return colors.map(_arrayToColor);
267749
- }
267750
-
267751
- proto.update = function(data) {
267752
- var gl = this.scene.glplot.gl;
267753
- var lineOptions;
267754
- var scatterOptions;
267755
- var errorOptions;
267756
- var textOptions;
267757
- var dashPattern = DASH_PATTERNS.solid;
267758
-
267759
- // Save data
267760
- this.data = data;
267761
-
267762
- // Run data conversion
267763
- var options = convertPlotlyOptions(this.scene, data);
267764
-
267765
- if('mode' in options) {
267766
- this.mode = options.mode;
267767
- }
267768
- if('lineDashes' in options) {
267769
- if(options.lineDashes in DASH_PATTERNS) {
267770
- dashPattern = DASH_PATTERNS[options.lineDashes];
267771
- }
267772
- }
267773
-
267774
- this.color = arrayToColor(options.scatterColor) ||
267775
- arrayToColor(options.lineColor);
267776
-
267777
- // Save data points
267778
- this.dataPoints = options.position;
267779
-
267780
- lineOptions = {
267781
- gl: this.scene.glplot.gl,
267782
- position: options.position,
267783
- color: options.lineColor,
267784
- lineWidth: options.lineWidth || 1,
267785
- dashes: dashPattern[0],
267786
- dashScale: dashPattern[1],
267787
- opacity: data.opacity,
267788
- connectGaps: data.connectgaps
267789
- };
267790
-
267791
- if(this.mode.indexOf('lines') !== -1) {
267792
- if(this.linePlot) this.linePlot.update(lineOptions);
267793
- else {
267794
- this.linePlot = createLinePlot(lineOptions);
267795
- this.linePlot._trace = this;
267796
- this.scene.glplot.add(this.linePlot);
267797
- }
267798
- } else if(this.linePlot) {
267799
- this.scene.glplot.remove(this.linePlot);
267800
- this.linePlot.dispose();
267801
- this.linePlot = null;
267802
- }
267803
-
267804
- // N.B. marker.opacity must be a scalar for performance
267805
- var scatterOpacity = data.opacity;
267806
- if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
267807
-
267808
- scatterOptions = {
267809
- gl: this.scene.glplot.gl,
267810
- position: options.position,
267811
- color: options.scatterColor,
267812
- size: options.scatterSize,
267813
- glyph: options.scatterMarker,
267814
- opacity: scatterOpacity,
267815
- orthographic: true,
267816
- lineWidth: options.scatterLineWidth,
267817
- lineColor: options.scatterLineColor,
267818
- project: options.project,
267819
- projectScale: options.projectScale,
267820
- projectOpacity: options.projectOpacity
267821
- };
267822
-
267823
- if(this.mode.indexOf('markers') !== -1) {
267824
- if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
267825
- else {
267826
- this.scatterPlot = createScatterPlot(scatterOptions);
267827
- this.scatterPlot._trace = this;
267828
- this.scatterPlot.highlightScale = 1;
267829
- this.scene.glplot.add(this.scatterPlot);
267830
- }
267831
- } else if(this.scatterPlot) {
267832
- this.scene.glplot.remove(this.scatterPlot);
267833
- this.scatterPlot.dispose();
267834
- this.scatterPlot = null;
267835
- }
267836
-
267837
- textOptions = {
267838
- gl: this.scene.glplot.gl,
267839
- position: options.position,
267840
- glyph: options.text,
267841
- color: options.textColor,
267842
- size: options.textSize,
267843
- angle: options.textAngle,
267844
- alignment: options.textOffset,
267845
- font: options.textFontFamily,
267846
- fontWeight: options.textFontWeight,
267847
- fontStyle: options.textFontStyle,
267848
- fontVariant: options.textFontVariant,
267849
- orthographic: true,
267850
- lineWidth: 0,
267851
- project: false,
267852
- opacity: data.opacity
267853
- };
267854
-
267855
- this.textLabels = data.hovertext || data.text;
267856
-
267857
- if(this.mode.indexOf('text') !== -1) {
267858
- if(this.textMarkers) this.textMarkers.update(textOptions);
267859
- else {
267860
- this.textMarkers = createScatterPlot(textOptions);
267861
- this.textMarkers._trace = this;
267862
- this.textMarkers.highlightScale = 1;
267863
- this.scene.glplot.add(this.textMarkers);
267864
- }
267865
- } else if(this.textMarkers) {
267866
- this.scene.glplot.remove(this.textMarkers);
267867
- this.textMarkers.dispose();
267868
- this.textMarkers = null;
267869
- }
267870
-
267871
- errorOptions = {
267872
- gl: this.scene.glplot.gl,
267873
- position: options.position,
267874
- color: options.errorColor,
267875
- error: options.errorBounds,
267876
- lineWidth: options.errorLineWidth,
267877
- capSize: options.errorCapSize,
267878
- opacity: data.opacity
267879
- };
267880
- if(this.errorBars) {
267881
- if(options.errorBounds) {
267882
- this.errorBars.update(errorOptions);
267883
- } else {
267884
- this.scene.glplot.remove(this.errorBars);
267885
- this.errorBars.dispose();
267886
- this.errorBars = null;
267887
- }
267888
- } else if(options.errorBounds) {
267889
- this.errorBars = createErrorBars(errorOptions);
267890
- this.errorBars._trace = this;
267891
- this.scene.glplot.add(this.errorBars);
267892
- }
267893
-
267894
- if(options.delaunayAxis >= 0) {
267895
- var delaunayOptions = constructDelaunay(
267896
- options.position,
267897
- options.delaunayColor,
267898
- options.delaunayAxis
267899
- );
267900
- delaunayOptions.opacity = data.opacity;
267901
-
267902
- if(this.delaunayMesh) {
267903
- this.delaunayMesh.update(delaunayOptions);
267904
- } else {
267905
- delaunayOptions.gl = gl;
267906
- this.delaunayMesh = createMesh(delaunayOptions);
267907
- this.delaunayMesh._trace = this;
267908
- this.scene.glplot.add(this.delaunayMesh);
267909
- }
267910
- } else if(this.delaunayMesh) {
267911
- this.scene.glplot.remove(this.delaunayMesh);
267912
- this.delaunayMesh.dispose();
267913
- this.delaunayMesh = null;
267914
- }
267915
- };
267916
-
267917
- proto.dispose = function() {
267918
- if(this.linePlot) {
267919
- this.scene.glplot.remove(this.linePlot);
267920
- this.linePlot.dispose();
267921
- }
267922
- if(this.scatterPlot) {
267923
- this.scene.glplot.remove(this.scatterPlot);
267924
- this.scatterPlot.dispose();
267925
- }
267926
- if(this.errorBars) {
267927
- this.scene.glplot.remove(this.errorBars);
267928
- this.errorBars.dispose();
267929
- }
267930
- if(this.textMarkers) {
267931
- this.scene.glplot.remove(this.textMarkers);
267932
- this.textMarkers.dispose();
267933
- }
267934
- if(this.delaunayMesh) {
267935
- this.scene.glplot.remove(this.delaunayMesh);
267936
- this.delaunayMesh.dispose();
267937
- }
267938
- };
267939
-
267940
- function createLineWithMarkers(scene, data) {
267941
- var plot = new LineWithMarkers(scene, data.uid);
267942
- plot.update(data);
267943
- return plot;
267944
- }
267945
-
267946
- module.exports = createLineWithMarkers;
267947
-
267948
-
267949
- /***/ }),
267950
-
267951
- /***/ 13744:
267952
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267953
-
267954
-
267955
-
267956
- var Registry = __webpack_require__(13936);
267957
- var Lib = __webpack_require__(30991);
267958
-
267959
- var subTypes = __webpack_require__(33068);
267960
- var handleMarkerDefaults = __webpack_require__(15294);
267961
- var handleLineDefaults = __webpack_require__(82094);
267962
- var handleTextDefaults = __webpack_require__(94729);
267963
-
267964
- var attributes = __webpack_require__(1015);
267965
-
267966
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
267967
- function coerce(attr, dflt) {
267968
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
267969
- }
267970
-
267971
- var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
267972
- if(!len) {
267973
- traceOut.visible = false;
267974
- return;
267975
- }
267976
-
267977
- coerce('text');
267978
- coerce('hovertext');
267979
- coerce('hovertemplate');
267980
- coerce('xhoverformat');
267981
- coerce('yhoverformat');
267982
- coerce('zhoverformat');
267983
-
267984
- coerce('mode');
267985
-
267986
- if(subTypes.hasMarkers(traceOut)) {
267987
- handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
267988
- }
267989
-
267990
- if(subTypes.hasLines(traceOut)) {
267991
- coerce('connectgaps');
267992
- handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
267993
- }
267994
-
267995
- if(subTypes.hasText(traceOut)) {
267996
- coerce('texttemplate');
267997
- handleTextDefaults(traceIn, traceOut, layout, coerce, {
267998
- noSelect: true,
267999
- noFontShadow: true,
268000
- noFontLineposition: true,
268001
- noFontTextcase: true,
268002
- });
268003
- }
268004
-
268005
- var lineColor = (traceOut.line || {}).color;
268006
- var markerColor = (traceOut.marker || {}).color;
268007
- if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
268008
-
268009
- var dims = ['x', 'y', 'z'];
268010
- for(var i = 0; i < 3; ++i) {
268011
- var projection = 'projection.' + dims[i];
268012
- if(coerce(projection + '.show')) {
268013
- coerce(projection + '.opacity');
268014
- coerce(projection + '.scale');
268015
- }
268016
- }
268017
-
268018
- var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
268019
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
268020
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
268021
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
268022
- };
268023
-
268024
- function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
268025
- var len = 0;
268026
- var x = coerce('x');
268027
- var y = coerce('y');
268028
- var z = coerce('z');
268029
-
268030
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
268031
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
268032
-
268033
- if(x && y && z) {
268034
- // TODO: what happens if one is missing?
268035
- len = Math.min(x.length, y.length, z.length);
268036
- traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
268037
- }
268038
-
268039
- return len;
268040
- }
268041
-
268042
-
268043
- /***/ }),
268044
-
268045
- /***/ 68860:
268046
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
268047
-
268048
-
268049
-
268050
- module.exports = {
268051
- plot: __webpack_require__(93219),
268052
- attributes: __webpack_require__(1015),
268053
- markerSymbols: __webpack_require__(98993),
268054
- supplyDefaults: __webpack_require__(13744),
268055
- colorbar: [
268056
- {
268057
- container: 'marker',
268058
- min: 'cmin',
268059
- max: 'cmax'
268060
- }, {
268061
- container: 'line',
268062
- min: 'cmin',
268063
- max: 'cmax'
268064
- }
268065
- ],
268066
- calc: __webpack_require__(30935),
268067
-
268068
- moduleType: 'trace',
268069
- name: 'scatter3d',
268070
- basePlotModule: __webpack_require__(68137),
268071
- categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
268072
- meta: {
268073
- hrName: 'scatter_3d',
268074
- description: [
268075
- 'The data visualized as scatter point or lines in 3D dimension',
268076
- 'is set in `x`, `y`, `z`.',
268077
- 'Text (appearing either on the chart or on hover only) is via `text`.',
268078
- 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
268079
- 'Projections are achieved via `projection`.',
268080
- 'Surface fills are achieved via `surfaceaxis`.'
268081
- ].join(' ')
268082
- }
268083
- };
268084
-
268085
-
268086
267101
  /***/ }),
268087
267102
 
268088
267103
  /***/ 47213:
@@ -272013,6 +271028,993 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
272013
271028
  };
272014
271029
 
272015
271030
 
271031
+ /***/ }),
271032
+
271033
+ /***/ 1015:
271034
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271035
+
271036
+
271037
+
271038
+ var scatterAttrs = __webpack_require__(86854);
271039
+ var fontAttrs = __webpack_require__(70827);
271040
+ var colorAttributes = __webpack_require__(17957);
271041
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
271042
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
271043
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
271044
+ var baseAttrs = __webpack_require__(35667);
271045
+ var DASHES = __webpack_require__(68828);
271046
+
271047
+ var MARKER_SYMBOLS = __webpack_require__(98993);
271048
+ var extendFlat = (__webpack_require__(91307).extendFlat);
271049
+ var overrideAll = (__webpack_require__(70756).overrideAll);
271050
+ var sortObjectKeys = __webpack_require__(99124);
271051
+
271052
+ var scatterLineAttrs = scatterAttrs.line;
271053
+ var scatterMarkerAttrs = scatterAttrs.marker;
271054
+ var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
271055
+
271056
+ var lineAttrs = extendFlat({
271057
+ width: scatterLineAttrs.width,
271058
+ dash: {
271059
+ valType: 'enumerated',
271060
+ values: sortObjectKeys(DASHES),
271061
+ dflt: 'solid',
271062
+ description: 'Sets the dash style of the lines.'
271063
+ }
271064
+ }, colorAttributes('line'));
271065
+
271066
+ function makeProjectionAttr(axLetter) {
271067
+ return {
271068
+ show: {
271069
+ valType: 'boolean',
271070
+ dflt: false,
271071
+ description: [
271072
+ 'Sets whether or not projections are shown along the',
271073
+ axLetter, 'axis.'
271074
+ ].join(' ')
271075
+ },
271076
+ opacity: {
271077
+ valType: 'number',
271078
+ min: 0,
271079
+ max: 1,
271080
+ dflt: 1,
271081
+ description: 'Sets the projection color.'
271082
+ },
271083
+ scale: {
271084
+ valType: 'number',
271085
+ min: 0,
271086
+ max: 10,
271087
+ dflt: 2 / 3,
271088
+ description: [
271089
+ 'Sets the scale factor determining the size of the',
271090
+ 'projection marker points.'
271091
+ ].join(' ')
271092
+ }
271093
+ };
271094
+ }
271095
+
271096
+ var attrs = module.exports = overrideAll({
271097
+ x: scatterAttrs.x,
271098
+ y: scatterAttrs.y,
271099
+ z: {
271100
+ valType: 'data_array',
271101
+ description: 'Sets the z coordinates.'
271102
+ },
271103
+
271104
+ text: extendFlat({}, scatterAttrs.text, {
271105
+ description: [
271106
+ 'Sets text elements associated with each (x,y,z) triplet.',
271107
+ 'If a single string, the same string appears over',
271108
+ 'all the data points.',
271109
+ 'If an array of string, the items are mapped in order to the',
271110
+ 'this trace\'s (x,y,z) coordinates.',
271111
+ 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
271112
+ 'these elements will be seen in the hover labels.'
271113
+ ].join(' ')
271114
+ }),
271115
+ texttemplate: texttemplateAttrs({}, {
271116
+
271117
+ }),
271118
+ hovertext: extendFlat({}, scatterAttrs.hovertext, {
271119
+ description: [
271120
+ 'Sets text elements associated with each (x,y,z) triplet.',
271121
+ 'If a single string, the same string appears over',
271122
+ 'all the data points.',
271123
+ 'If an array of string, the items are mapped in order to the',
271124
+ 'this trace\'s (x,y,z) coordinates.',
271125
+ 'To be seen, trace `hoverinfo` must contain a *text* flag.'
271126
+ ].join(' ')
271127
+ }),
271128
+ hovertemplate: hovertemplateAttrs(),
271129
+
271130
+ xhoverformat: axisHoverFormat('x'),
271131
+ yhoverformat: axisHoverFormat('y'),
271132
+ zhoverformat: axisHoverFormat('z'),
271133
+
271134
+ mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
271135
+ {dflt: 'lines+markers'}),
271136
+ surfaceaxis: {
271137
+ valType: 'enumerated',
271138
+ values: [-1, 0, 1, 2],
271139
+ dflt: -1,
271140
+ description: [
271141
+ 'If *-1*, the scatter points are not fill with a surface',
271142
+ 'If *0*, *1*, *2*, the scatter points are filled with',
271143
+ 'a Delaunay surface about the x, y, z respectively.'
271144
+ ].join(' ')
271145
+ },
271146
+ surfacecolor: {
271147
+ valType: 'color',
271148
+ description: 'Sets the surface fill color.'
271149
+ },
271150
+ projection: {
271151
+ x: makeProjectionAttr('x'),
271152
+ y: makeProjectionAttr('y'),
271153
+ z: makeProjectionAttr('z')
271154
+ },
271155
+
271156
+ connectgaps: scatterAttrs.connectgaps,
271157
+ line: lineAttrs,
271158
+
271159
+ marker: extendFlat({ // Parity with scatter.js?
271160
+ symbol: {
271161
+ valType: 'enumerated',
271162
+ values: sortObjectKeys(MARKER_SYMBOLS),
271163
+ dflt: 'circle',
271164
+ arrayOk: true,
271165
+ description: 'Sets the marker symbol type.'
271166
+ },
271167
+ size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
271168
+ sizeref: scatterMarkerAttrs.sizeref,
271169
+ sizemin: scatterMarkerAttrs.sizemin,
271170
+ sizemode: scatterMarkerAttrs.sizemode,
271171
+ opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
271172
+ arrayOk: false,
271173
+ description: [
271174
+ 'Sets the marker opacity.',
271175
+ 'Note that the marker opacity for scatter3d traces',
271176
+ 'must be a scalar value for performance reasons.',
271177
+ 'To set a blending opacity value',
271178
+ '(i.e. which is not transparent), set *marker.color*',
271179
+ 'to an rgba color and use its alpha channel.'
271180
+ ].join(' ')
271181
+ }),
271182
+ colorbar: scatterMarkerAttrs.colorbar,
271183
+
271184
+ line: extendFlat({
271185
+ width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
271186
+ },
271187
+ colorAttributes('marker.line')
271188
+ )
271189
+ },
271190
+ colorAttributes('marker')
271191
+ ),
271192
+
271193
+ textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
271194
+ textfont: fontAttrs({
271195
+ noFontShadow: true,
271196
+ noFontLineposition: true,
271197
+ noFontTextcase: true,
271198
+ editType: 'calc',
271199
+ colorEditType: 'style',
271200
+ arrayOk: true,
271201
+ variantValues: ['normal', 'small-caps'],
271202
+ description: 'Sets the text font.'
271203
+ }),
271204
+
271205
+ opacity: baseAttrs.opacity,
271206
+
271207
+ hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
271208
+ }, 'calc', 'nested');
271209
+
271210
+ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
271211
+
271212
+
271213
+ /***/ }),
271214
+
271215
+ /***/ 30935:
271216
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271217
+
271218
+
271219
+
271220
+ var arraysToCalcdata = __webpack_require__(47213);
271221
+ var calcColorscale = __webpack_require__(59498);
271222
+
271223
+ /**
271224
+ * This is a kludge to put the array attributes into
271225
+ * calcdata the way Scatter.plot does, so that legends and
271226
+ * popovers know what to do with them.
271227
+ */
271228
+ module.exports = function calc(gd, trace) {
271229
+ var cd = [{x: false, y: false, trace: trace, t: {}}];
271230
+
271231
+ arraysToCalcdata(cd, trace);
271232
+ calcColorscale(gd, trace);
271233
+
271234
+ return cd;
271235
+ };
271236
+
271237
+
271238
+ /***/ }),
271239
+
271240
+ /***/ 77681:
271241
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271242
+
271243
+
271244
+
271245
+ var Registry = __webpack_require__(13936);
271246
+
271247
+ function calculateAxisErrors(data, params, scaleFactor, axis) {
271248
+ if(!params || !params.visible) return null;
271249
+
271250
+ var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
271251
+ var result = new Array(data.length);
271252
+
271253
+ for(var i = 0; i < data.length; i++) {
271254
+ var errors = computeError(+data[i], i);
271255
+
271256
+ if(axis.type === 'log') {
271257
+ var point = axis.c2l(data[i]);
271258
+ var min = data[i] - errors[0];
271259
+ var max = data[i] + errors[1];
271260
+
271261
+ result[i] = [
271262
+ (axis.c2l(min, true) - point) * scaleFactor,
271263
+ (axis.c2l(max, true) - point) * scaleFactor
271264
+ ];
271265
+
271266
+ // Keep track of the lower error bound which isn't negative!
271267
+ if(min > 0) {
271268
+ var lower = axis.c2l(min);
271269
+ if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
271270
+ axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
271271
+ }
271272
+ } else {
271273
+ result[i] = [
271274
+ -errors[0] * scaleFactor,
271275
+ errors[1] * scaleFactor
271276
+ ];
271277
+ }
271278
+ }
271279
+
271280
+ return result;
271281
+ }
271282
+
271283
+ function dataLength(array) {
271284
+ for(var i = 0; i < array.length; i++) {
271285
+ if(array[i]) return array[i].length;
271286
+ }
271287
+ return 0;
271288
+ }
271289
+
271290
+ function calculateErrors(data, scaleFactor, sceneLayout) {
271291
+ var errors = [
271292
+ calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
271293
+ calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
271294
+ calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
271295
+ ];
271296
+
271297
+ var n = dataLength(errors);
271298
+ if(n === 0) return null;
271299
+
271300
+ var errorBounds = new Array(n);
271301
+
271302
+ for(var i = 0; i < n; i++) {
271303
+ var bound = [[0, 0, 0], [0, 0, 0]];
271304
+
271305
+ for(var j = 0; j < 3; j++) {
271306
+ if(errors[j]) {
271307
+ for(var k = 0; k < 2; k++) {
271308
+ bound[k][j] = errors[j][i][k];
271309
+ }
271310
+ }
271311
+ }
271312
+
271313
+ errorBounds[i] = bound;
271314
+ }
271315
+
271316
+ return errorBounds;
271317
+ }
271318
+
271319
+ module.exports = calculateErrors;
271320
+
271321
+
271322
+ /***/ }),
271323
+
271324
+ /***/ 93219:
271325
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271326
+
271327
+
271328
+
271329
+ var createLinePlot = (__webpack_require__(46000).gl_line3d);
271330
+ var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
271331
+ var createErrorBars = (__webpack_require__(46000).gl_error3d);
271332
+ var createMesh = (__webpack_require__(46000).gl_mesh3d);
271333
+ var triangulate = (__webpack_require__(46000).delaunay_triangulate);
271334
+
271335
+ var Lib = __webpack_require__(30991);
271336
+ var str2RgbaArray = __webpack_require__(44960);
271337
+ var formatColor = (__webpack_require__(592).formatColor);
271338
+ var makeBubbleSizeFn = __webpack_require__(42581);
271339
+ var DASH_PATTERNS = __webpack_require__(68828);
271340
+ var MARKER_SYMBOLS = __webpack_require__(98993);
271341
+
271342
+ var Axes = __webpack_require__(15076);
271343
+ var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
271344
+
271345
+ var calculateError = __webpack_require__(77681);
271346
+
271347
+ function LineWithMarkers(scene, uid) {
271348
+ this.scene = scene;
271349
+ this.uid = uid;
271350
+ this.linePlot = null;
271351
+ this.scatterPlot = null;
271352
+ this.errorBars = null;
271353
+ this.textMarkers = null;
271354
+ this.delaunayMesh = null;
271355
+ this.color = null;
271356
+ this.mode = '';
271357
+ this.dataPoints = [];
271358
+ this.axesBounds = [
271359
+ [-Infinity, -Infinity, -Infinity],
271360
+ [Infinity, Infinity, Infinity]
271361
+ ];
271362
+ this.textLabels = null;
271363
+ this.data = null;
271364
+ }
271365
+
271366
+ var proto = LineWithMarkers.prototype;
271367
+
271368
+ proto.handlePick = function(selection) {
271369
+ if(selection.object &&
271370
+ (selection.object === this.linePlot ||
271371
+ selection.object === this.delaunayMesh ||
271372
+ selection.object === this.textMarkers ||
271373
+ selection.object === this.scatterPlot)
271374
+ ) {
271375
+ var ind = selection.index = selection.data.index;
271376
+
271377
+ if(selection.object.highlight) {
271378
+ selection.object.highlight(null);
271379
+ }
271380
+ if(this.scatterPlot) {
271381
+ selection.object = this.scatterPlot;
271382
+ this.scatterPlot.highlight(selection.data);
271383
+ }
271384
+
271385
+ selection.textLabel = '';
271386
+ if(this.textLabels) {
271387
+ if(Lib.isArrayOrTypedArray(this.textLabels)) {
271388
+ if(this.textLabels[ind] || this.textLabels[ind] === 0) {
271389
+ selection.textLabel = this.textLabels[ind];
271390
+ }
271391
+ } else {
271392
+ selection.textLabel = this.textLabels;
271393
+ }
271394
+ }
271395
+
271396
+ selection.traceCoordinate = [
271397
+ this.data.x[ind],
271398
+ this.data.y[ind],
271399
+ this.data.z[ind]
271400
+ ];
271401
+
271402
+ return true;
271403
+ }
271404
+ };
271405
+
271406
+ function constructDelaunay(points, color, axis) {
271407
+ var u = (axis + 1) % 3;
271408
+ var v = (axis + 2) % 3;
271409
+ var filteredPoints = [];
271410
+ var filteredIds = [];
271411
+ var i;
271412
+
271413
+ for(i = 0; i < points.length; ++i) {
271414
+ var p = points[i];
271415
+ if(isNaN(p[u]) || !isFinite(p[u]) ||
271416
+ isNaN(p[v]) || !isFinite(p[v])) {
271417
+ continue;
271418
+ }
271419
+ filteredPoints.push([p[u], p[v]]);
271420
+ filteredIds.push(i);
271421
+ }
271422
+ var cells = triangulate(filteredPoints);
271423
+ for(i = 0; i < cells.length; ++i) {
271424
+ var c = cells[i];
271425
+ for(var j = 0; j < c.length; ++j) {
271426
+ c[j] = filteredIds[c[j]];
271427
+ }
271428
+ }
271429
+ return {
271430
+ positions: points,
271431
+ cells: cells,
271432
+ meshColor: color
271433
+ };
271434
+ }
271435
+
271436
+ function calculateErrorParams(errors) {
271437
+ var capSize = [0.0, 0.0, 0.0];
271438
+ var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
271439
+ var lineWidth = [1.0, 1.0, 1.0];
271440
+
271441
+ for(var i = 0; i < 3; i++) {
271442
+ var e = errors[i];
271443
+
271444
+ if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
271445
+ if(!e || !e.visible) continue;
271446
+
271447
+ capSize[i] = e.width / 2; // ballpark rescaling
271448
+ color[i] = str2RgbaArray(e.color);
271449
+ lineWidth[i] = e.thickness;
271450
+ }
271451
+
271452
+ return {capSize: capSize, color: color, lineWidth: lineWidth};
271453
+ }
271454
+
271455
+ function parseAlignmentX(a) {
271456
+ if(a === null || a === undefined) return 0;
271457
+
271458
+ return (a.indexOf('left') > -1) ? -1 :
271459
+ (a.indexOf('right') > -1) ? 1 : 0;
271460
+ }
271461
+
271462
+ function parseAlignmentY(a) {
271463
+ if(a === null || a === undefined) return 0;
271464
+
271465
+ return (a.indexOf('top') > -1) ? -1 :
271466
+ (a.indexOf('bottom') > -1) ? 1 : 0;
271467
+ }
271468
+
271469
+ function calculateTextOffset(tp) {
271470
+ // Read out text properties
271471
+
271472
+ var defaultAlignmentX = 0;
271473
+ var defaultAlignmentY = 0;
271474
+
271475
+ var textOffset = [
271476
+ defaultAlignmentX,
271477
+ defaultAlignmentY
271478
+ ];
271479
+
271480
+ if(Array.isArray(tp)) {
271481
+ for(var i = 0; i < tp.length; i++) {
271482
+ textOffset[i] = [
271483
+ defaultAlignmentX,
271484
+ defaultAlignmentY
271485
+ ];
271486
+ if(tp[i]) {
271487
+ textOffset[i][0] = parseAlignmentX(tp[i]);
271488
+ textOffset[i][1] = parseAlignmentY(tp[i]);
271489
+ }
271490
+ }
271491
+ } else {
271492
+ textOffset[0] = parseAlignmentX(tp);
271493
+ textOffset[1] = parseAlignmentY(tp);
271494
+ }
271495
+
271496
+ return textOffset;
271497
+ }
271498
+
271499
+
271500
+ function calculateSize(sizeIn, sizeFn) {
271501
+ // rough parity with Plotly 2D markers
271502
+ return sizeFn(sizeIn * 4);
271503
+ }
271504
+
271505
+ function calculateSymbol(symbolIn) {
271506
+ return MARKER_SYMBOLS[symbolIn];
271507
+ }
271508
+
271509
+ function formatParam(paramIn, len, calculate, dflt, extraFn) {
271510
+ var paramOut = null;
271511
+
271512
+ if(Lib.isArrayOrTypedArray(paramIn)) {
271513
+ paramOut = [];
271514
+
271515
+ for(var i = 0; i < len; i++) {
271516
+ if(paramIn[i] === undefined) paramOut[i] = dflt;
271517
+ else paramOut[i] = calculate(paramIn[i], extraFn);
271518
+ }
271519
+ } else paramOut = calculate(paramIn, Lib.identity);
271520
+
271521
+ return paramOut;
271522
+ }
271523
+
271524
+
271525
+ function convertPlotlyOptions(scene, data) {
271526
+ var points = [];
271527
+ var sceneLayout = scene.fullSceneLayout;
271528
+ var scaleFactor = scene.dataScale;
271529
+ var xaxis = sceneLayout.xaxis;
271530
+ var yaxis = sceneLayout.yaxis;
271531
+ var zaxis = sceneLayout.zaxis;
271532
+ var marker = data.marker;
271533
+ var line = data.line;
271534
+ var x = data.x || [];
271535
+ var y = data.y || [];
271536
+ var z = data.z || [];
271537
+ var len = x.length;
271538
+ var xcalendar = data.xcalendar;
271539
+ var ycalendar = data.ycalendar;
271540
+ var zcalendar = data.zcalendar;
271541
+ var xc, yc, zc;
271542
+ var params, i;
271543
+ var text;
271544
+
271545
+ // Convert points
271546
+ for(i = 0; i < len; i++) {
271547
+ // sanitize numbers and apply transforms based on axes.type
271548
+ xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
271549
+ yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
271550
+ zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
271551
+
271552
+ points[i] = [xc, yc, zc];
271553
+ }
271554
+
271555
+ // convert text
271556
+ if(Array.isArray(data.text)) {
271557
+ text = data.text;
271558
+ } else if(Lib.isTypedArray(data.text)) {
271559
+ text = Array.from(data.text);
271560
+ } else if(data.text !== undefined) {
271561
+ text = new Array(len);
271562
+ for(i = 0; i < len; i++) text[i] = data.text;
271563
+ }
271564
+
271565
+ function formatter(axName, val) {
271566
+ var ax = sceneLayout[axName];
271567
+ return Axes.tickText(ax, ax.d2l(val), true).text;
271568
+ }
271569
+
271570
+ // check texttemplate
271571
+ var texttemplate = data.texttemplate;
271572
+ if(texttemplate) {
271573
+ var fullLayout = scene.fullLayout;
271574
+ var d3locale = fullLayout._d3locale;
271575
+ var isArray = Array.isArray(texttemplate);
271576
+ var N = isArray ? Math.min(texttemplate.length, len) : len;
271577
+ var txt = isArray ?
271578
+ function(i) { return texttemplate[i]; } :
271579
+ function() { return texttemplate; };
271580
+
271581
+ text = new Array(N);
271582
+
271583
+ for(i = 0; i < N; i++) {
271584
+ var d = {x: x[i], y: y[i], z: z[i]};
271585
+ var labels = {
271586
+ xLabel: formatter('xaxis', x[i]),
271587
+ yLabel: formatter('yaxis', y[i]),
271588
+ zLabel: formatter('zaxis', z[i])
271589
+ };
271590
+ var pointValues = {};
271591
+ appendArrayPointValue(pointValues, data, i);
271592
+ var meta = data._meta || {};
271593
+ text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
271594
+ }
271595
+ }
271596
+
271597
+ // Build object parameters
271598
+ params = {
271599
+ position: points,
271600
+ mode: data.mode,
271601
+ text: text
271602
+ };
271603
+
271604
+ if('line' in data) {
271605
+ params.lineColor = formatColor(line, 1, len);
271606
+ params.lineWidth = line.width;
271607
+ params.lineDashes = line.dash;
271608
+ }
271609
+
271610
+ if('marker' in data) {
271611
+ var sizeFn = makeBubbleSizeFn(data);
271612
+
271613
+ params.scatterColor = formatColor(marker, 1, len);
271614
+ params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
271615
+ params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
271616
+ params.scatterLineWidth = marker.line.width; // arrayOk === false
271617
+ params.scatterLineColor = formatColor(marker.line, 1, len);
271618
+ params.scatterAngle = 0;
271619
+ }
271620
+
271621
+ if('textposition' in data) {
271622
+ params.textOffset = calculateTextOffset(data.textposition);
271623
+ params.textColor = formatColor(data.textfont, 1, len);
271624
+ params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
271625
+ params.textFontFamily = data.textfont.family;
271626
+ params.textFontWeight = data.textfont.weight;
271627
+ params.textFontStyle = data.textfont.style;
271628
+ params.textFontVariant = data.textfont.variant;
271629
+ params.textAngle = 0;
271630
+ }
271631
+
271632
+ var dims = ['x', 'y', 'z'];
271633
+ params.project = [false, false, false];
271634
+ params.projectScale = [1, 1, 1];
271635
+ params.projectOpacity = [1, 1, 1];
271636
+ for(i = 0; i < 3; ++i) {
271637
+ var projection = data.projection[dims[i]];
271638
+ if((params.project[i] = projection.show)) {
271639
+ params.projectOpacity[i] = projection.opacity;
271640
+ params.projectScale[i] = projection.scale;
271641
+ }
271642
+ }
271643
+
271644
+ params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
271645
+
271646
+ var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
271647
+ params.errorColor = errorParams.color;
271648
+ params.errorLineWidth = errorParams.lineWidth;
271649
+ params.errorCapSize = errorParams.capSize;
271650
+
271651
+ params.delaunayAxis = data.surfaceaxis;
271652
+ params.delaunayColor = str2RgbaArray(data.surfacecolor);
271653
+
271654
+ return params;
271655
+ }
271656
+
271657
+ function _arrayToColor(color) {
271658
+ if(Lib.isArrayOrTypedArray(color)) {
271659
+ var c = color[0];
271660
+
271661
+ if(Lib.isArrayOrTypedArray(c)) color = c;
271662
+
271663
+ return 'rgb(' + color.slice(0, 3).map(function(x) {
271664
+ return Math.round(x * 255);
271665
+ }) + ')';
271666
+ }
271667
+
271668
+ return null;
271669
+ }
271670
+
271671
+ function arrayToColor(colors) {
271672
+ if(!Lib.isArrayOrTypedArray(colors)) {
271673
+ return null;
271674
+ }
271675
+
271676
+ if((colors.length === 4) && (typeof colors[0] === 'number')) {
271677
+ return _arrayToColor(colors);
271678
+ }
271679
+
271680
+ return colors.map(_arrayToColor);
271681
+ }
271682
+
271683
+ proto.update = function(data) {
271684
+ var gl = this.scene.glplot.gl;
271685
+ var lineOptions;
271686
+ var scatterOptions;
271687
+ var errorOptions;
271688
+ var textOptions;
271689
+ var dashPattern = DASH_PATTERNS.solid;
271690
+
271691
+ // Save data
271692
+ this.data = data;
271693
+
271694
+ // Run data conversion
271695
+ var options = convertPlotlyOptions(this.scene, data);
271696
+
271697
+ if('mode' in options) {
271698
+ this.mode = options.mode;
271699
+ }
271700
+ if('lineDashes' in options) {
271701
+ if(options.lineDashes in DASH_PATTERNS) {
271702
+ dashPattern = DASH_PATTERNS[options.lineDashes];
271703
+ }
271704
+ }
271705
+
271706
+ this.color = arrayToColor(options.scatterColor) ||
271707
+ arrayToColor(options.lineColor);
271708
+
271709
+ // Save data points
271710
+ this.dataPoints = options.position;
271711
+
271712
+ lineOptions = {
271713
+ gl: this.scene.glplot.gl,
271714
+ position: options.position,
271715
+ color: options.lineColor,
271716
+ lineWidth: options.lineWidth || 1,
271717
+ dashes: dashPattern[0],
271718
+ dashScale: dashPattern[1],
271719
+ opacity: data.opacity,
271720
+ connectGaps: data.connectgaps
271721
+ };
271722
+
271723
+ if(this.mode.indexOf('lines') !== -1) {
271724
+ if(this.linePlot) this.linePlot.update(lineOptions);
271725
+ else {
271726
+ this.linePlot = createLinePlot(lineOptions);
271727
+ this.linePlot._trace = this;
271728
+ this.scene.glplot.add(this.linePlot);
271729
+ }
271730
+ } else if(this.linePlot) {
271731
+ this.scene.glplot.remove(this.linePlot);
271732
+ this.linePlot.dispose();
271733
+ this.linePlot = null;
271734
+ }
271735
+
271736
+ // N.B. marker.opacity must be a scalar for performance
271737
+ var scatterOpacity = data.opacity;
271738
+ if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
271739
+
271740
+ scatterOptions = {
271741
+ gl: this.scene.glplot.gl,
271742
+ position: options.position,
271743
+ color: options.scatterColor,
271744
+ size: options.scatterSize,
271745
+ glyph: options.scatterMarker,
271746
+ opacity: scatterOpacity,
271747
+ orthographic: true,
271748
+ lineWidth: options.scatterLineWidth,
271749
+ lineColor: options.scatterLineColor,
271750
+ project: options.project,
271751
+ projectScale: options.projectScale,
271752
+ projectOpacity: options.projectOpacity
271753
+ };
271754
+
271755
+ if(this.mode.indexOf('markers') !== -1) {
271756
+ if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
271757
+ else {
271758
+ this.scatterPlot = createScatterPlot(scatterOptions);
271759
+ this.scatterPlot._trace = this;
271760
+ this.scatterPlot.highlightScale = 1;
271761
+ this.scene.glplot.add(this.scatterPlot);
271762
+ }
271763
+ } else if(this.scatterPlot) {
271764
+ this.scene.glplot.remove(this.scatterPlot);
271765
+ this.scatterPlot.dispose();
271766
+ this.scatterPlot = null;
271767
+ }
271768
+
271769
+ textOptions = {
271770
+ gl: this.scene.glplot.gl,
271771
+ position: options.position,
271772
+ glyph: options.text,
271773
+ color: options.textColor,
271774
+ size: options.textSize,
271775
+ angle: options.textAngle,
271776
+ alignment: options.textOffset,
271777
+ font: options.textFontFamily,
271778
+ fontWeight: options.textFontWeight,
271779
+ fontStyle: options.textFontStyle,
271780
+ fontVariant: options.textFontVariant,
271781
+ orthographic: true,
271782
+ lineWidth: 0,
271783
+ project: false,
271784
+ opacity: data.opacity
271785
+ };
271786
+
271787
+ this.textLabels = data.hovertext || data.text;
271788
+
271789
+ if(this.mode.indexOf('text') !== -1) {
271790
+ if(this.textMarkers) this.textMarkers.update(textOptions);
271791
+ else {
271792
+ this.textMarkers = createScatterPlot(textOptions);
271793
+ this.textMarkers._trace = this;
271794
+ this.textMarkers.highlightScale = 1;
271795
+ this.scene.glplot.add(this.textMarkers);
271796
+ }
271797
+ } else if(this.textMarkers) {
271798
+ this.scene.glplot.remove(this.textMarkers);
271799
+ this.textMarkers.dispose();
271800
+ this.textMarkers = null;
271801
+ }
271802
+
271803
+ errorOptions = {
271804
+ gl: this.scene.glplot.gl,
271805
+ position: options.position,
271806
+ color: options.errorColor,
271807
+ error: options.errorBounds,
271808
+ lineWidth: options.errorLineWidth,
271809
+ capSize: options.errorCapSize,
271810
+ opacity: data.opacity
271811
+ };
271812
+ if(this.errorBars) {
271813
+ if(options.errorBounds) {
271814
+ this.errorBars.update(errorOptions);
271815
+ } else {
271816
+ this.scene.glplot.remove(this.errorBars);
271817
+ this.errorBars.dispose();
271818
+ this.errorBars = null;
271819
+ }
271820
+ } else if(options.errorBounds) {
271821
+ this.errorBars = createErrorBars(errorOptions);
271822
+ this.errorBars._trace = this;
271823
+ this.scene.glplot.add(this.errorBars);
271824
+ }
271825
+
271826
+ if(options.delaunayAxis >= 0) {
271827
+ var delaunayOptions = constructDelaunay(
271828
+ options.position,
271829
+ options.delaunayColor,
271830
+ options.delaunayAxis
271831
+ );
271832
+ delaunayOptions.opacity = data.opacity;
271833
+
271834
+ if(this.delaunayMesh) {
271835
+ this.delaunayMesh.update(delaunayOptions);
271836
+ } else {
271837
+ delaunayOptions.gl = gl;
271838
+ this.delaunayMesh = createMesh(delaunayOptions);
271839
+ this.delaunayMesh._trace = this;
271840
+ this.scene.glplot.add(this.delaunayMesh);
271841
+ }
271842
+ } else if(this.delaunayMesh) {
271843
+ this.scene.glplot.remove(this.delaunayMesh);
271844
+ this.delaunayMesh.dispose();
271845
+ this.delaunayMesh = null;
271846
+ }
271847
+ };
271848
+
271849
+ proto.dispose = function() {
271850
+ if(this.linePlot) {
271851
+ this.scene.glplot.remove(this.linePlot);
271852
+ this.linePlot.dispose();
271853
+ }
271854
+ if(this.scatterPlot) {
271855
+ this.scene.glplot.remove(this.scatterPlot);
271856
+ this.scatterPlot.dispose();
271857
+ }
271858
+ if(this.errorBars) {
271859
+ this.scene.glplot.remove(this.errorBars);
271860
+ this.errorBars.dispose();
271861
+ }
271862
+ if(this.textMarkers) {
271863
+ this.scene.glplot.remove(this.textMarkers);
271864
+ this.textMarkers.dispose();
271865
+ }
271866
+ if(this.delaunayMesh) {
271867
+ this.scene.glplot.remove(this.delaunayMesh);
271868
+ this.delaunayMesh.dispose();
271869
+ }
271870
+ };
271871
+
271872
+ function createLineWithMarkers(scene, data) {
271873
+ var plot = new LineWithMarkers(scene, data.uid);
271874
+ plot.update(data);
271875
+ return plot;
271876
+ }
271877
+
271878
+ module.exports = createLineWithMarkers;
271879
+
271880
+
271881
+ /***/ }),
271882
+
271883
+ /***/ 13744:
271884
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271885
+
271886
+
271887
+
271888
+ var Registry = __webpack_require__(13936);
271889
+ var Lib = __webpack_require__(30991);
271890
+
271891
+ var subTypes = __webpack_require__(33068);
271892
+ var handleMarkerDefaults = __webpack_require__(15294);
271893
+ var handleLineDefaults = __webpack_require__(82094);
271894
+ var handleTextDefaults = __webpack_require__(94729);
271895
+
271896
+ var attributes = __webpack_require__(1015);
271897
+
271898
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
271899
+ function coerce(attr, dflt) {
271900
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
271901
+ }
271902
+
271903
+ var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
271904
+ if(!len) {
271905
+ traceOut.visible = false;
271906
+ return;
271907
+ }
271908
+
271909
+ coerce('text');
271910
+ coerce('hovertext');
271911
+ coerce('hovertemplate');
271912
+ coerce('xhoverformat');
271913
+ coerce('yhoverformat');
271914
+ coerce('zhoverformat');
271915
+
271916
+ coerce('mode');
271917
+
271918
+ if(subTypes.hasMarkers(traceOut)) {
271919
+ handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
271920
+ }
271921
+
271922
+ if(subTypes.hasLines(traceOut)) {
271923
+ coerce('connectgaps');
271924
+ handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
271925
+ }
271926
+
271927
+ if(subTypes.hasText(traceOut)) {
271928
+ coerce('texttemplate');
271929
+ handleTextDefaults(traceIn, traceOut, layout, coerce, {
271930
+ noSelect: true,
271931
+ noFontShadow: true,
271932
+ noFontLineposition: true,
271933
+ noFontTextcase: true,
271934
+ });
271935
+ }
271936
+
271937
+ var lineColor = (traceOut.line || {}).color;
271938
+ var markerColor = (traceOut.marker || {}).color;
271939
+ if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
271940
+
271941
+ var dims = ['x', 'y', 'z'];
271942
+ for(var i = 0; i < 3; ++i) {
271943
+ var projection = 'projection.' + dims[i];
271944
+ if(coerce(projection + '.show')) {
271945
+ coerce(projection + '.opacity');
271946
+ coerce(projection + '.scale');
271947
+ }
271948
+ }
271949
+
271950
+ var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
271951
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
271952
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
271953
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
271954
+ };
271955
+
271956
+ function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
271957
+ var len = 0;
271958
+ var x = coerce('x');
271959
+ var y = coerce('y');
271960
+ var z = coerce('z');
271961
+
271962
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
271963
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
271964
+
271965
+ if(x && y && z) {
271966
+ // TODO: what happens if one is missing?
271967
+ len = Math.min(x.length, y.length, z.length);
271968
+ traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
271969
+ }
271970
+
271971
+ return len;
271972
+ }
271973
+
271974
+
271975
+ /***/ }),
271976
+
271977
+ /***/ 68860:
271978
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271979
+
271980
+
271981
+
271982
+ module.exports = {
271983
+ plot: __webpack_require__(93219),
271984
+ attributes: __webpack_require__(1015),
271985
+ markerSymbols: __webpack_require__(98993),
271986
+ supplyDefaults: __webpack_require__(13744),
271987
+ colorbar: [
271988
+ {
271989
+ container: 'marker',
271990
+ min: 'cmin',
271991
+ max: 'cmax'
271992
+ }, {
271993
+ container: 'line',
271994
+ min: 'cmin',
271995
+ max: 'cmax'
271996
+ }
271997
+ ],
271998
+ calc: __webpack_require__(30935),
271999
+
272000
+ moduleType: 'trace',
272001
+ name: 'scatter3d',
272002
+ basePlotModule: __webpack_require__(68137),
272003
+ categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
272004
+ meta: {
272005
+ hrName: 'scatter_3d',
272006
+ description: [
272007
+ 'The data visualized as scatter point or lines in 3D dimension',
272008
+ 'is set in `x`, `y`, `z`.',
272009
+ 'Text (appearing either on the chart or on hover only) is via `text`.',
272010
+ 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
272011
+ 'Projections are achieved via `projection`.',
272012
+ 'Surface fills are achieved via `surfaceaxis`.'
272013
+ ].join(' ')
272014
+ }
272015
+ };
272016
+
272017
+
272016
272018
  /***/ }),
272017
272019
 
272018
272020
  /***/ 44771:
@@ -369332,7 +369334,7 @@ function HtmlRunner() {
369332
369334
  const iframeClasses = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
369333
369335
  [styles_module_scss_1.default.codeHasBeenRun]: codeHasBeenRun,
369334
369336
  });
369335
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.htmlrunnerContainer, children: [(0, jsx_runtime_1.jsx)(OutputTabPanel_1.OutputTabPanel, { title: "Preview", icon: preview_svg_1.default, readOnly: readOnly, extraTabContent: codeHasBeenRun && openInNewTabLink, tabPanelClassName: styles_module_scss_1.default.previewHtml, children: error ? ((0, jsx_runtime_1.jsx)("div", { className: iframeClasses, children: (0, jsx_runtime_1.jsx)(NotFoundPage_1.NotFoundPage, {}) })) : ((0, jsx_runtime_1.jsx)("iframe", { className: iframeClasses, sandbox: "allow-scripts allow-same-origin allow-modals allow-popups", referrerPolicy: "strict-origin-when-cross-origin", allow: "\r\n accelerometer 'none';\r\n camera 'none';\r\n encrypted-media;\r\n fullscreen;\r\n picture-in-picture;\r\n geolocation 'none';\r\n gyroscope 'none';\r\n magnetometer 'none';\r\n microphone 'none';\r\n midi 'none';\r\n payment 'none';\r\n usb 'none';\r\n ", id: "output-frame", title: "HTML Output Preview", ref: output, onLoad: iframeReload })) }), !isPreviewMode && ((0, jsx_runtime_1.jsx)(ResizableWithHandle_1.default, { "data-testid": "proj-console-container", handleDirection: "top", defaultHeight: "50%", className: styles_module_scss_1.default.resizeContainer, handleClassName: styles_module_scss_1.default.resizeHandleContainer, children: (0, jsx_runtime_1.jsx)(OutputTabPanel_1.OutputTabPanel, { title: "Console", icon: console_svg_1.default, readOnly: readOnly, children: (0, jsx_runtime_1.jsx)(HtmlConsole_1.default, { consoleLogs: consoleLogs }) }) }))] }));
369337
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.htmlrunnerContainer, children: [(0, jsx_runtime_1.jsx)(OutputTabPanel_1.OutputTabPanel, { title: "Preview", icon: preview_svg_1.default, readOnly: readOnly, extraTabContent: codeHasBeenRun && openInNewTabLink, tabPanelClassName: styles_module_scss_1.default.previewHtml, children: error ? ((0, jsx_runtime_1.jsx)("div", { className: iframeClasses, children: (0, jsx_runtime_1.jsx)(NotFoundPage_1.NotFoundPage, {}) })) : ((0, jsx_runtime_1.jsx)("iframe", { className: iframeClasses, sandbox: "allow-scripts allow-same-origin allow-modals allow-popups", referrerPolicy: "strict-origin-when-cross-origin", allow: "\n accelerometer 'none';\n camera 'none';\n encrypted-media;\n fullscreen;\n picture-in-picture;\n geolocation 'none';\n gyroscope 'none';\n magnetometer 'none';\n microphone 'none';\n midi 'none';\n payment 'none';\n usb 'none';\n ", id: "output-frame", title: "HTML Output Preview", ref: output, onLoad: iframeReload })) }), !isPreviewMode && ((0, jsx_runtime_1.jsx)(ResizableWithHandle_1.default, { "data-testid": "proj-console-container", handleDirection: "top", defaultHeight: "50%", className: styles_module_scss_1.default.resizeContainer, handleClassName: styles_module_scss_1.default.resizeHandleContainer, children: (0, jsx_runtime_1.jsx)(OutputTabPanel_1.OutputTabPanel, { title: "Console", icon: console_svg_1.default, readOnly: readOnly, children: (0, jsx_runtime_1.jsx)(HtmlConsole_1.default, { consoleLogs: consoleLogs }) }) }))] }));
369336
369338
  }
369337
369339
  exports["default"] = HtmlRunner;
369338
369340
 
@@ -369411,6 +369413,10 @@ const node_html_parser_1 = __webpack_require__(36192);
369411
369413
  const ProjectTypes_1 = __webpack_require__(27130);
369412
369414
  const binaryStore_1 = __webpack_require__(5060);
369413
369415
  const projectHelpers_1 = __webpack_require__(2610);
369416
+ // Strips sourceMappingURL comments from JS code
369417
+ function stripSourceMapComments(code) {
369418
+ return code.replace(/\/\/#[ \t]*sourceMappingURL=.*$/gm, "");
369419
+ }
369414
369420
  /** Normalizes CSS paths
369415
369421
  * Treats paths without leading / or ./ or ../ as relative to current file
369416
369422
  * E.g. 'image.png' will be treated as './image.png'
@@ -369562,9 +369568,11 @@ const jsRewriteImports = async (jsFile, components, stack) => {
369562
369568
  return full.replace(importPath, blobUrl);
369563
369569
  });
369564
369570
  const p5Rewritten = await jsRewriteP5AssetCalls({ ...jsFile, content: importsRewritten }, components, stack);
369571
+ // Strip sourceMappingURL comments before creating blob (Safari CORS fix)
369572
+ const cleaned = stripSourceMapComments(p5Rewritten);
369565
369573
  return {
369566
- blobUrl: (0, exports.getBlobURL)(p5Rewritten, getMimeType(jsFile.path)),
369567
- content: p5Rewritten,
369574
+ blobUrl: (0, exports.getBlobURL)(cleaned, getMimeType(jsFile.path)),
369575
+ content: cleaned,
369568
369576
  };
369569
369577
  };
369570
369578
  const CSS_ASSET_RE = /@import\s+(?:url\(\s*)?(["'])([^"']+)\1\s*\)?([^;]*);|url\(\s*(["']?)([^"')]+)\4\s*\)/g;
@@ -369657,6 +369665,15 @@ async function rewriteSources(indexPage, components, baseFilePath, propName, blo
369657
369665
  const { blobUrl } = await resolveFile(file, components, [baseFilePath]);
369658
369666
  blobSourceMap[blobUrl] = file.path;
369659
369667
  node.setAttribute(propName, blobUrl);
369668
+ // // If this is a <script> tag, add crossorigin="anonymous"
369669
+ // if (
369670
+ // node.tagName &&
369671
+ // node.tagName.toLowerCase() === "script" &&
369672
+ // propName === "src"
369673
+ // ) {
369674
+ // console.log("this is a script tag, adding crossorigin");
369675
+ // node.setAttribute("crossorigin", "anonymous");
369676
+ // }
369660
369677
  }
369661
369678
  }
369662
369679
  /** Recursively resolves and rewrites all imports starting from html file, with cycle detection */
@@ -369714,234 +369731,234 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
369714
369731
  exports.consoleOverrideScript = exports.disableLocalStorageScript = void 0;
369715
369732
  // insert script to disable access to specific localStorage keys
369716
369733
  // localstorage.getItem() is a potential security risk when executing untrusted code
369717
- exports.disableLocalStorageScript = `
369718
- <script>
369719
- (function() {
369720
- const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
369721
- const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
369722
- const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
369723
- const originalClear = window.localStorage.clear.bind(window.localStorage);
369724
-
369725
- const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
369726
-
369727
- Object.defineProperty(window, 'localStorage', {
369728
- value: {
369729
- getItem: function(key) {
369730
- if (isDisallowedKey(key)) {
369731
- console.log(\`localStorage.getItem for "\${key}" is disabled\`);
369732
- return null;
369733
- }
369734
- return originalGetItem(key);
369735
- },
369736
- setItem: function(key, value) {
369737
- if (isDisallowedKey(key)) {
369738
- console.log(\`localStorage.setItem for "\${key}" is disabled\`);
369739
- return;
369740
- }
369741
- return originalSetItem(key, value);
369742
- },
369743
- removeItem: function(key) {
369744
- if (isDisallowedKey(key)) {
369745
- console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
369746
- return;
369747
- }
369748
- return originalRemoveItem(key);
369749
- },
369750
- clear: function() {
369751
- console.log('localStorage.clear is disabled');
369752
- return;
369753
- }
369754
- },
369755
- writable: false,
369756
- configurable: false
369757
- });
369758
- })();
369759
- </script>
369734
+ exports.disableLocalStorageScript = `
369735
+ <script>
369736
+ (function() {
369737
+ const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
369738
+ const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
369739
+ const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
369740
+ const originalClear = window.localStorage.clear.bind(window.localStorage);
369741
+
369742
+ const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
369743
+
369744
+ Object.defineProperty(window, 'localStorage', {
369745
+ value: {
369746
+ getItem: function(key) {
369747
+ if (isDisallowedKey(key)) {
369748
+ console.log(\`localStorage.getItem for "\${key}" is disabled\`);
369749
+ return null;
369750
+ }
369751
+ return originalGetItem(key);
369752
+ },
369753
+ setItem: function(key, value) {
369754
+ if (isDisallowedKey(key)) {
369755
+ console.log(\`localStorage.setItem for "\${key}" is disabled\`);
369756
+ return;
369757
+ }
369758
+ return originalSetItem(key, value);
369759
+ },
369760
+ removeItem: function(key) {
369761
+ if (isDisallowedKey(key)) {
369762
+ console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
369763
+ return;
369764
+ }
369765
+ return originalRemoveItem(key);
369766
+ },
369767
+ clear: function() {
369768
+ console.log('localStorage.clear is disabled');
369769
+ return;
369770
+ }
369771
+ },
369772
+ writable: false,
369773
+ configurable: false
369774
+ });
369775
+ })();
369776
+ </script>
369760
369777
  `;
369761
369778
  const MAX_DEPTH = 5; // Maximum depth for object serialization to prevent infinite recursion
369762
369779
  // Override console methods to send logs to parent window and serialize complex objects
369763
- exports.consoleOverrideScript = `
369764
- <script>
369765
- (function() {
369766
- const SerializedType = {
369767
- Null: "null",
369768
- Undefined: "undefined",
369769
- Boolean: "boolean",
369770
- Number: "number",
369771
- String: "string",
369772
- Array: "array",
369773
- Object: "object",
369774
- };
369775
-
369776
- const original = {};
369777
- const methods = ["log", "error", "warn", "info", "debug", "assert"];
369778
-
369779
- function getTimestamp() {
369780
- const now = new Date();
369781
- const pad = (n) => String(n).padStart(2, '0');
369782
-
369783
- return (
369784
- now.getFullYear() + '-' +
369785
- pad(now.getMonth() + 1) + '-' +
369786
- pad(now.getDate()) + ' ' +
369787
- pad(now.getHours()) + ':' +
369788
- pad(now.getMinutes()) + ':' +
369789
- pad(now.getSeconds()) + '.' +
369790
- pad(Math.floor(now.getMilliseconds() / 10))
369791
- );
369792
- }
369793
-
369794
- function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
369795
- if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
369796
-
369797
- if (arg && typeof arg === "object") {
369798
- if (visited.has(arg)) {
369799
- return { "type": SerializedType.String, "value": "[Circular reference]" };
369800
- }
369801
- visited.add(arg);
369802
- }
369803
-
369804
- const type = typeof arg;
369805
- if (arg === null) return { "type": SerializedType.Null, "value": "null" };
369806
- if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
369807
- if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
369808
- if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
369809
- if (type === "string") return { "type": SerializedType.String, "value": arg };
369810
-
369811
- if (Array.isArray(arg)) {
369812
- return {
369813
- "type": SerializedType.Array,
369814
- "value": arg.map(item => serialize(item, depth + 1, maxDepth))
369815
- };
369816
- }
369817
-
369818
- if (type === "object" && arg !== null) {
369819
- const props = {};
369820
- try {
369821
- for (let key in arg) {
369822
- if (arg.hasOwnProperty(key)) {
369823
- props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
369824
- }
369825
- }
369826
- } catch (error) {
369827
- console.error("Error serializing object property:", error);
369828
- }
369829
- return { "type": SerializedType.Object, "value": props };
369830
- }
369831
-
369832
- return { "type": SerializedType.String, "value": String(arg) };
369833
- }
369834
-
369835
- methods.forEach(m => {
369836
- original[m] = console[m] || function(){};
369837
-
369838
- console[m] = function(...args) {
369839
- const timestamp = getTimestamp();
369840
-
369841
- let level = m;
369842
- let serializedArgs = args.map(arg => serialize(arg));
369843
-
369844
- if (m === "assert") {
369845
- const condition = Boolean(args[0]);
369846
- const messageArgs = args.slice(1);
369847
-
369848
- serializedArgs =
369849
- messageArgs.length > 0
369850
- ? messageArgs.map(arg => serialize(arg))
369851
- : [
369852
- {
369853
- "type": "string",
369854
- "value": condition ? "Assertion passed" : "Assertion failed",
369855
- },
369856
- ];
369857
-
369858
- level = condition ? "log" : "error";
369859
- }
369860
-
369861
- window.parent.postMessage({
369862
- "type": "console",
369863
- "method": level,
369864
- "data": serializedArgs,
369865
- "timestamp": timestamp
369866
- }, "*");
369867
-
369868
- original[m](...args);
369869
- };
369870
- });
369871
-
369872
- window.addEventListener("error", function(event) {
369873
- const timestamp = getTimestamp();
369874
- const error = event.error;
369875
-
369876
- let message;
369877
- if (error && error.name && error.message) {
369878
- message = error.name + ": " + error.message;
369879
- } else if (event.message) {
369880
- message = event.message;
369881
- } else {
369882
- message = "Unknown JavaScript error";
369883
- }
369884
-
369885
- let displayFilename = event.filename;
369886
-
369887
- if (
369888
- typeof displayFilename === "string" &&
369889
- displayFilename.startsWith("blob:")
369890
- ) {
369891
- const sourceMap = window.__blobSourceMap__ || {};
369892
- const mappedFilename = sourceMap[displayFilename];
369893
-
369894
- if (mappedFilename) {
369895
- displayFilename = mappedFilename;
369896
- } else {
369897
- const meta = document.querySelector("meta[filename]");
369898
- displayFilename =
369899
- (meta && meta.getAttribute("filename")) || "preview";
369900
- }
369901
- }
369902
-
369903
- const location =
369904
- displayFilename || event.lineno || event.colno
369905
- ? " at " +
369906
- [displayFilename, event.lineno, event.colno]
369907
- .filter(Boolean)
369908
- .join(":")
369909
- : "";
369910
-
369911
- window.parent.postMessage({
369912
- "type": "console",
369913
- "method": "error",
369914
- "data": [
369915
- { "type": "string", "value": message + location }
369916
- ],
369917
- "timestamp": timestamp
369918
- }, "*");
369919
- });
369920
-
369921
- window.addEventListener("unhandledrejection", function(event) {
369922
- const timestamp = getTimestamp();
369923
- const reason = event.reason;
369924
-
369925
- let message;
369926
- if (reason && reason.name && reason.message) {
369927
- message = reason.name + ": " + reason.message;
369928
- } else if (typeof reason === "string") {
369929
- message = "UnhandledPromiseRejection: " + reason;
369930
- } else {
369931
- message = "UnhandledPromiseRejection: " + String(reason);
369932
- }
369933
-
369934
- window.parent.postMessage({
369935
- "type": "console",
369936
- "method": "error",
369937
- "data": [
369938
- { "type": "string", "value": message }
369939
- ],
369940
- "timestamp": timestamp
369941
- }, "*");
369942
- });
369943
- })();
369944
- </script>
369780
+ exports.consoleOverrideScript = `
369781
+ <script>
369782
+ (function() {
369783
+ const SerializedType = {
369784
+ Null: "null",
369785
+ Undefined: "undefined",
369786
+ Boolean: "boolean",
369787
+ Number: "number",
369788
+ String: "string",
369789
+ Array: "array",
369790
+ Object: "object",
369791
+ };
369792
+
369793
+ const original = {};
369794
+ const methods = ["log", "error", "warn", "info", "debug", "assert"];
369795
+
369796
+ function getTimestamp() {
369797
+ const now = new Date();
369798
+ const pad = (n) => String(n).padStart(2, '0');
369799
+
369800
+ return (
369801
+ now.getFullYear() + '-' +
369802
+ pad(now.getMonth() + 1) + '-' +
369803
+ pad(now.getDate()) + ' ' +
369804
+ pad(now.getHours()) + ':' +
369805
+ pad(now.getMinutes()) + ':' +
369806
+ pad(now.getSeconds()) + '.' +
369807
+ pad(Math.floor(now.getMilliseconds() / 10))
369808
+ );
369809
+ }
369810
+
369811
+ function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
369812
+ if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
369813
+
369814
+ if (arg && typeof arg === "object") {
369815
+ if (visited.has(arg)) {
369816
+ return { "type": SerializedType.String, "value": "[Circular reference]" };
369817
+ }
369818
+ visited.add(arg);
369819
+ }
369820
+
369821
+ const type = typeof arg;
369822
+ if (arg === null) return { "type": SerializedType.Null, "value": "null" };
369823
+ if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
369824
+ if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
369825
+ if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
369826
+ if (type === "string") return { "type": SerializedType.String, "value": arg };
369827
+
369828
+ if (Array.isArray(arg)) {
369829
+ return {
369830
+ "type": SerializedType.Array,
369831
+ "value": arg.map(item => serialize(item, depth + 1, maxDepth))
369832
+ };
369833
+ }
369834
+
369835
+ if (type === "object" && arg !== null) {
369836
+ const props = {};
369837
+ try {
369838
+ for (let key in arg) {
369839
+ if (arg.hasOwnProperty(key)) {
369840
+ props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
369841
+ }
369842
+ }
369843
+ } catch (error) {
369844
+ console.error("Error serializing object property:", error);
369845
+ }
369846
+ return { "type": SerializedType.Object, "value": props };
369847
+ }
369848
+
369849
+ return { "type": SerializedType.String, "value": String(arg) };
369850
+ }
369851
+
369852
+ methods.forEach(m => {
369853
+ original[m] = console[m] || function(){};
369854
+
369855
+ console[m] = function(...args) {
369856
+ const timestamp = getTimestamp();
369857
+
369858
+ let level = m;
369859
+ let serializedArgs = args.map(arg => serialize(arg));
369860
+
369861
+ if (m === "assert") {
369862
+ const condition = Boolean(args[0]);
369863
+ const messageArgs = args.slice(1);
369864
+
369865
+ serializedArgs =
369866
+ messageArgs.length > 0
369867
+ ? messageArgs.map(arg => serialize(arg))
369868
+ : [
369869
+ {
369870
+ "type": "string",
369871
+ "value": condition ? "Assertion passed" : "Assertion failed",
369872
+ },
369873
+ ];
369874
+
369875
+ level = condition ? "log" : "error";
369876
+ }
369877
+
369878
+ window.parent.postMessage({
369879
+ "type": "console",
369880
+ "method": level,
369881
+ "data": serializedArgs,
369882
+ "timestamp": timestamp
369883
+ }, "*");
369884
+
369885
+ original[m](...args);
369886
+ };
369887
+ });
369888
+
369889
+ window.addEventListener("error", function(event) {
369890
+ const timestamp = getTimestamp();
369891
+ const error = event.error;
369892
+
369893
+ let message;
369894
+ if (error && error.name && error.message) {
369895
+ message = error.name + ": " + error.message;
369896
+ } else if (event.message) {
369897
+ message = event.message;
369898
+ } else {
369899
+ message = "Unknown JavaScript error";
369900
+ }
369901
+
369902
+ let displayFilename = event.filename;
369903
+
369904
+ if (
369905
+ typeof displayFilename === "string" &&
369906
+ displayFilename.startsWith("blob:")
369907
+ ) {
369908
+ const sourceMap = window.__blobSourceMap__ || {};
369909
+ const mappedFilename = sourceMap[displayFilename];
369910
+
369911
+ if (mappedFilename) {
369912
+ displayFilename = mappedFilename;
369913
+ } else {
369914
+ const meta = document.querySelector("meta[filename]");
369915
+ displayFilename =
369916
+ (meta && meta.getAttribute("filename")) || "preview";
369917
+ }
369918
+ }
369919
+
369920
+ const location =
369921
+ displayFilename || event.lineno || event.colno
369922
+ ? " at " +
369923
+ [displayFilename, event.lineno, event.colno]
369924
+ .filter(Boolean)
369925
+ .join(":")
369926
+ : "";
369927
+
369928
+ window.parent.postMessage({
369929
+ "type": "console",
369930
+ "method": "error",
369931
+ "data": [
369932
+ { "type": "string", "value": message + location }
369933
+ ],
369934
+ "timestamp": timestamp
369935
+ }, "*");
369936
+ });
369937
+
369938
+ window.addEventListener("unhandledrejection", function(event) {
369939
+ const timestamp = getTimestamp();
369940
+ const reason = event.reason;
369941
+
369942
+ let message;
369943
+ if (reason && reason.name && reason.message) {
369944
+ message = reason.name + ": " + reason.message;
369945
+ } else if (typeof reason === "string") {
369946
+ message = "UnhandledPromiseRejection: " + reason;
369947
+ } else {
369948
+ message = "UnhandledPromiseRejection: " + String(reason);
369949
+ }
369950
+
369951
+ window.parent.postMessage({
369952
+ "type": "console",
369953
+ "method": "error",
369954
+ "data": [
369955
+ { "type": "string", "value": message }
369956
+ ],
369957
+ "timestamp": timestamp
369958
+ }, "*");
369959
+ });
369960
+ })();
369961
+ </script>
369945
369962
  `;
369946
369963
 
369947
369964
 
@@ -370046,6 +370063,7 @@ const PyodideRunner = ({ active, packageApiUrl, }) => {
370046
370063
  const interruptBuffer = (0, react_1.useRef)(null);
370047
370064
  const stdinBuffer = (0, react_1.useRef)(null);
370048
370065
  const stdinClosed = (0, react_1.useRef)(false);
370066
+ const workerReady = (0, react_1.useRef)(false);
370049
370067
  const loadedRunner = (0, stores_1.useAppSelector)((state) => state.editor.loadedRunner);
370050
370068
  const project = (0, stores_1.useAppSelector)((s) => s.editor.project);
370051
370069
  const projectComponents = project.components || [];
@@ -370096,7 +370114,9 @@ const PyodideRunner = ({ active, packageApiUrl, }) => {
370096
370114
  console.log("Destroying and recreating Pyodide worker");
370097
370115
  pyodideWorker.terminate();
370098
370116
  }
370117
+ workerReady.current = false;
370099
370118
  interruptBuffer.current = null;
370119
+ stdinBuffer.current = null;
370100
370120
  stdinClosed.current = false;
370101
370121
  disableInput();
370102
370122
  const newWorker = createWorker();
@@ -370141,6 +370161,7 @@ const PyodideRunner = ({ active, packageApiUrl, }) => {
370141
370161
  const handleLoaded = (stdin, interrupt) => {
370142
370162
  stdinBuffer.current = stdin;
370143
370163
  interruptBuffer.current = interrupt;
370164
+ workerReady.current = true;
370144
370165
  if (loadedRunner !== EditorTypes_1.RunnerType.PYODIDE) {
370145
370166
  dispatch((0, EditorSlice_1.setLoadedRunner)(EditorTypes_1.RunnerType.PYODIDE));
370146
370167
  }
@@ -370254,6 +370275,9 @@ const PyodideRunner = ({ active, packageApiUrl, }) => {
370254
370275
  setVisuals((array) => [...array, { origin, content }]);
370255
370276
  };
370256
370277
  const handleRun = async () => {
370278
+ if (!workerReady.current || !pyodideWorker) {
370279
+ return;
370280
+ }
370257
370281
  if (output.current) {
370258
370282
  output.current.innerHTML = "";
370259
370283
  }
@@ -370318,7 +370342,6 @@ const PyodideRunner = ({ active, packageApiUrl, }) => {
370318
370342
  type: Errors_1.ErrorType.RUNTIME_ERROR,
370319
370343
  message: "Execution interrupted",
370320
370344
  }));
370321
- dispatch((0, EditorSlice_1.codeRunHandled)());
370322
370345
  };
370323
370346
  const writeFile = (filename, content) => {
370324
370347
  pyodideWorker?.postMessage({ method: "writeFile", filename, content });
@@ -371757,17 +371780,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
371757
371780
  const jsx_runtime_1 = __webpack_require__(74848);
371758
371781
  const ContextMenu_1 = __importDefault(__webpack_require__(39179));
371759
371782
  const AuthContext_1 = __webpack_require__(55471);
371760
- const BeforeUnloadContext_1 = __webpack_require__(2373);
371761
371783
  const UserMenu = (props) => {
371762
371784
  const { anchorRef, opened, onClose } = props;
371763
371785
  const { onLogout, onViewProfile } = (0, AuthContext_1.useAuthActions)();
371764
- const beforeUnloadRef = (0, BeforeUnloadContext_1.useBeforeUnload)();
371765
- const handleLogout = () => {
371766
- if (beforeUnloadRef?.current) {
371767
- window.removeEventListener("beforeunload", beforeUnloadRef.current);
371768
- }
371769
- onLogout();
371770
- };
371771
371786
  return ((0, jsx_runtime_1.jsx)(ContextMenu_1.default, { align: "start", direction: "top", menuWidth: 142, menuOptions: [
371772
371787
  {
371773
371788
  text: "View Profile",
@@ -371775,7 +371790,7 @@ const UserMenu = (props) => {
371775
371790
  },
371776
371791
  {
371777
371792
  text: "Logout",
371778
- action: handleLogout,
371793
+ action: onLogout,
371779
371794
  },
371780
371795
  ], opened: opened, anchorRef: anchorRef, onClose: onClose, gap: 4 }));
371781
371796
  };
@@ -372344,7 +372359,7 @@ const WebComponentProject = ({ nameEditable = false, sidebarOptions = [], packag
372344
372359
  return () => clearTimeout(timeout);
372345
372360
  }, [project]);
372346
372361
  renderer.link = function (data) {
372347
- return `<a href="${data.href}" target="_blank" rel="noreferrer"
372362
+ return `<a href="${data.href}" target="_blank" rel="noreferrer"
372348
372363
  }">${data.text}</a>`;
372349
372364
  };
372350
372365
  marked_1.marked.setOptions({
@@ -372470,7 +372485,6 @@ const ToastMessages_1 = __webpack_require__(6459);
372470
372485
  const Modals_1 = __webpack_require__(18284);
372471
372486
  const Loading_1 = __importDefault(__webpack_require__(34466));
372472
372487
  const stores_1 = __webpack_require__(32132);
372473
- const BeforeUnloadContext_1 = __webpack_require__(2373);
372474
372488
  const SaveBeforeLeave_1 = __webpack_require__(47318);
372475
372489
  const selectors_1 = __webpack_require__(43551);
372476
372490
  const WebComponentLoader = (props) => {
@@ -372571,10 +372585,10 @@ const WebComponentLoader = (props) => {
372571
372585
  (0, react_1.useEffect)(() => {
372572
372586
  // Create a script element to save the existing Prism object if there is one
372573
372587
  const script = document.createElement("script");
372574
- script.textContent = `
372575
- if (window.Prism) {
372576
- window.syntaxHighlight = window.Prism;
372577
- }
372588
+ script.textContent = `
372589
+ if (window.Prism) {
372590
+ window.syntaxHighlight = window.Prism;
372591
+ }
372578
372592
  `;
372579
372593
  // Append the script to the document body
372580
372594
  document.body.appendChild(script);
@@ -372585,7 +372599,6 @@ const WebComponentLoader = (props) => {
372585
372599
  }, []);
372586
372600
  const modal = (modalWindowShowing && Modals_1.ModalTypeToComponentMap[modalWindowShowing]) ?? null;
372587
372601
  const isReadOnly = (0, stores_1.useAppSelector)((state) => state.editor.readOnly);
372588
- const beforeUnloadRef = (0, react_1.useRef)(null);
372589
372602
  const shouldBlockNavigation = (0, stores_1.useAppSelector)(selectors_1.selectProjectDirtyState);
372590
372603
  // effect for browser actions (refresh, tab close etc)
372591
372604
  (0, react_1.useEffect)(() => {
@@ -372597,17 +372610,15 @@ const WebComponentLoader = (props) => {
372597
372610
  // for browsers to show the confirmation dialog
372598
372611
  e.returnValue = "";
372599
372612
  };
372600
- beforeUnloadRef.current = handleBeforeUnload;
372601
372613
  window.addEventListener("beforeunload", handleBeforeUnload);
372602
372614
  return () => {
372603
372615
  window.removeEventListener("beforeunload", handleBeforeUnload);
372604
- beforeUnloadRef.current = null;
372605
372616
  };
372606
- }, [isPreviewMode, isReadOnly, shouldBlockNavigation]);
372607
- const renderSuccessState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(BeforeUnloadContext_1.BeforeUnloadContext.Provider, { value: beforeUnloadRef, children: (0, jsx_runtime_1.jsxs)(settings_1.SettingsContext.Provider, { value: {
372608
- theme: themeDefault,
372609
- fontSize: "small",
372610
- }, children: [(0, jsx_runtime_1.jsx)(ToastMessages_1.ToastMessagesProvider, {}), (0, jsx_runtime_1.jsxs)("div", { id: "textjam-root", className: `editor-shell --${themeDefault}`, children: [(0, jsx_runtime_1.jsx)(WebComponentProject_1.default, { nameEditable: projectNameEditable, sidebarOptions: sidebarOptions, packageApiUrl: packageApiUrl }), errorModalShowing && (0, jsx_runtime_1.jsx)(ErrorModal_1.default, {}), modal, (0, jsx_runtime_1.jsx)(SaveBeforeLeave_1.SaveBeforeLeaveModal, {})] })] }) }) }));
372617
+ }, [shouldBlockNavigation, isPreviewMode, isReadOnly]);
372618
+ const renderSuccessState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(settings_1.SettingsContext.Provider, { value: {
372619
+ theme: themeDefault,
372620
+ fontSize: "small",
372621
+ }, children: [(0, jsx_runtime_1.jsx)(ToastMessages_1.ToastMessagesProvider, {}), (0, jsx_runtime_1.jsxs)("div", { id: "textjam-root", className: `editor-shell --${themeDefault}`, children: [(0, jsx_runtime_1.jsx)(WebComponentProject_1.default, { nameEditable: projectNameEditable, sidebarOptions: sidebarOptions, packageApiUrl: packageApiUrl }), errorModalShowing && (0, jsx_runtime_1.jsx)(ErrorModal_1.default, {}), modal, shouldBlockNavigation && (0, jsx_runtime_1.jsx)(SaveBeforeLeave_1.SaveBeforeLeaveModal, {})] })] }) }));
372611
372622
  const renderFailedState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("p", { children: t("webComponent.failed") }) }));
372612
372623
  const renderLoadingState = () => (0, jsx_runtime_1.jsx)(Loading_1.default, {});
372613
372624
  if (loading === types_1.LoadingState.SUCCESS) {
@@ -372648,20 +372659,6 @@ const useAuthActions = () => {
372648
372659
  exports.useAuthActions = useAuthActions;
372649
372660
 
372650
372661
 
372651
- /***/ }),
372652
-
372653
- /***/ 2373:
372654
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
372655
-
372656
-
372657
- Object.defineProperty(exports, "__esModule", ({ value: true }));
372658
- exports.useBeforeUnload = exports.BeforeUnloadContext = void 0;
372659
- const react_1 = __webpack_require__(51649);
372660
- exports.BeforeUnloadContext = (0, react_1.createContext)(null);
372661
- const useBeforeUnload = () => (0, react_1.useContext)(exports.BeforeUnloadContext);
372662
- exports.useBeforeUnload = useBeforeUnload;
372663
-
372664
-
372665
372662
  /***/ }),
372666
372663
 
372667
372664
  /***/ 59578:
@@ -373718,15 +373715,21 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
373718
373715
  components: cleanedComponents,
373719
373716
  identifier: projectData.identifier,
373720
373717
  };
373718
+ const newLastSavedSnapshot = (0, buildProjectSnapshot_1.buildProjectSnapshot)(cleanedProject);
373721
373719
  const updatedProjectSnapshot = {
373722
373720
  components: cleanedComponents,
373723
373721
  hasStructureChanges: false,
373724
- lastSavedSnapshot: (0, buildProjectSnapshot_1.buildProjectSnapshot)(cleanedProject),
373722
+ lastSavedSnapshot: newLastSavedSnapshot,
373725
373723
  identifier: projectData.identifier,
373726
373724
  };
373727
373725
  dispatch((0, EditorSlice_1.updateProjectSnapshot)(updatedProjectSnapshot));
373726
+ upsertCacheValue(cleanedProject.identifier, {
373727
+ ...cleanedProject,
373728
+ lastSavedSnapshot: newLastSavedSnapshot,
373729
+ });
373728
373730
  }, [
373729
373731
  deleteValueFromCache,
373732
+ upsertCacheValue,
373730
373733
  dispatch,
373731
373734
  project,
373732
373735
  projectData?.identifier,
@@ -374882,6 +374885,7 @@ exports.IndexedDb = {
374882
374885
  Object.defineProperty(exports, "__esModule", ({ value: true }));
374883
374886
  exports.LeaveGuardController = void 0;
374884
374887
  const LeaveFlowSlice_1 = __webpack_require__(52990);
374888
+ const selectors_1 = __webpack_require__(43551);
374885
374889
  class LeaveGuardController {
374886
374890
  store;
374887
374891
  pendingPromise = null;
@@ -374891,12 +374895,11 @@ class LeaveGuardController {
374891
374895
  this.store = store;
374892
374896
  }
374893
374897
  canLeave = () => {
374894
- // TODO: activate when the check is implemented
374895
- // const state = this.store.getState();
374896
- // const isDirty = selectIsDirty(state);
374897
- // if (!isDirty) {
374898
- // return Promise.resolve(true);
374899
- // }
374898
+ const state = this.store.getState();
374899
+ const isDirty = (0, selectors_1.selectProjectDirtyState)(state);
374900
+ if (!isDirty) {
374901
+ return Promise.resolve(true);
374902
+ }
374900
374903
  if (this.pendingPromise) {
374901
374904
  return this.pendingPromise;
374902
374905
  }
@@ -383262,7 +383265,7 @@ module.exports = webpackAsyncContext;
383262
383265
  /***/ 24427:
383263
383266
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
383264
383267
 
383265
- module.exports = __webpack_require__.p + "assets/PyodideWorkerd2b0583273d433314bf9.js";
383268
+ module.exports = __webpack_require__.p + "assets/PyodideWorker0e6512099ae51c6f104a.js";
383266
383269
 
383267
383270
  /***/ }),
383268
383271