gwchq-textjam 0.2.32 → 0.2.34

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
@@ -68207,7 +68207,7 @@ __webpack_require__.d(__webpack_exports__, {
68207
68207
  });
68208
68208
 
68209
68209
  ;// ./src/assets/editor/pyodide/shims/pygal.js?url
68210
- const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalc0b4f32d2d2cc5a0c638.js";
68210
+ const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalef3b78a56cb1d66beb61.js";
68211
68211
  ;// ./src/assets/editor/pyodide/packages/turtle-0.0.1-py3-none-any.whl?url
68212
68212
  const turtle_0_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "assets/turtle-0.0.1-py3-none-any0c3147a3e0c3188b2544.whl";
68213
68213
  ;// ./src/assets/editor/pyodide/packages/p5-0.0.1-py3-none-any.whl?url
@@ -68348,8 +68348,8 @@ __webpack_require__.r(__webpack_exports__);
68348
68348
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68349
68349
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68350
68350
  /* harmony export */ });
68351
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
68352
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
68351
+ /* harmony import */ var C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
68352
+ /* harmony import */ var C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
68353
68353
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
68354
68354
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
68355
68355
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
@@ -68373,7 +68373,7 @@ var DraggableTab = _ref => {
68373
68373
  panelIndex,
68374
68374
  fileIndex
68375
68375
  } = _ref,
68376
- otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
68376
+ otherProps = (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
68377
68377
  var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
68378
68378
  var openFilesCount = openFiles[panelIndex].length;
68379
68379
  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
@@ -68390,7 +68390,7 @@ var DraggableTab = _ref => {
68390
68390
  switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
68391
68391
  }
68392
68392
  };
68393
- var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68393
+ var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68394
68394
  onClick: e => {
68395
68395
  e.stopPropagation();
68396
68396
  switchToFileTab(panelIndex, fileIndex);
@@ -68408,7 +68408,7 @@ var DraggableTab = _ref => {
68408
68408
  draggableProps,
68409
68409
  dragHandleProps
68410
68410
  } = _ref2;
68411
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68411
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
68412
68412
  className: "draggable-tab",
68413
68413
  ref: innerRef
68414
68414
  }, draggableProps), dragHandleProps), {}, {
@@ -68430,8 +68430,8 @@ __webpack_require__.r(__webpack_exports__);
68430
68430
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68431
68431
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68432
68432
  /* harmony export */ });
68433
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
68434
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
68433
+ /* harmony import */ var C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
68434
+ /* harmony import */ var C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
68435
68435
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
68436
68436
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
68437
68437
  /* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
@@ -68450,8 +68450,8 @@ var DroppableTabList = _ref => {
68450
68450
  children: _children,
68451
68451
  index
68452
68452
  } = _ref,
68453
- otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
68454
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
68453
+ otherProps = (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
68454
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
68455
68455
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
68456
68456
  direction: "horizontal",
68457
68457
  droppableId: index.toString(),
@@ -68461,7 +68461,7 @@ var DroppableTabList = _ref => {
68461
68461
  droppableProps,
68462
68462
  placeholder
68463
68463
  } = _ref2;
68464
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
68464
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
68465
68465
  className: "droppable-tab-list"
68466
68466
  }, droppableProps), {}, {
68467
68467
  ref: innerRef,
@@ -102222,8 +102222,8 @@ __webpack_require__.r(__webpack_exports__);
102222
102222
 
102223
102223
 
102224
102224
  // TODO: refactor existing modals
102225
- /** !deprecated!
102226
- * use BaseModal from `index.tsx` instead
102225
+ /** !deprecated!
102226
+ * use BaseModal from `index.tsx` instead
102227
102227
  */
102228
102228
 
102229
102229
  var BaseModal = _ref => {
@@ -103015,7 +103015,7 @@ __webpack_require__.r(__webpack_exports__);
103015
103015
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
103016
103016
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
103017
103017
  /* harmony export */ });
103018
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
103018
+ /* harmony import */ var C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
103019
103019
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
103020
103020
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
103021
103021
  /* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
@@ -103129,7 +103129,7 @@ var ProjectName = _ref => {
103129
103129
  id: "project_name_label",
103130
103130
  className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
103131
103131
  children: "Project Name"
103132
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
103132
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,C_Project_source_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
103133
103133
  className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
103134
103134
  }, hoverProps), {}, {
103135
103135
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
@@ -103490,7 +103490,7 @@ var SaveButton = props => {
103490
103490
  }, hoverProps), {}, {
103491
103491
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)((Tooltip_default()), {
103492
103492
  message: NO_CHANGES_TO_SAVE_MESSAGE,
103493
- visible: !hasChangesToSave && hovered,
103493
+ visible: hovered && !hasChangesToSave,
103494
103494
  position: "bottom"
103495
103495
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], (0,objectSpread2/* default */.A)({
103496
103496
  buttonText: buttonText,
@@ -116719,115 +116719,6 @@ function escapeName(str, charsToEscape) {
116719
116719
 
116720
116720
 
116721
116721
 
116722
- /***/ }),
116723
-
116724
- /***/ 16450:
116725
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
116726
-
116727
-
116728
-
116729
- var isValue = __webpack_require__(48175)
116730
- , ensureValue = __webpack_require__(34809)
116731
- , ensurePlainFunction = __webpack_require__(90251)
116732
- , copy = __webpack_require__(30203)
116733
- , normalizeOptions = __webpack_require__(90148)
116734
- , map = __webpack_require__(30498);
116735
-
116736
- var bind = Function.prototype.bind
116737
- , defineProperty = Object.defineProperty
116738
- , hasOwnProperty = Object.prototype.hasOwnProperty
116739
- , define;
116740
-
116741
- define = function (name, desc, options) {
116742
- var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
116743
- dgs = copy(desc);
116744
- delete dgs.writable;
116745
- delete dgs.value;
116746
- dgs.get = function () {
116747
- if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
116748
- desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
116749
- defineProperty(this, name, desc);
116750
- return this[name];
116751
- };
116752
- return dgs;
116753
- };
116754
-
116755
- module.exports = function (props/*, options*/) {
116756
- var options = normalizeOptions(arguments[1]);
116757
- if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
116758
- return map(props, function (desc, name) { return define(name, desc, options); });
116759
- };
116760
-
116761
-
116762
- /***/ }),
116763
-
116764
- /***/ 58263:
116765
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
116766
-
116767
-
116768
-
116769
- var isValue = __webpack_require__(48175)
116770
- , isPlainFunction = __webpack_require__(6873)
116771
- , assign = __webpack_require__(16596)
116772
- , normalizeOpts = __webpack_require__(90148)
116773
- , contains = __webpack_require__(70214);
116774
-
116775
- var d = (module.exports = function (dscr, value/*, options*/) {
116776
- var c, e, w, options, desc;
116777
- if (arguments.length < 2 || typeof dscr !== "string") {
116778
- options = value;
116779
- value = dscr;
116780
- dscr = null;
116781
- } else {
116782
- options = arguments[2];
116783
- }
116784
- if (isValue(dscr)) {
116785
- c = contains.call(dscr, "c");
116786
- e = contains.call(dscr, "e");
116787
- w = contains.call(dscr, "w");
116788
- } else {
116789
- c = w = true;
116790
- e = false;
116791
- }
116792
-
116793
- desc = { value: value, configurable: c, enumerable: e, writable: w };
116794
- return !options ? desc : assign(normalizeOpts(options), desc);
116795
- });
116796
-
116797
- d.gs = function (dscr, get, set/*, options*/) {
116798
- var c, e, options, desc;
116799
- if (typeof dscr !== "string") {
116800
- options = set;
116801
- set = get;
116802
- get = dscr;
116803
- dscr = null;
116804
- } else {
116805
- options = arguments[3];
116806
- }
116807
- if (!isValue(get)) {
116808
- get = undefined;
116809
- } else if (!isPlainFunction(get)) {
116810
- options = get;
116811
- get = set = undefined;
116812
- } else if (!isValue(set)) {
116813
- set = undefined;
116814
- } else if (!isPlainFunction(set)) {
116815
- options = set;
116816
- set = undefined;
116817
- }
116818
- if (isValue(dscr)) {
116819
- c = contains.call(dscr, "c");
116820
- e = contains.call(dscr, "e");
116821
- } else {
116822
- c = true;
116823
- e = false;
116824
- }
116825
-
116826
- desc = { get: get, set: set, configurable: c, enumerable: e };
116827
- return !options ? desc : assign(normalizeOpts(options), desc);
116828
- };
116829
-
116830
-
116831
116722
  /***/ }),
116832
116723
 
116833
116724
  /***/ 83999:
@@ -131656,6 +131547,115 @@ year.every = function(k) {
131656
131547
  var years = year.range;
131657
131548
 
131658
131549
 
131550
+ /***/ }),
131551
+
131552
+ /***/ 16450:
131553
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
131554
+
131555
+
131556
+
131557
+ var isValue = __webpack_require__(48175)
131558
+ , ensureValue = __webpack_require__(34809)
131559
+ , ensurePlainFunction = __webpack_require__(90251)
131560
+ , copy = __webpack_require__(30203)
131561
+ , normalizeOptions = __webpack_require__(90148)
131562
+ , map = __webpack_require__(30498);
131563
+
131564
+ var bind = Function.prototype.bind
131565
+ , defineProperty = Object.defineProperty
131566
+ , hasOwnProperty = Object.prototype.hasOwnProperty
131567
+ , define;
131568
+
131569
+ define = function (name, desc, options) {
131570
+ var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
131571
+ dgs = copy(desc);
131572
+ delete dgs.writable;
131573
+ delete dgs.value;
131574
+ dgs.get = function () {
131575
+ if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
131576
+ desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
131577
+ defineProperty(this, name, desc);
131578
+ return this[name];
131579
+ };
131580
+ return dgs;
131581
+ };
131582
+
131583
+ module.exports = function (props/*, options*/) {
131584
+ var options = normalizeOptions(arguments[1]);
131585
+ if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
131586
+ return map(props, function (desc, name) { return define(name, desc, options); });
131587
+ };
131588
+
131589
+
131590
+ /***/ }),
131591
+
131592
+ /***/ 58263:
131593
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
131594
+
131595
+
131596
+
131597
+ var isValue = __webpack_require__(48175)
131598
+ , isPlainFunction = __webpack_require__(6873)
131599
+ , assign = __webpack_require__(16596)
131600
+ , normalizeOpts = __webpack_require__(90148)
131601
+ , contains = __webpack_require__(70214);
131602
+
131603
+ var d = (module.exports = function (dscr, value/*, options*/) {
131604
+ var c, e, w, options, desc;
131605
+ if (arguments.length < 2 || typeof dscr !== "string") {
131606
+ options = value;
131607
+ value = dscr;
131608
+ dscr = null;
131609
+ } else {
131610
+ options = arguments[2];
131611
+ }
131612
+ if (isValue(dscr)) {
131613
+ c = contains.call(dscr, "c");
131614
+ e = contains.call(dscr, "e");
131615
+ w = contains.call(dscr, "w");
131616
+ } else {
131617
+ c = w = true;
131618
+ e = false;
131619
+ }
131620
+
131621
+ desc = { value: value, configurable: c, enumerable: e, writable: w };
131622
+ return !options ? desc : assign(normalizeOpts(options), desc);
131623
+ });
131624
+
131625
+ d.gs = function (dscr, get, set/*, options*/) {
131626
+ var c, e, options, desc;
131627
+ if (typeof dscr !== "string") {
131628
+ options = set;
131629
+ set = get;
131630
+ get = dscr;
131631
+ dscr = null;
131632
+ } else {
131633
+ options = arguments[3];
131634
+ }
131635
+ if (!isValue(get)) {
131636
+ get = undefined;
131637
+ } else if (!isPlainFunction(get)) {
131638
+ options = get;
131639
+ get = set = undefined;
131640
+ } else if (!isValue(set)) {
131641
+ set = undefined;
131642
+ } else if (!isPlainFunction(set)) {
131643
+ options = set;
131644
+ set = undefined;
131645
+ }
131646
+ if (isValue(dscr)) {
131647
+ c = contains.call(dscr, "c");
131648
+ e = contains.call(dscr, "e");
131649
+ } else {
131650
+ c = true;
131651
+ e = false;
131652
+ }
131653
+
131654
+ desc = { get: get, set: set, configurable: c, enumerable: e };
131655
+ return !options ? desc : assign(normalizeOpts(options), desc);
131656
+ };
131657
+
131658
+
131659
131659
  /***/ }),
131660
131660
 
131661
131661
  /***/ 30041:
@@ -142941,7 +142941,7 @@ __webpack_require__.r(__webpack_exports__);
142941
142941
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
142942
142942
  /* harmony export */ });
142943
142943
  // extracted by mini-css-extract-plugin
142944
- /* 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","tree":"styles-module__tree--KziAJ","fileTreeActions":"styles-module__fileTreeActions--k+Wsd","fileTreeActionsLabel":"styles-module__fileTreeActionsLabel--dPZp4","importButton":"styles-module__importButton--rcLUm","importArrowIcon":"styles-module__importArrowIcon--3eOLN","label":"styles-module__label--WY51f","iconButton":"styles-module__iconButton--6UIVe","iconButtonFilled":"styles-module__iconButtonFilled--w2vJC","dragline":"styles-module__dragline--RXmTT","emptyStateContainer":"styles-module__emptyStateContainer--AnTAm","emptyStateIcon":"styles-module__emptyStateIcon--sDlxK","emptyStateMessage":"styles-module__emptyStateMessage--OkPax"});
142944
+ /* 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","tree":"styles-module__tree--KziAJ","fileTreeActions":"styles-module__fileTreeActions--k+Wsd","tooltipWrapper":"styles-module__tooltipWrapper--wltXE","fileTreeActionsLabel":"styles-module__fileTreeActionsLabel--dPZp4","importButton":"styles-module__importButton--rcLUm","importArrowIcon":"styles-module__importArrowIcon--3eOLN","label":"styles-module__label--WY51f","iconButton":"styles-module__iconButton--6UIVe","iconButtonFilled":"styles-module__iconButtonFilled--w2vJC","dragline":"styles-module__dragline--RXmTT","emptyStateContainer":"styles-module__emptyStateContainer--AnTAm","emptyStateIcon":"styles-module__emptyStateIcon--sDlxK","emptyStateMessage":"styles-module__emptyStateMessage--OkPax"});
142945
142945
 
142946
142946
  /***/ }),
142947
142947
 
@@ -143025,7 +143025,7 @@ __webpack_require__.r(__webpack_exports__);
143025
143025
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
143026
143026
  /* harmony export */ });
143027
143027
  // extracted by mini-css-extract-plugin
143028
- /* 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","wrapper":"styles-module__wrapper--NmEQI","header":"styles-module__header--UkMi-","headerBtn":"styles-module__headerBtn--kUJII","gwcLogo":"styles-module__gwcLogo--svs9k","textJamLogo":"styles-module__textJamLogo--dZcnz","btnSvg":"styles-module__btnSvg--Ri2uZ","projectName":"styles-module__projectName--6o3NT","linkButton":"styles-module__linkButton--bj6aP","sharedProject":"styles-module__sharedProject--baj0W","remixBtnContent":"styles-module__remixBtnContent--sJf5m"});
143028
+ /* 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","wrapper":"styles-module__wrapper--NmEQI","tooltipAnchor":"styles-module__tooltipAnchor--nyFj4","header":"styles-module__header--UkMi-","headerBtn":"styles-module__headerBtn--kUJII","gwcLogo":"styles-module__gwcLogo--svs9k","textJamLogo":"styles-module__textJamLogo--dZcnz","btnSvg":"styles-module__btnSvg--Ri2uZ","projectName":"styles-module__projectName--6o3NT","linkButton":"styles-module__linkButton--bj6aP","sharedProject":"styles-module__sharedProject--baj0W","remixBtnContent":"styles-module__remixBtnContent--sJf5m"});
143029
143029
 
143030
143030
  /***/ }),
143031
143031
 
@@ -143108,7 +143108,7 @@ __webpack_require__.r(__webpack_exports__);
143108
143108
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
143109
143109
  /* harmony export */ });
143110
143110
  // extracted by mini-css-extract-plugin
143111
- /* 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","tooltip":"styles-module__tooltip--7XFyr","visible":"styles-module__visible--wGPCM","position-bottom":"styles-module__position-bottom--Lwi+l","position-fixed":"styles-module__position-fixed--t8yrP"});
143111
+ /* 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","tooltip":"styles-module__tooltip--7XFyr","visible":"styles-module__visible--wGPCM","position-bottom":"styles-module__position-bottom--Lwi+l","position-bottom-right":"styles-module__position-bottom-right--SMrip","position-fixed":"styles-module__position-fixed--t8yrP","size-default":"styles-module__size-default--B+ZT4","size-fit":"styles-module__size-fit--ZW8rV"});
143112
143112
 
143113
143113
  /***/ }),
143114
143114
 
@@ -148247,6 +148247,324 @@ function hsl2rgb(hsl) {
148247
148247
  }
148248
148248
 
148249
148249
 
148250
+ /***/ }),
148251
+
148252
+ /***/ 9793:
148253
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148254
+
148255
+
148256
+
148257
+ var annAttrs = __webpack_require__(84676);
148258
+ var overrideAll = (__webpack_require__(70756).overrideAll);
148259
+ var templatedArray = (__webpack_require__(79338).templatedArray);
148260
+
148261
+ module.exports = overrideAll(templatedArray('annotation', {
148262
+ visible: annAttrs.visible,
148263
+ x: {
148264
+ valType: 'any',
148265
+ description: [
148266
+ 'Sets the annotation\'s x position.'
148267
+ ].join(' ')
148268
+ },
148269
+ y: {
148270
+ valType: 'any',
148271
+ description: [
148272
+ 'Sets the annotation\'s y position.'
148273
+ ].join(' ')
148274
+ },
148275
+ z: {
148276
+ valType: 'any',
148277
+ description: [
148278
+ 'Sets the annotation\'s z position.'
148279
+ ].join(' ')
148280
+ },
148281
+ ax: {
148282
+ valType: 'number',
148283
+ description: [
148284
+ 'Sets the x component of the arrow tail about the arrow head (in pixels).'
148285
+ ].join(' ')
148286
+ },
148287
+ ay: {
148288
+ valType: 'number',
148289
+ description: [
148290
+ 'Sets the y component of the arrow tail about the arrow head (in pixels).'
148291
+ ].join(' ')
148292
+ },
148293
+
148294
+ xanchor: annAttrs.xanchor,
148295
+ xshift: annAttrs.xshift,
148296
+ yanchor: annAttrs.yanchor,
148297
+ yshift: annAttrs.yshift,
148298
+
148299
+ text: annAttrs.text,
148300
+ textangle: annAttrs.textangle,
148301
+ font: annAttrs.font,
148302
+ width: annAttrs.width,
148303
+ height: annAttrs.height,
148304
+ opacity: annAttrs.opacity,
148305
+ align: annAttrs.align,
148306
+ valign: annAttrs.valign,
148307
+ bgcolor: annAttrs.bgcolor,
148308
+ bordercolor: annAttrs.bordercolor,
148309
+ borderpad: annAttrs.borderpad,
148310
+ borderwidth: annAttrs.borderwidth,
148311
+ showarrow: annAttrs.showarrow,
148312
+ arrowcolor: annAttrs.arrowcolor,
148313
+ arrowhead: annAttrs.arrowhead,
148314
+ startarrowhead: annAttrs.startarrowhead,
148315
+ arrowside: annAttrs.arrowside,
148316
+ arrowsize: annAttrs.arrowsize,
148317
+ startarrowsize: annAttrs.startarrowsize,
148318
+ arrowwidth: annAttrs.arrowwidth,
148319
+ standoff: annAttrs.standoff,
148320
+ startstandoff: annAttrs.startstandoff,
148321
+ hovertext: annAttrs.hovertext,
148322
+ hoverlabel: annAttrs.hoverlabel,
148323
+ captureevents: annAttrs.captureevents,
148324
+
148325
+ // maybes later?
148326
+ // clicktoshow: annAttrs.clicktoshow,
148327
+ // xclick: annAttrs.xclick,
148328
+ // yclick: annAttrs.yclick,
148329
+
148330
+ // not needed!
148331
+ // axref: 'pixel'
148332
+ // ayref: 'pixel'
148333
+ // xref: 'x'
148334
+ // yref: 'y
148335
+ // zref: 'z'
148336
+ }), 'calc', 'from-root');
148337
+
148338
+
148339
+ /***/ }),
148340
+
148341
+ /***/ 58121:
148342
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148343
+
148344
+
148345
+
148346
+ var Lib = __webpack_require__(30991);
148347
+ var Axes = __webpack_require__(15076);
148348
+
148349
+ module.exports = function convert(scene) {
148350
+ var fullSceneLayout = scene.fullSceneLayout;
148351
+ var anns = fullSceneLayout.annotations;
148352
+
148353
+ for(var i = 0; i < anns.length; i++) {
148354
+ mockAnnAxes(anns[i], scene);
148355
+ }
148356
+
148357
+ scene.fullLayout._infolayer
148358
+ .selectAll('.annotation-' + scene.id)
148359
+ .remove();
148360
+ };
148361
+
148362
+ function mockAnnAxes(ann, scene) {
148363
+ var fullSceneLayout = scene.fullSceneLayout;
148364
+ var domain = fullSceneLayout.domain;
148365
+ var size = scene.fullLayout._size;
148366
+
148367
+ var base = {
148368
+ // this gets fill in on render
148369
+ pdata: null,
148370
+
148371
+ // to get setConvert to not execute cleanly
148372
+ type: 'linear',
148373
+
148374
+ // don't try to update them on `editable: true`
148375
+ autorange: false,
148376
+
148377
+ // set infinite range so that annotation draw routine
148378
+ // does not try to remove 'outside-range' annotations,
148379
+ // this case is handled in the render loop
148380
+ range: [-Infinity, Infinity]
148381
+ };
148382
+
148383
+ ann._xa = {};
148384
+ Lib.extendFlat(ann._xa, base);
148385
+ Axes.setConvert(ann._xa);
148386
+ ann._xa._offset = size.l + domain.x[0] * size.w;
148387
+ ann._xa.l2p = function() {
148388
+ return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
148389
+ };
148390
+
148391
+ ann._ya = {};
148392
+ Lib.extendFlat(ann._ya, base);
148393
+ Axes.setConvert(ann._ya);
148394
+ ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
148395
+ ann._ya.l2p = function() {
148396
+ return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
148397
+ };
148398
+ }
148399
+
148400
+
148401
+ /***/ }),
148402
+
148403
+ /***/ 41926:
148404
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148405
+
148406
+
148407
+
148408
+ var Lib = __webpack_require__(30991);
148409
+ var Axes = __webpack_require__(15076);
148410
+ var handleArrayContainerDefaults = __webpack_require__(21238);
148411
+ var handleAnnotationCommonDefaults = __webpack_require__(84081);
148412
+ var attributes = __webpack_require__(9793);
148413
+
148414
+ module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
148415
+ handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
148416
+ name: 'annotations',
148417
+ handleItemDefaults: handleAnnotationDefaults,
148418
+ fullLayout: opts.fullLayout
148419
+ });
148420
+ };
148421
+
148422
+ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
148423
+ function coerce(attr, dflt) {
148424
+ return Lib.coerce(annIn, annOut, attributes, attr, dflt);
148425
+ }
148426
+
148427
+ function coercePosition(axLetter) {
148428
+ var axName = axLetter + 'axis';
148429
+
148430
+ // mock in such way that getFromId grabs correct 3D axis
148431
+ var gdMock = { _fullLayout: {} };
148432
+ gdMock._fullLayout[axName] = sceneLayout[axName];
148433
+
148434
+ return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
148435
+ }
148436
+
148437
+
148438
+ var visible = coerce('visible');
148439
+ if(!visible) return;
148440
+
148441
+ handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
148442
+
148443
+ coercePosition('x');
148444
+ coercePosition('y');
148445
+ coercePosition('z');
148446
+
148447
+ // if you have one coordinate you should all three
148448
+ Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
148449
+
148450
+ // hard-set here for completeness
148451
+ annOut.xref = 'x';
148452
+ annOut.yref = 'y';
148453
+ annOut.zref = 'z';
148454
+
148455
+ coerce('xanchor');
148456
+ coerce('yanchor');
148457
+ coerce('xshift');
148458
+ coerce('yshift');
148459
+
148460
+ if(annOut.showarrow) {
148461
+ annOut.axref = 'pixel';
148462
+ annOut.ayref = 'pixel';
148463
+
148464
+ // TODO maybe default values should be bigger than the 2D case?
148465
+ coerce('ax', -10);
148466
+ coerce('ay', -30);
148467
+
148468
+ // if you have one part of arrow length you should have both
148469
+ Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
148470
+ }
148471
+ }
148472
+
148473
+
148474
+ /***/ }),
148475
+
148476
+ /***/ 13802:
148477
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148478
+
148479
+
148480
+
148481
+ var drawRaw = (__webpack_require__(47995).drawRaw);
148482
+ var project = __webpack_require__(51344);
148483
+ var axLetters = ['x', 'y', 'z'];
148484
+
148485
+ module.exports = function draw(scene) {
148486
+ var fullSceneLayout = scene.fullSceneLayout;
148487
+ var dataScale = scene.dataScale;
148488
+ var anns = fullSceneLayout.annotations;
148489
+
148490
+ for(var i = 0; i < anns.length; i++) {
148491
+ var ann = anns[i];
148492
+ var annotationIsOffscreen = false;
148493
+
148494
+ for(var j = 0; j < 3; j++) {
148495
+ var axLetter = axLetters[j];
148496
+ var pos = ann[axLetter];
148497
+ var ax = fullSceneLayout[axLetter + 'axis'];
148498
+ var posFraction = ax.r2fraction(pos);
148499
+
148500
+ if(posFraction < 0 || posFraction > 1) {
148501
+ annotationIsOffscreen = true;
148502
+ break;
148503
+ }
148504
+ }
148505
+
148506
+ if(annotationIsOffscreen) {
148507
+ scene.fullLayout._infolayer
148508
+ .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
148509
+ .remove();
148510
+ } else {
148511
+ ann._pdata = project(scene.glplot.cameraParams, [
148512
+ fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
148513
+ fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
148514
+ fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
148515
+ ]);
148516
+
148517
+ drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
148518
+ }
148519
+ }
148520
+ };
148521
+
148522
+
148523
+ /***/ }),
148524
+
148525
+ /***/ 86578:
148526
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
148527
+
148528
+
148529
+
148530
+ var Registry = __webpack_require__(13936);
148531
+ var Lib = __webpack_require__(30991);
148532
+
148533
+ module.exports = {
148534
+ moduleType: 'component',
148535
+ name: 'annotations3d',
148536
+
148537
+ schema: {
148538
+ subplots: {
148539
+ scene: {annotations: __webpack_require__(9793)}
148540
+ }
148541
+ },
148542
+
148543
+ layoutAttributes: __webpack_require__(9793),
148544
+ handleDefaults: __webpack_require__(41926),
148545
+ includeBasePlot: includeGL3D,
148546
+
148547
+ convert: __webpack_require__(58121),
148548
+ draw: __webpack_require__(13802)
148549
+ };
148550
+
148551
+ function includeGL3D(layoutIn, layoutOut) {
148552
+ var GL3D = Registry.subplotsRegistry.gl3d;
148553
+ if(!GL3D) return;
148554
+
148555
+ var attrRegex = GL3D.attrRegex;
148556
+
148557
+ var keys = Object.keys(layoutIn);
148558
+ for(var i = 0; i < keys.length; i++) {
148559
+ var k = keys[i];
148560
+ if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
148561
+ Lib.pushUnique(layoutOut._basePlotModules, GL3D);
148562
+ Lib.pushUnique(layoutOut._subplots.gl3d, k);
148563
+ }
148564
+ }
148565
+ }
148566
+
148567
+
148250
148568
  /***/ }),
148251
148569
 
148252
148570
  /***/ 2595:
@@ -150220,324 +150538,6 @@ module.exports = {
150220
150538
  };
150221
150539
 
150222
150540
 
150223
- /***/ }),
150224
-
150225
- /***/ 9793:
150226
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150227
-
150228
-
150229
-
150230
- var annAttrs = __webpack_require__(84676);
150231
- var overrideAll = (__webpack_require__(70756).overrideAll);
150232
- var templatedArray = (__webpack_require__(79338).templatedArray);
150233
-
150234
- module.exports = overrideAll(templatedArray('annotation', {
150235
- visible: annAttrs.visible,
150236
- x: {
150237
- valType: 'any',
150238
- description: [
150239
- 'Sets the annotation\'s x position.'
150240
- ].join(' ')
150241
- },
150242
- y: {
150243
- valType: 'any',
150244
- description: [
150245
- 'Sets the annotation\'s y position.'
150246
- ].join(' ')
150247
- },
150248
- z: {
150249
- valType: 'any',
150250
- description: [
150251
- 'Sets the annotation\'s z position.'
150252
- ].join(' ')
150253
- },
150254
- ax: {
150255
- valType: 'number',
150256
- description: [
150257
- 'Sets the x component of the arrow tail about the arrow head (in pixels).'
150258
- ].join(' ')
150259
- },
150260
- ay: {
150261
- valType: 'number',
150262
- description: [
150263
- 'Sets the y component of the arrow tail about the arrow head (in pixels).'
150264
- ].join(' ')
150265
- },
150266
-
150267
- xanchor: annAttrs.xanchor,
150268
- xshift: annAttrs.xshift,
150269
- yanchor: annAttrs.yanchor,
150270
- yshift: annAttrs.yshift,
150271
-
150272
- text: annAttrs.text,
150273
- textangle: annAttrs.textangle,
150274
- font: annAttrs.font,
150275
- width: annAttrs.width,
150276
- height: annAttrs.height,
150277
- opacity: annAttrs.opacity,
150278
- align: annAttrs.align,
150279
- valign: annAttrs.valign,
150280
- bgcolor: annAttrs.bgcolor,
150281
- bordercolor: annAttrs.bordercolor,
150282
- borderpad: annAttrs.borderpad,
150283
- borderwidth: annAttrs.borderwidth,
150284
- showarrow: annAttrs.showarrow,
150285
- arrowcolor: annAttrs.arrowcolor,
150286
- arrowhead: annAttrs.arrowhead,
150287
- startarrowhead: annAttrs.startarrowhead,
150288
- arrowside: annAttrs.arrowside,
150289
- arrowsize: annAttrs.arrowsize,
150290
- startarrowsize: annAttrs.startarrowsize,
150291
- arrowwidth: annAttrs.arrowwidth,
150292
- standoff: annAttrs.standoff,
150293
- startstandoff: annAttrs.startstandoff,
150294
- hovertext: annAttrs.hovertext,
150295
- hoverlabel: annAttrs.hoverlabel,
150296
- captureevents: annAttrs.captureevents,
150297
-
150298
- // maybes later?
150299
- // clicktoshow: annAttrs.clicktoshow,
150300
- // xclick: annAttrs.xclick,
150301
- // yclick: annAttrs.yclick,
150302
-
150303
- // not needed!
150304
- // axref: 'pixel'
150305
- // ayref: 'pixel'
150306
- // xref: 'x'
150307
- // yref: 'y
150308
- // zref: 'z'
150309
- }), 'calc', 'from-root');
150310
-
150311
-
150312
- /***/ }),
150313
-
150314
- /***/ 58121:
150315
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150316
-
150317
-
150318
-
150319
- var Lib = __webpack_require__(30991);
150320
- var Axes = __webpack_require__(15076);
150321
-
150322
- module.exports = function convert(scene) {
150323
- var fullSceneLayout = scene.fullSceneLayout;
150324
- var anns = fullSceneLayout.annotations;
150325
-
150326
- for(var i = 0; i < anns.length; i++) {
150327
- mockAnnAxes(anns[i], scene);
150328
- }
150329
-
150330
- scene.fullLayout._infolayer
150331
- .selectAll('.annotation-' + scene.id)
150332
- .remove();
150333
- };
150334
-
150335
- function mockAnnAxes(ann, scene) {
150336
- var fullSceneLayout = scene.fullSceneLayout;
150337
- var domain = fullSceneLayout.domain;
150338
- var size = scene.fullLayout._size;
150339
-
150340
- var base = {
150341
- // this gets fill in on render
150342
- pdata: null,
150343
-
150344
- // to get setConvert to not execute cleanly
150345
- type: 'linear',
150346
-
150347
- // don't try to update them on `editable: true`
150348
- autorange: false,
150349
-
150350
- // set infinite range so that annotation draw routine
150351
- // does not try to remove 'outside-range' annotations,
150352
- // this case is handled in the render loop
150353
- range: [-Infinity, Infinity]
150354
- };
150355
-
150356
- ann._xa = {};
150357
- Lib.extendFlat(ann._xa, base);
150358
- Axes.setConvert(ann._xa);
150359
- ann._xa._offset = size.l + domain.x[0] * size.w;
150360
- ann._xa.l2p = function() {
150361
- return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
150362
- };
150363
-
150364
- ann._ya = {};
150365
- Lib.extendFlat(ann._ya, base);
150366
- Axes.setConvert(ann._ya);
150367
- ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
150368
- ann._ya.l2p = function() {
150369
- return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
150370
- };
150371
- }
150372
-
150373
-
150374
- /***/ }),
150375
-
150376
- /***/ 41926:
150377
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150378
-
150379
-
150380
-
150381
- var Lib = __webpack_require__(30991);
150382
- var Axes = __webpack_require__(15076);
150383
- var handleArrayContainerDefaults = __webpack_require__(21238);
150384
- var handleAnnotationCommonDefaults = __webpack_require__(84081);
150385
- var attributes = __webpack_require__(9793);
150386
-
150387
- module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
150388
- handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
150389
- name: 'annotations',
150390
- handleItemDefaults: handleAnnotationDefaults,
150391
- fullLayout: opts.fullLayout
150392
- });
150393
- };
150394
-
150395
- function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
150396
- function coerce(attr, dflt) {
150397
- return Lib.coerce(annIn, annOut, attributes, attr, dflt);
150398
- }
150399
-
150400
- function coercePosition(axLetter) {
150401
- var axName = axLetter + 'axis';
150402
-
150403
- // mock in such way that getFromId grabs correct 3D axis
150404
- var gdMock = { _fullLayout: {} };
150405
- gdMock._fullLayout[axName] = sceneLayout[axName];
150406
-
150407
- return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
150408
- }
150409
-
150410
-
150411
- var visible = coerce('visible');
150412
- if(!visible) return;
150413
-
150414
- handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
150415
-
150416
- coercePosition('x');
150417
- coercePosition('y');
150418
- coercePosition('z');
150419
-
150420
- // if you have one coordinate you should all three
150421
- Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
150422
-
150423
- // hard-set here for completeness
150424
- annOut.xref = 'x';
150425
- annOut.yref = 'y';
150426
- annOut.zref = 'z';
150427
-
150428
- coerce('xanchor');
150429
- coerce('yanchor');
150430
- coerce('xshift');
150431
- coerce('yshift');
150432
-
150433
- if(annOut.showarrow) {
150434
- annOut.axref = 'pixel';
150435
- annOut.ayref = 'pixel';
150436
-
150437
- // TODO maybe default values should be bigger than the 2D case?
150438
- coerce('ax', -10);
150439
- coerce('ay', -30);
150440
-
150441
- // if you have one part of arrow length you should have both
150442
- Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
150443
- }
150444
- }
150445
-
150446
-
150447
- /***/ }),
150448
-
150449
- /***/ 13802:
150450
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150451
-
150452
-
150453
-
150454
- var drawRaw = (__webpack_require__(47995).drawRaw);
150455
- var project = __webpack_require__(51344);
150456
- var axLetters = ['x', 'y', 'z'];
150457
-
150458
- module.exports = function draw(scene) {
150459
- var fullSceneLayout = scene.fullSceneLayout;
150460
- var dataScale = scene.dataScale;
150461
- var anns = fullSceneLayout.annotations;
150462
-
150463
- for(var i = 0; i < anns.length; i++) {
150464
- var ann = anns[i];
150465
- var annotationIsOffscreen = false;
150466
-
150467
- for(var j = 0; j < 3; j++) {
150468
- var axLetter = axLetters[j];
150469
- var pos = ann[axLetter];
150470
- var ax = fullSceneLayout[axLetter + 'axis'];
150471
- var posFraction = ax.r2fraction(pos);
150472
-
150473
- if(posFraction < 0 || posFraction > 1) {
150474
- annotationIsOffscreen = true;
150475
- break;
150476
- }
150477
- }
150478
-
150479
- if(annotationIsOffscreen) {
150480
- scene.fullLayout._infolayer
150481
- .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
150482
- .remove();
150483
- } else {
150484
- ann._pdata = project(scene.glplot.cameraParams, [
150485
- fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
150486
- fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
150487
- fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
150488
- ]);
150489
-
150490
- drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
150491
- }
150492
- }
150493
- };
150494
-
150495
-
150496
- /***/ }),
150497
-
150498
- /***/ 86578:
150499
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150500
-
150501
-
150502
-
150503
- var Registry = __webpack_require__(13936);
150504
- var Lib = __webpack_require__(30991);
150505
-
150506
- module.exports = {
150507
- moduleType: 'component',
150508
- name: 'annotations3d',
150509
-
150510
- schema: {
150511
- subplots: {
150512
- scene: {annotations: __webpack_require__(9793)}
150513
- }
150514
- },
150515
-
150516
- layoutAttributes: __webpack_require__(9793),
150517
- handleDefaults: __webpack_require__(41926),
150518
- includeBasePlot: includeGL3D,
150519
-
150520
- convert: __webpack_require__(58121),
150521
- draw: __webpack_require__(13802)
150522
- };
150523
-
150524
- function includeGL3D(layoutIn, layoutOut) {
150525
- var GL3D = Registry.subplotsRegistry.gl3d;
150526
- if(!GL3D) return;
150527
-
150528
- var attrRegex = GL3D.attrRegex;
150529
-
150530
- var keys = Object.keys(layoutIn);
150531
- for(var i = 0; i < keys.length; i++) {
150532
- var k = keys[i];
150533
- if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
150534
- Lib.pushUnique(layoutOut._basePlotModules, GL3D);
150535
- Lib.pushUnique(layoutOut._subplots.gl3d, k);
150536
- }
150537
- }
150538
- }
150539
-
150540
-
150541
150541
  /***/ }),
150542
150542
 
150543
150543
  /***/ 27639:
@@ -248770,6 +248770,595 @@ function isValidZ(z) {
248770
248770
  }
248771
248771
 
248772
248772
 
248773
+ /***/ }),
248774
+
248775
+ /***/ 42124:
248776
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248777
+
248778
+
248779
+
248780
+ var histogramAttrs = __webpack_require__(71250);
248781
+ var makeBinAttrs = __webpack_require__(9284);
248782
+ var heatmapAttrs = __webpack_require__(68300);
248783
+ var baseAttrs = __webpack_require__(35667);
248784
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
248785
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
248786
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
248787
+ var colorScaleAttrs = __webpack_require__(17957);
248788
+
248789
+ var extendFlat = (__webpack_require__(91307).extendFlat);
248790
+
248791
+ module.exports = extendFlat(
248792
+ {
248793
+ x: histogramAttrs.x,
248794
+ y: histogramAttrs.y,
248795
+
248796
+ z: {
248797
+ valType: 'data_array',
248798
+ editType: 'calc',
248799
+ description: 'Sets the aggregation data.'
248800
+ },
248801
+ marker: {
248802
+ color: {
248803
+ valType: 'data_array',
248804
+ editType: 'calc',
248805
+ description: 'Sets the aggregation data.'
248806
+ },
248807
+ editType: 'calc'
248808
+ },
248809
+
248810
+ histnorm: histogramAttrs.histnorm,
248811
+ histfunc: histogramAttrs.histfunc,
248812
+ nbinsx: histogramAttrs.nbinsx,
248813
+ xbins: makeBinAttrs('x'),
248814
+ nbinsy: histogramAttrs.nbinsy,
248815
+ ybins: makeBinAttrs('y'),
248816
+ autobinx: histogramAttrs.autobinx,
248817
+ autobiny: histogramAttrs.autobiny,
248818
+
248819
+ bingroup: extendFlat({}, histogramAttrs.bingroup, {
248820
+ description: [
248821
+ 'Set the `xbingroup` and `ybingroup` default prefix',
248822
+ 'For example, setting a `bingroup` of *1* on two histogram2d traces',
248823
+ 'will make them their x-bins and y-bins match separately.'
248824
+ ].join(' ')
248825
+ }),
248826
+ xbingroup: extendFlat({}, histogramAttrs.bingroup, {
248827
+ description: [
248828
+ 'Set a group of histogram traces which will have compatible x-bin settings.',
248829
+ 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
248830
+ '(on axes of the same axis type) can have compatible x-bin settings.',
248831
+ 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
248832
+ ].join(' ')
248833
+ }),
248834
+ ybingroup: extendFlat({}, histogramAttrs.bingroup, {
248835
+ description: [
248836
+ 'Set a group of histogram traces which will have compatible y-bin settings.',
248837
+ 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
248838
+ '(on axes of the same axis type) can have compatible y-bin settings.',
248839
+ 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
248840
+ ].join(' ')
248841
+ }),
248842
+
248843
+ xgap: heatmapAttrs.xgap,
248844
+ ygap: heatmapAttrs.ygap,
248845
+ zsmooth: heatmapAttrs.zsmooth,
248846
+ xhoverformat: axisHoverFormat('x'),
248847
+ yhoverformat: axisHoverFormat('y'),
248848
+ zhoverformat: axisHoverFormat('z', 1),
248849
+ hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
248850
+ texttemplate: texttemplateAttrs({
248851
+ arrayOk: false,
248852
+ editType: 'plot'
248853
+ }, {
248854
+ keys: 'z'
248855
+ }),
248856
+ textfont: heatmapAttrs.textfont,
248857
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
248858
+ },
248859
+ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
248860
+ );
248861
+
248862
+
248863
+ /***/ }),
248864
+
248865
+ /***/ 32492:
248866
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
248867
+
248868
+
248869
+
248870
+ var Lib = __webpack_require__(30991);
248871
+ var Axes = __webpack_require__(15076);
248872
+
248873
+ var binFunctions = __webpack_require__(47260);
248874
+ var normFunctions = __webpack_require__(855);
248875
+ var doAvg = __webpack_require__(26756);
248876
+ var getBinSpanLabelRound = __webpack_require__(41574);
248877
+ var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
248878
+
248879
+ module.exports = function calc(gd, trace) {
248880
+ var xa = Axes.getFromId(gd, trace.xaxis);
248881
+ var ya = Axes.getFromId(gd, trace.yaxis);
248882
+
248883
+ var xcalendar = trace.xcalendar;
248884
+ var ycalendar = trace.ycalendar;
248885
+ var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
248886
+ var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
248887
+ var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
248888
+ var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
248889
+
248890
+ var i, j, n, m;
248891
+
248892
+ // calculate the bins
248893
+ var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
248894
+ var xBinSpec = xBinsAndPos[0];
248895
+ var xPos0 = xBinsAndPos[1];
248896
+ var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
248897
+ var yBinSpec = yBinsAndPos[0];
248898
+ var yPos0 = yBinsAndPos[1];
248899
+
248900
+ var serieslen = trace._length;
248901
+ if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
248902
+ if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
248903
+
248904
+ // make the empty bin array & scale the map
248905
+ var z = [];
248906
+ var onecol = [];
248907
+ var zerocol = [];
248908
+ var nonuniformBinsX = typeof xBinSpec.size === 'string';
248909
+ var nonuniformBinsY = typeof yBinSpec.size === 'string';
248910
+ var xEdges = [];
248911
+ var yEdges = [];
248912
+ var xbins = nonuniformBinsX ? xEdges : xBinSpec;
248913
+ var ybins = nonuniformBinsY ? yEdges : yBinSpec;
248914
+ var total = 0;
248915
+ var counts = [];
248916
+ var inputPoints = [];
248917
+ var norm = trace.histnorm;
248918
+ var func = trace.histfunc;
248919
+ var densitynorm = norm.indexOf('density') !== -1;
248920
+ var extremefunc = func === 'max' || func === 'min';
248921
+ var sizeinit = extremefunc ? null : 0;
248922
+ var binfunc = binFunctions.count;
248923
+ var normfunc = normFunctions[norm];
248924
+ var doavg = false;
248925
+ var xinc = [];
248926
+ var yinc = [];
248927
+
248928
+ // set a binning function other than count?
248929
+ // for binning functions: check first for 'z',
248930
+ // then 'mc' in case we had a colored scatter plot
248931
+ // and want to transfer these colors to the 2D histo
248932
+ // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
248933
+ var rawCounterData = ('z' in trace) ?
248934
+ trace.z :
248935
+ (('marker' in trace && Array.isArray(trace.marker.color)) ?
248936
+ trace.marker.color : '');
248937
+ if(rawCounterData && func !== 'count') {
248938
+ doavg = func === 'avg';
248939
+ binfunc = binFunctions[func];
248940
+ }
248941
+
248942
+ // decrease end a little in case of rounding errors
248943
+ var xBinSize = xBinSpec.size;
248944
+ var xBinStart = xr2c(xBinSpec.start);
248945
+ var xBinEnd = xr2c(xBinSpec.end) +
248946
+ (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
248947
+
248948
+ for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
248949
+ onecol.push(sizeinit);
248950
+ xEdges.push(i);
248951
+ if(doavg) zerocol.push(0);
248952
+ }
248953
+ xEdges.push(i);
248954
+
248955
+ var nx = onecol.length;
248956
+ var dx = (i - xBinStart) / nx;
248957
+ var x0 = xc2r(xBinStart + dx / 2);
248958
+
248959
+ var yBinSize = yBinSpec.size;
248960
+ var yBinStart = yr2c(yBinSpec.start);
248961
+ var yBinEnd = yr2c(yBinSpec.end) +
248962
+ (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
248963
+
248964
+ for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
248965
+ z.push(onecol.slice());
248966
+ yEdges.push(i);
248967
+ var ipCol = new Array(nx);
248968
+ for(j = 0; j < nx; j++) ipCol[j] = [];
248969
+ inputPoints.push(ipCol);
248970
+ if(doavg) counts.push(zerocol.slice());
248971
+ }
248972
+ yEdges.push(i);
248973
+
248974
+ var ny = z.length;
248975
+ var dy = (i - yBinStart) / ny;
248976
+ var y0 = yc2r(yBinStart + dy / 2);
248977
+
248978
+ if(densitynorm) {
248979
+ xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
248980
+ yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
248981
+ }
248982
+
248983
+ // for date axes we need bin bounds to be calcdata. For nonuniform bins
248984
+ // we already have this, but uniform with start/end/size they're still strings.
248985
+ if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
248986
+ if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
248987
+
248988
+ // put data into bins
248989
+ var uniqueValsPerX = true;
248990
+ var uniqueValsPerY = true;
248991
+ var xVals = new Array(nx);
248992
+ var yVals = new Array(ny);
248993
+ var xGapLow = Infinity;
248994
+ var xGapHigh = Infinity;
248995
+ var yGapLow = Infinity;
248996
+ var yGapHigh = Infinity;
248997
+ for(i = 0; i < serieslen; i++) {
248998
+ var xi = xPos0[i];
248999
+ var yi = yPos0[i];
249000
+ n = Lib.findBin(xi, xbins);
249001
+ m = Lib.findBin(yi, ybins);
249002
+ if(n >= 0 && n < nx && m >= 0 && m < ny) {
249003
+ total += binfunc(n, i, z[m], rawCounterData, counts[m]);
249004
+ inputPoints[m][n].push(i);
249005
+
249006
+ if(uniqueValsPerX) {
249007
+ if(xVals[n] === undefined) xVals[n] = xi;
249008
+ else if(xVals[n] !== xi) uniqueValsPerX = false;
249009
+ }
249010
+ if(uniqueValsPerY) {
249011
+ if(yVals[m] === undefined) yVals[m] = yi;
249012
+ else if(yVals[m] !== yi) uniqueValsPerY = false;
249013
+ }
249014
+
249015
+ xGapLow = Math.min(xGapLow, xi - xEdges[n]);
249016
+ xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
249017
+ yGapLow = Math.min(yGapLow, yi - yEdges[m]);
249018
+ yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
249019
+ }
249020
+ }
249021
+ // normalize, if needed
249022
+ if(doavg) {
249023
+ for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
249024
+ }
249025
+ if(normfunc) {
249026
+ for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
249027
+ }
249028
+
249029
+ return {
249030
+ x: xPos0,
249031
+ xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
249032
+ x0: x0,
249033
+ dx: dx,
249034
+ y: yPos0,
249035
+ yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
249036
+ y0: y0,
249037
+ dy: dy,
249038
+ z: z,
249039
+ pts: inputPoints
249040
+ };
249041
+ };
249042
+
249043
+ function makeIncrements(len, bins, dv, nonuniform) {
249044
+ var out = new Array(len);
249045
+ var i;
249046
+ if(nonuniform) {
249047
+ for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
249048
+ } else {
249049
+ var inc = 1 / dv;
249050
+ for(i = 0; i < len; i++) out[i] = inc;
249051
+ }
249052
+ return out;
249053
+ }
249054
+
249055
+ function binsToCalc(r2c, bins) {
249056
+ return {
249057
+ start: r2c(bins.start),
249058
+ end: r2c(bins.end),
249059
+ size: bins.size
249060
+ };
249061
+ }
249062
+
249063
+ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
249064
+ var i;
249065
+ var len = edges.length - 1;
249066
+ var out = new Array(len);
249067
+ var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
249068
+
249069
+ for(i = 0; i < len; i++) {
249070
+ var v = (uniqueVals || [])[i];
249071
+ out[i] = v === undefined ?
249072
+ [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
249073
+ [v, v];
249074
+ }
249075
+ return out;
249076
+ }
249077
+
249078
+
249079
+ /***/ }),
249080
+
249081
+ /***/ 15611:
249082
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249083
+
249084
+
249085
+
249086
+ var Lib = __webpack_require__(30991);
249087
+
249088
+ var handleSampleDefaults = __webpack_require__(6236);
249089
+ var handleStyleDefaults = __webpack_require__(25157);
249090
+ var colorscaleDefaults = __webpack_require__(13682);
249091
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
249092
+ var attributes = __webpack_require__(42124);
249093
+
249094
+
249095
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
249096
+ function coerce(attr, dflt) {
249097
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
249098
+ }
249099
+
249100
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
249101
+ if(traceOut.visible === false) return;
249102
+
249103
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
249104
+ colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
249105
+ coerce('hovertemplate');
249106
+
249107
+ handleHeatmapLabelDefaults(coerce, layout);
249108
+
249109
+ coerce('xhoverformat');
249110
+ coerce('yhoverformat');
249111
+ };
249112
+
249113
+
249114
+ /***/ }),
249115
+
249116
+ /***/ 94587:
249117
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249118
+
249119
+
249120
+
249121
+ var heatmapHover = __webpack_require__(85243);
249122
+ var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
249123
+
249124
+ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
249125
+ var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
249126
+
249127
+ if(!pts) return;
249128
+
249129
+ pointData = pts[0];
249130
+ var indices = pointData.index;
249131
+ var ny = indices[0];
249132
+ var nx = indices[1];
249133
+ var cd0 = pointData.cd[0];
249134
+ var trace = cd0.trace;
249135
+ var xRange = cd0.xRanges[nx];
249136
+ var yRange = cd0.yRanges[ny];
249137
+
249138
+ pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
249139
+ pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
249140
+
249141
+ return pts;
249142
+ };
249143
+
249144
+
249145
+ /***/ }),
249146
+
249147
+ /***/ 3617:
249148
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249149
+
249150
+
249151
+
249152
+ module.exports = {
249153
+ attributes: __webpack_require__(42124),
249154
+ supplyDefaults: __webpack_require__(15611),
249155
+ crossTraceDefaults: __webpack_require__(34294),
249156
+ calc: __webpack_require__(91980),
249157
+ plot: __webpack_require__(29406),
249158
+ layerName: 'heatmaplayer',
249159
+ colorbar: __webpack_require__(90165),
249160
+ style: __webpack_require__(58756),
249161
+ hoverPoints: __webpack_require__(94587),
249162
+ eventData: __webpack_require__(63870),
249163
+
249164
+ moduleType: 'trace',
249165
+ name: 'histogram2d',
249166
+ basePlotModule: __webpack_require__(47885),
249167
+ categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
249168
+ meta: {
249169
+ hrName: 'histogram_2d',
249170
+ description: [
249171
+ 'The sample data from which statistics are computed is set in `x`',
249172
+ 'and `y` (where `x` and `y` represent marginal distributions,',
249173
+ 'binning is set in `xbins` and `ybins` in this case)',
249174
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
249175
+ 'binning is set by `x` and `y` in this case).',
249176
+ 'The resulting distribution is visualized as a heatmap.'
249177
+ ].join(' ')
249178
+ }
249179
+ };
249180
+
249181
+
249182
+ /***/ }),
249183
+
249184
+ /***/ 6236:
249185
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249186
+
249187
+
249188
+
249189
+ var Registry = __webpack_require__(13936);
249190
+ var Lib = __webpack_require__(30991);
249191
+
249192
+ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
249193
+ var x = coerce('x');
249194
+ var y = coerce('y');
249195
+ var xlen = Lib.minRowLength(x);
249196
+ var ylen = Lib.minRowLength(y);
249197
+
249198
+ // we could try to accept x0 and dx, etc...
249199
+ // but that's a pretty weird use case.
249200
+ // for now require both x and y explicitly specified.
249201
+ if(!xlen || !ylen) {
249202
+ traceOut.visible = false;
249203
+ return;
249204
+ }
249205
+
249206
+ traceOut._length = Math.min(xlen, ylen);
249207
+
249208
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
249209
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
249210
+
249211
+ // if marker.color is an array, we can use it in aggregation instead of z
249212
+ var hasAggregationData = coerce('z') || coerce('marker.color');
249213
+
249214
+ if(hasAggregationData) coerce('histfunc');
249215
+ coerce('histnorm');
249216
+
249217
+ // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
249218
+ // autobin(x|y) are only included here to appease Plotly.validate
249219
+ coerce('autobinx');
249220
+ coerce('autobiny');
249221
+ };
249222
+
249223
+
249224
+ /***/ }),
249225
+
249226
+ /***/ 34872:
249227
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249228
+
249229
+
249230
+
249231
+ var histogram2dAttrs = __webpack_require__(42124);
249232
+ var contourAttrs = __webpack_require__(70318);
249233
+ var colorScaleAttrs = __webpack_require__(17957);
249234
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
249235
+
249236
+ var extendFlat = (__webpack_require__(91307).extendFlat);
249237
+
249238
+ module.exports = extendFlat({
249239
+ x: histogram2dAttrs.x,
249240
+ y: histogram2dAttrs.y,
249241
+ z: histogram2dAttrs.z,
249242
+ marker: histogram2dAttrs.marker,
249243
+
249244
+ histnorm: histogram2dAttrs.histnorm,
249245
+ histfunc: histogram2dAttrs.histfunc,
249246
+ nbinsx: histogram2dAttrs.nbinsx,
249247
+ xbins: histogram2dAttrs.xbins,
249248
+ nbinsy: histogram2dAttrs.nbinsy,
249249
+ ybins: histogram2dAttrs.ybins,
249250
+ autobinx: histogram2dAttrs.autobinx,
249251
+ autobiny: histogram2dAttrs.autobiny,
249252
+
249253
+ bingroup: histogram2dAttrs.bingroup,
249254
+ xbingroup: histogram2dAttrs.xbingroup,
249255
+ ybingroup: histogram2dAttrs.ybingroup,
249256
+
249257
+ autocontour: contourAttrs.autocontour,
249258
+ ncontours: contourAttrs.ncontours,
249259
+ contours: contourAttrs.contours,
249260
+ line: {
249261
+ color: contourAttrs.line.color,
249262
+ width: extendFlat({}, contourAttrs.line.width, {
249263
+ dflt: 0.5,
249264
+ description: 'Sets the contour line width in (in px)'
249265
+ }),
249266
+ dash: contourAttrs.line.dash,
249267
+ smoothing: contourAttrs.line.smoothing,
249268
+ editType: 'plot'
249269
+ },
249270
+ xhoverformat: axisHoverFormat('x'),
249271
+ yhoverformat: axisHoverFormat('y'),
249272
+ zhoverformat: axisHoverFormat('z', 1),
249273
+ hovertemplate: histogram2dAttrs.hovertemplate,
249274
+ texttemplate: contourAttrs.texttemplate,
249275
+ textfont: contourAttrs.textfont
249276
+ },
249277
+ colorScaleAttrs('', {
249278
+ cLetter: 'z',
249279
+ editTypeOverride: 'calc'
249280
+ })
249281
+ );
249282
+
249283
+
249284
+ /***/ }),
249285
+
249286
+ /***/ 14319:
249287
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249288
+
249289
+
249290
+
249291
+ var Lib = __webpack_require__(30991);
249292
+
249293
+ var handleSampleDefaults = __webpack_require__(6236);
249294
+ var handleContoursDefaults = __webpack_require__(657);
249295
+ var handleStyleDefaults = __webpack_require__(74619);
249296
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
249297
+ var attributes = __webpack_require__(34872);
249298
+
249299
+
249300
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
249301
+ function coerce(attr, dflt) {
249302
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
249303
+ }
249304
+
249305
+ function coerce2(attr) {
249306
+ return Lib.coerce2(traceIn, traceOut, attributes, attr);
249307
+ }
249308
+
249309
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
249310
+ if(traceOut.visible === false) return;
249311
+
249312
+ handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
249313
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
249314
+ coerce('xhoverformat');
249315
+ coerce('yhoverformat');
249316
+ coerce('hovertemplate');
249317
+ if(
249318
+ traceOut.contours &&
249319
+ traceOut.contours.coloring === 'heatmap'
249320
+ ) {
249321
+ handleHeatmapLabelDefaults(coerce, layout);
249322
+ }
249323
+ };
249324
+
249325
+
249326
+ /***/ }),
249327
+
249328
+ /***/ 60613:
249329
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
249330
+
249331
+
249332
+
249333
+ module.exports = {
249334
+ attributes: __webpack_require__(34872),
249335
+ supplyDefaults: __webpack_require__(14319),
249336
+ crossTraceDefaults: __webpack_require__(34294),
249337
+ calc: __webpack_require__(3274),
249338
+ plot: (__webpack_require__(32664).plot),
249339
+ layerName: 'contourlayer',
249340
+ style: __webpack_require__(72690),
249341
+ colorbar: __webpack_require__(70307),
249342
+ hoverPoints: __webpack_require__(52353),
249343
+
249344
+ moduleType: 'trace',
249345
+ name: 'histogram2dcontour',
249346
+ basePlotModule: __webpack_require__(47885),
249347
+ categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
249348
+ meta: {
249349
+ hrName: 'histogram_2d_contour',
249350
+ description: [
249351
+ 'The sample data from which statistics are computed is set in `x`',
249352
+ 'and `y` (where `x` and `y` represent marginal distributions,',
249353
+ 'binning is set in `xbins` and `ybins` in this case)',
249354
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
249355
+ 'binning is set by `x` and `y` in this case).',
249356
+ 'The resulting distribution is visualized as a contour plot.'
249357
+ ].join(' ')
249358
+ }
249359
+ };
249360
+
249361
+
248773
249362
  /***/ }),
248774
249363
 
248775
249364
  /***/ 71250:
@@ -250478,595 +251067,6 @@ module.exports = {
250478
251067
  };
250479
251068
 
250480
251069
 
250481
- /***/ }),
250482
-
250483
- /***/ 42124:
250484
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250485
-
250486
-
250487
-
250488
- var histogramAttrs = __webpack_require__(71250);
250489
- var makeBinAttrs = __webpack_require__(9284);
250490
- var heatmapAttrs = __webpack_require__(68300);
250491
- var baseAttrs = __webpack_require__(35667);
250492
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
250493
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
250494
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
250495
- var colorScaleAttrs = __webpack_require__(17957);
250496
-
250497
- var extendFlat = (__webpack_require__(91307).extendFlat);
250498
-
250499
- module.exports = extendFlat(
250500
- {
250501
- x: histogramAttrs.x,
250502
- y: histogramAttrs.y,
250503
-
250504
- z: {
250505
- valType: 'data_array',
250506
- editType: 'calc',
250507
- description: 'Sets the aggregation data.'
250508
- },
250509
- marker: {
250510
- color: {
250511
- valType: 'data_array',
250512
- editType: 'calc',
250513
- description: 'Sets the aggregation data.'
250514
- },
250515
- editType: 'calc'
250516
- },
250517
-
250518
- histnorm: histogramAttrs.histnorm,
250519
- histfunc: histogramAttrs.histfunc,
250520
- nbinsx: histogramAttrs.nbinsx,
250521
- xbins: makeBinAttrs('x'),
250522
- nbinsy: histogramAttrs.nbinsy,
250523
- ybins: makeBinAttrs('y'),
250524
- autobinx: histogramAttrs.autobinx,
250525
- autobiny: histogramAttrs.autobiny,
250526
-
250527
- bingroup: extendFlat({}, histogramAttrs.bingroup, {
250528
- description: [
250529
- 'Set the `xbingroup` and `ybingroup` default prefix',
250530
- 'For example, setting a `bingroup` of *1* on two histogram2d traces',
250531
- 'will make them their x-bins and y-bins match separately.'
250532
- ].join(' ')
250533
- }),
250534
- xbingroup: extendFlat({}, histogramAttrs.bingroup, {
250535
- description: [
250536
- 'Set a group of histogram traces which will have compatible x-bin settings.',
250537
- 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
250538
- '(on axes of the same axis type) can have compatible x-bin settings.',
250539
- 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
250540
- ].join(' ')
250541
- }),
250542
- ybingroup: extendFlat({}, histogramAttrs.bingroup, {
250543
- description: [
250544
- 'Set a group of histogram traces which will have compatible y-bin settings.',
250545
- 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
250546
- '(on axes of the same axis type) can have compatible y-bin settings.',
250547
- 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
250548
- ].join(' ')
250549
- }),
250550
-
250551
- xgap: heatmapAttrs.xgap,
250552
- ygap: heatmapAttrs.ygap,
250553
- zsmooth: heatmapAttrs.zsmooth,
250554
- xhoverformat: axisHoverFormat('x'),
250555
- yhoverformat: axisHoverFormat('y'),
250556
- zhoverformat: axisHoverFormat('z', 1),
250557
- hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
250558
- texttemplate: texttemplateAttrs({
250559
- arrayOk: false,
250560
- editType: 'plot'
250561
- }, {
250562
- keys: 'z'
250563
- }),
250564
- textfont: heatmapAttrs.textfont,
250565
- showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
250566
- },
250567
- colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
250568
- );
250569
-
250570
-
250571
- /***/ }),
250572
-
250573
- /***/ 32492:
250574
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250575
-
250576
-
250577
-
250578
- var Lib = __webpack_require__(30991);
250579
- var Axes = __webpack_require__(15076);
250580
-
250581
- var binFunctions = __webpack_require__(47260);
250582
- var normFunctions = __webpack_require__(855);
250583
- var doAvg = __webpack_require__(26756);
250584
- var getBinSpanLabelRound = __webpack_require__(41574);
250585
- var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
250586
-
250587
- module.exports = function calc(gd, trace) {
250588
- var xa = Axes.getFromId(gd, trace.xaxis);
250589
- var ya = Axes.getFromId(gd, trace.yaxis);
250590
-
250591
- var xcalendar = trace.xcalendar;
250592
- var ycalendar = trace.ycalendar;
250593
- var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
250594
- var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
250595
- var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
250596
- var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
250597
-
250598
- var i, j, n, m;
250599
-
250600
- // calculate the bins
250601
- var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
250602
- var xBinSpec = xBinsAndPos[0];
250603
- var xPos0 = xBinsAndPos[1];
250604
- var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
250605
- var yBinSpec = yBinsAndPos[0];
250606
- var yPos0 = yBinsAndPos[1];
250607
-
250608
- var serieslen = trace._length;
250609
- if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
250610
- if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
250611
-
250612
- // make the empty bin array & scale the map
250613
- var z = [];
250614
- var onecol = [];
250615
- var zerocol = [];
250616
- var nonuniformBinsX = typeof xBinSpec.size === 'string';
250617
- var nonuniformBinsY = typeof yBinSpec.size === 'string';
250618
- var xEdges = [];
250619
- var yEdges = [];
250620
- var xbins = nonuniformBinsX ? xEdges : xBinSpec;
250621
- var ybins = nonuniformBinsY ? yEdges : yBinSpec;
250622
- var total = 0;
250623
- var counts = [];
250624
- var inputPoints = [];
250625
- var norm = trace.histnorm;
250626
- var func = trace.histfunc;
250627
- var densitynorm = norm.indexOf('density') !== -1;
250628
- var extremefunc = func === 'max' || func === 'min';
250629
- var sizeinit = extremefunc ? null : 0;
250630
- var binfunc = binFunctions.count;
250631
- var normfunc = normFunctions[norm];
250632
- var doavg = false;
250633
- var xinc = [];
250634
- var yinc = [];
250635
-
250636
- // set a binning function other than count?
250637
- // for binning functions: check first for 'z',
250638
- // then 'mc' in case we had a colored scatter plot
250639
- // and want to transfer these colors to the 2D histo
250640
- // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
250641
- var rawCounterData = ('z' in trace) ?
250642
- trace.z :
250643
- (('marker' in trace && Array.isArray(trace.marker.color)) ?
250644
- trace.marker.color : '');
250645
- if(rawCounterData && func !== 'count') {
250646
- doavg = func === 'avg';
250647
- binfunc = binFunctions[func];
250648
- }
250649
-
250650
- // decrease end a little in case of rounding errors
250651
- var xBinSize = xBinSpec.size;
250652
- var xBinStart = xr2c(xBinSpec.start);
250653
- var xBinEnd = xr2c(xBinSpec.end) +
250654
- (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
250655
-
250656
- for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
250657
- onecol.push(sizeinit);
250658
- xEdges.push(i);
250659
- if(doavg) zerocol.push(0);
250660
- }
250661
- xEdges.push(i);
250662
-
250663
- var nx = onecol.length;
250664
- var dx = (i - xBinStart) / nx;
250665
- var x0 = xc2r(xBinStart + dx / 2);
250666
-
250667
- var yBinSize = yBinSpec.size;
250668
- var yBinStart = yr2c(yBinSpec.start);
250669
- var yBinEnd = yr2c(yBinSpec.end) +
250670
- (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
250671
-
250672
- for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
250673
- z.push(onecol.slice());
250674
- yEdges.push(i);
250675
- var ipCol = new Array(nx);
250676
- for(j = 0; j < nx; j++) ipCol[j] = [];
250677
- inputPoints.push(ipCol);
250678
- if(doavg) counts.push(zerocol.slice());
250679
- }
250680
- yEdges.push(i);
250681
-
250682
- var ny = z.length;
250683
- var dy = (i - yBinStart) / ny;
250684
- var y0 = yc2r(yBinStart + dy / 2);
250685
-
250686
- if(densitynorm) {
250687
- xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
250688
- yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
250689
- }
250690
-
250691
- // for date axes we need bin bounds to be calcdata. For nonuniform bins
250692
- // we already have this, but uniform with start/end/size they're still strings.
250693
- if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
250694
- if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
250695
-
250696
- // put data into bins
250697
- var uniqueValsPerX = true;
250698
- var uniqueValsPerY = true;
250699
- var xVals = new Array(nx);
250700
- var yVals = new Array(ny);
250701
- var xGapLow = Infinity;
250702
- var xGapHigh = Infinity;
250703
- var yGapLow = Infinity;
250704
- var yGapHigh = Infinity;
250705
- for(i = 0; i < serieslen; i++) {
250706
- var xi = xPos0[i];
250707
- var yi = yPos0[i];
250708
- n = Lib.findBin(xi, xbins);
250709
- m = Lib.findBin(yi, ybins);
250710
- if(n >= 0 && n < nx && m >= 0 && m < ny) {
250711
- total += binfunc(n, i, z[m], rawCounterData, counts[m]);
250712
- inputPoints[m][n].push(i);
250713
-
250714
- if(uniqueValsPerX) {
250715
- if(xVals[n] === undefined) xVals[n] = xi;
250716
- else if(xVals[n] !== xi) uniqueValsPerX = false;
250717
- }
250718
- if(uniqueValsPerY) {
250719
- if(yVals[m] === undefined) yVals[m] = yi;
250720
- else if(yVals[m] !== yi) uniqueValsPerY = false;
250721
- }
250722
-
250723
- xGapLow = Math.min(xGapLow, xi - xEdges[n]);
250724
- xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
250725
- yGapLow = Math.min(yGapLow, yi - yEdges[m]);
250726
- yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
250727
- }
250728
- }
250729
- // normalize, if needed
250730
- if(doavg) {
250731
- for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
250732
- }
250733
- if(normfunc) {
250734
- for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
250735
- }
250736
-
250737
- return {
250738
- x: xPos0,
250739
- xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
250740
- x0: x0,
250741
- dx: dx,
250742
- y: yPos0,
250743
- yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
250744
- y0: y0,
250745
- dy: dy,
250746
- z: z,
250747
- pts: inputPoints
250748
- };
250749
- };
250750
-
250751
- function makeIncrements(len, bins, dv, nonuniform) {
250752
- var out = new Array(len);
250753
- var i;
250754
- if(nonuniform) {
250755
- for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
250756
- } else {
250757
- var inc = 1 / dv;
250758
- for(i = 0; i < len; i++) out[i] = inc;
250759
- }
250760
- return out;
250761
- }
250762
-
250763
- function binsToCalc(r2c, bins) {
250764
- return {
250765
- start: r2c(bins.start),
250766
- end: r2c(bins.end),
250767
- size: bins.size
250768
- };
250769
- }
250770
-
250771
- function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
250772
- var i;
250773
- var len = edges.length - 1;
250774
- var out = new Array(len);
250775
- var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
250776
-
250777
- for(i = 0; i < len; i++) {
250778
- var v = (uniqueVals || [])[i];
250779
- out[i] = v === undefined ?
250780
- [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
250781
- [v, v];
250782
- }
250783
- return out;
250784
- }
250785
-
250786
-
250787
- /***/ }),
250788
-
250789
- /***/ 15611:
250790
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250791
-
250792
-
250793
-
250794
- var Lib = __webpack_require__(30991);
250795
-
250796
- var handleSampleDefaults = __webpack_require__(6236);
250797
- var handleStyleDefaults = __webpack_require__(25157);
250798
- var colorscaleDefaults = __webpack_require__(13682);
250799
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
250800
- var attributes = __webpack_require__(42124);
250801
-
250802
-
250803
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
250804
- function coerce(attr, dflt) {
250805
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
250806
- }
250807
-
250808
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
250809
- if(traceOut.visible === false) return;
250810
-
250811
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
250812
- colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
250813
- coerce('hovertemplate');
250814
-
250815
- handleHeatmapLabelDefaults(coerce, layout);
250816
-
250817
- coerce('xhoverformat');
250818
- coerce('yhoverformat');
250819
- };
250820
-
250821
-
250822
- /***/ }),
250823
-
250824
- /***/ 94587:
250825
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250826
-
250827
-
250828
-
250829
- var heatmapHover = __webpack_require__(85243);
250830
- var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
250831
-
250832
- module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
250833
- var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
250834
-
250835
- if(!pts) return;
250836
-
250837
- pointData = pts[0];
250838
- var indices = pointData.index;
250839
- var ny = indices[0];
250840
- var nx = indices[1];
250841
- var cd0 = pointData.cd[0];
250842
- var trace = cd0.trace;
250843
- var xRange = cd0.xRanges[nx];
250844
- var yRange = cd0.yRanges[ny];
250845
-
250846
- pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
250847
- pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
250848
-
250849
- return pts;
250850
- };
250851
-
250852
-
250853
- /***/ }),
250854
-
250855
- /***/ 3617:
250856
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250857
-
250858
-
250859
-
250860
- module.exports = {
250861
- attributes: __webpack_require__(42124),
250862
- supplyDefaults: __webpack_require__(15611),
250863
- crossTraceDefaults: __webpack_require__(34294),
250864
- calc: __webpack_require__(91980),
250865
- plot: __webpack_require__(29406),
250866
- layerName: 'heatmaplayer',
250867
- colorbar: __webpack_require__(90165),
250868
- style: __webpack_require__(58756),
250869
- hoverPoints: __webpack_require__(94587),
250870
- eventData: __webpack_require__(63870),
250871
-
250872
- moduleType: 'trace',
250873
- name: 'histogram2d',
250874
- basePlotModule: __webpack_require__(47885),
250875
- categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
250876
- meta: {
250877
- hrName: 'histogram_2d',
250878
- description: [
250879
- 'The sample data from which statistics are computed is set in `x`',
250880
- 'and `y` (where `x` and `y` represent marginal distributions,',
250881
- 'binning is set in `xbins` and `ybins` in this case)',
250882
- 'or `z` (where `z` represent the 2D distribution and binning set,',
250883
- 'binning is set by `x` and `y` in this case).',
250884
- 'The resulting distribution is visualized as a heatmap.'
250885
- ].join(' ')
250886
- }
250887
- };
250888
-
250889
-
250890
- /***/ }),
250891
-
250892
- /***/ 6236:
250893
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250894
-
250895
-
250896
-
250897
- var Registry = __webpack_require__(13936);
250898
- var Lib = __webpack_require__(30991);
250899
-
250900
- module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
250901
- var x = coerce('x');
250902
- var y = coerce('y');
250903
- var xlen = Lib.minRowLength(x);
250904
- var ylen = Lib.minRowLength(y);
250905
-
250906
- // we could try to accept x0 and dx, etc...
250907
- // but that's a pretty weird use case.
250908
- // for now require both x and y explicitly specified.
250909
- if(!xlen || !ylen) {
250910
- traceOut.visible = false;
250911
- return;
250912
- }
250913
-
250914
- traceOut._length = Math.min(xlen, ylen);
250915
-
250916
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
250917
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
250918
-
250919
- // if marker.color is an array, we can use it in aggregation instead of z
250920
- var hasAggregationData = coerce('z') || coerce('marker.color');
250921
-
250922
- if(hasAggregationData) coerce('histfunc');
250923
- coerce('histnorm');
250924
-
250925
- // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
250926
- // autobin(x|y) are only included here to appease Plotly.validate
250927
- coerce('autobinx');
250928
- coerce('autobiny');
250929
- };
250930
-
250931
-
250932
- /***/ }),
250933
-
250934
- /***/ 34872:
250935
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250936
-
250937
-
250938
-
250939
- var histogram2dAttrs = __webpack_require__(42124);
250940
- var contourAttrs = __webpack_require__(70318);
250941
- var colorScaleAttrs = __webpack_require__(17957);
250942
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
250943
-
250944
- var extendFlat = (__webpack_require__(91307).extendFlat);
250945
-
250946
- module.exports = extendFlat({
250947
- x: histogram2dAttrs.x,
250948
- y: histogram2dAttrs.y,
250949
- z: histogram2dAttrs.z,
250950
- marker: histogram2dAttrs.marker,
250951
-
250952
- histnorm: histogram2dAttrs.histnorm,
250953
- histfunc: histogram2dAttrs.histfunc,
250954
- nbinsx: histogram2dAttrs.nbinsx,
250955
- xbins: histogram2dAttrs.xbins,
250956
- nbinsy: histogram2dAttrs.nbinsy,
250957
- ybins: histogram2dAttrs.ybins,
250958
- autobinx: histogram2dAttrs.autobinx,
250959
- autobiny: histogram2dAttrs.autobiny,
250960
-
250961
- bingroup: histogram2dAttrs.bingroup,
250962
- xbingroup: histogram2dAttrs.xbingroup,
250963
- ybingroup: histogram2dAttrs.ybingroup,
250964
-
250965
- autocontour: contourAttrs.autocontour,
250966
- ncontours: contourAttrs.ncontours,
250967
- contours: contourAttrs.contours,
250968
- line: {
250969
- color: contourAttrs.line.color,
250970
- width: extendFlat({}, contourAttrs.line.width, {
250971
- dflt: 0.5,
250972
- description: 'Sets the contour line width in (in px)'
250973
- }),
250974
- dash: contourAttrs.line.dash,
250975
- smoothing: contourAttrs.line.smoothing,
250976
- editType: 'plot'
250977
- },
250978
- xhoverformat: axisHoverFormat('x'),
250979
- yhoverformat: axisHoverFormat('y'),
250980
- zhoverformat: axisHoverFormat('z', 1),
250981
- hovertemplate: histogram2dAttrs.hovertemplate,
250982
- texttemplate: contourAttrs.texttemplate,
250983
- textfont: contourAttrs.textfont
250984
- },
250985
- colorScaleAttrs('', {
250986
- cLetter: 'z',
250987
- editTypeOverride: 'calc'
250988
- })
250989
- );
250990
-
250991
-
250992
- /***/ }),
250993
-
250994
- /***/ 14319:
250995
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250996
-
250997
-
250998
-
250999
- var Lib = __webpack_require__(30991);
251000
-
251001
- var handleSampleDefaults = __webpack_require__(6236);
251002
- var handleContoursDefaults = __webpack_require__(657);
251003
- var handleStyleDefaults = __webpack_require__(74619);
251004
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
251005
- var attributes = __webpack_require__(34872);
251006
-
251007
-
251008
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
251009
- function coerce(attr, dflt) {
251010
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
251011
- }
251012
-
251013
- function coerce2(attr) {
251014
- return Lib.coerce2(traceIn, traceOut, attributes, attr);
251015
- }
251016
-
251017
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
251018
- if(traceOut.visible === false) return;
251019
-
251020
- handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
251021
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
251022
- coerce('xhoverformat');
251023
- coerce('yhoverformat');
251024
- coerce('hovertemplate');
251025
- if(
251026
- traceOut.contours &&
251027
- traceOut.contours.coloring === 'heatmap'
251028
- ) {
251029
- handleHeatmapLabelDefaults(coerce, layout);
251030
- }
251031
- };
251032
-
251033
-
251034
- /***/ }),
251035
-
251036
- /***/ 60613:
251037
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
251038
-
251039
-
251040
-
251041
- module.exports = {
251042
- attributes: __webpack_require__(34872),
251043
- supplyDefaults: __webpack_require__(14319),
251044
- crossTraceDefaults: __webpack_require__(34294),
251045
- calc: __webpack_require__(3274),
251046
- plot: (__webpack_require__(32664).plot),
251047
- layerName: 'contourlayer',
251048
- style: __webpack_require__(72690),
251049
- colorbar: __webpack_require__(70307),
251050
- hoverPoints: __webpack_require__(52353),
251051
-
251052
- moduleType: 'trace',
251053
- name: 'histogram2dcontour',
251054
- basePlotModule: __webpack_require__(47885),
251055
- categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
251056
- meta: {
251057
- hrName: 'histogram_2d_contour',
251058
- description: [
251059
- 'The sample data from which statistics are computed is set in `x`',
251060
- 'and `y` (where `x` and `y` represent marginal distributions,',
251061
- 'binning is set in `xbins` and `ybins` in this case)',
251062
- 'or `z` (where `z` represent the 2D distribution and binning set,',
251063
- 'binning is set by `x` and `y` in this case).',
251064
- 'The resulting distribution is visualized as a contour plot.'
251065
- ].join(' ')
251066
- }
251067
- };
251068
-
251069
-
251070
251070
  /***/ }),
251071
251071
 
251072
251072
  /***/ 48223:
@@ -267256,6 +267256,993 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
267256
267256
  };
267257
267257
 
267258
267258
 
267259
+ /***/ }),
267260
+
267261
+ /***/ 1015:
267262
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267263
+
267264
+
267265
+
267266
+ var scatterAttrs = __webpack_require__(86854);
267267
+ var fontAttrs = __webpack_require__(70827);
267268
+ var colorAttributes = __webpack_require__(17957);
267269
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
267270
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
267271
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
267272
+ var baseAttrs = __webpack_require__(35667);
267273
+ var DASHES = __webpack_require__(68828);
267274
+
267275
+ var MARKER_SYMBOLS = __webpack_require__(98993);
267276
+ var extendFlat = (__webpack_require__(91307).extendFlat);
267277
+ var overrideAll = (__webpack_require__(70756).overrideAll);
267278
+ var sortObjectKeys = __webpack_require__(99124);
267279
+
267280
+ var scatterLineAttrs = scatterAttrs.line;
267281
+ var scatterMarkerAttrs = scatterAttrs.marker;
267282
+ var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
267283
+
267284
+ var lineAttrs = extendFlat({
267285
+ width: scatterLineAttrs.width,
267286
+ dash: {
267287
+ valType: 'enumerated',
267288
+ values: sortObjectKeys(DASHES),
267289
+ dflt: 'solid',
267290
+ description: 'Sets the dash style of the lines.'
267291
+ }
267292
+ }, colorAttributes('line'));
267293
+
267294
+ function makeProjectionAttr(axLetter) {
267295
+ return {
267296
+ show: {
267297
+ valType: 'boolean',
267298
+ dflt: false,
267299
+ description: [
267300
+ 'Sets whether or not projections are shown along the',
267301
+ axLetter, 'axis.'
267302
+ ].join(' ')
267303
+ },
267304
+ opacity: {
267305
+ valType: 'number',
267306
+ min: 0,
267307
+ max: 1,
267308
+ dflt: 1,
267309
+ description: 'Sets the projection color.'
267310
+ },
267311
+ scale: {
267312
+ valType: 'number',
267313
+ min: 0,
267314
+ max: 10,
267315
+ dflt: 2 / 3,
267316
+ description: [
267317
+ 'Sets the scale factor determining the size of the',
267318
+ 'projection marker points.'
267319
+ ].join(' ')
267320
+ }
267321
+ };
267322
+ }
267323
+
267324
+ var attrs = module.exports = overrideAll({
267325
+ x: scatterAttrs.x,
267326
+ y: scatterAttrs.y,
267327
+ z: {
267328
+ valType: 'data_array',
267329
+ description: 'Sets the z coordinates.'
267330
+ },
267331
+
267332
+ text: extendFlat({}, scatterAttrs.text, {
267333
+ description: [
267334
+ 'Sets text elements associated with each (x,y,z) triplet.',
267335
+ 'If a single string, the same string appears over',
267336
+ 'all the data points.',
267337
+ 'If an array of string, the items are mapped in order to the',
267338
+ 'this trace\'s (x,y,z) coordinates.',
267339
+ 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
267340
+ 'these elements will be seen in the hover labels.'
267341
+ ].join(' ')
267342
+ }),
267343
+ texttemplate: texttemplateAttrs({}, {
267344
+
267345
+ }),
267346
+ hovertext: extendFlat({}, scatterAttrs.hovertext, {
267347
+ description: [
267348
+ 'Sets text elements associated with each (x,y,z) triplet.',
267349
+ 'If a single string, the same string appears over',
267350
+ 'all the data points.',
267351
+ 'If an array of string, the items are mapped in order to the',
267352
+ 'this trace\'s (x,y,z) coordinates.',
267353
+ 'To be seen, trace `hoverinfo` must contain a *text* flag.'
267354
+ ].join(' ')
267355
+ }),
267356
+ hovertemplate: hovertemplateAttrs(),
267357
+
267358
+ xhoverformat: axisHoverFormat('x'),
267359
+ yhoverformat: axisHoverFormat('y'),
267360
+ zhoverformat: axisHoverFormat('z'),
267361
+
267362
+ mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
267363
+ {dflt: 'lines+markers'}),
267364
+ surfaceaxis: {
267365
+ valType: 'enumerated',
267366
+ values: [-1, 0, 1, 2],
267367
+ dflt: -1,
267368
+ description: [
267369
+ 'If *-1*, the scatter points are not fill with a surface',
267370
+ 'If *0*, *1*, *2*, the scatter points are filled with',
267371
+ 'a Delaunay surface about the x, y, z respectively.'
267372
+ ].join(' ')
267373
+ },
267374
+ surfacecolor: {
267375
+ valType: 'color',
267376
+ description: 'Sets the surface fill color.'
267377
+ },
267378
+ projection: {
267379
+ x: makeProjectionAttr('x'),
267380
+ y: makeProjectionAttr('y'),
267381
+ z: makeProjectionAttr('z')
267382
+ },
267383
+
267384
+ connectgaps: scatterAttrs.connectgaps,
267385
+ line: lineAttrs,
267386
+
267387
+ marker: extendFlat({ // Parity with scatter.js?
267388
+ symbol: {
267389
+ valType: 'enumerated',
267390
+ values: sortObjectKeys(MARKER_SYMBOLS),
267391
+ dflt: 'circle',
267392
+ arrayOk: true,
267393
+ description: 'Sets the marker symbol type.'
267394
+ },
267395
+ size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
267396
+ sizeref: scatterMarkerAttrs.sizeref,
267397
+ sizemin: scatterMarkerAttrs.sizemin,
267398
+ sizemode: scatterMarkerAttrs.sizemode,
267399
+ opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
267400
+ arrayOk: false,
267401
+ description: [
267402
+ 'Sets the marker opacity.',
267403
+ 'Note that the marker opacity for scatter3d traces',
267404
+ 'must be a scalar value for performance reasons.',
267405
+ 'To set a blending opacity value',
267406
+ '(i.e. which is not transparent), set *marker.color*',
267407
+ 'to an rgba color and use its alpha channel.'
267408
+ ].join(' ')
267409
+ }),
267410
+ colorbar: scatterMarkerAttrs.colorbar,
267411
+
267412
+ line: extendFlat({
267413
+ width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
267414
+ },
267415
+ colorAttributes('marker.line')
267416
+ )
267417
+ },
267418
+ colorAttributes('marker')
267419
+ ),
267420
+
267421
+ textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
267422
+ textfont: fontAttrs({
267423
+ noFontShadow: true,
267424
+ noFontLineposition: true,
267425
+ noFontTextcase: true,
267426
+ editType: 'calc',
267427
+ colorEditType: 'style',
267428
+ arrayOk: true,
267429
+ variantValues: ['normal', 'small-caps'],
267430
+ description: 'Sets the text font.'
267431
+ }),
267432
+
267433
+ opacity: baseAttrs.opacity,
267434
+
267435
+ hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
267436
+ }, 'calc', 'nested');
267437
+
267438
+ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
267439
+
267440
+
267441
+ /***/ }),
267442
+
267443
+ /***/ 30935:
267444
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267445
+
267446
+
267447
+
267448
+ var arraysToCalcdata = __webpack_require__(47213);
267449
+ var calcColorscale = __webpack_require__(59498);
267450
+
267451
+ /**
267452
+ * This is a kludge to put the array attributes into
267453
+ * calcdata the way Scatter.plot does, so that legends and
267454
+ * popovers know what to do with them.
267455
+ */
267456
+ module.exports = function calc(gd, trace) {
267457
+ var cd = [{x: false, y: false, trace: trace, t: {}}];
267458
+
267459
+ arraysToCalcdata(cd, trace);
267460
+ calcColorscale(gd, trace);
267461
+
267462
+ return cd;
267463
+ };
267464
+
267465
+
267466
+ /***/ }),
267467
+
267468
+ /***/ 77681:
267469
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267470
+
267471
+
267472
+
267473
+ var Registry = __webpack_require__(13936);
267474
+
267475
+ function calculateAxisErrors(data, params, scaleFactor, axis) {
267476
+ if(!params || !params.visible) return null;
267477
+
267478
+ var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
267479
+ var result = new Array(data.length);
267480
+
267481
+ for(var i = 0; i < data.length; i++) {
267482
+ var errors = computeError(+data[i], i);
267483
+
267484
+ if(axis.type === 'log') {
267485
+ var point = axis.c2l(data[i]);
267486
+ var min = data[i] - errors[0];
267487
+ var max = data[i] + errors[1];
267488
+
267489
+ result[i] = [
267490
+ (axis.c2l(min, true) - point) * scaleFactor,
267491
+ (axis.c2l(max, true) - point) * scaleFactor
267492
+ ];
267493
+
267494
+ // Keep track of the lower error bound which isn't negative!
267495
+ if(min > 0) {
267496
+ var lower = axis.c2l(min);
267497
+ if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
267498
+ axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
267499
+ }
267500
+ } else {
267501
+ result[i] = [
267502
+ -errors[0] * scaleFactor,
267503
+ errors[1] * scaleFactor
267504
+ ];
267505
+ }
267506
+ }
267507
+
267508
+ return result;
267509
+ }
267510
+
267511
+ function dataLength(array) {
267512
+ for(var i = 0; i < array.length; i++) {
267513
+ if(array[i]) return array[i].length;
267514
+ }
267515
+ return 0;
267516
+ }
267517
+
267518
+ function calculateErrors(data, scaleFactor, sceneLayout) {
267519
+ var errors = [
267520
+ calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
267521
+ calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
267522
+ calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
267523
+ ];
267524
+
267525
+ var n = dataLength(errors);
267526
+ if(n === 0) return null;
267527
+
267528
+ var errorBounds = new Array(n);
267529
+
267530
+ for(var i = 0; i < n; i++) {
267531
+ var bound = [[0, 0, 0], [0, 0, 0]];
267532
+
267533
+ for(var j = 0; j < 3; j++) {
267534
+ if(errors[j]) {
267535
+ for(var k = 0; k < 2; k++) {
267536
+ bound[k][j] = errors[j][i][k];
267537
+ }
267538
+ }
267539
+ }
267540
+
267541
+ errorBounds[i] = bound;
267542
+ }
267543
+
267544
+ return errorBounds;
267545
+ }
267546
+
267547
+ module.exports = calculateErrors;
267548
+
267549
+
267550
+ /***/ }),
267551
+
267552
+ /***/ 93219:
267553
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
267554
+
267555
+
267556
+
267557
+ var createLinePlot = (__webpack_require__(46000).gl_line3d);
267558
+ var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
267559
+ var createErrorBars = (__webpack_require__(46000).gl_error3d);
267560
+ var createMesh = (__webpack_require__(46000).gl_mesh3d);
267561
+ var triangulate = (__webpack_require__(46000).delaunay_triangulate);
267562
+
267563
+ var Lib = __webpack_require__(30991);
267564
+ var str2RgbaArray = __webpack_require__(44960);
267565
+ var formatColor = (__webpack_require__(592).formatColor);
267566
+ var makeBubbleSizeFn = __webpack_require__(42581);
267567
+ var DASH_PATTERNS = __webpack_require__(68828);
267568
+ var MARKER_SYMBOLS = __webpack_require__(98993);
267569
+
267570
+ var Axes = __webpack_require__(15076);
267571
+ var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
267572
+
267573
+ var calculateError = __webpack_require__(77681);
267574
+
267575
+ function LineWithMarkers(scene, uid) {
267576
+ this.scene = scene;
267577
+ this.uid = uid;
267578
+ this.linePlot = null;
267579
+ this.scatterPlot = null;
267580
+ this.errorBars = null;
267581
+ this.textMarkers = null;
267582
+ this.delaunayMesh = null;
267583
+ this.color = null;
267584
+ this.mode = '';
267585
+ this.dataPoints = [];
267586
+ this.axesBounds = [
267587
+ [-Infinity, -Infinity, -Infinity],
267588
+ [Infinity, Infinity, Infinity]
267589
+ ];
267590
+ this.textLabels = null;
267591
+ this.data = null;
267592
+ }
267593
+
267594
+ var proto = LineWithMarkers.prototype;
267595
+
267596
+ proto.handlePick = function(selection) {
267597
+ if(selection.object &&
267598
+ (selection.object === this.linePlot ||
267599
+ selection.object === this.delaunayMesh ||
267600
+ selection.object === this.textMarkers ||
267601
+ selection.object === this.scatterPlot)
267602
+ ) {
267603
+ var ind = selection.index = selection.data.index;
267604
+
267605
+ if(selection.object.highlight) {
267606
+ selection.object.highlight(null);
267607
+ }
267608
+ if(this.scatterPlot) {
267609
+ selection.object = this.scatterPlot;
267610
+ this.scatterPlot.highlight(selection.data);
267611
+ }
267612
+
267613
+ selection.textLabel = '';
267614
+ if(this.textLabels) {
267615
+ if(Lib.isArrayOrTypedArray(this.textLabels)) {
267616
+ if(this.textLabels[ind] || this.textLabels[ind] === 0) {
267617
+ selection.textLabel = this.textLabels[ind];
267618
+ }
267619
+ } else {
267620
+ selection.textLabel = this.textLabels;
267621
+ }
267622
+ }
267623
+
267624
+ selection.traceCoordinate = [
267625
+ this.data.x[ind],
267626
+ this.data.y[ind],
267627
+ this.data.z[ind]
267628
+ ];
267629
+
267630
+ return true;
267631
+ }
267632
+ };
267633
+
267634
+ function constructDelaunay(points, color, axis) {
267635
+ var u = (axis + 1) % 3;
267636
+ var v = (axis + 2) % 3;
267637
+ var filteredPoints = [];
267638
+ var filteredIds = [];
267639
+ var i;
267640
+
267641
+ for(i = 0; i < points.length; ++i) {
267642
+ var p = points[i];
267643
+ if(isNaN(p[u]) || !isFinite(p[u]) ||
267644
+ isNaN(p[v]) || !isFinite(p[v])) {
267645
+ continue;
267646
+ }
267647
+ filteredPoints.push([p[u], p[v]]);
267648
+ filteredIds.push(i);
267649
+ }
267650
+ var cells = triangulate(filteredPoints);
267651
+ for(i = 0; i < cells.length; ++i) {
267652
+ var c = cells[i];
267653
+ for(var j = 0; j < c.length; ++j) {
267654
+ c[j] = filteredIds[c[j]];
267655
+ }
267656
+ }
267657
+ return {
267658
+ positions: points,
267659
+ cells: cells,
267660
+ meshColor: color
267661
+ };
267662
+ }
267663
+
267664
+ function calculateErrorParams(errors) {
267665
+ var capSize = [0.0, 0.0, 0.0];
267666
+ var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
267667
+ var lineWidth = [1.0, 1.0, 1.0];
267668
+
267669
+ for(var i = 0; i < 3; i++) {
267670
+ var e = errors[i];
267671
+
267672
+ if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
267673
+ if(!e || !e.visible) continue;
267674
+
267675
+ capSize[i] = e.width / 2; // ballpark rescaling
267676
+ color[i] = str2RgbaArray(e.color);
267677
+ lineWidth[i] = e.thickness;
267678
+ }
267679
+
267680
+ return {capSize: capSize, color: color, lineWidth: lineWidth};
267681
+ }
267682
+
267683
+ function parseAlignmentX(a) {
267684
+ if(a === null || a === undefined) return 0;
267685
+
267686
+ return (a.indexOf('left') > -1) ? -1 :
267687
+ (a.indexOf('right') > -1) ? 1 : 0;
267688
+ }
267689
+
267690
+ function parseAlignmentY(a) {
267691
+ if(a === null || a === undefined) return 0;
267692
+
267693
+ return (a.indexOf('top') > -1) ? -1 :
267694
+ (a.indexOf('bottom') > -1) ? 1 : 0;
267695
+ }
267696
+
267697
+ function calculateTextOffset(tp) {
267698
+ // Read out text properties
267699
+
267700
+ var defaultAlignmentX = 0;
267701
+ var defaultAlignmentY = 0;
267702
+
267703
+ var textOffset = [
267704
+ defaultAlignmentX,
267705
+ defaultAlignmentY
267706
+ ];
267707
+
267708
+ if(Array.isArray(tp)) {
267709
+ for(var i = 0; i < tp.length; i++) {
267710
+ textOffset[i] = [
267711
+ defaultAlignmentX,
267712
+ defaultAlignmentY
267713
+ ];
267714
+ if(tp[i]) {
267715
+ textOffset[i][0] = parseAlignmentX(tp[i]);
267716
+ textOffset[i][1] = parseAlignmentY(tp[i]);
267717
+ }
267718
+ }
267719
+ } else {
267720
+ textOffset[0] = parseAlignmentX(tp);
267721
+ textOffset[1] = parseAlignmentY(tp);
267722
+ }
267723
+
267724
+ return textOffset;
267725
+ }
267726
+
267727
+
267728
+ function calculateSize(sizeIn, sizeFn) {
267729
+ // rough parity with Plotly 2D markers
267730
+ return sizeFn(sizeIn * 4);
267731
+ }
267732
+
267733
+ function calculateSymbol(symbolIn) {
267734
+ return MARKER_SYMBOLS[symbolIn];
267735
+ }
267736
+
267737
+ function formatParam(paramIn, len, calculate, dflt, extraFn) {
267738
+ var paramOut = null;
267739
+
267740
+ if(Lib.isArrayOrTypedArray(paramIn)) {
267741
+ paramOut = [];
267742
+
267743
+ for(var i = 0; i < len; i++) {
267744
+ if(paramIn[i] === undefined) paramOut[i] = dflt;
267745
+ else paramOut[i] = calculate(paramIn[i], extraFn);
267746
+ }
267747
+ } else paramOut = calculate(paramIn, Lib.identity);
267748
+
267749
+ return paramOut;
267750
+ }
267751
+
267752
+
267753
+ function convertPlotlyOptions(scene, data) {
267754
+ var points = [];
267755
+ var sceneLayout = scene.fullSceneLayout;
267756
+ var scaleFactor = scene.dataScale;
267757
+ var xaxis = sceneLayout.xaxis;
267758
+ var yaxis = sceneLayout.yaxis;
267759
+ var zaxis = sceneLayout.zaxis;
267760
+ var marker = data.marker;
267761
+ var line = data.line;
267762
+ var x = data.x || [];
267763
+ var y = data.y || [];
267764
+ var z = data.z || [];
267765
+ var len = x.length;
267766
+ var xcalendar = data.xcalendar;
267767
+ var ycalendar = data.ycalendar;
267768
+ var zcalendar = data.zcalendar;
267769
+ var xc, yc, zc;
267770
+ var params, i;
267771
+ var text;
267772
+
267773
+ // Convert points
267774
+ for(i = 0; i < len; i++) {
267775
+ // sanitize numbers and apply transforms based on axes.type
267776
+ xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
267777
+ yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
267778
+ zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
267779
+
267780
+ points[i] = [xc, yc, zc];
267781
+ }
267782
+
267783
+ // convert text
267784
+ if(Array.isArray(data.text)) {
267785
+ text = data.text;
267786
+ } else if(Lib.isTypedArray(data.text)) {
267787
+ text = Array.from(data.text);
267788
+ } else if(data.text !== undefined) {
267789
+ text = new Array(len);
267790
+ for(i = 0; i < len; i++) text[i] = data.text;
267791
+ }
267792
+
267793
+ function formatter(axName, val) {
267794
+ var ax = sceneLayout[axName];
267795
+ return Axes.tickText(ax, ax.d2l(val), true).text;
267796
+ }
267797
+
267798
+ // check texttemplate
267799
+ var texttemplate = data.texttemplate;
267800
+ if(texttemplate) {
267801
+ var fullLayout = scene.fullLayout;
267802
+ var d3locale = fullLayout._d3locale;
267803
+ var isArray = Array.isArray(texttemplate);
267804
+ var N = isArray ? Math.min(texttemplate.length, len) : len;
267805
+ var txt = isArray ?
267806
+ function(i) { return texttemplate[i]; } :
267807
+ function() { return texttemplate; };
267808
+
267809
+ text = new Array(N);
267810
+
267811
+ for(i = 0; i < N; i++) {
267812
+ var d = {x: x[i], y: y[i], z: z[i]};
267813
+ var labels = {
267814
+ xLabel: formatter('xaxis', x[i]),
267815
+ yLabel: formatter('yaxis', y[i]),
267816
+ zLabel: formatter('zaxis', z[i])
267817
+ };
267818
+ var pointValues = {};
267819
+ appendArrayPointValue(pointValues, data, i);
267820
+ var meta = data._meta || {};
267821
+ text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
267822
+ }
267823
+ }
267824
+
267825
+ // Build object parameters
267826
+ params = {
267827
+ position: points,
267828
+ mode: data.mode,
267829
+ text: text
267830
+ };
267831
+
267832
+ if('line' in data) {
267833
+ params.lineColor = formatColor(line, 1, len);
267834
+ params.lineWidth = line.width;
267835
+ params.lineDashes = line.dash;
267836
+ }
267837
+
267838
+ if('marker' in data) {
267839
+ var sizeFn = makeBubbleSizeFn(data);
267840
+
267841
+ params.scatterColor = formatColor(marker, 1, len);
267842
+ params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
267843
+ params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
267844
+ params.scatterLineWidth = marker.line.width; // arrayOk === false
267845
+ params.scatterLineColor = formatColor(marker.line, 1, len);
267846
+ params.scatterAngle = 0;
267847
+ }
267848
+
267849
+ if('textposition' in data) {
267850
+ params.textOffset = calculateTextOffset(data.textposition);
267851
+ params.textColor = formatColor(data.textfont, 1, len);
267852
+ params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
267853
+ params.textFontFamily = data.textfont.family;
267854
+ params.textFontWeight = data.textfont.weight;
267855
+ params.textFontStyle = data.textfont.style;
267856
+ params.textFontVariant = data.textfont.variant;
267857
+ params.textAngle = 0;
267858
+ }
267859
+
267860
+ var dims = ['x', 'y', 'z'];
267861
+ params.project = [false, false, false];
267862
+ params.projectScale = [1, 1, 1];
267863
+ params.projectOpacity = [1, 1, 1];
267864
+ for(i = 0; i < 3; ++i) {
267865
+ var projection = data.projection[dims[i]];
267866
+ if((params.project[i] = projection.show)) {
267867
+ params.projectOpacity[i] = projection.opacity;
267868
+ params.projectScale[i] = projection.scale;
267869
+ }
267870
+ }
267871
+
267872
+ params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
267873
+
267874
+ var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
267875
+ params.errorColor = errorParams.color;
267876
+ params.errorLineWidth = errorParams.lineWidth;
267877
+ params.errorCapSize = errorParams.capSize;
267878
+
267879
+ params.delaunayAxis = data.surfaceaxis;
267880
+ params.delaunayColor = str2RgbaArray(data.surfacecolor);
267881
+
267882
+ return params;
267883
+ }
267884
+
267885
+ function _arrayToColor(color) {
267886
+ if(Lib.isArrayOrTypedArray(color)) {
267887
+ var c = color[0];
267888
+
267889
+ if(Lib.isArrayOrTypedArray(c)) color = c;
267890
+
267891
+ return 'rgb(' + color.slice(0, 3).map(function(x) {
267892
+ return Math.round(x * 255);
267893
+ }) + ')';
267894
+ }
267895
+
267896
+ return null;
267897
+ }
267898
+
267899
+ function arrayToColor(colors) {
267900
+ if(!Lib.isArrayOrTypedArray(colors)) {
267901
+ return null;
267902
+ }
267903
+
267904
+ if((colors.length === 4) && (typeof colors[0] === 'number')) {
267905
+ return _arrayToColor(colors);
267906
+ }
267907
+
267908
+ return colors.map(_arrayToColor);
267909
+ }
267910
+
267911
+ proto.update = function(data) {
267912
+ var gl = this.scene.glplot.gl;
267913
+ var lineOptions;
267914
+ var scatterOptions;
267915
+ var errorOptions;
267916
+ var textOptions;
267917
+ var dashPattern = DASH_PATTERNS.solid;
267918
+
267919
+ // Save data
267920
+ this.data = data;
267921
+
267922
+ // Run data conversion
267923
+ var options = convertPlotlyOptions(this.scene, data);
267924
+
267925
+ if('mode' in options) {
267926
+ this.mode = options.mode;
267927
+ }
267928
+ if('lineDashes' in options) {
267929
+ if(options.lineDashes in DASH_PATTERNS) {
267930
+ dashPattern = DASH_PATTERNS[options.lineDashes];
267931
+ }
267932
+ }
267933
+
267934
+ this.color = arrayToColor(options.scatterColor) ||
267935
+ arrayToColor(options.lineColor);
267936
+
267937
+ // Save data points
267938
+ this.dataPoints = options.position;
267939
+
267940
+ lineOptions = {
267941
+ gl: this.scene.glplot.gl,
267942
+ position: options.position,
267943
+ color: options.lineColor,
267944
+ lineWidth: options.lineWidth || 1,
267945
+ dashes: dashPattern[0],
267946
+ dashScale: dashPattern[1],
267947
+ opacity: data.opacity,
267948
+ connectGaps: data.connectgaps
267949
+ };
267950
+
267951
+ if(this.mode.indexOf('lines') !== -1) {
267952
+ if(this.linePlot) this.linePlot.update(lineOptions);
267953
+ else {
267954
+ this.linePlot = createLinePlot(lineOptions);
267955
+ this.linePlot._trace = this;
267956
+ this.scene.glplot.add(this.linePlot);
267957
+ }
267958
+ } else if(this.linePlot) {
267959
+ this.scene.glplot.remove(this.linePlot);
267960
+ this.linePlot.dispose();
267961
+ this.linePlot = null;
267962
+ }
267963
+
267964
+ // N.B. marker.opacity must be a scalar for performance
267965
+ var scatterOpacity = data.opacity;
267966
+ if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
267967
+
267968
+ scatterOptions = {
267969
+ gl: this.scene.glplot.gl,
267970
+ position: options.position,
267971
+ color: options.scatterColor,
267972
+ size: options.scatterSize,
267973
+ glyph: options.scatterMarker,
267974
+ opacity: scatterOpacity,
267975
+ orthographic: true,
267976
+ lineWidth: options.scatterLineWidth,
267977
+ lineColor: options.scatterLineColor,
267978
+ project: options.project,
267979
+ projectScale: options.projectScale,
267980
+ projectOpacity: options.projectOpacity
267981
+ };
267982
+
267983
+ if(this.mode.indexOf('markers') !== -1) {
267984
+ if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
267985
+ else {
267986
+ this.scatterPlot = createScatterPlot(scatterOptions);
267987
+ this.scatterPlot._trace = this;
267988
+ this.scatterPlot.highlightScale = 1;
267989
+ this.scene.glplot.add(this.scatterPlot);
267990
+ }
267991
+ } else if(this.scatterPlot) {
267992
+ this.scene.glplot.remove(this.scatterPlot);
267993
+ this.scatterPlot.dispose();
267994
+ this.scatterPlot = null;
267995
+ }
267996
+
267997
+ textOptions = {
267998
+ gl: this.scene.glplot.gl,
267999
+ position: options.position,
268000
+ glyph: options.text,
268001
+ color: options.textColor,
268002
+ size: options.textSize,
268003
+ angle: options.textAngle,
268004
+ alignment: options.textOffset,
268005
+ font: options.textFontFamily,
268006
+ fontWeight: options.textFontWeight,
268007
+ fontStyle: options.textFontStyle,
268008
+ fontVariant: options.textFontVariant,
268009
+ orthographic: true,
268010
+ lineWidth: 0,
268011
+ project: false,
268012
+ opacity: data.opacity
268013
+ };
268014
+
268015
+ this.textLabels = data.hovertext || data.text;
268016
+
268017
+ if(this.mode.indexOf('text') !== -1) {
268018
+ if(this.textMarkers) this.textMarkers.update(textOptions);
268019
+ else {
268020
+ this.textMarkers = createScatterPlot(textOptions);
268021
+ this.textMarkers._trace = this;
268022
+ this.textMarkers.highlightScale = 1;
268023
+ this.scene.glplot.add(this.textMarkers);
268024
+ }
268025
+ } else if(this.textMarkers) {
268026
+ this.scene.glplot.remove(this.textMarkers);
268027
+ this.textMarkers.dispose();
268028
+ this.textMarkers = null;
268029
+ }
268030
+
268031
+ errorOptions = {
268032
+ gl: this.scene.glplot.gl,
268033
+ position: options.position,
268034
+ color: options.errorColor,
268035
+ error: options.errorBounds,
268036
+ lineWidth: options.errorLineWidth,
268037
+ capSize: options.errorCapSize,
268038
+ opacity: data.opacity
268039
+ };
268040
+ if(this.errorBars) {
268041
+ if(options.errorBounds) {
268042
+ this.errorBars.update(errorOptions);
268043
+ } else {
268044
+ this.scene.glplot.remove(this.errorBars);
268045
+ this.errorBars.dispose();
268046
+ this.errorBars = null;
268047
+ }
268048
+ } else if(options.errorBounds) {
268049
+ this.errorBars = createErrorBars(errorOptions);
268050
+ this.errorBars._trace = this;
268051
+ this.scene.glplot.add(this.errorBars);
268052
+ }
268053
+
268054
+ if(options.delaunayAxis >= 0) {
268055
+ var delaunayOptions = constructDelaunay(
268056
+ options.position,
268057
+ options.delaunayColor,
268058
+ options.delaunayAxis
268059
+ );
268060
+ delaunayOptions.opacity = data.opacity;
268061
+
268062
+ if(this.delaunayMesh) {
268063
+ this.delaunayMesh.update(delaunayOptions);
268064
+ } else {
268065
+ delaunayOptions.gl = gl;
268066
+ this.delaunayMesh = createMesh(delaunayOptions);
268067
+ this.delaunayMesh._trace = this;
268068
+ this.scene.glplot.add(this.delaunayMesh);
268069
+ }
268070
+ } else if(this.delaunayMesh) {
268071
+ this.scene.glplot.remove(this.delaunayMesh);
268072
+ this.delaunayMesh.dispose();
268073
+ this.delaunayMesh = null;
268074
+ }
268075
+ };
268076
+
268077
+ proto.dispose = function() {
268078
+ if(this.linePlot) {
268079
+ this.scene.glplot.remove(this.linePlot);
268080
+ this.linePlot.dispose();
268081
+ }
268082
+ if(this.scatterPlot) {
268083
+ this.scene.glplot.remove(this.scatterPlot);
268084
+ this.scatterPlot.dispose();
268085
+ }
268086
+ if(this.errorBars) {
268087
+ this.scene.glplot.remove(this.errorBars);
268088
+ this.errorBars.dispose();
268089
+ }
268090
+ if(this.textMarkers) {
268091
+ this.scene.glplot.remove(this.textMarkers);
268092
+ this.textMarkers.dispose();
268093
+ }
268094
+ if(this.delaunayMesh) {
268095
+ this.scene.glplot.remove(this.delaunayMesh);
268096
+ this.delaunayMesh.dispose();
268097
+ }
268098
+ };
268099
+
268100
+ function createLineWithMarkers(scene, data) {
268101
+ var plot = new LineWithMarkers(scene, data.uid);
268102
+ plot.update(data);
268103
+ return plot;
268104
+ }
268105
+
268106
+ module.exports = createLineWithMarkers;
268107
+
268108
+
268109
+ /***/ }),
268110
+
268111
+ /***/ 13744:
268112
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
268113
+
268114
+
268115
+
268116
+ var Registry = __webpack_require__(13936);
268117
+ var Lib = __webpack_require__(30991);
268118
+
268119
+ var subTypes = __webpack_require__(33068);
268120
+ var handleMarkerDefaults = __webpack_require__(15294);
268121
+ var handleLineDefaults = __webpack_require__(82094);
268122
+ var handleTextDefaults = __webpack_require__(94729);
268123
+
268124
+ var attributes = __webpack_require__(1015);
268125
+
268126
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
268127
+ function coerce(attr, dflt) {
268128
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
268129
+ }
268130
+
268131
+ var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
268132
+ if(!len) {
268133
+ traceOut.visible = false;
268134
+ return;
268135
+ }
268136
+
268137
+ coerce('text');
268138
+ coerce('hovertext');
268139
+ coerce('hovertemplate');
268140
+ coerce('xhoverformat');
268141
+ coerce('yhoverformat');
268142
+ coerce('zhoverformat');
268143
+
268144
+ coerce('mode');
268145
+
268146
+ if(subTypes.hasMarkers(traceOut)) {
268147
+ handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
268148
+ }
268149
+
268150
+ if(subTypes.hasLines(traceOut)) {
268151
+ coerce('connectgaps');
268152
+ handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
268153
+ }
268154
+
268155
+ if(subTypes.hasText(traceOut)) {
268156
+ coerce('texttemplate');
268157
+ handleTextDefaults(traceIn, traceOut, layout, coerce, {
268158
+ noSelect: true,
268159
+ noFontShadow: true,
268160
+ noFontLineposition: true,
268161
+ noFontTextcase: true,
268162
+ });
268163
+ }
268164
+
268165
+ var lineColor = (traceOut.line || {}).color;
268166
+ var markerColor = (traceOut.marker || {}).color;
268167
+ if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
268168
+
268169
+ var dims = ['x', 'y', 'z'];
268170
+ for(var i = 0; i < 3; ++i) {
268171
+ var projection = 'projection.' + dims[i];
268172
+ if(coerce(projection + '.show')) {
268173
+ coerce(projection + '.opacity');
268174
+ coerce(projection + '.scale');
268175
+ }
268176
+ }
268177
+
268178
+ var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
268179
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
268180
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
268181
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
268182
+ };
268183
+
268184
+ function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
268185
+ var len = 0;
268186
+ var x = coerce('x');
268187
+ var y = coerce('y');
268188
+ var z = coerce('z');
268189
+
268190
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
268191
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
268192
+
268193
+ if(x && y && z) {
268194
+ // TODO: what happens if one is missing?
268195
+ len = Math.min(x.length, y.length, z.length);
268196
+ traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
268197
+ }
268198
+
268199
+ return len;
268200
+ }
268201
+
268202
+
268203
+ /***/ }),
268204
+
268205
+ /***/ 68860:
268206
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
268207
+
268208
+
268209
+
268210
+ module.exports = {
268211
+ plot: __webpack_require__(93219),
268212
+ attributes: __webpack_require__(1015),
268213
+ markerSymbols: __webpack_require__(98993),
268214
+ supplyDefaults: __webpack_require__(13744),
268215
+ colorbar: [
268216
+ {
268217
+ container: 'marker',
268218
+ min: 'cmin',
268219
+ max: 'cmax'
268220
+ }, {
268221
+ container: 'line',
268222
+ min: 'cmin',
268223
+ max: 'cmax'
268224
+ }
268225
+ ],
268226
+ calc: __webpack_require__(30935),
268227
+
268228
+ moduleType: 'trace',
268229
+ name: 'scatter3d',
268230
+ basePlotModule: __webpack_require__(68137),
268231
+ categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
268232
+ meta: {
268233
+ hrName: 'scatter_3d',
268234
+ description: [
268235
+ 'The data visualized as scatter point or lines in 3D dimension',
268236
+ 'is set in `x`, `y`, `z`.',
268237
+ 'Text (appearing either on the chart or on hover only) is via `text`.',
268238
+ 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
268239
+ 'Projections are achieved via `projection`.',
268240
+ 'Surface fills are achieved via `surfaceaxis`.'
268241
+ ].join(' ')
268242
+ }
268243
+ };
268244
+
268245
+
267259
268246
  /***/ }),
267260
268247
 
267261
268248
  /***/ 47213:
@@ -271186,993 +272173,6 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
271186
272173
  };
271187
272174
 
271188
272175
 
271189
- /***/ }),
271190
-
271191
- /***/ 1015:
271192
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271193
-
271194
-
271195
-
271196
- var scatterAttrs = __webpack_require__(86854);
271197
- var fontAttrs = __webpack_require__(70827);
271198
- var colorAttributes = __webpack_require__(17957);
271199
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
271200
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
271201
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
271202
- var baseAttrs = __webpack_require__(35667);
271203
- var DASHES = __webpack_require__(68828);
271204
-
271205
- var MARKER_SYMBOLS = __webpack_require__(98993);
271206
- var extendFlat = (__webpack_require__(91307).extendFlat);
271207
- var overrideAll = (__webpack_require__(70756).overrideAll);
271208
- var sortObjectKeys = __webpack_require__(99124);
271209
-
271210
- var scatterLineAttrs = scatterAttrs.line;
271211
- var scatterMarkerAttrs = scatterAttrs.marker;
271212
- var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
271213
-
271214
- var lineAttrs = extendFlat({
271215
- width: scatterLineAttrs.width,
271216
- dash: {
271217
- valType: 'enumerated',
271218
- values: sortObjectKeys(DASHES),
271219
- dflt: 'solid',
271220
- description: 'Sets the dash style of the lines.'
271221
- }
271222
- }, colorAttributes('line'));
271223
-
271224
- function makeProjectionAttr(axLetter) {
271225
- return {
271226
- show: {
271227
- valType: 'boolean',
271228
- dflt: false,
271229
- description: [
271230
- 'Sets whether or not projections are shown along the',
271231
- axLetter, 'axis.'
271232
- ].join(' ')
271233
- },
271234
- opacity: {
271235
- valType: 'number',
271236
- min: 0,
271237
- max: 1,
271238
- dflt: 1,
271239
- description: 'Sets the projection color.'
271240
- },
271241
- scale: {
271242
- valType: 'number',
271243
- min: 0,
271244
- max: 10,
271245
- dflt: 2 / 3,
271246
- description: [
271247
- 'Sets the scale factor determining the size of the',
271248
- 'projection marker points.'
271249
- ].join(' ')
271250
- }
271251
- };
271252
- }
271253
-
271254
- var attrs = module.exports = overrideAll({
271255
- x: scatterAttrs.x,
271256
- y: scatterAttrs.y,
271257
- z: {
271258
- valType: 'data_array',
271259
- description: 'Sets the z coordinates.'
271260
- },
271261
-
271262
- text: extendFlat({}, scatterAttrs.text, {
271263
- description: [
271264
- 'Sets text elements associated with each (x,y,z) triplet.',
271265
- 'If a single string, the same string appears over',
271266
- 'all the data points.',
271267
- 'If an array of string, the items are mapped in order to the',
271268
- 'this trace\'s (x,y,z) coordinates.',
271269
- 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
271270
- 'these elements will be seen in the hover labels.'
271271
- ].join(' ')
271272
- }),
271273
- texttemplate: texttemplateAttrs({}, {
271274
-
271275
- }),
271276
- hovertext: extendFlat({}, scatterAttrs.hovertext, {
271277
- description: [
271278
- 'Sets text elements associated with each (x,y,z) triplet.',
271279
- 'If a single string, the same string appears over',
271280
- 'all the data points.',
271281
- 'If an array of string, the items are mapped in order to the',
271282
- 'this trace\'s (x,y,z) coordinates.',
271283
- 'To be seen, trace `hoverinfo` must contain a *text* flag.'
271284
- ].join(' ')
271285
- }),
271286
- hovertemplate: hovertemplateAttrs(),
271287
-
271288
- xhoverformat: axisHoverFormat('x'),
271289
- yhoverformat: axisHoverFormat('y'),
271290
- zhoverformat: axisHoverFormat('z'),
271291
-
271292
- mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
271293
- {dflt: 'lines+markers'}),
271294
- surfaceaxis: {
271295
- valType: 'enumerated',
271296
- values: [-1, 0, 1, 2],
271297
- dflt: -1,
271298
- description: [
271299
- 'If *-1*, the scatter points are not fill with a surface',
271300
- 'If *0*, *1*, *2*, the scatter points are filled with',
271301
- 'a Delaunay surface about the x, y, z respectively.'
271302
- ].join(' ')
271303
- },
271304
- surfacecolor: {
271305
- valType: 'color',
271306
- description: 'Sets the surface fill color.'
271307
- },
271308
- projection: {
271309
- x: makeProjectionAttr('x'),
271310
- y: makeProjectionAttr('y'),
271311
- z: makeProjectionAttr('z')
271312
- },
271313
-
271314
- connectgaps: scatterAttrs.connectgaps,
271315
- line: lineAttrs,
271316
-
271317
- marker: extendFlat({ // Parity with scatter.js?
271318
- symbol: {
271319
- valType: 'enumerated',
271320
- values: sortObjectKeys(MARKER_SYMBOLS),
271321
- dflt: 'circle',
271322
- arrayOk: true,
271323
- description: 'Sets the marker symbol type.'
271324
- },
271325
- size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
271326
- sizeref: scatterMarkerAttrs.sizeref,
271327
- sizemin: scatterMarkerAttrs.sizemin,
271328
- sizemode: scatterMarkerAttrs.sizemode,
271329
- opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
271330
- arrayOk: false,
271331
- description: [
271332
- 'Sets the marker opacity.',
271333
- 'Note that the marker opacity for scatter3d traces',
271334
- 'must be a scalar value for performance reasons.',
271335
- 'To set a blending opacity value',
271336
- '(i.e. which is not transparent), set *marker.color*',
271337
- 'to an rgba color and use its alpha channel.'
271338
- ].join(' ')
271339
- }),
271340
- colorbar: scatterMarkerAttrs.colorbar,
271341
-
271342
- line: extendFlat({
271343
- width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
271344
- },
271345
- colorAttributes('marker.line')
271346
- )
271347
- },
271348
- colorAttributes('marker')
271349
- ),
271350
-
271351
- textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
271352
- textfont: fontAttrs({
271353
- noFontShadow: true,
271354
- noFontLineposition: true,
271355
- noFontTextcase: true,
271356
- editType: 'calc',
271357
- colorEditType: 'style',
271358
- arrayOk: true,
271359
- variantValues: ['normal', 'small-caps'],
271360
- description: 'Sets the text font.'
271361
- }),
271362
-
271363
- opacity: baseAttrs.opacity,
271364
-
271365
- hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
271366
- }, 'calc', 'nested');
271367
-
271368
- attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
271369
-
271370
-
271371
- /***/ }),
271372
-
271373
- /***/ 30935:
271374
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271375
-
271376
-
271377
-
271378
- var arraysToCalcdata = __webpack_require__(47213);
271379
- var calcColorscale = __webpack_require__(59498);
271380
-
271381
- /**
271382
- * This is a kludge to put the array attributes into
271383
- * calcdata the way Scatter.plot does, so that legends and
271384
- * popovers know what to do with them.
271385
- */
271386
- module.exports = function calc(gd, trace) {
271387
- var cd = [{x: false, y: false, trace: trace, t: {}}];
271388
-
271389
- arraysToCalcdata(cd, trace);
271390
- calcColorscale(gd, trace);
271391
-
271392
- return cd;
271393
- };
271394
-
271395
-
271396
- /***/ }),
271397
-
271398
- /***/ 77681:
271399
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271400
-
271401
-
271402
-
271403
- var Registry = __webpack_require__(13936);
271404
-
271405
- function calculateAxisErrors(data, params, scaleFactor, axis) {
271406
- if(!params || !params.visible) return null;
271407
-
271408
- var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
271409
- var result = new Array(data.length);
271410
-
271411
- for(var i = 0; i < data.length; i++) {
271412
- var errors = computeError(+data[i], i);
271413
-
271414
- if(axis.type === 'log') {
271415
- var point = axis.c2l(data[i]);
271416
- var min = data[i] - errors[0];
271417
- var max = data[i] + errors[1];
271418
-
271419
- result[i] = [
271420
- (axis.c2l(min, true) - point) * scaleFactor,
271421
- (axis.c2l(max, true) - point) * scaleFactor
271422
- ];
271423
-
271424
- // Keep track of the lower error bound which isn't negative!
271425
- if(min > 0) {
271426
- var lower = axis.c2l(min);
271427
- if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
271428
- axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
271429
- }
271430
- } else {
271431
- result[i] = [
271432
- -errors[0] * scaleFactor,
271433
- errors[1] * scaleFactor
271434
- ];
271435
- }
271436
- }
271437
-
271438
- return result;
271439
- }
271440
-
271441
- function dataLength(array) {
271442
- for(var i = 0; i < array.length; i++) {
271443
- if(array[i]) return array[i].length;
271444
- }
271445
- return 0;
271446
- }
271447
-
271448
- function calculateErrors(data, scaleFactor, sceneLayout) {
271449
- var errors = [
271450
- calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
271451
- calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
271452
- calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
271453
- ];
271454
-
271455
- var n = dataLength(errors);
271456
- if(n === 0) return null;
271457
-
271458
- var errorBounds = new Array(n);
271459
-
271460
- for(var i = 0; i < n; i++) {
271461
- var bound = [[0, 0, 0], [0, 0, 0]];
271462
-
271463
- for(var j = 0; j < 3; j++) {
271464
- if(errors[j]) {
271465
- for(var k = 0; k < 2; k++) {
271466
- bound[k][j] = errors[j][i][k];
271467
- }
271468
- }
271469
- }
271470
-
271471
- errorBounds[i] = bound;
271472
- }
271473
-
271474
- return errorBounds;
271475
- }
271476
-
271477
- module.exports = calculateErrors;
271478
-
271479
-
271480
- /***/ }),
271481
-
271482
- /***/ 93219:
271483
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271484
-
271485
-
271486
-
271487
- var createLinePlot = (__webpack_require__(46000).gl_line3d);
271488
- var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
271489
- var createErrorBars = (__webpack_require__(46000).gl_error3d);
271490
- var createMesh = (__webpack_require__(46000).gl_mesh3d);
271491
- var triangulate = (__webpack_require__(46000).delaunay_triangulate);
271492
-
271493
- var Lib = __webpack_require__(30991);
271494
- var str2RgbaArray = __webpack_require__(44960);
271495
- var formatColor = (__webpack_require__(592).formatColor);
271496
- var makeBubbleSizeFn = __webpack_require__(42581);
271497
- var DASH_PATTERNS = __webpack_require__(68828);
271498
- var MARKER_SYMBOLS = __webpack_require__(98993);
271499
-
271500
- var Axes = __webpack_require__(15076);
271501
- var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
271502
-
271503
- var calculateError = __webpack_require__(77681);
271504
-
271505
- function LineWithMarkers(scene, uid) {
271506
- this.scene = scene;
271507
- this.uid = uid;
271508
- this.linePlot = null;
271509
- this.scatterPlot = null;
271510
- this.errorBars = null;
271511
- this.textMarkers = null;
271512
- this.delaunayMesh = null;
271513
- this.color = null;
271514
- this.mode = '';
271515
- this.dataPoints = [];
271516
- this.axesBounds = [
271517
- [-Infinity, -Infinity, -Infinity],
271518
- [Infinity, Infinity, Infinity]
271519
- ];
271520
- this.textLabels = null;
271521
- this.data = null;
271522
- }
271523
-
271524
- var proto = LineWithMarkers.prototype;
271525
-
271526
- proto.handlePick = function(selection) {
271527
- if(selection.object &&
271528
- (selection.object === this.linePlot ||
271529
- selection.object === this.delaunayMesh ||
271530
- selection.object === this.textMarkers ||
271531
- selection.object === this.scatterPlot)
271532
- ) {
271533
- var ind = selection.index = selection.data.index;
271534
-
271535
- if(selection.object.highlight) {
271536
- selection.object.highlight(null);
271537
- }
271538
- if(this.scatterPlot) {
271539
- selection.object = this.scatterPlot;
271540
- this.scatterPlot.highlight(selection.data);
271541
- }
271542
-
271543
- selection.textLabel = '';
271544
- if(this.textLabels) {
271545
- if(Lib.isArrayOrTypedArray(this.textLabels)) {
271546
- if(this.textLabels[ind] || this.textLabels[ind] === 0) {
271547
- selection.textLabel = this.textLabels[ind];
271548
- }
271549
- } else {
271550
- selection.textLabel = this.textLabels;
271551
- }
271552
- }
271553
-
271554
- selection.traceCoordinate = [
271555
- this.data.x[ind],
271556
- this.data.y[ind],
271557
- this.data.z[ind]
271558
- ];
271559
-
271560
- return true;
271561
- }
271562
- };
271563
-
271564
- function constructDelaunay(points, color, axis) {
271565
- var u = (axis + 1) % 3;
271566
- var v = (axis + 2) % 3;
271567
- var filteredPoints = [];
271568
- var filteredIds = [];
271569
- var i;
271570
-
271571
- for(i = 0; i < points.length; ++i) {
271572
- var p = points[i];
271573
- if(isNaN(p[u]) || !isFinite(p[u]) ||
271574
- isNaN(p[v]) || !isFinite(p[v])) {
271575
- continue;
271576
- }
271577
- filteredPoints.push([p[u], p[v]]);
271578
- filteredIds.push(i);
271579
- }
271580
- var cells = triangulate(filteredPoints);
271581
- for(i = 0; i < cells.length; ++i) {
271582
- var c = cells[i];
271583
- for(var j = 0; j < c.length; ++j) {
271584
- c[j] = filteredIds[c[j]];
271585
- }
271586
- }
271587
- return {
271588
- positions: points,
271589
- cells: cells,
271590
- meshColor: color
271591
- };
271592
- }
271593
-
271594
- function calculateErrorParams(errors) {
271595
- var capSize = [0.0, 0.0, 0.0];
271596
- var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
271597
- var lineWidth = [1.0, 1.0, 1.0];
271598
-
271599
- for(var i = 0; i < 3; i++) {
271600
- var e = errors[i];
271601
-
271602
- if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
271603
- if(!e || !e.visible) continue;
271604
-
271605
- capSize[i] = e.width / 2; // ballpark rescaling
271606
- color[i] = str2RgbaArray(e.color);
271607
- lineWidth[i] = e.thickness;
271608
- }
271609
-
271610
- return {capSize: capSize, color: color, lineWidth: lineWidth};
271611
- }
271612
-
271613
- function parseAlignmentX(a) {
271614
- if(a === null || a === undefined) return 0;
271615
-
271616
- return (a.indexOf('left') > -1) ? -1 :
271617
- (a.indexOf('right') > -1) ? 1 : 0;
271618
- }
271619
-
271620
- function parseAlignmentY(a) {
271621
- if(a === null || a === undefined) return 0;
271622
-
271623
- return (a.indexOf('top') > -1) ? -1 :
271624
- (a.indexOf('bottom') > -1) ? 1 : 0;
271625
- }
271626
-
271627
- function calculateTextOffset(tp) {
271628
- // Read out text properties
271629
-
271630
- var defaultAlignmentX = 0;
271631
- var defaultAlignmentY = 0;
271632
-
271633
- var textOffset = [
271634
- defaultAlignmentX,
271635
- defaultAlignmentY
271636
- ];
271637
-
271638
- if(Array.isArray(tp)) {
271639
- for(var i = 0; i < tp.length; i++) {
271640
- textOffset[i] = [
271641
- defaultAlignmentX,
271642
- defaultAlignmentY
271643
- ];
271644
- if(tp[i]) {
271645
- textOffset[i][0] = parseAlignmentX(tp[i]);
271646
- textOffset[i][1] = parseAlignmentY(tp[i]);
271647
- }
271648
- }
271649
- } else {
271650
- textOffset[0] = parseAlignmentX(tp);
271651
- textOffset[1] = parseAlignmentY(tp);
271652
- }
271653
-
271654
- return textOffset;
271655
- }
271656
-
271657
-
271658
- function calculateSize(sizeIn, sizeFn) {
271659
- // rough parity with Plotly 2D markers
271660
- return sizeFn(sizeIn * 4);
271661
- }
271662
-
271663
- function calculateSymbol(symbolIn) {
271664
- return MARKER_SYMBOLS[symbolIn];
271665
- }
271666
-
271667
- function formatParam(paramIn, len, calculate, dflt, extraFn) {
271668
- var paramOut = null;
271669
-
271670
- if(Lib.isArrayOrTypedArray(paramIn)) {
271671
- paramOut = [];
271672
-
271673
- for(var i = 0; i < len; i++) {
271674
- if(paramIn[i] === undefined) paramOut[i] = dflt;
271675
- else paramOut[i] = calculate(paramIn[i], extraFn);
271676
- }
271677
- } else paramOut = calculate(paramIn, Lib.identity);
271678
-
271679
- return paramOut;
271680
- }
271681
-
271682
-
271683
- function convertPlotlyOptions(scene, data) {
271684
- var points = [];
271685
- var sceneLayout = scene.fullSceneLayout;
271686
- var scaleFactor = scene.dataScale;
271687
- var xaxis = sceneLayout.xaxis;
271688
- var yaxis = sceneLayout.yaxis;
271689
- var zaxis = sceneLayout.zaxis;
271690
- var marker = data.marker;
271691
- var line = data.line;
271692
- var x = data.x || [];
271693
- var y = data.y || [];
271694
- var z = data.z || [];
271695
- var len = x.length;
271696
- var xcalendar = data.xcalendar;
271697
- var ycalendar = data.ycalendar;
271698
- var zcalendar = data.zcalendar;
271699
- var xc, yc, zc;
271700
- var params, i;
271701
- var text;
271702
-
271703
- // Convert points
271704
- for(i = 0; i < len; i++) {
271705
- // sanitize numbers and apply transforms based on axes.type
271706
- xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
271707
- yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
271708
- zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
271709
-
271710
- points[i] = [xc, yc, zc];
271711
- }
271712
-
271713
- // convert text
271714
- if(Array.isArray(data.text)) {
271715
- text = data.text;
271716
- } else if(Lib.isTypedArray(data.text)) {
271717
- text = Array.from(data.text);
271718
- } else if(data.text !== undefined) {
271719
- text = new Array(len);
271720
- for(i = 0; i < len; i++) text[i] = data.text;
271721
- }
271722
-
271723
- function formatter(axName, val) {
271724
- var ax = sceneLayout[axName];
271725
- return Axes.tickText(ax, ax.d2l(val), true).text;
271726
- }
271727
-
271728
- // check texttemplate
271729
- var texttemplate = data.texttemplate;
271730
- if(texttemplate) {
271731
- var fullLayout = scene.fullLayout;
271732
- var d3locale = fullLayout._d3locale;
271733
- var isArray = Array.isArray(texttemplate);
271734
- var N = isArray ? Math.min(texttemplate.length, len) : len;
271735
- var txt = isArray ?
271736
- function(i) { return texttemplate[i]; } :
271737
- function() { return texttemplate; };
271738
-
271739
- text = new Array(N);
271740
-
271741
- for(i = 0; i < N; i++) {
271742
- var d = {x: x[i], y: y[i], z: z[i]};
271743
- var labels = {
271744
- xLabel: formatter('xaxis', x[i]),
271745
- yLabel: formatter('yaxis', y[i]),
271746
- zLabel: formatter('zaxis', z[i])
271747
- };
271748
- var pointValues = {};
271749
- appendArrayPointValue(pointValues, data, i);
271750
- var meta = data._meta || {};
271751
- text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
271752
- }
271753
- }
271754
-
271755
- // Build object parameters
271756
- params = {
271757
- position: points,
271758
- mode: data.mode,
271759
- text: text
271760
- };
271761
-
271762
- if('line' in data) {
271763
- params.lineColor = formatColor(line, 1, len);
271764
- params.lineWidth = line.width;
271765
- params.lineDashes = line.dash;
271766
- }
271767
-
271768
- if('marker' in data) {
271769
- var sizeFn = makeBubbleSizeFn(data);
271770
-
271771
- params.scatterColor = formatColor(marker, 1, len);
271772
- params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
271773
- params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
271774
- params.scatterLineWidth = marker.line.width; // arrayOk === false
271775
- params.scatterLineColor = formatColor(marker.line, 1, len);
271776
- params.scatterAngle = 0;
271777
- }
271778
-
271779
- if('textposition' in data) {
271780
- params.textOffset = calculateTextOffset(data.textposition);
271781
- params.textColor = formatColor(data.textfont, 1, len);
271782
- params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
271783
- params.textFontFamily = data.textfont.family;
271784
- params.textFontWeight = data.textfont.weight;
271785
- params.textFontStyle = data.textfont.style;
271786
- params.textFontVariant = data.textfont.variant;
271787
- params.textAngle = 0;
271788
- }
271789
-
271790
- var dims = ['x', 'y', 'z'];
271791
- params.project = [false, false, false];
271792
- params.projectScale = [1, 1, 1];
271793
- params.projectOpacity = [1, 1, 1];
271794
- for(i = 0; i < 3; ++i) {
271795
- var projection = data.projection[dims[i]];
271796
- if((params.project[i] = projection.show)) {
271797
- params.projectOpacity[i] = projection.opacity;
271798
- params.projectScale[i] = projection.scale;
271799
- }
271800
- }
271801
-
271802
- params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
271803
-
271804
- var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
271805
- params.errorColor = errorParams.color;
271806
- params.errorLineWidth = errorParams.lineWidth;
271807
- params.errorCapSize = errorParams.capSize;
271808
-
271809
- params.delaunayAxis = data.surfaceaxis;
271810
- params.delaunayColor = str2RgbaArray(data.surfacecolor);
271811
-
271812
- return params;
271813
- }
271814
-
271815
- function _arrayToColor(color) {
271816
- if(Lib.isArrayOrTypedArray(color)) {
271817
- var c = color[0];
271818
-
271819
- if(Lib.isArrayOrTypedArray(c)) color = c;
271820
-
271821
- return 'rgb(' + color.slice(0, 3).map(function(x) {
271822
- return Math.round(x * 255);
271823
- }) + ')';
271824
- }
271825
-
271826
- return null;
271827
- }
271828
-
271829
- function arrayToColor(colors) {
271830
- if(!Lib.isArrayOrTypedArray(colors)) {
271831
- return null;
271832
- }
271833
-
271834
- if((colors.length === 4) && (typeof colors[0] === 'number')) {
271835
- return _arrayToColor(colors);
271836
- }
271837
-
271838
- return colors.map(_arrayToColor);
271839
- }
271840
-
271841
- proto.update = function(data) {
271842
- var gl = this.scene.glplot.gl;
271843
- var lineOptions;
271844
- var scatterOptions;
271845
- var errorOptions;
271846
- var textOptions;
271847
- var dashPattern = DASH_PATTERNS.solid;
271848
-
271849
- // Save data
271850
- this.data = data;
271851
-
271852
- // Run data conversion
271853
- var options = convertPlotlyOptions(this.scene, data);
271854
-
271855
- if('mode' in options) {
271856
- this.mode = options.mode;
271857
- }
271858
- if('lineDashes' in options) {
271859
- if(options.lineDashes in DASH_PATTERNS) {
271860
- dashPattern = DASH_PATTERNS[options.lineDashes];
271861
- }
271862
- }
271863
-
271864
- this.color = arrayToColor(options.scatterColor) ||
271865
- arrayToColor(options.lineColor);
271866
-
271867
- // Save data points
271868
- this.dataPoints = options.position;
271869
-
271870
- lineOptions = {
271871
- gl: this.scene.glplot.gl,
271872
- position: options.position,
271873
- color: options.lineColor,
271874
- lineWidth: options.lineWidth || 1,
271875
- dashes: dashPattern[0],
271876
- dashScale: dashPattern[1],
271877
- opacity: data.opacity,
271878
- connectGaps: data.connectgaps
271879
- };
271880
-
271881
- if(this.mode.indexOf('lines') !== -1) {
271882
- if(this.linePlot) this.linePlot.update(lineOptions);
271883
- else {
271884
- this.linePlot = createLinePlot(lineOptions);
271885
- this.linePlot._trace = this;
271886
- this.scene.glplot.add(this.linePlot);
271887
- }
271888
- } else if(this.linePlot) {
271889
- this.scene.glplot.remove(this.linePlot);
271890
- this.linePlot.dispose();
271891
- this.linePlot = null;
271892
- }
271893
-
271894
- // N.B. marker.opacity must be a scalar for performance
271895
- var scatterOpacity = data.opacity;
271896
- if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
271897
-
271898
- scatterOptions = {
271899
- gl: this.scene.glplot.gl,
271900
- position: options.position,
271901
- color: options.scatterColor,
271902
- size: options.scatterSize,
271903
- glyph: options.scatterMarker,
271904
- opacity: scatterOpacity,
271905
- orthographic: true,
271906
- lineWidth: options.scatterLineWidth,
271907
- lineColor: options.scatterLineColor,
271908
- project: options.project,
271909
- projectScale: options.projectScale,
271910
- projectOpacity: options.projectOpacity
271911
- };
271912
-
271913
- if(this.mode.indexOf('markers') !== -1) {
271914
- if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
271915
- else {
271916
- this.scatterPlot = createScatterPlot(scatterOptions);
271917
- this.scatterPlot._trace = this;
271918
- this.scatterPlot.highlightScale = 1;
271919
- this.scene.glplot.add(this.scatterPlot);
271920
- }
271921
- } else if(this.scatterPlot) {
271922
- this.scene.glplot.remove(this.scatterPlot);
271923
- this.scatterPlot.dispose();
271924
- this.scatterPlot = null;
271925
- }
271926
-
271927
- textOptions = {
271928
- gl: this.scene.glplot.gl,
271929
- position: options.position,
271930
- glyph: options.text,
271931
- color: options.textColor,
271932
- size: options.textSize,
271933
- angle: options.textAngle,
271934
- alignment: options.textOffset,
271935
- font: options.textFontFamily,
271936
- fontWeight: options.textFontWeight,
271937
- fontStyle: options.textFontStyle,
271938
- fontVariant: options.textFontVariant,
271939
- orthographic: true,
271940
- lineWidth: 0,
271941
- project: false,
271942
- opacity: data.opacity
271943
- };
271944
-
271945
- this.textLabels = data.hovertext || data.text;
271946
-
271947
- if(this.mode.indexOf('text') !== -1) {
271948
- if(this.textMarkers) this.textMarkers.update(textOptions);
271949
- else {
271950
- this.textMarkers = createScatterPlot(textOptions);
271951
- this.textMarkers._trace = this;
271952
- this.textMarkers.highlightScale = 1;
271953
- this.scene.glplot.add(this.textMarkers);
271954
- }
271955
- } else if(this.textMarkers) {
271956
- this.scene.glplot.remove(this.textMarkers);
271957
- this.textMarkers.dispose();
271958
- this.textMarkers = null;
271959
- }
271960
-
271961
- errorOptions = {
271962
- gl: this.scene.glplot.gl,
271963
- position: options.position,
271964
- color: options.errorColor,
271965
- error: options.errorBounds,
271966
- lineWidth: options.errorLineWidth,
271967
- capSize: options.errorCapSize,
271968
- opacity: data.opacity
271969
- };
271970
- if(this.errorBars) {
271971
- if(options.errorBounds) {
271972
- this.errorBars.update(errorOptions);
271973
- } else {
271974
- this.scene.glplot.remove(this.errorBars);
271975
- this.errorBars.dispose();
271976
- this.errorBars = null;
271977
- }
271978
- } else if(options.errorBounds) {
271979
- this.errorBars = createErrorBars(errorOptions);
271980
- this.errorBars._trace = this;
271981
- this.scene.glplot.add(this.errorBars);
271982
- }
271983
-
271984
- if(options.delaunayAxis >= 0) {
271985
- var delaunayOptions = constructDelaunay(
271986
- options.position,
271987
- options.delaunayColor,
271988
- options.delaunayAxis
271989
- );
271990
- delaunayOptions.opacity = data.opacity;
271991
-
271992
- if(this.delaunayMesh) {
271993
- this.delaunayMesh.update(delaunayOptions);
271994
- } else {
271995
- delaunayOptions.gl = gl;
271996
- this.delaunayMesh = createMesh(delaunayOptions);
271997
- this.delaunayMesh._trace = this;
271998
- this.scene.glplot.add(this.delaunayMesh);
271999
- }
272000
- } else if(this.delaunayMesh) {
272001
- this.scene.glplot.remove(this.delaunayMesh);
272002
- this.delaunayMesh.dispose();
272003
- this.delaunayMesh = null;
272004
- }
272005
- };
272006
-
272007
- proto.dispose = function() {
272008
- if(this.linePlot) {
272009
- this.scene.glplot.remove(this.linePlot);
272010
- this.linePlot.dispose();
272011
- }
272012
- if(this.scatterPlot) {
272013
- this.scene.glplot.remove(this.scatterPlot);
272014
- this.scatterPlot.dispose();
272015
- }
272016
- if(this.errorBars) {
272017
- this.scene.glplot.remove(this.errorBars);
272018
- this.errorBars.dispose();
272019
- }
272020
- if(this.textMarkers) {
272021
- this.scene.glplot.remove(this.textMarkers);
272022
- this.textMarkers.dispose();
272023
- }
272024
- if(this.delaunayMesh) {
272025
- this.scene.glplot.remove(this.delaunayMesh);
272026
- this.delaunayMesh.dispose();
272027
- }
272028
- };
272029
-
272030
- function createLineWithMarkers(scene, data) {
272031
- var plot = new LineWithMarkers(scene, data.uid);
272032
- plot.update(data);
272033
- return plot;
272034
- }
272035
-
272036
- module.exports = createLineWithMarkers;
272037
-
272038
-
272039
- /***/ }),
272040
-
272041
- /***/ 13744:
272042
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
272043
-
272044
-
272045
-
272046
- var Registry = __webpack_require__(13936);
272047
- var Lib = __webpack_require__(30991);
272048
-
272049
- var subTypes = __webpack_require__(33068);
272050
- var handleMarkerDefaults = __webpack_require__(15294);
272051
- var handleLineDefaults = __webpack_require__(82094);
272052
- var handleTextDefaults = __webpack_require__(94729);
272053
-
272054
- var attributes = __webpack_require__(1015);
272055
-
272056
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
272057
- function coerce(attr, dflt) {
272058
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
272059
- }
272060
-
272061
- var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
272062
- if(!len) {
272063
- traceOut.visible = false;
272064
- return;
272065
- }
272066
-
272067
- coerce('text');
272068
- coerce('hovertext');
272069
- coerce('hovertemplate');
272070
- coerce('xhoverformat');
272071
- coerce('yhoverformat');
272072
- coerce('zhoverformat');
272073
-
272074
- coerce('mode');
272075
-
272076
- if(subTypes.hasMarkers(traceOut)) {
272077
- handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
272078
- }
272079
-
272080
- if(subTypes.hasLines(traceOut)) {
272081
- coerce('connectgaps');
272082
- handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
272083
- }
272084
-
272085
- if(subTypes.hasText(traceOut)) {
272086
- coerce('texttemplate');
272087
- handleTextDefaults(traceIn, traceOut, layout, coerce, {
272088
- noSelect: true,
272089
- noFontShadow: true,
272090
- noFontLineposition: true,
272091
- noFontTextcase: true,
272092
- });
272093
- }
272094
-
272095
- var lineColor = (traceOut.line || {}).color;
272096
- var markerColor = (traceOut.marker || {}).color;
272097
- if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
272098
-
272099
- var dims = ['x', 'y', 'z'];
272100
- for(var i = 0; i < 3; ++i) {
272101
- var projection = 'projection.' + dims[i];
272102
- if(coerce(projection + '.show')) {
272103
- coerce(projection + '.opacity');
272104
- coerce(projection + '.scale');
272105
- }
272106
- }
272107
-
272108
- var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
272109
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
272110
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
272111
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
272112
- };
272113
-
272114
- function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
272115
- var len = 0;
272116
- var x = coerce('x');
272117
- var y = coerce('y');
272118
- var z = coerce('z');
272119
-
272120
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
272121
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
272122
-
272123
- if(x && y && z) {
272124
- // TODO: what happens if one is missing?
272125
- len = Math.min(x.length, y.length, z.length);
272126
- traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
272127
- }
272128
-
272129
- return len;
272130
- }
272131
-
272132
-
272133
- /***/ }),
272134
-
272135
- /***/ 68860:
272136
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
272137
-
272138
-
272139
-
272140
- module.exports = {
272141
- plot: __webpack_require__(93219),
272142
- attributes: __webpack_require__(1015),
272143
- markerSymbols: __webpack_require__(98993),
272144
- supplyDefaults: __webpack_require__(13744),
272145
- colorbar: [
272146
- {
272147
- container: 'marker',
272148
- min: 'cmin',
272149
- max: 'cmax'
272150
- }, {
272151
- container: 'line',
272152
- min: 'cmin',
272153
- max: 'cmax'
272154
- }
272155
- ],
272156
- calc: __webpack_require__(30935),
272157
-
272158
- moduleType: 'trace',
272159
- name: 'scatter3d',
272160
- basePlotModule: __webpack_require__(68137),
272161
- categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
272162
- meta: {
272163
- hrName: 'scatter_3d',
272164
- description: [
272165
- 'The data visualized as scatter point or lines in 3D dimension',
272166
- 'is set in `x`, `y`, `z`.',
272167
- 'Text (appearing either on the chart or on hover only) is via `text`.',
272168
- 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
272169
- 'Projections are achieved via `projection`.',
272170
- 'Surface fills are achieved via `surfaceaxis`.'
272171
- ].join(' ')
272172
- }
272173
- };
272174
-
272175
-
272176
272176
  /***/ }),
272177
272177
 
272178
272178
  /***/ 44771:
@@ -368804,7 +368804,7 @@ const HistoryButton = ({ className }) => {
368804
368804
  const handleClick = () => {
368805
368805
  setIsContextOpen((prev) => !prev);
368806
368806
  };
368807
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.btnContainer, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Nothing here yet! Once you save your work, versions will appear here so you can restore them.", visible: hovered && !commits?.length, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: ref, className: (0, classnames_1.default)(styles_module_scss_1.default.historyButton, className, {
368807
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.btnContainer, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Nothing here yet! Once you save your work, versions will appear here so you can restore them.", visible: hovered && !commits?.length, position: "bottom" }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Load previous versions", visible: hovered && !!commits?.length, position: "bottom", size: "fit" }), (0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: ref, className: (0, classnames_1.default)(styles_module_scss_1.default.historyButton, className, {
368808
368808
  [styles_module_scss_1.default.historyActive]: isContextOpen,
368809
368809
  }), variant: "tertiary", onClickHandler: handleClick, ButtonIcon: () => (0, SvgIcon_1.SvgIcon)({ SvgElement: history_svg_1.default, size: 24 }), disabled: !commits?.length })] }), (0, jsx_runtime_1.jsx)(CommitHistoryMenu_1.CommitHistoryMenu, { isOpen: isContextOpen, onClose: () => setIsContextOpen(false), commits: commits, btnRef: ref, activeCommitId: project.commitId ?? undefined })] }));
368810
368810
  };
@@ -368851,13 +368851,16 @@ const stores_1 = __webpack_require__(32132);
368851
368851
  const SvgIcon_1 = __webpack_require__(82917);
368852
368852
  const Button_1 = __importDefault(__webpack_require__(79428));
368853
368853
  const createProjectArchive_1 = __webpack_require__(46514);
368854
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
368855
+ const useHover_1 = __webpack_require__(78556);
368854
368856
  const DownloadButton = (props) => {
368855
368857
  const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
368858
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
368856
368859
  const onClickDownload = async () => {
368857
368860
  const { zipBlob: content } = await (0, createProjectArchive_1.createProjectArchive)(project);
368858
368861
  file_saver_1.default.saveAs(content, `${(0, js_convert_case_1.toSnakeCase)(project.name || "untitled_project")}.zip`);
368859
368862
  };
368860
- return ((0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: download_svg_1.default, size: 24 }), onClickHandler: onClickDownload, ...props }));
368863
+ return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: download_svg_1.default, size: 24 }), onClickHandler: onClickDownload, ...props }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Download project", visible: hovered, position: "fixed", size: "fit" })] }));
368861
368864
  };
368862
368865
  exports["default"] = DownloadButton;
368863
368866
 
@@ -369430,7 +369433,7 @@ function HtmlRunner() {
369430
369433
  const iframeClasses = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
369431
369434
  [styles_module_scss_1.default.codeHasBeenRun]: codeHasBeenRun,
369432
369435
  });
369433
- 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, src: "about:blank" }, iframeKey)) }), !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 }) }) }))] }));
369436
+ 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, src: "about:blank" }, iframeKey)) }), !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 }) }) }))] }));
369434
369437
  }
369435
369438
  exports["default"] = HtmlRunner;
369436
369439
 
@@ -369817,234 +369820,234 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
369817
369820
  exports.consoleOverrideScript = exports.disableLocalStorageScript = void 0;
369818
369821
  // insert script to disable access to specific localStorage keys
369819
369822
  // localstorage.getItem() is a potential security risk when executing untrusted code
369820
- exports.disableLocalStorageScript = `
369821
- <script>
369822
- (function() {
369823
- const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
369824
- const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
369825
- const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
369826
- const originalClear = window.localStorage.clear.bind(window.localStorage);
369827
-
369828
- const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
369829
-
369830
- Object.defineProperty(window, 'localStorage', {
369831
- value: {
369832
- getItem: function(key) {
369833
- if (isDisallowedKey(key)) {
369834
- console.log(\`localStorage.getItem for "\${key}" is disabled\`);
369835
- return null;
369836
- }
369837
- return originalGetItem(key);
369838
- },
369839
- setItem: function(key, value) {
369840
- if (isDisallowedKey(key)) {
369841
- console.log(\`localStorage.setItem for "\${key}" is disabled\`);
369842
- return;
369843
- }
369844
- return originalSetItem(key, value);
369845
- },
369846
- removeItem: function(key) {
369847
- if (isDisallowedKey(key)) {
369848
- console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
369849
- return;
369850
- }
369851
- return originalRemoveItem(key);
369852
- },
369853
- clear: function() {
369854
- console.log('localStorage.clear is disabled');
369855
- return;
369856
- }
369857
- },
369858
- writable: false,
369859
- configurable: false
369860
- });
369861
- })();
369862
- </script>
369823
+ exports.disableLocalStorageScript = `
369824
+ <script>
369825
+ (function() {
369826
+ const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
369827
+ const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
369828
+ const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
369829
+ const originalClear = window.localStorage.clear.bind(window.localStorage);
369830
+
369831
+ const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
369832
+
369833
+ Object.defineProperty(window, 'localStorage', {
369834
+ value: {
369835
+ getItem: function(key) {
369836
+ if (isDisallowedKey(key)) {
369837
+ console.log(\`localStorage.getItem for "\${key}" is disabled\`);
369838
+ return null;
369839
+ }
369840
+ return originalGetItem(key);
369841
+ },
369842
+ setItem: function(key, value) {
369843
+ if (isDisallowedKey(key)) {
369844
+ console.log(\`localStorage.setItem for "\${key}" is disabled\`);
369845
+ return;
369846
+ }
369847
+ return originalSetItem(key, value);
369848
+ },
369849
+ removeItem: function(key) {
369850
+ if (isDisallowedKey(key)) {
369851
+ console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
369852
+ return;
369853
+ }
369854
+ return originalRemoveItem(key);
369855
+ },
369856
+ clear: function() {
369857
+ console.log('localStorage.clear is disabled');
369858
+ return;
369859
+ }
369860
+ },
369861
+ writable: false,
369862
+ configurable: false
369863
+ });
369864
+ })();
369865
+ </script>
369863
369866
  `;
369864
369867
  const MAX_DEPTH = 5; // Maximum depth for object serialization to prevent infinite recursion
369865
369868
  // Override console methods to send logs to parent window and serialize complex objects
369866
- exports.consoleOverrideScript = `
369867
- <script>
369868
- (function() {
369869
- const SerializedType = {
369870
- Null: "null",
369871
- Undefined: "undefined",
369872
- Boolean: "boolean",
369873
- Number: "number",
369874
- String: "string",
369875
- Array: "array",
369876
- Object: "object",
369877
- };
369878
-
369879
- const original = {};
369880
- const methods = ["log", "error", "warn", "info", "debug", "assert"];
369881
-
369882
- function getTimestamp() {
369883
- const now = new Date();
369884
- const pad = (n) => String(n).padStart(2, '0');
369885
-
369886
- return (
369887
- now.getFullYear() + '-' +
369888
- pad(now.getMonth() + 1) + '-' +
369889
- pad(now.getDate()) + ' ' +
369890
- pad(now.getHours()) + ':' +
369891
- pad(now.getMinutes()) + ':' +
369892
- pad(now.getSeconds()) + '.' +
369893
- pad(Math.floor(now.getMilliseconds() / 10))
369894
- );
369895
- }
369896
-
369897
- function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
369898
- if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
369899
-
369900
- if (arg && typeof arg === "object") {
369901
- if (visited.has(arg)) {
369902
- return { "type": SerializedType.String, "value": "[Circular reference]" };
369903
- }
369904
- visited.add(arg);
369905
- }
369906
-
369907
- const type = typeof arg;
369908
- if (arg === null) return { "type": SerializedType.Null, "value": "null" };
369909
- if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
369910
- if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
369911
- if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
369912
- if (type === "string") return { "type": SerializedType.String, "value": arg };
369913
-
369914
- if (Array.isArray(arg)) {
369915
- return {
369916
- "type": SerializedType.Array,
369917
- "value": arg.map(item => serialize(item, depth + 1, maxDepth))
369918
- };
369919
- }
369920
-
369921
- if (type === "object" && arg !== null) {
369922
- const props = {};
369923
- try {
369924
- for (let key in arg) {
369925
- if (arg.hasOwnProperty(key)) {
369926
- props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
369927
- }
369928
- }
369929
- } catch (error) {
369930
- console.error("Error serializing object property:", error);
369931
- }
369932
- return { "type": SerializedType.Object, "value": props };
369933
- }
369934
-
369935
- return { "type": SerializedType.String, "value": String(arg) };
369936
- }
369937
-
369938
- methods.forEach(m => {
369939
- original[m] = console[m] || function(){};
369940
-
369941
- console[m] = function(...args) {
369942
- const timestamp = getTimestamp();
369943
-
369944
- let level = m;
369945
- let serializedArgs = args.map(arg => serialize(arg));
369946
-
369947
- if (m === "assert") {
369948
- const condition = Boolean(args[0]);
369949
- const messageArgs = args.slice(1);
369950
-
369951
- serializedArgs =
369952
- messageArgs.length > 0
369953
- ? messageArgs.map(arg => serialize(arg))
369954
- : [
369955
- {
369956
- "type": "string",
369957
- "value": condition ? "Assertion passed" : "Assertion failed",
369958
- },
369959
- ];
369960
-
369961
- level = condition ? "log" : "error";
369962
- }
369963
-
369964
- window.parent.postMessage({
369965
- "type": "console",
369966
- "method": level,
369967
- "data": serializedArgs,
369968
- "timestamp": timestamp
369969
- }, "*");
369970
-
369971
- original[m](...args);
369972
- };
369973
- });
369974
-
369975
- window.addEventListener("error", function(event) {
369976
- const timestamp = getTimestamp();
369977
- const error = event.error;
369978
-
369979
- let message;
369980
- if (error && error.name && error.message) {
369981
- message = error.name + ": " + error.message;
369982
- } else if (event.message) {
369983
- message = event.message;
369984
- } else {
369985
- message = "Unknown JavaScript error";
369986
- }
369987
-
369988
- let displayFilename = event.filename;
369989
-
369990
- if (
369991
- typeof displayFilename === "string" &&
369992
- displayFilename.startsWith("blob:")
369993
- ) {
369994
- const sourceMap = window.__blobSourceMap__ || {};
369995
- const mappedFilename = sourceMap[displayFilename];
369996
-
369997
- if (mappedFilename) {
369998
- displayFilename = mappedFilename;
369999
- } else {
370000
- const meta = document.querySelector("meta[filename]");
370001
- displayFilename =
370002
- (meta && meta.getAttribute("filename")) || "preview";
370003
- }
370004
- }
370005
-
370006
- const location =
370007
- displayFilename || event.lineno || event.colno
370008
- ? " at " +
370009
- [displayFilename, event.lineno, event.colno]
370010
- .filter(Boolean)
370011
- .join(":")
370012
- : "";
370013
-
370014
- window.parent.postMessage({
370015
- "type": "console",
370016
- "method": "error",
370017
- "data": [
370018
- { "type": "string", "value": message + location }
370019
- ],
370020
- "timestamp": timestamp
370021
- }, "*");
370022
- });
370023
-
370024
- window.addEventListener("unhandledrejection", function(event) {
370025
- const timestamp = getTimestamp();
370026
- const reason = event.reason;
370027
-
370028
- let message;
370029
- if (reason && reason.name && reason.message) {
370030
- message = reason.name + ": " + reason.message;
370031
- } else if (typeof reason === "string") {
370032
- message = "UnhandledPromiseRejection: " + reason;
370033
- } else {
370034
- message = "UnhandledPromiseRejection: " + String(reason);
370035
- }
370036
-
370037
- window.parent.postMessage({
370038
- "type": "console",
370039
- "method": "error",
370040
- "data": [
370041
- { "type": "string", "value": message }
370042
- ],
370043
- "timestamp": timestamp
370044
- }, "*");
370045
- });
370046
- })();
370047
- </script>
369869
+ exports.consoleOverrideScript = `
369870
+ <script>
369871
+ (function() {
369872
+ const SerializedType = {
369873
+ Null: "null",
369874
+ Undefined: "undefined",
369875
+ Boolean: "boolean",
369876
+ Number: "number",
369877
+ String: "string",
369878
+ Array: "array",
369879
+ Object: "object",
369880
+ };
369881
+
369882
+ const original = {};
369883
+ const methods = ["log", "error", "warn", "info", "debug", "assert"];
369884
+
369885
+ function getTimestamp() {
369886
+ const now = new Date();
369887
+ const pad = (n) => String(n).padStart(2, '0');
369888
+
369889
+ return (
369890
+ now.getFullYear() + '-' +
369891
+ pad(now.getMonth() + 1) + '-' +
369892
+ pad(now.getDate()) + ' ' +
369893
+ pad(now.getHours()) + ':' +
369894
+ pad(now.getMinutes()) + ':' +
369895
+ pad(now.getSeconds()) + '.' +
369896
+ pad(Math.floor(now.getMilliseconds() / 10))
369897
+ );
369898
+ }
369899
+
369900
+ function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
369901
+ if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
369902
+
369903
+ if (arg && typeof arg === "object") {
369904
+ if (visited.has(arg)) {
369905
+ return { "type": SerializedType.String, "value": "[Circular reference]" };
369906
+ }
369907
+ visited.add(arg);
369908
+ }
369909
+
369910
+ const type = typeof arg;
369911
+ if (arg === null) return { "type": SerializedType.Null, "value": "null" };
369912
+ if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
369913
+ if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
369914
+ if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
369915
+ if (type === "string") return { "type": SerializedType.String, "value": arg };
369916
+
369917
+ if (Array.isArray(arg)) {
369918
+ return {
369919
+ "type": SerializedType.Array,
369920
+ "value": arg.map(item => serialize(item, depth + 1, maxDepth))
369921
+ };
369922
+ }
369923
+
369924
+ if (type === "object" && arg !== null) {
369925
+ const props = {};
369926
+ try {
369927
+ for (let key in arg) {
369928
+ if (arg.hasOwnProperty(key)) {
369929
+ props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
369930
+ }
369931
+ }
369932
+ } catch (error) {
369933
+ console.error("Error serializing object property:", error);
369934
+ }
369935
+ return { "type": SerializedType.Object, "value": props };
369936
+ }
369937
+
369938
+ return { "type": SerializedType.String, "value": String(arg) };
369939
+ }
369940
+
369941
+ methods.forEach(m => {
369942
+ original[m] = console[m] || function(){};
369943
+
369944
+ console[m] = function(...args) {
369945
+ const timestamp = getTimestamp();
369946
+
369947
+ let level = m;
369948
+ let serializedArgs = args.map(arg => serialize(arg));
369949
+
369950
+ if (m === "assert") {
369951
+ const condition = Boolean(args[0]);
369952
+ const messageArgs = args.slice(1);
369953
+
369954
+ serializedArgs =
369955
+ messageArgs.length > 0
369956
+ ? messageArgs.map(arg => serialize(arg))
369957
+ : [
369958
+ {
369959
+ "type": "string",
369960
+ "value": condition ? "Assertion passed" : "Assertion failed",
369961
+ },
369962
+ ];
369963
+
369964
+ level = condition ? "log" : "error";
369965
+ }
369966
+
369967
+ window.parent.postMessage({
369968
+ "type": "console",
369969
+ "method": level,
369970
+ "data": serializedArgs,
369971
+ "timestamp": timestamp
369972
+ }, "*");
369973
+
369974
+ original[m](...args);
369975
+ };
369976
+ });
369977
+
369978
+ window.addEventListener("error", function(event) {
369979
+ const timestamp = getTimestamp();
369980
+ const error = event.error;
369981
+
369982
+ let message;
369983
+ if (error && error.name && error.message) {
369984
+ message = error.name + ": " + error.message;
369985
+ } else if (event.message) {
369986
+ message = event.message;
369987
+ } else {
369988
+ message = "Unknown JavaScript error";
369989
+ }
369990
+
369991
+ let displayFilename = event.filename;
369992
+
369993
+ if (
369994
+ typeof displayFilename === "string" &&
369995
+ displayFilename.startsWith("blob:")
369996
+ ) {
369997
+ const sourceMap = window.__blobSourceMap__ || {};
369998
+ const mappedFilename = sourceMap[displayFilename];
369999
+
370000
+ if (mappedFilename) {
370001
+ displayFilename = mappedFilename;
370002
+ } else {
370003
+ const meta = document.querySelector("meta[filename]");
370004
+ displayFilename =
370005
+ (meta && meta.getAttribute("filename")) || "preview";
370006
+ }
370007
+ }
370008
+
370009
+ const location =
370010
+ displayFilename || event.lineno || event.colno
370011
+ ? " at " +
370012
+ [displayFilename, event.lineno, event.colno]
370013
+ .filter(Boolean)
370014
+ .join(":")
370015
+ : "";
370016
+
370017
+ window.parent.postMessage({
370018
+ "type": "console",
370019
+ "method": "error",
370020
+ "data": [
370021
+ { "type": "string", "value": message + location }
370022
+ ],
370023
+ "timestamp": timestamp
370024
+ }, "*");
370025
+ });
370026
+
370027
+ window.addEventListener("unhandledrejection", function(event) {
370028
+ const timestamp = getTimestamp();
370029
+ const reason = event.reason;
370030
+
370031
+ let message;
370032
+ if (reason && reason.name && reason.message) {
370033
+ message = reason.name + ": " + reason.message;
370034
+ } else if (typeof reason === "string") {
370035
+ message = "UnhandledPromiseRejection: " + reason;
370036
+ } else {
370037
+ message = "UnhandledPromiseRejection: " + String(reason);
370038
+ }
370039
+
370040
+ window.parent.postMessage({
370041
+ "type": "console",
370042
+ "method": "error",
370043
+ "data": [
370044
+ { "type": "string", "value": message }
370045
+ ],
370046
+ "timestamp": timestamp
370047
+ }, "*");
370048
+ });
370049
+ })();
370050
+ </script>
370048
370051
  `;
370049
370052
 
370050
370053
 
@@ -371618,12 +371621,15 @@ const SvgIcon_1 = __webpack_require__(82917);
371618
371621
  const arrow_right_svg_1 = __importDefault(__webpack_require__(17297));
371619
371622
  const styles_module_scss_1 = __importDefault(__webpack_require__(51191));
371620
371623
  const ContextMenu_1 = __importDefault(__webpack_require__(39179));
371624
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
371625
+ const useHover_1 = __webpack_require__(78556);
371621
371626
  const Dropdown = (props) => {
371622
371627
  const { ButtonIcon, buttonClassname, menuOptions, menuPosition, ariaLabel } = props;
371623
371628
  const { direction = "bottom", align = "center" } = menuPosition || {};
371624
371629
  const [isOpen, setOpen] = (0, react_1.useState)(false);
371625
371630
  const buttonRef = (0, react_1.useRef)(null);
371626
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", "aria-label": ariaLabel, className: (0, classnames_1.default)(buttonClassname, isOpen && styles_module_scss_1.default.buttonActive), onClick: () => setOpen((prev) => !prev), ref: buttonRef, children: [ButtonIcon && ((0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: ButtonIcon, size: 16, "aria-hidden": "true", focusable: "false" })), (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { className: (0, classnames_1.default)(styles_module_scss_1.default.arrowIcon, isOpen && styles_module_scss_1.default.arrowIconOpen), style: { rotate: `${isOpen ? "-" : ""}90deg` }, SvgElement: arrow_right_svg_1.default, size: 8, "aria-hidden": "true", focusable: "false" })] }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { anchorRef: buttonRef, menuOptions: menuOptions, opened: isOpen, onClose: () => setOpen(false), align: align, direction: direction, gap: 4 })] }));
371631
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
371632
+ return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", "aria-label": ariaLabel, className: (0, classnames_1.default)(buttonClassname, isOpen && styles_module_scss_1.default.buttonActive), onClick: () => setOpen((prev) => !prev), ref: buttonRef, children: [ButtonIcon && ((0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: ButtonIcon, size: 16, "aria-hidden": "true", focusable: "false" })), (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { className: (0, classnames_1.default)(styles_module_scss_1.default.arrowIcon, isOpen && styles_module_scss_1.default.arrowIconOpen), style: { rotate: `${isOpen ? "-" : ""}90deg` }, SvgElement: arrow_right_svg_1.default, size: 8, "aria-hidden": "true", focusable: "false" })] }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Upload files", visible: hovered && !isOpen, position: "fixed", size: "fit" }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { anchorRef: buttonRef, menuOptions: menuOptions, opened: isOpen, onClose: () => setOpen(false), align: align, direction: direction, gap: 4 })] }));
371627
371633
  };
371628
371634
  exports["default"] = Dropdown;
371629
371635
 
@@ -371698,10 +371704,15 @@ const FileTreeContext_1 = __webpack_require__(5323);
371698
371704
  const ProjectTypes_1 = __webpack_require__(27130);
371699
371705
  const Text_1 = __webpack_require__(82803);
371700
371706
  const stores_1 = __webpack_require__(32132);
371707
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
371708
+ const useHover_1 = __webpack_require__(78556);
371701
371709
  const FileTreeActions = ({ hasExpandedNodes, }) => {
371702
371710
  const { expandAll, collapseAll, createComponent, importFiles, importFolder } = (0, react_1.useContext)(FileTreeContext_1.TreeContext);
371703
371711
  const isReadOnly = (0, stores_1.useAppSelector)((state) => state.editor.readOnly);
371704
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fileTreeActions, children: [hasExpandedNodes ? ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Collapse all folders", onClick: collapseAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(minus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Expand all folders", onClick: expandAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(plus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) })), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, weight: "medium", className: styles_module_scss_1.default.fileTreeActionsLabel, children: "Project files" }), !isReadOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add folder", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.DIR), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_folder_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add file", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.FILE), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_file_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles, importFolder: importFolder })] }))] }));
371712
+ const { hovered: toggleHovered, hoverProps: toggleHoverProps } = (0, useHover_1.useHover)();
371713
+ const { hovered: addFolderHovered, hoverProps: addFolderHoverProps } = (0, useHover_1.useHover)();
371714
+ const { hovered: addFileHovered, hoverProps: addFileHoverProps } = (0, useHover_1.useHover)();
371715
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fileTreeActions, children: [hasExpandedNodes ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...toggleHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Collapse all folders", onClick: collapseAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(minus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Collapse all folders", visible: toggleHovered, position: "fixed", size: "fit" })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...toggleHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Expand all folders", onClick: expandAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(plus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Expand all folders", visible: toggleHovered, position: "fixed", size: "fit" })] })), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, weight: "medium", className: styles_module_scss_1.default.fileTreeActionsLabel, children: "Project files" }), !isReadOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...addFolderHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add folder", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.DIR), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_folder_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Add folder", visible: addFolderHovered, position: "fixed", size: "fit" })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...addFileHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add file", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.FILE), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_file_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Add file", visible: addFileHovered, position: "fixed", size: "fit" })] }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles, importFolder: importFolder })] }))] }));
371705
371716
  };
371706
371717
  exports.FileTreeActions = FileTreeActions;
371707
371718
 
@@ -372557,7 +372568,7 @@ const getSidebarOptions = (initials, homeAction, isCodeVisible) => [
372557
372568
  {
372558
372569
  name: "user",
372559
372570
  buttonText: initials,
372560
- title: "User account",
372571
+ title: "Your Profile",
372561
372572
  position: "bottom",
372562
372573
  },
372563
372574
  ]
@@ -372625,21 +372636,31 @@ const Button_1 = __importDefault(__webpack_require__(79428));
372625
372636
  const classnames_1 = __importDefault(__webpack_require__(46942));
372626
372637
  const styles_module_scss_1 = __importDefault(__webpack_require__(21852));
372627
372638
  const UserMenu_1 = __importDefault(__webpack_require__(2957));
372639
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
372640
+ const useHover_1 = __webpack_require__(78556);
372628
372641
  const backgroundColors = [
372629
- 'D7F9F4', '43D6B9',
372630
- '0D9C90', 'E5F8FF',
372631
- 'FEEFEE', 'F37C6F',
372632
- 'FFF3E8', 'F9B88C',
372633
- 'FA7815', 'FCE688'
372642
+ "D7F9F4",
372643
+ "43D6B9",
372644
+ "0D9C90",
372645
+ "E5F8FF",
372646
+ "FEEFEE",
372647
+ "F37C6F",
372648
+ "FFF3E8",
372649
+ "F9B88C",
372650
+ "FA7815",
372651
+ "FCE688",
372634
372652
  ];
372635
372653
  const SidebarBarOption = (props) => {
372636
- const { Icon, isActive, name, title, toggleOption, buttonText, isUser, action } = props;
372654
+ const { Icon, isActive, name, title, toggleOption, buttonText, isUser, action, } = props;
372655
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
372637
372656
  const userId = (0, stores_1.useAppSelector)((state) => state.user.userId);
372638
372657
  const isFacilitator = (0, stores_1.useAppSelector)((state) => state.user.isFacilitator);
372639
372658
  const avatarSrc = (0, stores_1.useAppSelector)((state) => state.user.avatarSrc);
372640
372659
  const avatarStyle = isUser
372641
372660
  ? isFacilitator
372642
- ? { background: 'linear-gradient(90deg,#d7f9f4,#fff9e2,#fff3e8,#e5f8ff,#d7f9f4)' }
372661
+ ? {
372662
+ background: "linear-gradient(90deg,#d7f9f4,#fff9e2,#fff3e8,#e5f8ff,#d7f9f4)",
372663
+ }
372643
372664
  : { backgroundColor: `#${backgroundColors[(userId ?? 0) % 10]}` }
372644
372665
  : null;
372645
372666
  const [isMenuOpen, setIsMenuOpen] = (0, react_1.useState)(false);
@@ -372659,9 +372680,7 @@ const SidebarBarOption = (props) => {
372659
372680
  skipOpenRef.current = true;
372660
372681
  setIsMenuOpen(false);
372661
372682
  };
372662
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!avatarSrc && isUser ? ((0, jsx_runtime_1.jsx)("img", { ref: buttonRef, onClick: onClickHandler, className: (0, classnames_1.default)(styles_module_scss_1.default.option, styles_module_scss_1.default.userOption), src: avatarSrc, alt: "User profile avatar" })) : ((0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: buttonRef, className: (0, classnames_1.default)(styles_module_scss_1.default.option, isActive && styles_module_scss_1.default.selected, isUser && styles_module_scss_1.default.userOption), style: avatarStyle, ButtonIcon: Icon, title: title, buttonText: buttonText, onClickHandler: onClickHandler, ...(isUser && {
372663
- label: `Profile image placeholder displaying the user’s initials`,
372664
- }) })), isUser && ((0, jsx_runtime_1.jsx)(UserMenu_1.default, { anchorRef: buttonRef, opened: isMenuOpen, onClose: handleClose }))] }));
372683
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!avatarSrc && isUser ? ((0, jsx_runtime_1.jsx)("img", { ref: buttonRef, onClick: onClickHandler, className: (0, classnames_1.default)(styles_module_scss_1.default.option, styles_module_scss_1.default.userOption), src: avatarSrc, alt: "User profile avatar" })) : ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, style: { position: "relative" }, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: buttonRef, className: (0, classnames_1.default)(styles_module_scss_1.default.option, isActive && styles_module_scss_1.default.selected, isUser && styles_module_scss_1.default.userOption), style: avatarStyle, ButtonIcon: Icon, buttonText: buttonText, onClickHandler: onClickHandler, label: isUser ? `Profile image placeholder displaying the user’s initials` : title }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: title ?? "", visible: hovered && !!title, position: "bottom-right", size: "fit" })] })), isUser && ((0, jsx_runtime_1.jsx)(UserMenu_1.default, { anchorRef: buttonRef, opened: isMenuOpen, onClose: handleClose }))] }));
372665
372684
  };
372666
372685
  exports["default"] = SidebarBarOption;
372667
372686
 
@@ -373004,8 +373023,11 @@ const remix_svg_1 = __importDefault(__webpack_require__(97950));
373004
373023
  const stores_1 = __webpack_require__(32132);
373005
373024
  const types_2 = __webpack_require__(92932);
373006
373025
  const SpinnerDotted_1 = __webpack_require__(79458);
373026
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
373027
+ const useHover_1 = __webpack_require__(78556);
373007
373028
  const SharedProjectBar = () => {
373008
373029
  const dispatch = (0, react_redux_1.useDispatch)();
373030
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
373009
373031
  const isCodeVisible = (0, stores_1.useAppSelector)((state) => state.editor.isCodeVisible);
373010
373032
  const saving = (0, stores_1.useAppSelector)((state) => state.editor.saving);
373011
373033
  const userId = (0, stores_1.useAppSelector)((state) => state.user.userId);
@@ -373033,7 +373055,7 @@ const SharedProjectBar = () => {
373033
373055
  },
373034
373056
  }));
373035
373057
  };
373036
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.header, styles_module_scss_1.default.sharedProject), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(gwc_logo_svg_1.default, { className: styles_module_scss_1.default.gwcLogo }), (0, jsx_runtime_1.jsx)(text_jam_logo_svg_1.default, { className: styles_module_scss_1.default.textJamLogo })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, styles_module_scss_1.default.projectName), children: (0, jsx_runtime_1.jsx)(SharedProjectName_1.default, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [isCodeVisible && userId && ((0, jsx_runtime_1.jsx)(Button_1.default, { ButtonIcon: remixButtonIcon, buttonText: remixButtonText, className: styles_module_scss_1.default.headerBtn, variant: "secondary", onClickHandler: handleOpenRemixModal, disabled: isSaving })), (0, jsx_runtime_1.jsx)(RunBar_1.default, {})] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.wrapper, children: (0, jsx_runtime_1.jsx)(Button_1.default, { className: (0, classnames_1.default)(styles_module_scss_1.default.linkButton, styles_module_scss_1.default.btnSvg), variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: link_svg_1.default, size: 24 }), onClickHandler: handleOpenShareModal }) })] }));
373058
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.header, styles_module_scss_1.default.sharedProject), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(gwc_logo_svg_1.default, { className: styles_module_scss_1.default.gwcLogo }), (0, jsx_runtime_1.jsx)(text_jam_logo_svg_1.default, { className: styles_module_scss_1.default.textJamLogo })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, styles_module_scss_1.default.projectName), children: (0, jsx_runtime_1.jsx)(SharedProjectName_1.default, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [isCodeVisible && userId && ((0, jsx_runtime_1.jsx)(Button_1.default, { ButtonIcon: remixButtonIcon, buttonText: remixButtonText, className: styles_module_scss_1.default.headerBtn, variant: "secondary", onClickHandler: handleOpenRemixModal, disabled: isSaving })), (0, jsx_runtime_1.jsx)(RunBar_1.default, {})] }), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, styles_module_scss_1.default.tooltipAnchor), ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { className: (0, classnames_1.default)(styles_module_scss_1.default.linkButton, styles_module_scss_1.default.btnSvg), variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: link_svg_1.default, size: 24 }), onClickHandler: handleOpenShareModal }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Share this project", visible: hovered, position: "bottom", size: "fit" })] })] }));
373037
373059
  };
373038
373060
  exports.SharedProjectBar = SharedProjectBar;
373039
373061
 
@@ -373102,7 +373124,7 @@ const ShareButton = (props) => {
373102
373124
  }, [dispatch, shareLinks]);
373103
373125
  const canShare = Boolean(shareLinks);
373104
373126
  const { hovered, hoverProps } = (0, useHover_1.useHover)();
373105
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.shareButtonWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "To share your project, please save it first.", visible: hovered && !canShare, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: !canShare, variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: share_svg_1.default, size: 24 }), onClickHandler: onClickShare, ...props })] }));
373127
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.shareButtonWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "To share your project, please save it first.", visible: hovered && !canShare, position: "bottom", size: "fit" }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Share this project", visible: hovered && canShare, position: "bottom", size: "fit" }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: !canShare, variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: share_svg_1.default, size: 24 }), onClickHandler: onClickShare, ...props })] }));
373106
373128
  };
373107
373129
  exports["default"] = ShareButton;
373108
373130
 
@@ -373245,10 +373267,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
373245
373267
  const jsx_runtime_1 = __webpack_require__(74848);
373246
373268
  const classnames_1 = __importDefault(__webpack_require__(46942));
373247
373269
  const styles_module_scss_1 = __importDefault(__webpack_require__(28188));
373248
- const Tooltip = ({ message, visible = false, position = "bottom", className, style, }) => {
373270
+ const Tooltip = ({ message, visible = false, position = "bottom", size = "default", className, style, }) => {
373249
373271
  if (!visible)
373250
373272
  return null;
373251
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tooltip, position && styles_module_scss_1.default[`position-${position}`], visible && styles_module_scss_1.default.visible, className), role: "tooltip", style: style, children: message }));
373273
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tooltip, position && styles_module_scss_1.default[`position-${position}`], styles_module_scss_1.default[`size-${size}`], visible && styles_module_scss_1.default.visible, className), role: "tooltip", style: style, children: message }));
373252
373274
  };
373253
373275
  exports["default"] = Tooltip;
373254
373276
 
@@ -373289,7 +373311,7 @@ const WebComponentProject = ({ nameEditable = false, sidebarOptions = [], packag
373289
373311
  return () => clearTimeout(timeout);
373290
373312
  }, [project]);
373291
373313
  renderer.link = function (data) {
373292
- return `<a href="${data.href}" target="_blank" rel="noreferrer"
373314
+ return `<a href="${data.href}" target="_blank" rel="noreferrer"
373293
373315
  }">${data.text}</a>`;
373294
373316
  };
373295
373317
  marked_1.marked.setOptions({
@@ -373520,10 +373542,10 @@ const WebComponentLoader = (props) => {
373520
373542
  (0, react_1.useEffect)(() => {
373521
373543
  // Create a script element to save the existing Prism object if there is one
373522
373544
  const script = document.createElement("script");
373523
- script.textContent = `
373524
- if (window.Prism) {
373525
- window.syntaxHighlight = window.Prism;
373526
- }
373545
+ script.textContent = `
373546
+ if (window.Prism) {
373547
+ window.syntaxHighlight = window.Prism;
373548
+ }
373527
373549
  `;
373528
373550
  // Append the script to the document body
373529
373551
  document.body.appendChild(script);
@@ -384575,7 +384597,7 @@ module.exports = webpackAsyncContext;
384575
384597
  /***/ 24427:
384576
384598
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
384577
384599
 
384578
- module.exports = __webpack_require__.p + "assets/PyodideWorkerb1409749c37aedc47dc8.js";
384600
+ module.exports = __webpack_require__.p + "assets/PyodideWorker5d8b7bf9f06568fe4573.js";
384579
384601
 
384580
384602
  /***/ }),
384581
384603