gwchq-textjam 0.2.33 → 0.2.35

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()), {
@@ -103460,7 +103460,6 @@ var jsx_runtime = __webpack_require__(74848);
103460
103460
 
103461
103461
 
103462
103462
  var NO_CHANGES_TO_SAVE_MESSAGE = "No new changes to save!";
103463
- var DEFAULT_TOOLTIP = "Save project";
103464
103463
  var SaveButton = props => {
103465
103464
  var dispatch = (0,external_react_redux_.useDispatch)();
103466
103465
  var {
@@ -103490,8 +103489,8 @@ var SaveButton = props => {
103490
103489
  className: styles_module.wrapper
103491
103490
  }, hoverProps), {}, {
103492
103491
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)((Tooltip_default()), {
103493
- message: DEFAULT_TOOLTIP + (hasChangesToSave ? "" : "\n" + NO_CHANGES_TO_SAVE_MESSAGE),
103494
- visible: hovered,
103492
+ message: NO_CHANGES_TO_SAVE_MESSAGE,
103493
+ visible: hovered && !hasChangesToSave,
103495
103494
  position: "bottom"
103496
103495
  }), /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], (0,objectSpread2/* default */.A)({
103497
103496
  buttonText: buttonText,
@@ -116720,115 +116719,6 @@ function escapeName(str, charsToEscape) {
116720
116719
 
116721
116720
 
116722
116721
 
116723
- /***/ }),
116724
-
116725
- /***/ 16450:
116726
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
116727
-
116728
-
116729
-
116730
- var isValue = __webpack_require__(48175)
116731
- , ensureValue = __webpack_require__(34809)
116732
- , ensurePlainFunction = __webpack_require__(90251)
116733
- , copy = __webpack_require__(30203)
116734
- , normalizeOptions = __webpack_require__(90148)
116735
- , map = __webpack_require__(30498);
116736
-
116737
- var bind = Function.prototype.bind
116738
- , defineProperty = Object.defineProperty
116739
- , hasOwnProperty = Object.prototype.hasOwnProperty
116740
- , define;
116741
-
116742
- define = function (name, desc, options) {
116743
- var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
116744
- dgs = copy(desc);
116745
- delete dgs.writable;
116746
- delete dgs.value;
116747
- dgs.get = function () {
116748
- if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
116749
- desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
116750
- defineProperty(this, name, desc);
116751
- return this[name];
116752
- };
116753
- return dgs;
116754
- };
116755
-
116756
- module.exports = function (props/*, options*/) {
116757
- var options = normalizeOptions(arguments[1]);
116758
- if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
116759
- return map(props, function (desc, name) { return define(name, desc, options); });
116760
- };
116761
-
116762
-
116763
- /***/ }),
116764
-
116765
- /***/ 58263:
116766
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
116767
-
116768
-
116769
-
116770
- var isValue = __webpack_require__(48175)
116771
- , isPlainFunction = __webpack_require__(6873)
116772
- , assign = __webpack_require__(16596)
116773
- , normalizeOpts = __webpack_require__(90148)
116774
- , contains = __webpack_require__(70214);
116775
-
116776
- var d = (module.exports = function (dscr, value/*, options*/) {
116777
- var c, e, w, options, desc;
116778
- if (arguments.length < 2 || typeof dscr !== "string") {
116779
- options = value;
116780
- value = dscr;
116781
- dscr = null;
116782
- } else {
116783
- options = arguments[2];
116784
- }
116785
- if (isValue(dscr)) {
116786
- c = contains.call(dscr, "c");
116787
- e = contains.call(dscr, "e");
116788
- w = contains.call(dscr, "w");
116789
- } else {
116790
- c = w = true;
116791
- e = false;
116792
- }
116793
-
116794
- desc = { value: value, configurable: c, enumerable: e, writable: w };
116795
- return !options ? desc : assign(normalizeOpts(options), desc);
116796
- });
116797
-
116798
- d.gs = function (dscr, get, set/*, options*/) {
116799
- var c, e, options, desc;
116800
- if (typeof dscr !== "string") {
116801
- options = set;
116802
- set = get;
116803
- get = dscr;
116804
- dscr = null;
116805
- } else {
116806
- options = arguments[3];
116807
- }
116808
- if (!isValue(get)) {
116809
- get = undefined;
116810
- } else if (!isPlainFunction(get)) {
116811
- options = get;
116812
- get = set = undefined;
116813
- } else if (!isValue(set)) {
116814
- set = undefined;
116815
- } else if (!isPlainFunction(set)) {
116816
- options = set;
116817
- set = undefined;
116818
- }
116819
- if (isValue(dscr)) {
116820
- c = contains.call(dscr, "c");
116821
- e = contains.call(dscr, "e");
116822
- } else {
116823
- c = true;
116824
- e = false;
116825
- }
116826
-
116827
- desc = { get: get, set: set, configurable: c, enumerable: e };
116828
- return !options ? desc : assign(normalizeOpts(options), desc);
116829
- };
116830
-
116831
-
116832
116722
  /***/ }),
116833
116723
 
116834
116724
  /***/ 83999:
@@ -131657,6 +131547,115 @@ year.every = function(k) {
131657
131547
  var years = year.range;
131658
131548
 
131659
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
+
131660
131659
  /***/ }),
131661
131660
 
131662
131661
  /***/ 30041:
@@ -143026,7 +143025,7 @@ __webpack_require__.r(__webpack_exports__);
143026
143025
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
143027
143026
  /* harmony export */ });
143028
143027
  // extracted by mini-css-extract-plugin
143029
- /* 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"});
143030
143029
 
143031
143030
  /***/ }),
143032
143031
 
@@ -143109,7 +143108,7 @@ __webpack_require__.r(__webpack_exports__);
143109
143108
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
143110
143109
  /* harmony export */ });
143111
143110
  // extracted by mini-css-extract-plugin
143112
- /* 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"});
143113
143112
 
143114
143113
  /***/ }),
143115
143114
 
@@ -148248,6 +148247,324 @@ function hsl2rgb(hsl) {
148248
148247
  }
148249
148248
 
148250
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
+
148251
148568
  /***/ }),
148252
148569
 
148253
148570
  /***/ 2595:
@@ -150221,324 +150538,6 @@ module.exports = {
150221
150538
  };
150222
150539
 
150223
150540
 
150224
- /***/ }),
150225
-
150226
- /***/ 9793:
150227
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150228
-
150229
-
150230
-
150231
- var annAttrs = __webpack_require__(84676);
150232
- var overrideAll = (__webpack_require__(70756).overrideAll);
150233
- var templatedArray = (__webpack_require__(79338).templatedArray);
150234
-
150235
- module.exports = overrideAll(templatedArray('annotation', {
150236
- visible: annAttrs.visible,
150237
- x: {
150238
- valType: 'any',
150239
- description: [
150240
- 'Sets the annotation\'s x position.'
150241
- ].join(' ')
150242
- },
150243
- y: {
150244
- valType: 'any',
150245
- description: [
150246
- 'Sets the annotation\'s y position.'
150247
- ].join(' ')
150248
- },
150249
- z: {
150250
- valType: 'any',
150251
- description: [
150252
- 'Sets the annotation\'s z position.'
150253
- ].join(' ')
150254
- },
150255
- ax: {
150256
- valType: 'number',
150257
- description: [
150258
- 'Sets the x component of the arrow tail about the arrow head (in pixels).'
150259
- ].join(' ')
150260
- },
150261
- ay: {
150262
- valType: 'number',
150263
- description: [
150264
- 'Sets the y component of the arrow tail about the arrow head (in pixels).'
150265
- ].join(' ')
150266
- },
150267
-
150268
- xanchor: annAttrs.xanchor,
150269
- xshift: annAttrs.xshift,
150270
- yanchor: annAttrs.yanchor,
150271
- yshift: annAttrs.yshift,
150272
-
150273
- text: annAttrs.text,
150274
- textangle: annAttrs.textangle,
150275
- font: annAttrs.font,
150276
- width: annAttrs.width,
150277
- height: annAttrs.height,
150278
- opacity: annAttrs.opacity,
150279
- align: annAttrs.align,
150280
- valign: annAttrs.valign,
150281
- bgcolor: annAttrs.bgcolor,
150282
- bordercolor: annAttrs.bordercolor,
150283
- borderpad: annAttrs.borderpad,
150284
- borderwidth: annAttrs.borderwidth,
150285
- showarrow: annAttrs.showarrow,
150286
- arrowcolor: annAttrs.arrowcolor,
150287
- arrowhead: annAttrs.arrowhead,
150288
- startarrowhead: annAttrs.startarrowhead,
150289
- arrowside: annAttrs.arrowside,
150290
- arrowsize: annAttrs.arrowsize,
150291
- startarrowsize: annAttrs.startarrowsize,
150292
- arrowwidth: annAttrs.arrowwidth,
150293
- standoff: annAttrs.standoff,
150294
- startstandoff: annAttrs.startstandoff,
150295
- hovertext: annAttrs.hovertext,
150296
- hoverlabel: annAttrs.hoverlabel,
150297
- captureevents: annAttrs.captureevents,
150298
-
150299
- // maybes later?
150300
- // clicktoshow: annAttrs.clicktoshow,
150301
- // xclick: annAttrs.xclick,
150302
- // yclick: annAttrs.yclick,
150303
-
150304
- // not needed!
150305
- // axref: 'pixel'
150306
- // ayref: 'pixel'
150307
- // xref: 'x'
150308
- // yref: 'y
150309
- // zref: 'z'
150310
- }), 'calc', 'from-root');
150311
-
150312
-
150313
- /***/ }),
150314
-
150315
- /***/ 58121:
150316
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150317
-
150318
-
150319
-
150320
- var Lib = __webpack_require__(30991);
150321
- var Axes = __webpack_require__(15076);
150322
-
150323
- module.exports = function convert(scene) {
150324
- var fullSceneLayout = scene.fullSceneLayout;
150325
- var anns = fullSceneLayout.annotations;
150326
-
150327
- for(var i = 0; i < anns.length; i++) {
150328
- mockAnnAxes(anns[i], scene);
150329
- }
150330
-
150331
- scene.fullLayout._infolayer
150332
- .selectAll('.annotation-' + scene.id)
150333
- .remove();
150334
- };
150335
-
150336
- function mockAnnAxes(ann, scene) {
150337
- var fullSceneLayout = scene.fullSceneLayout;
150338
- var domain = fullSceneLayout.domain;
150339
- var size = scene.fullLayout._size;
150340
-
150341
- var base = {
150342
- // this gets fill in on render
150343
- pdata: null,
150344
-
150345
- // to get setConvert to not execute cleanly
150346
- type: 'linear',
150347
-
150348
- // don't try to update them on `editable: true`
150349
- autorange: false,
150350
-
150351
- // set infinite range so that annotation draw routine
150352
- // does not try to remove 'outside-range' annotations,
150353
- // this case is handled in the render loop
150354
- range: [-Infinity, Infinity]
150355
- };
150356
-
150357
- ann._xa = {};
150358
- Lib.extendFlat(ann._xa, base);
150359
- Axes.setConvert(ann._xa);
150360
- ann._xa._offset = size.l + domain.x[0] * size.w;
150361
- ann._xa.l2p = function() {
150362
- return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
150363
- };
150364
-
150365
- ann._ya = {};
150366
- Lib.extendFlat(ann._ya, base);
150367
- Axes.setConvert(ann._ya);
150368
- ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
150369
- ann._ya.l2p = function() {
150370
- return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
150371
- };
150372
- }
150373
-
150374
-
150375
- /***/ }),
150376
-
150377
- /***/ 41926:
150378
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150379
-
150380
-
150381
-
150382
- var Lib = __webpack_require__(30991);
150383
- var Axes = __webpack_require__(15076);
150384
- var handleArrayContainerDefaults = __webpack_require__(21238);
150385
- var handleAnnotationCommonDefaults = __webpack_require__(84081);
150386
- var attributes = __webpack_require__(9793);
150387
-
150388
- module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
150389
- handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
150390
- name: 'annotations',
150391
- handleItemDefaults: handleAnnotationDefaults,
150392
- fullLayout: opts.fullLayout
150393
- });
150394
- };
150395
-
150396
- function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
150397
- function coerce(attr, dflt) {
150398
- return Lib.coerce(annIn, annOut, attributes, attr, dflt);
150399
- }
150400
-
150401
- function coercePosition(axLetter) {
150402
- var axName = axLetter + 'axis';
150403
-
150404
- // mock in such way that getFromId grabs correct 3D axis
150405
- var gdMock = { _fullLayout: {} };
150406
- gdMock._fullLayout[axName] = sceneLayout[axName];
150407
-
150408
- return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
150409
- }
150410
-
150411
-
150412
- var visible = coerce('visible');
150413
- if(!visible) return;
150414
-
150415
- handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
150416
-
150417
- coercePosition('x');
150418
- coercePosition('y');
150419
- coercePosition('z');
150420
-
150421
- // if you have one coordinate you should all three
150422
- Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
150423
-
150424
- // hard-set here for completeness
150425
- annOut.xref = 'x';
150426
- annOut.yref = 'y';
150427
- annOut.zref = 'z';
150428
-
150429
- coerce('xanchor');
150430
- coerce('yanchor');
150431
- coerce('xshift');
150432
- coerce('yshift');
150433
-
150434
- if(annOut.showarrow) {
150435
- annOut.axref = 'pixel';
150436
- annOut.ayref = 'pixel';
150437
-
150438
- // TODO maybe default values should be bigger than the 2D case?
150439
- coerce('ax', -10);
150440
- coerce('ay', -30);
150441
-
150442
- // if you have one part of arrow length you should have both
150443
- Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
150444
- }
150445
- }
150446
-
150447
-
150448
- /***/ }),
150449
-
150450
- /***/ 13802:
150451
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150452
-
150453
-
150454
-
150455
- var drawRaw = (__webpack_require__(47995).drawRaw);
150456
- var project = __webpack_require__(51344);
150457
- var axLetters = ['x', 'y', 'z'];
150458
-
150459
- module.exports = function draw(scene) {
150460
- var fullSceneLayout = scene.fullSceneLayout;
150461
- var dataScale = scene.dataScale;
150462
- var anns = fullSceneLayout.annotations;
150463
-
150464
- for(var i = 0; i < anns.length; i++) {
150465
- var ann = anns[i];
150466
- var annotationIsOffscreen = false;
150467
-
150468
- for(var j = 0; j < 3; j++) {
150469
- var axLetter = axLetters[j];
150470
- var pos = ann[axLetter];
150471
- var ax = fullSceneLayout[axLetter + 'axis'];
150472
- var posFraction = ax.r2fraction(pos);
150473
-
150474
- if(posFraction < 0 || posFraction > 1) {
150475
- annotationIsOffscreen = true;
150476
- break;
150477
- }
150478
- }
150479
-
150480
- if(annotationIsOffscreen) {
150481
- scene.fullLayout._infolayer
150482
- .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
150483
- .remove();
150484
- } else {
150485
- ann._pdata = project(scene.glplot.cameraParams, [
150486
- fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
150487
- fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
150488
- fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
150489
- ]);
150490
-
150491
- drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
150492
- }
150493
- }
150494
- };
150495
-
150496
-
150497
- /***/ }),
150498
-
150499
- /***/ 86578:
150500
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
150501
-
150502
-
150503
-
150504
- var Registry = __webpack_require__(13936);
150505
- var Lib = __webpack_require__(30991);
150506
-
150507
- module.exports = {
150508
- moduleType: 'component',
150509
- name: 'annotations3d',
150510
-
150511
- schema: {
150512
- subplots: {
150513
- scene: {annotations: __webpack_require__(9793)}
150514
- }
150515
- },
150516
-
150517
- layoutAttributes: __webpack_require__(9793),
150518
- handleDefaults: __webpack_require__(41926),
150519
- includeBasePlot: includeGL3D,
150520
-
150521
- convert: __webpack_require__(58121),
150522
- draw: __webpack_require__(13802)
150523
- };
150524
-
150525
- function includeGL3D(layoutIn, layoutOut) {
150526
- var GL3D = Registry.subplotsRegistry.gl3d;
150527
- if(!GL3D) return;
150528
-
150529
- var attrRegex = GL3D.attrRegex;
150530
-
150531
- var keys = Object.keys(layoutIn);
150532
- for(var i = 0; i < keys.length; i++) {
150533
- var k = keys[i];
150534
- if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
150535
- Lib.pushUnique(layoutOut._basePlotModules, GL3D);
150536
- Lib.pushUnique(layoutOut._subplots.gl3d, k);
150537
- }
150538
- }
150539
- }
150540
-
150541
-
150542
150541
  /***/ }),
150543
150542
 
150544
150543
  /***/ 27639:
@@ -248771,6 +248770,595 @@ function isValidZ(z) {
248771
248770
  }
248772
248771
 
248773
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
+
248774
249362
  /***/ }),
248775
249363
 
248776
249364
  /***/ 71250:
@@ -250479,595 +251067,6 @@ module.exports = {
250479
251067
  };
250480
251068
 
250481
251069
 
250482
- /***/ }),
250483
-
250484
- /***/ 42124:
250485
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250486
-
250487
-
250488
-
250489
- var histogramAttrs = __webpack_require__(71250);
250490
- var makeBinAttrs = __webpack_require__(9284);
250491
- var heatmapAttrs = __webpack_require__(68300);
250492
- var baseAttrs = __webpack_require__(35667);
250493
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
250494
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
250495
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
250496
- var colorScaleAttrs = __webpack_require__(17957);
250497
-
250498
- var extendFlat = (__webpack_require__(91307).extendFlat);
250499
-
250500
- module.exports = extendFlat(
250501
- {
250502
- x: histogramAttrs.x,
250503
- y: histogramAttrs.y,
250504
-
250505
- z: {
250506
- valType: 'data_array',
250507
- editType: 'calc',
250508
- description: 'Sets the aggregation data.'
250509
- },
250510
- marker: {
250511
- color: {
250512
- valType: 'data_array',
250513
- editType: 'calc',
250514
- description: 'Sets the aggregation data.'
250515
- },
250516
- editType: 'calc'
250517
- },
250518
-
250519
- histnorm: histogramAttrs.histnorm,
250520
- histfunc: histogramAttrs.histfunc,
250521
- nbinsx: histogramAttrs.nbinsx,
250522
- xbins: makeBinAttrs('x'),
250523
- nbinsy: histogramAttrs.nbinsy,
250524
- ybins: makeBinAttrs('y'),
250525
- autobinx: histogramAttrs.autobinx,
250526
- autobiny: histogramAttrs.autobiny,
250527
-
250528
- bingroup: extendFlat({}, histogramAttrs.bingroup, {
250529
- description: [
250530
- 'Set the `xbingroup` and `ybingroup` default prefix',
250531
- 'For example, setting a `bingroup` of *1* on two histogram2d traces',
250532
- 'will make them their x-bins and y-bins match separately.'
250533
- ].join(' ')
250534
- }),
250535
- xbingroup: extendFlat({}, histogramAttrs.bingroup, {
250536
- description: [
250537
- 'Set a group of histogram traces which will have compatible x-bin settings.',
250538
- 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
250539
- '(on axes of the same axis type) can have compatible x-bin settings.',
250540
- 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
250541
- ].join(' ')
250542
- }),
250543
- ybingroup: extendFlat({}, histogramAttrs.bingroup, {
250544
- description: [
250545
- 'Set a group of histogram traces which will have compatible y-bin settings.',
250546
- 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
250547
- '(on axes of the same axis type) can have compatible y-bin settings.',
250548
- 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
250549
- ].join(' ')
250550
- }),
250551
-
250552
- xgap: heatmapAttrs.xgap,
250553
- ygap: heatmapAttrs.ygap,
250554
- zsmooth: heatmapAttrs.zsmooth,
250555
- xhoverformat: axisHoverFormat('x'),
250556
- yhoverformat: axisHoverFormat('y'),
250557
- zhoverformat: axisHoverFormat('z', 1),
250558
- hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
250559
- texttemplate: texttemplateAttrs({
250560
- arrayOk: false,
250561
- editType: 'plot'
250562
- }, {
250563
- keys: 'z'
250564
- }),
250565
- textfont: heatmapAttrs.textfont,
250566
- showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
250567
- },
250568
- colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
250569
- );
250570
-
250571
-
250572
- /***/ }),
250573
-
250574
- /***/ 32492:
250575
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250576
-
250577
-
250578
-
250579
- var Lib = __webpack_require__(30991);
250580
- var Axes = __webpack_require__(15076);
250581
-
250582
- var binFunctions = __webpack_require__(47260);
250583
- var normFunctions = __webpack_require__(855);
250584
- var doAvg = __webpack_require__(26756);
250585
- var getBinSpanLabelRound = __webpack_require__(41574);
250586
- var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
250587
-
250588
- module.exports = function calc(gd, trace) {
250589
- var xa = Axes.getFromId(gd, trace.xaxis);
250590
- var ya = Axes.getFromId(gd, trace.yaxis);
250591
-
250592
- var xcalendar = trace.xcalendar;
250593
- var ycalendar = trace.ycalendar;
250594
- var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
250595
- var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
250596
- var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
250597
- var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
250598
-
250599
- var i, j, n, m;
250600
-
250601
- // calculate the bins
250602
- var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
250603
- var xBinSpec = xBinsAndPos[0];
250604
- var xPos0 = xBinsAndPos[1];
250605
- var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
250606
- var yBinSpec = yBinsAndPos[0];
250607
- var yPos0 = yBinsAndPos[1];
250608
-
250609
- var serieslen = trace._length;
250610
- if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
250611
- if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
250612
-
250613
- // make the empty bin array & scale the map
250614
- var z = [];
250615
- var onecol = [];
250616
- var zerocol = [];
250617
- var nonuniformBinsX = typeof xBinSpec.size === 'string';
250618
- var nonuniformBinsY = typeof yBinSpec.size === 'string';
250619
- var xEdges = [];
250620
- var yEdges = [];
250621
- var xbins = nonuniformBinsX ? xEdges : xBinSpec;
250622
- var ybins = nonuniformBinsY ? yEdges : yBinSpec;
250623
- var total = 0;
250624
- var counts = [];
250625
- var inputPoints = [];
250626
- var norm = trace.histnorm;
250627
- var func = trace.histfunc;
250628
- var densitynorm = norm.indexOf('density') !== -1;
250629
- var extremefunc = func === 'max' || func === 'min';
250630
- var sizeinit = extremefunc ? null : 0;
250631
- var binfunc = binFunctions.count;
250632
- var normfunc = normFunctions[norm];
250633
- var doavg = false;
250634
- var xinc = [];
250635
- var yinc = [];
250636
-
250637
- // set a binning function other than count?
250638
- // for binning functions: check first for 'z',
250639
- // then 'mc' in case we had a colored scatter plot
250640
- // and want to transfer these colors to the 2D histo
250641
- // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
250642
- var rawCounterData = ('z' in trace) ?
250643
- trace.z :
250644
- (('marker' in trace && Array.isArray(trace.marker.color)) ?
250645
- trace.marker.color : '');
250646
- if(rawCounterData && func !== 'count') {
250647
- doavg = func === 'avg';
250648
- binfunc = binFunctions[func];
250649
- }
250650
-
250651
- // decrease end a little in case of rounding errors
250652
- var xBinSize = xBinSpec.size;
250653
- var xBinStart = xr2c(xBinSpec.start);
250654
- var xBinEnd = xr2c(xBinSpec.end) +
250655
- (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
250656
-
250657
- for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
250658
- onecol.push(sizeinit);
250659
- xEdges.push(i);
250660
- if(doavg) zerocol.push(0);
250661
- }
250662
- xEdges.push(i);
250663
-
250664
- var nx = onecol.length;
250665
- var dx = (i - xBinStart) / nx;
250666
- var x0 = xc2r(xBinStart + dx / 2);
250667
-
250668
- var yBinSize = yBinSpec.size;
250669
- var yBinStart = yr2c(yBinSpec.start);
250670
- var yBinEnd = yr2c(yBinSpec.end) +
250671
- (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
250672
-
250673
- for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
250674
- z.push(onecol.slice());
250675
- yEdges.push(i);
250676
- var ipCol = new Array(nx);
250677
- for(j = 0; j < nx; j++) ipCol[j] = [];
250678
- inputPoints.push(ipCol);
250679
- if(doavg) counts.push(zerocol.slice());
250680
- }
250681
- yEdges.push(i);
250682
-
250683
- var ny = z.length;
250684
- var dy = (i - yBinStart) / ny;
250685
- var y0 = yc2r(yBinStart + dy / 2);
250686
-
250687
- if(densitynorm) {
250688
- xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
250689
- yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
250690
- }
250691
-
250692
- // for date axes we need bin bounds to be calcdata. For nonuniform bins
250693
- // we already have this, but uniform with start/end/size they're still strings.
250694
- if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
250695
- if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
250696
-
250697
- // put data into bins
250698
- var uniqueValsPerX = true;
250699
- var uniqueValsPerY = true;
250700
- var xVals = new Array(nx);
250701
- var yVals = new Array(ny);
250702
- var xGapLow = Infinity;
250703
- var xGapHigh = Infinity;
250704
- var yGapLow = Infinity;
250705
- var yGapHigh = Infinity;
250706
- for(i = 0; i < serieslen; i++) {
250707
- var xi = xPos0[i];
250708
- var yi = yPos0[i];
250709
- n = Lib.findBin(xi, xbins);
250710
- m = Lib.findBin(yi, ybins);
250711
- if(n >= 0 && n < nx && m >= 0 && m < ny) {
250712
- total += binfunc(n, i, z[m], rawCounterData, counts[m]);
250713
- inputPoints[m][n].push(i);
250714
-
250715
- if(uniqueValsPerX) {
250716
- if(xVals[n] === undefined) xVals[n] = xi;
250717
- else if(xVals[n] !== xi) uniqueValsPerX = false;
250718
- }
250719
- if(uniqueValsPerY) {
250720
- if(yVals[m] === undefined) yVals[m] = yi;
250721
- else if(yVals[m] !== yi) uniqueValsPerY = false;
250722
- }
250723
-
250724
- xGapLow = Math.min(xGapLow, xi - xEdges[n]);
250725
- xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
250726
- yGapLow = Math.min(yGapLow, yi - yEdges[m]);
250727
- yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
250728
- }
250729
- }
250730
- // normalize, if needed
250731
- if(doavg) {
250732
- for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
250733
- }
250734
- if(normfunc) {
250735
- for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
250736
- }
250737
-
250738
- return {
250739
- x: xPos0,
250740
- xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
250741
- x0: x0,
250742
- dx: dx,
250743
- y: yPos0,
250744
- yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
250745
- y0: y0,
250746
- dy: dy,
250747
- z: z,
250748
- pts: inputPoints
250749
- };
250750
- };
250751
-
250752
- function makeIncrements(len, bins, dv, nonuniform) {
250753
- var out = new Array(len);
250754
- var i;
250755
- if(nonuniform) {
250756
- for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
250757
- } else {
250758
- var inc = 1 / dv;
250759
- for(i = 0; i < len; i++) out[i] = inc;
250760
- }
250761
- return out;
250762
- }
250763
-
250764
- function binsToCalc(r2c, bins) {
250765
- return {
250766
- start: r2c(bins.start),
250767
- end: r2c(bins.end),
250768
- size: bins.size
250769
- };
250770
- }
250771
-
250772
- function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
250773
- var i;
250774
- var len = edges.length - 1;
250775
- var out = new Array(len);
250776
- var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
250777
-
250778
- for(i = 0; i < len; i++) {
250779
- var v = (uniqueVals || [])[i];
250780
- out[i] = v === undefined ?
250781
- [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
250782
- [v, v];
250783
- }
250784
- return out;
250785
- }
250786
-
250787
-
250788
- /***/ }),
250789
-
250790
- /***/ 15611:
250791
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250792
-
250793
-
250794
-
250795
- var Lib = __webpack_require__(30991);
250796
-
250797
- var handleSampleDefaults = __webpack_require__(6236);
250798
- var handleStyleDefaults = __webpack_require__(25157);
250799
- var colorscaleDefaults = __webpack_require__(13682);
250800
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
250801
- var attributes = __webpack_require__(42124);
250802
-
250803
-
250804
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
250805
- function coerce(attr, dflt) {
250806
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
250807
- }
250808
-
250809
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
250810
- if(traceOut.visible === false) return;
250811
-
250812
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
250813
- colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
250814
- coerce('hovertemplate');
250815
-
250816
- handleHeatmapLabelDefaults(coerce, layout);
250817
-
250818
- coerce('xhoverformat');
250819
- coerce('yhoverformat');
250820
- };
250821
-
250822
-
250823
- /***/ }),
250824
-
250825
- /***/ 94587:
250826
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250827
-
250828
-
250829
-
250830
- var heatmapHover = __webpack_require__(85243);
250831
- var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
250832
-
250833
- module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
250834
- var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
250835
-
250836
- if(!pts) return;
250837
-
250838
- pointData = pts[0];
250839
- var indices = pointData.index;
250840
- var ny = indices[0];
250841
- var nx = indices[1];
250842
- var cd0 = pointData.cd[0];
250843
- var trace = cd0.trace;
250844
- var xRange = cd0.xRanges[nx];
250845
- var yRange = cd0.yRanges[ny];
250846
-
250847
- pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
250848
- pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
250849
-
250850
- return pts;
250851
- };
250852
-
250853
-
250854
- /***/ }),
250855
-
250856
- /***/ 3617:
250857
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250858
-
250859
-
250860
-
250861
- module.exports = {
250862
- attributes: __webpack_require__(42124),
250863
- supplyDefaults: __webpack_require__(15611),
250864
- crossTraceDefaults: __webpack_require__(34294),
250865
- calc: __webpack_require__(91980),
250866
- plot: __webpack_require__(29406),
250867
- layerName: 'heatmaplayer',
250868
- colorbar: __webpack_require__(90165),
250869
- style: __webpack_require__(58756),
250870
- hoverPoints: __webpack_require__(94587),
250871
- eventData: __webpack_require__(63870),
250872
-
250873
- moduleType: 'trace',
250874
- name: 'histogram2d',
250875
- basePlotModule: __webpack_require__(47885),
250876
- categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
250877
- meta: {
250878
- hrName: 'histogram_2d',
250879
- description: [
250880
- 'The sample data from which statistics are computed is set in `x`',
250881
- 'and `y` (where `x` and `y` represent marginal distributions,',
250882
- 'binning is set in `xbins` and `ybins` in this case)',
250883
- 'or `z` (where `z` represent the 2D distribution and binning set,',
250884
- 'binning is set by `x` and `y` in this case).',
250885
- 'The resulting distribution is visualized as a heatmap.'
250886
- ].join(' ')
250887
- }
250888
- };
250889
-
250890
-
250891
- /***/ }),
250892
-
250893
- /***/ 6236:
250894
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250895
-
250896
-
250897
-
250898
- var Registry = __webpack_require__(13936);
250899
- var Lib = __webpack_require__(30991);
250900
-
250901
- module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
250902
- var x = coerce('x');
250903
- var y = coerce('y');
250904
- var xlen = Lib.minRowLength(x);
250905
- var ylen = Lib.minRowLength(y);
250906
-
250907
- // we could try to accept x0 and dx, etc...
250908
- // but that's a pretty weird use case.
250909
- // for now require both x and y explicitly specified.
250910
- if(!xlen || !ylen) {
250911
- traceOut.visible = false;
250912
- return;
250913
- }
250914
-
250915
- traceOut._length = Math.min(xlen, ylen);
250916
-
250917
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
250918
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
250919
-
250920
- // if marker.color is an array, we can use it in aggregation instead of z
250921
- var hasAggregationData = coerce('z') || coerce('marker.color');
250922
-
250923
- if(hasAggregationData) coerce('histfunc');
250924
- coerce('histnorm');
250925
-
250926
- // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
250927
- // autobin(x|y) are only included here to appease Plotly.validate
250928
- coerce('autobinx');
250929
- coerce('autobiny');
250930
- };
250931
-
250932
-
250933
- /***/ }),
250934
-
250935
- /***/ 34872:
250936
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250937
-
250938
-
250939
-
250940
- var histogram2dAttrs = __webpack_require__(42124);
250941
- var contourAttrs = __webpack_require__(70318);
250942
- var colorScaleAttrs = __webpack_require__(17957);
250943
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
250944
-
250945
- var extendFlat = (__webpack_require__(91307).extendFlat);
250946
-
250947
- module.exports = extendFlat({
250948
- x: histogram2dAttrs.x,
250949
- y: histogram2dAttrs.y,
250950
- z: histogram2dAttrs.z,
250951
- marker: histogram2dAttrs.marker,
250952
-
250953
- histnorm: histogram2dAttrs.histnorm,
250954
- histfunc: histogram2dAttrs.histfunc,
250955
- nbinsx: histogram2dAttrs.nbinsx,
250956
- xbins: histogram2dAttrs.xbins,
250957
- nbinsy: histogram2dAttrs.nbinsy,
250958
- ybins: histogram2dAttrs.ybins,
250959
- autobinx: histogram2dAttrs.autobinx,
250960
- autobiny: histogram2dAttrs.autobiny,
250961
-
250962
- bingroup: histogram2dAttrs.bingroup,
250963
- xbingroup: histogram2dAttrs.xbingroup,
250964
- ybingroup: histogram2dAttrs.ybingroup,
250965
-
250966
- autocontour: contourAttrs.autocontour,
250967
- ncontours: contourAttrs.ncontours,
250968
- contours: contourAttrs.contours,
250969
- line: {
250970
- color: contourAttrs.line.color,
250971
- width: extendFlat({}, contourAttrs.line.width, {
250972
- dflt: 0.5,
250973
- description: 'Sets the contour line width in (in px)'
250974
- }),
250975
- dash: contourAttrs.line.dash,
250976
- smoothing: contourAttrs.line.smoothing,
250977
- editType: 'plot'
250978
- },
250979
- xhoverformat: axisHoverFormat('x'),
250980
- yhoverformat: axisHoverFormat('y'),
250981
- zhoverformat: axisHoverFormat('z', 1),
250982
- hovertemplate: histogram2dAttrs.hovertemplate,
250983
- texttemplate: contourAttrs.texttemplate,
250984
- textfont: contourAttrs.textfont
250985
- },
250986
- colorScaleAttrs('', {
250987
- cLetter: 'z',
250988
- editTypeOverride: 'calc'
250989
- })
250990
- );
250991
-
250992
-
250993
- /***/ }),
250994
-
250995
- /***/ 14319:
250996
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
250997
-
250998
-
250999
-
251000
- var Lib = __webpack_require__(30991);
251001
-
251002
- var handleSampleDefaults = __webpack_require__(6236);
251003
- var handleContoursDefaults = __webpack_require__(657);
251004
- var handleStyleDefaults = __webpack_require__(74619);
251005
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
251006
- var attributes = __webpack_require__(34872);
251007
-
251008
-
251009
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
251010
- function coerce(attr, dflt) {
251011
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
251012
- }
251013
-
251014
- function coerce2(attr) {
251015
- return Lib.coerce2(traceIn, traceOut, attributes, attr);
251016
- }
251017
-
251018
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
251019
- if(traceOut.visible === false) return;
251020
-
251021
- handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
251022
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
251023
- coerce('xhoverformat');
251024
- coerce('yhoverformat');
251025
- coerce('hovertemplate');
251026
- if(
251027
- traceOut.contours &&
251028
- traceOut.contours.coloring === 'heatmap'
251029
- ) {
251030
- handleHeatmapLabelDefaults(coerce, layout);
251031
- }
251032
- };
251033
-
251034
-
251035
- /***/ }),
251036
-
251037
- /***/ 60613:
251038
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
251039
-
251040
-
251041
-
251042
- module.exports = {
251043
- attributes: __webpack_require__(34872),
251044
- supplyDefaults: __webpack_require__(14319),
251045
- crossTraceDefaults: __webpack_require__(34294),
251046
- calc: __webpack_require__(3274),
251047
- plot: (__webpack_require__(32664).plot),
251048
- layerName: 'contourlayer',
251049
- style: __webpack_require__(72690),
251050
- colorbar: __webpack_require__(70307),
251051
- hoverPoints: __webpack_require__(52353),
251052
-
251053
- moduleType: 'trace',
251054
- name: 'histogram2dcontour',
251055
- basePlotModule: __webpack_require__(47885),
251056
- categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
251057
- meta: {
251058
- hrName: 'histogram_2d_contour',
251059
- description: [
251060
- 'The sample data from which statistics are computed is set in `x`',
251061
- 'and `y` (where `x` and `y` represent marginal distributions,',
251062
- 'binning is set in `xbins` and `ybins` in this case)',
251063
- 'or `z` (where `z` represent the 2D distribution and binning set,',
251064
- 'binning is set by `x` and `y` in this case).',
251065
- 'The resulting distribution is visualized as a contour plot.'
251066
- ].join(' ')
251067
- }
251068
- };
251069
-
251070
-
251071
251070
  /***/ }),
251072
251071
 
251073
251072
  /***/ 48223:
@@ -267257,6 +267256,993 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
267257
267256
  };
267258
267257
 
267259
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
+
267260
268246
  /***/ }),
267261
268247
 
267262
268248
  /***/ 47213:
@@ -271187,993 +272173,6 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
271187
272173
  };
271188
272174
 
271189
272175
 
271190
- /***/ }),
271191
-
271192
- /***/ 1015:
271193
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271194
-
271195
-
271196
-
271197
- var scatterAttrs = __webpack_require__(86854);
271198
- var fontAttrs = __webpack_require__(70827);
271199
- var colorAttributes = __webpack_require__(17957);
271200
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
271201
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
271202
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
271203
- var baseAttrs = __webpack_require__(35667);
271204
- var DASHES = __webpack_require__(68828);
271205
-
271206
- var MARKER_SYMBOLS = __webpack_require__(98993);
271207
- var extendFlat = (__webpack_require__(91307).extendFlat);
271208
- var overrideAll = (__webpack_require__(70756).overrideAll);
271209
- var sortObjectKeys = __webpack_require__(99124);
271210
-
271211
- var scatterLineAttrs = scatterAttrs.line;
271212
- var scatterMarkerAttrs = scatterAttrs.marker;
271213
- var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
271214
-
271215
- var lineAttrs = extendFlat({
271216
- width: scatterLineAttrs.width,
271217
- dash: {
271218
- valType: 'enumerated',
271219
- values: sortObjectKeys(DASHES),
271220
- dflt: 'solid',
271221
- description: 'Sets the dash style of the lines.'
271222
- }
271223
- }, colorAttributes('line'));
271224
-
271225
- function makeProjectionAttr(axLetter) {
271226
- return {
271227
- show: {
271228
- valType: 'boolean',
271229
- dflt: false,
271230
- description: [
271231
- 'Sets whether or not projections are shown along the',
271232
- axLetter, 'axis.'
271233
- ].join(' ')
271234
- },
271235
- opacity: {
271236
- valType: 'number',
271237
- min: 0,
271238
- max: 1,
271239
- dflt: 1,
271240
- description: 'Sets the projection color.'
271241
- },
271242
- scale: {
271243
- valType: 'number',
271244
- min: 0,
271245
- max: 10,
271246
- dflt: 2 / 3,
271247
- description: [
271248
- 'Sets the scale factor determining the size of the',
271249
- 'projection marker points.'
271250
- ].join(' ')
271251
- }
271252
- };
271253
- }
271254
-
271255
- var attrs = module.exports = overrideAll({
271256
- x: scatterAttrs.x,
271257
- y: scatterAttrs.y,
271258
- z: {
271259
- valType: 'data_array',
271260
- description: 'Sets the z coordinates.'
271261
- },
271262
-
271263
- text: extendFlat({}, scatterAttrs.text, {
271264
- description: [
271265
- 'Sets text elements associated with each (x,y,z) triplet.',
271266
- 'If a single string, the same string appears over',
271267
- 'all the data points.',
271268
- 'If an array of string, the items are mapped in order to the',
271269
- 'this trace\'s (x,y,z) coordinates.',
271270
- 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
271271
- 'these elements will be seen in the hover labels.'
271272
- ].join(' ')
271273
- }),
271274
- texttemplate: texttemplateAttrs({}, {
271275
-
271276
- }),
271277
- hovertext: extendFlat({}, scatterAttrs.hovertext, {
271278
- description: [
271279
- 'Sets text elements associated with each (x,y,z) triplet.',
271280
- 'If a single string, the same string appears over',
271281
- 'all the data points.',
271282
- 'If an array of string, the items are mapped in order to the',
271283
- 'this trace\'s (x,y,z) coordinates.',
271284
- 'To be seen, trace `hoverinfo` must contain a *text* flag.'
271285
- ].join(' ')
271286
- }),
271287
- hovertemplate: hovertemplateAttrs(),
271288
-
271289
- xhoverformat: axisHoverFormat('x'),
271290
- yhoverformat: axisHoverFormat('y'),
271291
- zhoverformat: axisHoverFormat('z'),
271292
-
271293
- mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
271294
- {dflt: 'lines+markers'}),
271295
- surfaceaxis: {
271296
- valType: 'enumerated',
271297
- values: [-1, 0, 1, 2],
271298
- dflt: -1,
271299
- description: [
271300
- 'If *-1*, the scatter points are not fill with a surface',
271301
- 'If *0*, *1*, *2*, the scatter points are filled with',
271302
- 'a Delaunay surface about the x, y, z respectively.'
271303
- ].join(' ')
271304
- },
271305
- surfacecolor: {
271306
- valType: 'color',
271307
- description: 'Sets the surface fill color.'
271308
- },
271309
- projection: {
271310
- x: makeProjectionAttr('x'),
271311
- y: makeProjectionAttr('y'),
271312
- z: makeProjectionAttr('z')
271313
- },
271314
-
271315
- connectgaps: scatterAttrs.connectgaps,
271316
- line: lineAttrs,
271317
-
271318
- marker: extendFlat({ // Parity with scatter.js?
271319
- symbol: {
271320
- valType: 'enumerated',
271321
- values: sortObjectKeys(MARKER_SYMBOLS),
271322
- dflt: 'circle',
271323
- arrayOk: true,
271324
- description: 'Sets the marker symbol type.'
271325
- },
271326
- size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
271327
- sizeref: scatterMarkerAttrs.sizeref,
271328
- sizemin: scatterMarkerAttrs.sizemin,
271329
- sizemode: scatterMarkerAttrs.sizemode,
271330
- opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
271331
- arrayOk: false,
271332
- description: [
271333
- 'Sets the marker opacity.',
271334
- 'Note that the marker opacity for scatter3d traces',
271335
- 'must be a scalar value for performance reasons.',
271336
- 'To set a blending opacity value',
271337
- '(i.e. which is not transparent), set *marker.color*',
271338
- 'to an rgba color and use its alpha channel.'
271339
- ].join(' ')
271340
- }),
271341
- colorbar: scatterMarkerAttrs.colorbar,
271342
-
271343
- line: extendFlat({
271344
- width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
271345
- },
271346
- colorAttributes('marker.line')
271347
- )
271348
- },
271349
- colorAttributes('marker')
271350
- ),
271351
-
271352
- textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
271353
- textfont: fontAttrs({
271354
- noFontShadow: true,
271355
- noFontLineposition: true,
271356
- noFontTextcase: true,
271357
- editType: 'calc',
271358
- colorEditType: 'style',
271359
- arrayOk: true,
271360
- variantValues: ['normal', 'small-caps'],
271361
- description: 'Sets the text font.'
271362
- }),
271363
-
271364
- opacity: baseAttrs.opacity,
271365
-
271366
- hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
271367
- }, 'calc', 'nested');
271368
-
271369
- attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
271370
-
271371
-
271372
- /***/ }),
271373
-
271374
- /***/ 30935:
271375
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271376
-
271377
-
271378
-
271379
- var arraysToCalcdata = __webpack_require__(47213);
271380
- var calcColorscale = __webpack_require__(59498);
271381
-
271382
- /**
271383
- * This is a kludge to put the array attributes into
271384
- * calcdata the way Scatter.plot does, so that legends and
271385
- * popovers know what to do with them.
271386
- */
271387
- module.exports = function calc(gd, trace) {
271388
- var cd = [{x: false, y: false, trace: trace, t: {}}];
271389
-
271390
- arraysToCalcdata(cd, trace);
271391
- calcColorscale(gd, trace);
271392
-
271393
- return cd;
271394
- };
271395
-
271396
-
271397
- /***/ }),
271398
-
271399
- /***/ 77681:
271400
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271401
-
271402
-
271403
-
271404
- var Registry = __webpack_require__(13936);
271405
-
271406
- function calculateAxisErrors(data, params, scaleFactor, axis) {
271407
- if(!params || !params.visible) return null;
271408
-
271409
- var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
271410
- var result = new Array(data.length);
271411
-
271412
- for(var i = 0; i < data.length; i++) {
271413
- var errors = computeError(+data[i], i);
271414
-
271415
- if(axis.type === 'log') {
271416
- var point = axis.c2l(data[i]);
271417
- var min = data[i] - errors[0];
271418
- var max = data[i] + errors[1];
271419
-
271420
- result[i] = [
271421
- (axis.c2l(min, true) - point) * scaleFactor,
271422
- (axis.c2l(max, true) - point) * scaleFactor
271423
- ];
271424
-
271425
- // Keep track of the lower error bound which isn't negative!
271426
- if(min > 0) {
271427
- var lower = axis.c2l(min);
271428
- if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
271429
- axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
271430
- }
271431
- } else {
271432
- result[i] = [
271433
- -errors[0] * scaleFactor,
271434
- errors[1] * scaleFactor
271435
- ];
271436
- }
271437
- }
271438
-
271439
- return result;
271440
- }
271441
-
271442
- function dataLength(array) {
271443
- for(var i = 0; i < array.length; i++) {
271444
- if(array[i]) return array[i].length;
271445
- }
271446
- return 0;
271447
- }
271448
-
271449
- function calculateErrors(data, scaleFactor, sceneLayout) {
271450
- var errors = [
271451
- calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
271452
- calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
271453
- calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
271454
- ];
271455
-
271456
- var n = dataLength(errors);
271457
- if(n === 0) return null;
271458
-
271459
- var errorBounds = new Array(n);
271460
-
271461
- for(var i = 0; i < n; i++) {
271462
- var bound = [[0, 0, 0], [0, 0, 0]];
271463
-
271464
- for(var j = 0; j < 3; j++) {
271465
- if(errors[j]) {
271466
- for(var k = 0; k < 2; k++) {
271467
- bound[k][j] = errors[j][i][k];
271468
- }
271469
- }
271470
- }
271471
-
271472
- errorBounds[i] = bound;
271473
- }
271474
-
271475
- return errorBounds;
271476
- }
271477
-
271478
- module.exports = calculateErrors;
271479
-
271480
-
271481
- /***/ }),
271482
-
271483
- /***/ 93219:
271484
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
271485
-
271486
-
271487
-
271488
- var createLinePlot = (__webpack_require__(46000).gl_line3d);
271489
- var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
271490
- var createErrorBars = (__webpack_require__(46000).gl_error3d);
271491
- var createMesh = (__webpack_require__(46000).gl_mesh3d);
271492
- var triangulate = (__webpack_require__(46000).delaunay_triangulate);
271493
-
271494
- var Lib = __webpack_require__(30991);
271495
- var str2RgbaArray = __webpack_require__(44960);
271496
- var formatColor = (__webpack_require__(592).formatColor);
271497
- var makeBubbleSizeFn = __webpack_require__(42581);
271498
- var DASH_PATTERNS = __webpack_require__(68828);
271499
- var MARKER_SYMBOLS = __webpack_require__(98993);
271500
-
271501
- var Axes = __webpack_require__(15076);
271502
- var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
271503
-
271504
- var calculateError = __webpack_require__(77681);
271505
-
271506
- function LineWithMarkers(scene, uid) {
271507
- this.scene = scene;
271508
- this.uid = uid;
271509
- this.linePlot = null;
271510
- this.scatterPlot = null;
271511
- this.errorBars = null;
271512
- this.textMarkers = null;
271513
- this.delaunayMesh = null;
271514
- this.color = null;
271515
- this.mode = '';
271516
- this.dataPoints = [];
271517
- this.axesBounds = [
271518
- [-Infinity, -Infinity, -Infinity],
271519
- [Infinity, Infinity, Infinity]
271520
- ];
271521
- this.textLabels = null;
271522
- this.data = null;
271523
- }
271524
-
271525
- var proto = LineWithMarkers.prototype;
271526
-
271527
- proto.handlePick = function(selection) {
271528
- if(selection.object &&
271529
- (selection.object === this.linePlot ||
271530
- selection.object === this.delaunayMesh ||
271531
- selection.object === this.textMarkers ||
271532
- selection.object === this.scatterPlot)
271533
- ) {
271534
- var ind = selection.index = selection.data.index;
271535
-
271536
- if(selection.object.highlight) {
271537
- selection.object.highlight(null);
271538
- }
271539
- if(this.scatterPlot) {
271540
- selection.object = this.scatterPlot;
271541
- this.scatterPlot.highlight(selection.data);
271542
- }
271543
-
271544
- selection.textLabel = '';
271545
- if(this.textLabels) {
271546
- if(Lib.isArrayOrTypedArray(this.textLabels)) {
271547
- if(this.textLabels[ind] || this.textLabels[ind] === 0) {
271548
- selection.textLabel = this.textLabels[ind];
271549
- }
271550
- } else {
271551
- selection.textLabel = this.textLabels;
271552
- }
271553
- }
271554
-
271555
- selection.traceCoordinate = [
271556
- this.data.x[ind],
271557
- this.data.y[ind],
271558
- this.data.z[ind]
271559
- ];
271560
-
271561
- return true;
271562
- }
271563
- };
271564
-
271565
- function constructDelaunay(points, color, axis) {
271566
- var u = (axis + 1) % 3;
271567
- var v = (axis + 2) % 3;
271568
- var filteredPoints = [];
271569
- var filteredIds = [];
271570
- var i;
271571
-
271572
- for(i = 0; i < points.length; ++i) {
271573
- var p = points[i];
271574
- if(isNaN(p[u]) || !isFinite(p[u]) ||
271575
- isNaN(p[v]) || !isFinite(p[v])) {
271576
- continue;
271577
- }
271578
- filteredPoints.push([p[u], p[v]]);
271579
- filteredIds.push(i);
271580
- }
271581
- var cells = triangulate(filteredPoints);
271582
- for(i = 0; i < cells.length; ++i) {
271583
- var c = cells[i];
271584
- for(var j = 0; j < c.length; ++j) {
271585
- c[j] = filteredIds[c[j]];
271586
- }
271587
- }
271588
- return {
271589
- positions: points,
271590
- cells: cells,
271591
- meshColor: color
271592
- };
271593
- }
271594
-
271595
- function calculateErrorParams(errors) {
271596
- var capSize = [0.0, 0.0, 0.0];
271597
- var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
271598
- var lineWidth = [1.0, 1.0, 1.0];
271599
-
271600
- for(var i = 0; i < 3; i++) {
271601
- var e = errors[i];
271602
-
271603
- if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
271604
- if(!e || !e.visible) continue;
271605
-
271606
- capSize[i] = e.width / 2; // ballpark rescaling
271607
- color[i] = str2RgbaArray(e.color);
271608
- lineWidth[i] = e.thickness;
271609
- }
271610
-
271611
- return {capSize: capSize, color: color, lineWidth: lineWidth};
271612
- }
271613
-
271614
- function parseAlignmentX(a) {
271615
- if(a === null || a === undefined) return 0;
271616
-
271617
- return (a.indexOf('left') > -1) ? -1 :
271618
- (a.indexOf('right') > -1) ? 1 : 0;
271619
- }
271620
-
271621
- function parseAlignmentY(a) {
271622
- if(a === null || a === undefined) return 0;
271623
-
271624
- return (a.indexOf('top') > -1) ? -1 :
271625
- (a.indexOf('bottom') > -1) ? 1 : 0;
271626
- }
271627
-
271628
- function calculateTextOffset(tp) {
271629
- // Read out text properties
271630
-
271631
- var defaultAlignmentX = 0;
271632
- var defaultAlignmentY = 0;
271633
-
271634
- var textOffset = [
271635
- defaultAlignmentX,
271636
- defaultAlignmentY
271637
- ];
271638
-
271639
- if(Array.isArray(tp)) {
271640
- for(var i = 0; i < tp.length; i++) {
271641
- textOffset[i] = [
271642
- defaultAlignmentX,
271643
- defaultAlignmentY
271644
- ];
271645
- if(tp[i]) {
271646
- textOffset[i][0] = parseAlignmentX(tp[i]);
271647
- textOffset[i][1] = parseAlignmentY(tp[i]);
271648
- }
271649
- }
271650
- } else {
271651
- textOffset[0] = parseAlignmentX(tp);
271652
- textOffset[1] = parseAlignmentY(tp);
271653
- }
271654
-
271655
- return textOffset;
271656
- }
271657
-
271658
-
271659
- function calculateSize(sizeIn, sizeFn) {
271660
- // rough parity with Plotly 2D markers
271661
- return sizeFn(sizeIn * 4);
271662
- }
271663
-
271664
- function calculateSymbol(symbolIn) {
271665
- return MARKER_SYMBOLS[symbolIn];
271666
- }
271667
-
271668
- function formatParam(paramIn, len, calculate, dflt, extraFn) {
271669
- var paramOut = null;
271670
-
271671
- if(Lib.isArrayOrTypedArray(paramIn)) {
271672
- paramOut = [];
271673
-
271674
- for(var i = 0; i < len; i++) {
271675
- if(paramIn[i] === undefined) paramOut[i] = dflt;
271676
- else paramOut[i] = calculate(paramIn[i], extraFn);
271677
- }
271678
- } else paramOut = calculate(paramIn, Lib.identity);
271679
-
271680
- return paramOut;
271681
- }
271682
-
271683
-
271684
- function convertPlotlyOptions(scene, data) {
271685
- var points = [];
271686
- var sceneLayout = scene.fullSceneLayout;
271687
- var scaleFactor = scene.dataScale;
271688
- var xaxis = sceneLayout.xaxis;
271689
- var yaxis = sceneLayout.yaxis;
271690
- var zaxis = sceneLayout.zaxis;
271691
- var marker = data.marker;
271692
- var line = data.line;
271693
- var x = data.x || [];
271694
- var y = data.y || [];
271695
- var z = data.z || [];
271696
- var len = x.length;
271697
- var xcalendar = data.xcalendar;
271698
- var ycalendar = data.ycalendar;
271699
- var zcalendar = data.zcalendar;
271700
- var xc, yc, zc;
271701
- var params, i;
271702
- var text;
271703
-
271704
- // Convert points
271705
- for(i = 0; i < len; i++) {
271706
- // sanitize numbers and apply transforms based on axes.type
271707
- xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
271708
- yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
271709
- zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
271710
-
271711
- points[i] = [xc, yc, zc];
271712
- }
271713
-
271714
- // convert text
271715
- if(Array.isArray(data.text)) {
271716
- text = data.text;
271717
- } else if(Lib.isTypedArray(data.text)) {
271718
- text = Array.from(data.text);
271719
- } else if(data.text !== undefined) {
271720
- text = new Array(len);
271721
- for(i = 0; i < len; i++) text[i] = data.text;
271722
- }
271723
-
271724
- function formatter(axName, val) {
271725
- var ax = sceneLayout[axName];
271726
- return Axes.tickText(ax, ax.d2l(val), true).text;
271727
- }
271728
-
271729
- // check texttemplate
271730
- var texttemplate = data.texttemplate;
271731
- if(texttemplate) {
271732
- var fullLayout = scene.fullLayout;
271733
- var d3locale = fullLayout._d3locale;
271734
- var isArray = Array.isArray(texttemplate);
271735
- var N = isArray ? Math.min(texttemplate.length, len) : len;
271736
- var txt = isArray ?
271737
- function(i) { return texttemplate[i]; } :
271738
- function() { return texttemplate; };
271739
-
271740
- text = new Array(N);
271741
-
271742
- for(i = 0; i < N; i++) {
271743
- var d = {x: x[i], y: y[i], z: z[i]};
271744
- var labels = {
271745
- xLabel: formatter('xaxis', x[i]),
271746
- yLabel: formatter('yaxis', y[i]),
271747
- zLabel: formatter('zaxis', z[i])
271748
- };
271749
- var pointValues = {};
271750
- appendArrayPointValue(pointValues, data, i);
271751
- var meta = data._meta || {};
271752
- text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
271753
- }
271754
- }
271755
-
271756
- // Build object parameters
271757
- params = {
271758
- position: points,
271759
- mode: data.mode,
271760
- text: text
271761
- };
271762
-
271763
- if('line' in data) {
271764
- params.lineColor = formatColor(line, 1, len);
271765
- params.lineWidth = line.width;
271766
- params.lineDashes = line.dash;
271767
- }
271768
-
271769
- if('marker' in data) {
271770
- var sizeFn = makeBubbleSizeFn(data);
271771
-
271772
- params.scatterColor = formatColor(marker, 1, len);
271773
- params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
271774
- params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
271775
- params.scatterLineWidth = marker.line.width; // arrayOk === false
271776
- params.scatterLineColor = formatColor(marker.line, 1, len);
271777
- params.scatterAngle = 0;
271778
- }
271779
-
271780
- if('textposition' in data) {
271781
- params.textOffset = calculateTextOffset(data.textposition);
271782
- params.textColor = formatColor(data.textfont, 1, len);
271783
- params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
271784
- params.textFontFamily = data.textfont.family;
271785
- params.textFontWeight = data.textfont.weight;
271786
- params.textFontStyle = data.textfont.style;
271787
- params.textFontVariant = data.textfont.variant;
271788
- params.textAngle = 0;
271789
- }
271790
-
271791
- var dims = ['x', 'y', 'z'];
271792
- params.project = [false, false, false];
271793
- params.projectScale = [1, 1, 1];
271794
- params.projectOpacity = [1, 1, 1];
271795
- for(i = 0; i < 3; ++i) {
271796
- var projection = data.projection[dims[i]];
271797
- if((params.project[i] = projection.show)) {
271798
- params.projectOpacity[i] = projection.opacity;
271799
- params.projectScale[i] = projection.scale;
271800
- }
271801
- }
271802
-
271803
- params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
271804
-
271805
- var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
271806
- params.errorColor = errorParams.color;
271807
- params.errorLineWidth = errorParams.lineWidth;
271808
- params.errorCapSize = errorParams.capSize;
271809
-
271810
- params.delaunayAxis = data.surfaceaxis;
271811
- params.delaunayColor = str2RgbaArray(data.surfacecolor);
271812
-
271813
- return params;
271814
- }
271815
-
271816
- function _arrayToColor(color) {
271817
- if(Lib.isArrayOrTypedArray(color)) {
271818
- var c = color[0];
271819
-
271820
- if(Lib.isArrayOrTypedArray(c)) color = c;
271821
-
271822
- return 'rgb(' + color.slice(0, 3).map(function(x) {
271823
- return Math.round(x * 255);
271824
- }) + ')';
271825
- }
271826
-
271827
- return null;
271828
- }
271829
-
271830
- function arrayToColor(colors) {
271831
- if(!Lib.isArrayOrTypedArray(colors)) {
271832
- return null;
271833
- }
271834
-
271835
- if((colors.length === 4) && (typeof colors[0] === 'number')) {
271836
- return _arrayToColor(colors);
271837
- }
271838
-
271839
- return colors.map(_arrayToColor);
271840
- }
271841
-
271842
- proto.update = function(data) {
271843
- var gl = this.scene.glplot.gl;
271844
- var lineOptions;
271845
- var scatterOptions;
271846
- var errorOptions;
271847
- var textOptions;
271848
- var dashPattern = DASH_PATTERNS.solid;
271849
-
271850
- // Save data
271851
- this.data = data;
271852
-
271853
- // Run data conversion
271854
- var options = convertPlotlyOptions(this.scene, data);
271855
-
271856
- if('mode' in options) {
271857
- this.mode = options.mode;
271858
- }
271859
- if('lineDashes' in options) {
271860
- if(options.lineDashes in DASH_PATTERNS) {
271861
- dashPattern = DASH_PATTERNS[options.lineDashes];
271862
- }
271863
- }
271864
-
271865
- this.color = arrayToColor(options.scatterColor) ||
271866
- arrayToColor(options.lineColor);
271867
-
271868
- // Save data points
271869
- this.dataPoints = options.position;
271870
-
271871
- lineOptions = {
271872
- gl: this.scene.glplot.gl,
271873
- position: options.position,
271874
- color: options.lineColor,
271875
- lineWidth: options.lineWidth || 1,
271876
- dashes: dashPattern[0],
271877
- dashScale: dashPattern[1],
271878
- opacity: data.opacity,
271879
- connectGaps: data.connectgaps
271880
- };
271881
-
271882
- if(this.mode.indexOf('lines') !== -1) {
271883
- if(this.linePlot) this.linePlot.update(lineOptions);
271884
- else {
271885
- this.linePlot = createLinePlot(lineOptions);
271886
- this.linePlot._trace = this;
271887
- this.scene.glplot.add(this.linePlot);
271888
- }
271889
- } else if(this.linePlot) {
271890
- this.scene.glplot.remove(this.linePlot);
271891
- this.linePlot.dispose();
271892
- this.linePlot = null;
271893
- }
271894
-
271895
- // N.B. marker.opacity must be a scalar for performance
271896
- var scatterOpacity = data.opacity;
271897
- if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
271898
-
271899
- scatterOptions = {
271900
- gl: this.scene.glplot.gl,
271901
- position: options.position,
271902
- color: options.scatterColor,
271903
- size: options.scatterSize,
271904
- glyph: options.scatterMarker,
271905
- opacity: scatterOpacity,
271906
- orthographic: true,
271907
- lineWidth: options.scatterLineWidth,
271908
- lineColor: options.scatterLineColor,
271909
- project: options.project,
271910
- projectScale: options.projectScale,
271911
- projectOpacity: options.projectOpacity
271912
- };
271913
-
271914
- if(this.mode.indexOf('markers') !== -1) {
271915
- if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
271916
- else {
271917
- this.scatterPlot = createScatterPlot(scatterOptions);
271918
- this.scatterPlot._trace = this;
271919
- this.scatterPlot.highlightScale = 1;
271920
- this.scene.glplot.add(this.scatterPlot);
271921
- }
271922
- } else if(this.scatterPlot) {
271923
- this.scene.glplot.remove(this.scatterPlot);
271924
- this.scatterPlot.dispose();
271925
- this.scatterPlot = null;
271926
- }
271927
-
271928
- textOptions = {
271929
- gl: this.scene.glplot.gl,
271930
- position: options.position,
271931
- glyph: options.text,
271932
- color: options.textColor,
271933
- size: options.textSize,
271934
- angle: options.textAngle,
271935
- alignment: options.textOffset,
271936
- font: options.textFontFamily,
271937
- fontWeight: options.textFontWeight,
271938
- fontStyle: options.textFontStyle,
271939
- fontVariant: options.textFontVariant,
271940
- orthographic: true,
271941
- lineWidth: 0,
271942
- project: false,
271943
- opacity: data.opacity
271944
- };
271945
-
271946
- this.textLabels = data.hovertext || data.text;
271947
-
271948
- if(this.mode.indexOf('text') !== -1) {
271949
- if(this.textMarkers) this.textMarkers.update(textOptions);
271950
- else {
271951
- this.textMarkers = createScatterPlot(textOptions);
271952
- this.textMarkers._trace = this;
271953
- this.textMarkers.highlightScale = 1;
271954
- this.scene.glplot.add(this.textMarkers);
271955
- }
271956
- } else if(this.textMarkers) {
271957
- this.scene.glplot.remove(this.textMarkers);
271958
- this.textMarkers.dispose();
271959
- this.textMarkers = null;
271960
- }
271961
-
271962
- errorOptions = {
271963
- gl: this.scene.glplot.gl,
271964
- position: options.position,
271965
- color: options.errorColor,
271966
- error: options.errorBounds,
271967
- lineWidth: options.errorLineWidth,
271968
- capSize: options.errorCapSize,
271969
- opacity: data.opacity
271970
- };
271971
- if(this.errorBars) {
271972
- if(options.errorBounds) {
271973
- this.errorBars.update(errorOptions);
271974
- } else {
271975
- this.scene.glplot.remove(this.errorBars);
271976
- this.errorBars.dispose();
271977
- this.errorBars = null;
271978
- }
271979
- } else if(options.errorBounds) {
271980
- this.errorBars = createErrorBars(errorOptions);
271981
- this.errorBars._trace = this;
271982
- this.scene.glplot.add(this.errorBars);
271983
- }
271984
-
271985
- if(options.delaunayAxis >= 0) {
271986
- var delaunayOptions = constructDelaunay(
271987
- options.position,
271988
- options.delaunayColor,
271989
- options.delaunayAxis
271990
- );
271991
- delaunayOptions.opacity = data.opacity;
271992
-
271993
- if(this.delaunayMesh) {
271994
- this.delaunayMesh.update(delaunayOptions);
271995
- } else {
271996
- delaunayOptions.gl = gl;
271997
- this.delaunayMesh = createMesh(delaunayOptions);
271998
- this.delaunayMesh._trace = this;
271999
- this.scene.glplot.add(this.delaunayMesh);
272000
- }
272001
- } else if(this.delaunayMesh) {
272002
- this.scene.glplot.remove(this.delaunayMesh);
272003
- this.delaunayMesh.dispose();
272004
- this.delaunayMesh = null;
272005
- }
272006
- };
272007
-
272008
- proto.dispose = function() {
272009
- if(this.linePlot) {
272010
- this.scene.glplot.remove(this.linePlot);
272011
- this.linePlot.dispose();
272012
- }
272013
- if(this.scatterPlot) {
272014
- this.scene.glplot.remove(this.scatterPlot);
272015
- this.scatterPlot.dispose();
272016
- }
272017
- if(this.errorBars) {
272018
- this.scene.glplot.remove(this.errorBars);
272019
- this.errorBars.dispose();
272020
- }
272021
- if(this.textMarkers) {
272022
- this.scene.glplot.remove(this.textMarkers);
272023
- this.textMarkers.dispose();
272024
- }
272025
- if(this.delaunayMesh) {
272026
- this.scene.glplot.remove(this.delaunayMesh);
272027
- this.delaunayMesh.dispose();
272028
- }
272029
- };
272030
-
272031
- function createLineWithMarkers(scene, data) {
272032
- var plot = new LineWithMarkers(scene, data.uid);
272033
- plot.update(data);
272034
- return plot;
272035
- }
272036
-
272037
- module.exports = createLineWithMarkers;
272038
-
272039
-
272040
- /***/ }),
272041
-
272042
- /***/ 13744:
272043
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
272044
-
272045
-
272046
-
272047
- var Registry = __webpack_require__(13936);
272048
- var Lib = __webpack_require__(30991);
272049
-
272050
- var subTypes = __webpack_require__(33068);
272051
- var handleMarkerDefaults = __webpack_require__(15294);
272052
- var handleLineDefaults = __webpack_require__(82094);
272053
- var handleTextDefaults = __webpack_require__(94729);
272054
-
272055
- var attributes = __webpack_require__(1015);
272056
-
272057
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
272058
- function coerce(attr, dflt) {
272059
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
272060
- }
272061
-
272062
- var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
272063
- if(!len) {
272064
- traceOut.visible = false;
272065
- return;
272066
- }
272067
-
272068
- coerce('text');
272069
- coerce('hovertext');
272070
- coerce('hovertemplate');
272071
- coerce('xhoverformat');
272072
- coerce('yhoverformat');
272073
- coerce('zhoverformat');
272074
-
272075
- coerce('mode');
272076
-
272077
- if(subTypes.hasMarkers(traceOut)) {
272078
- handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
272079
- }
272080
-
272081
- if(subTypes.hasLines(traceOut)) {
272082
- coerce('connectgaps');
272083
- handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
272084
- }
272085
-
272086
- if(subTypes.hasText(traceOut)) {
272087
- coerce('texttemplate');
272088
- handleTextDefaults(traceIn, traceOut, layout, coerce, {
272089
- noSelect: true,
272090
- noFontShadow: true,
272091
- noFontLineposition: true,
272092
- noFontTextcase: true,
272093
- });
272094
- }
272095
-
272096
- var lineColor = (traceOut.line || {}).color;
272097
- var markerColor = (traceOut.marker || {}).color;
272098
- if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
272099
-
272100
- var dims = ['x', 'y', 'z'];
272101
- for(var i = 0; i < 3; ++i) {
272102
- var projection = 'projection.' + dims[i];
272103
- if(coerce(projection + '.show')) {
272104
- coerce(projection + '.opacity');
272105
- coerce(projection + '.scale');
272106
- }
272107
- }
272108
-
272109
- var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
272110
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
272111
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
272112
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
272113
- };
272114
-
272115
- function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
272116
- var len = 0;
272117
- var x = coerce('x');
272118
- var y = coerce('y');
272119
- var z = coerce('z');
272120
-
272121
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
272122
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
272123
-
272124
- if(x && y && z) {
272125
- // TODO: what happens if one is missing?
272126
- len = Math.min(x.length, y.length, z.length);
272127
- traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
272128
- }
272129
-
272130
- return len;
272131
- }
272132
-
272133
-
272134
- /***/ }),
272135
-
272136
- /***/ 68860:
272137
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
272138
-
272139
-
272140
-
272141
- module.exports = {
272142
- plot: __webpack_require__(93219),
272143
- attributes: __webpack_require__(1015),
272144
- markerSymbols: __webpack_require__(98993),
272145
- supplyDefaults: __webpack_require__(13744),
272146
- colorbar: [
272147
- {
272148
- container: 'marker',
272149
- min: 'cmin',
272150
- max: 'cmax'
272151
- }, {
272152
- container: 'line',
272153
- min: 'cmin',
272154
- max: 'cmax'
272155
- }
272156
- ],
272157
- calc: __webpack_require__(30935),
272158
-
272159
- moduleType: 'trace',
272160
- name: 'scatter3d',
272161
- basePlotModule: __webpack_require__(68137),
272162
- categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
272163
- meta: {
272164
- hrName: 'scatter_3d',
272165
- description: [
272166
- 'The data visualized as scatter point or lines in 3D dimension',
272167
- 'is set in `x`, `y`, `z`.',
272168
- 'Text (appearing either on the chart or on hover only) is via `text`.',
272169
- 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
272170
- 'Projections are achieved via `projection`.',
272171
- 'Surface fills are achieved via `surfaceaxis`.'
272172
- ].join(' ')
272173
- }
272174
- };
272175
-
272176
-
272177
272176
  /***/ }),
272178
272177
 
272179
272178
  /***/ 44771:
@@ -368805,7 +368804,7 @@ const HistoryButton = ({ className }) => {
368805
368804
  const handleClick = () => {
368806
368805
  setIsContextOpen((prev) => !prev);
368807
368806
  };
368808
- 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" }), (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, {
368809
368808
  [styles_module_scss_1.default.historyActive]: isContextOpen,
368810
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 })] }));
368811
368810
  };
@@ -368861,7 +368860,7 @@ const DownloadButton = (props) => {
368861
368860
  const { zipBlob: content } = await (0, createProjectArchive_1.createProjectArchive)(project);
368862
368861
  file_saver_1.default.saveAs(content, `${(0, js_convert_case_1.toSnakeCase)(project.name || "untitled_project")}.zip`);
368863
368862
  };
368864
- 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: "bottom" })] }));
368863
+ return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, style: { position: "relative" }, 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 files", visible: hovered, position: "bottom", size: "fit" })] }));
368865
368864
  };
368866
368865
  exports["default"] = DownloadButton;
368867
368866
 
@@ -369434,7 +369433,7 @@ function HtmlRunner() {
369434
369433
  const iframeClasses = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
369435
369434
  [styles_module_scss_1.default.codeHasBeenRun]: codeHasBeenRun,
369436
369435
  });
369437
- 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 }) }) }))] }));
369438
369437
  }
369439
369438
  exports["default"] = HtmlRunner;
369440
369439
 
@@ -369821,234 +369820,234 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
369821
369820
  exports.consoleOverrideScript = exports.disableLocalStorageScript = void 0;
369822
369821
  // insert script to disable access to specific localStorage keys
369823
369822
  // localstorage.getItem() is a potential security risk when executing untrusted code
369824
- exports.disableLocalStorageScript = `
369825
- <script>
369826
- (function() {
369827
- const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
369828
- const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
369829
- const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
369830
- const originalClear = window.localStorage.clear.bind(window.localStorage);
369831
-
369832
- const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
369833
-
369834
- Object.defineProperty(window, 'localStorage', {
369835
- value: {
369836
- getItem: function(key) {
369837
- if (isDisallowedKey(key)) {
369838
- console.log(\`localStorage.getItem for "\${key}" is disabled\`);
369839
- return null;
369840
- }
369841
- return originalGetItem(key);
369842
- },
369843
- setItem: function(key, value) {
369844
- if (isDisallowedKey(key)) {
369845
- console.log(\`localStorage.setItem for "\${key}" is disabled\`);
369846
- return;
369847
- }
369848
- return originalSetItem(key, value);
369849
- },
369850
- removeItem: function(key) {
369851
- if (isDisallowedKey(key)) {
369852
- console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
369853
- return;
369854
- }
369855
- return originalRemoveItem(key);
369856
- },
369857
- clear: function() {
369858
- console.log('localStorage.clear is disabled');
369859
- return;
369860
- }
369861
- },
369862
- writable: false,
369863
- configurable: false
369864
- });
369865
- })();
369866
- </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>
369867
369866
  `;
369868
369867
  const MAX_DEPTH = 5; // Maximum depth for object serialization to prevent infinite recursion
369869
369868
  // Override console methods to send logs to parent window and serialize complex objects
369870
- exports.consoleOverrideScript = `
369871
- <script>
369872
- (function() {
369873
- const SerializedType = {
369874
- Null: "null",
369875
- Undefined: "undefined",
369876
- Boolean: "boolean",
369877
- Number: "number",
369878
- String: "string",
369879
- Array: "array",
369880
- Object: "object",
369881
- };
369882
-
369883
- const original = {};
369884
- const methods = ["log", "error", "warn", "info", "debug", "assert"];
369885
-
369886
- function getTimestamp() {
369887
- const now = new Date();
369888
- const pad = (n) => String(n).padStart(2, '0');
369889
-
369890
- return (
369891
- now.getFullYear() + '-' +
369892
- pad(now.getMonth() + 1) + '-' +
369893
- pad(now.getDate()) + ' ' +
369894
- pad(now.getHours()) + ':' +
369895
- pad(now.getMinutes()) + ':' +
369896
- pad(now.getSeconds()) + '.' +
369897
- pad(Math.floor(now.getMilliseconds() / 10))
369898
- );
369899
- }
369900
-
369901
- function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
369902
- if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
369903
-
369904
- if (arg && typeof arg === "object") {
369905
- if (visited.has(arg)) {
369906
- return { "type": SerializedType.String, "value": "[Circular reference]" };
369907
- }
369908
- visited.add(arg);
369909
- }
369910
-
369911
- const type = typeof arg;
369912
- if (arg === null) return { "type": SerializedType.Null, "value": "null" };
369913
- if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
369914
- if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
369915
- if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
369916
- if (type === "string") return { "type": SerializedType.String, "value": arg };
369917
-
369918
- if (Array.isArray(arg)) {
369919
- return {
369920
- "type": SerializedType.Array,
369921
- "value": arg.map(item => serialize(item, depth + 1, maxDepth))
369922
- };
369923
- }
369924
-
369925
- if (type === "object" && arg !== null) {
369926
- const props = {};
369927
- try {
369928
- for (let key in arg) {
369929
- if (arg.hasOwnProperty(key)) {
369930
- props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
369931
- }
369932
- }
369933
- } catch (error) {
369934
- console.error("Error serializing object property:", error);
369935
- }
369936
- return { "type": SerializedType.Object, "value": props };
369937
- }
369938
-
369939
- return { "type": SerializedType.String, "value": String(arg) };
369940
- }
369941
-
369942
- methods.forEach(m => {
369943
- original[m] = console[m] || function(){};
369944
-
369945
- console[m] = function(...args) {
369946
- const timestamp = getTimestamp();
369947
-
369948
- let level = m;
369949
- let serializedArgs = args.map(arg => serialize(arg));
369950
-
369951
- if (m === "assert") {
369952
- const condition = Boolean(args[0]);
369953
- const messageArgs = args.slice(1);
369954
-
369955
- serializedArgs =
369956
- messageArgs.length > 0
369957
- ? messageArgs.map(arg => serialize(arg))
369958
- : [
369959
- {
369960
- "type": "string",
369961
- "value": condition ? "Assertion passed" : "Assertion failed",
369962
- },
369963
- ];
369964
-
369965
- level = condition ? "log" : "error";
369966
- }
369967
-
369968
- window.parent.postMessage({
369969
- "type": "console",
369970
- "method": level,
369971
- "data": serializedArgs,
369972
- "timestamp": timestamp
369973
- }, "*");
369974
-
369975
- original[m](...args);
369976
- };
369977
- });
369978
-
369979
- window.addEventListener("error", function(event) {
369980
- const timestamp = getTimestamp();
369981
- const error = event.error;
369982
-
369983
- let message;
369984
- if (error && error.name && error.message) {
369985
- message = error.name + ": " + error.message;
369986
- } else if (event.message) {
369987
- message = event.message;
369988
- } else {
369989
- message = "Unknown JavaScript error";
369990
- }
369991
-
369992
- let displayFilename = event.filename;
369993
-
369994
- if (
369995
- typeof displayFilename === "string" &&
369996
- displayFilename.startsWith("blob:")
369997
- ) {
369998
- const sourceMap = window.__blobSourceMap__ || {};
369999
- const mappedFilename = sourceMap[displayFilename];
370000
-
370001
- if (mappedFilename) {
370002
- displayFilename = mappedFilename;
370003
- } else {
370004
- const meta = document.querySelector("meta[filename]");
370005
- displayFilename =
370006
- (meta && meta.getAttribute("filename")) || "preview";
370007
- }
370008
- }
370009
-
370010
- const location =
370011
- displayFilename || event.lineno || event.colno
370012
- ? " at " +
370013
- [displayFilename, event.lineno, event.colno]
370014
- .filter(Boolean)
370015
- .join(":")
370016
- : "";
370017
-
370018
- window.parent.postMessage({
370019
- "type": "console",
370020
- "method": "error",
370021
- "data": [
370022
- { "type": "string", "value": message + location }
370023
- ],
370024
- "timestamp": timestamp
370025
- }, "*");
370026
- });
370027
-
370028
- window.addEventListener("unhandledrejection", function(event) {
370029
- const timestamp = getTimestamp();
370030
- const reason = event.reason;
370031
-
370032
- let message;
370033
- if (reason && reason.name && reason.message) {
370034
- message = reason.name + ": " + reason.message;
370035
- } else if (typeof reason === "string") {
370036
- message = "UnhandledPromiseRejection: " + reason;
370037
- } else {
370038
- message = "UnhandledPromiseRejection: " + String(reason);
370039
- }
370040
-
370041
- window.parent.postMessage({
370042
- "type": "console",
370043
- "method": "error",
370044
- "data": [
370045
- { "type": "string", "value": message }
370046
- ],
370047
- "timestamp": timestamp
370048
- }, "*");
370049
- });
370050
- })();
370051
- </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>
370052
370051
  `;
370053
370052
 
370054
370053
 
@@ -371630,7 +371629,7 @@ const Dropdown = (props) => {
371630
371629
  const [isOpen, setOpen] = (0, react_1.useState)(false);
371631
371630
  const buttonRef = (0, react_1.useRef)(null);
371632
371631
  const { hovered, hoverProps } = (0, useHover_1.useHover)();
371633
- 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" }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { anchorRef: buttonRef, menuOptions: menuOptions, opened: isOpen, onClose: () => setOpen(false), align: align, direction: direction, gap: 4 })] }));
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 })] }));
371634
371633
  };
371635
371634
  exports["default"] = Dropdown;
371636
371635
 
@@ -371713,7 +371712,7 @@ const FileTreeActions = ({ hasExpandedNodes, }) => {
371713
371712
  const { hovered: toggleHovered, hoverProps: toggleHoverProps } = (0, useHover_1.useHover)();
371714
371713
  const { hovered: addFolderHovered, hoverProps: addFolderHoverProps } = (0, useHover_1.useHover)();
371715
371714
  const { hovered: addFileHovered, hoverProps: addFileHoverProps } = (0, useHover_1.useHover)();
371716
- 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" })] })) : ((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" })] })), (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" })] }), (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" })] }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles, importFolder: importFolder })] }))] }));
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 })] }))] }));
371717
371716
  };
371718
371717
  exports.FileTreeActions = FileTreeActions;
371719
371718
 
@@ -372569,7 +372568,7 @@ const getSidebarOptions = (initials, homeAction, isCodeVisible) => [
372569
372568
  {
372570
372569
  name: "user",
372571
372570
  buttonText: initials,
372572
- title: "User account",
372571
+ title: "Your Profile",
372573
372572
  position: "bottom",
372574
372573
  },
372575
372574
  ]
@@ -372637,6 +372636,8 @@ const Button_1 = __importDefault(__webpack_require__(79428));
372637
372636
  const classnames_1 = __importDefault(__webpack_require__(46942));
372638
372637
  const styles_module_scss_1 = __importDefault(__webpack_require__(21852));
372639
372638
  const UserMenu_1 = __importDefault(__webpack_require__(2957));
372639
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
372640
+ const useHover_1 = __webpack_require__(78556);
372640
372641
  const backgroundColors = [
372641
372642
  "D7F9F4",
372642
372643
  "43D6B9",
@@ -372651,6 +372652,7 @@ const backgroundColors = [
372651
372652
  ];
372652
372653
  const SidebarBarOption = (props) => {
372653
372654
  const { Icon, isActive, name, title, toggleOption, buttonText, isUser, action, } = props;
372655
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
372654
372656
  const userId = (0, stores_1.useAppSelector)((state) => state.user.userId);
372655
372657
  const isFacilitator = (0, stores_1.useAppSelector)((state) => state.user.isFacilitator);
372656
372658
  const avatarSrc = (0, stores_1.useAppSelector)((state) => state.user.avatarSrc);
@@ -372678,9 +372680,8 @@ const SidebarBarOption = (props) => {
372678
372680
  skipOpenRef.current = true;
372679
372681
  setIsMenuOpen(false);
372680
372682
  };
372681
- 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 && {
372682
- label: `Profile image placeholder displaying the user’s initials`,
372683
- }) })), isUser && ((0, jsx_runtime_1.jsx)(UserMenu_1.default, { anchorRef: buttonRef, opened: isMenuOpen, onClose: handleClose }))] }));
372683
+ const profileTooltip = (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: title ?? "", visible: hovered && !!title, position: "bottom-right", size: "fit" });
372684
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!avatarSrc && isUser ? ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, style: { position: "relative" }, children: [(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" }), profileTooltip] })) : ((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 }), profileTooltip] })), isUser && ((0, jsx_runtime_1.jsx)(UserMenu_1.default, { anchorRef: buttonRef, opened: isMenuOpen, onClose: handleClose }))] }));
372684
372685
  };
372685
372686
  exports["default"] = SidebarBarOption;
372686
372687
 
@@ -373023,8 +373024,11 @@ const remix_svg_1 = __importDefault(__webpack_require__(97950));
373023
373024
  const stores_1 = __webpack_require__(32132);
373024
373025
  const types_2 = __webpack_require__(92932);
373025
373026
  const SpinnerDotted_1 = __webpack_require__(79458);
373027
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
373028
+ const useHover_1 = __webpack_require__(78556);
373026
373029
  const SharedProjectBar = () => {
373027
373030
  const dispatch = (0, react_redux_1.useDispatch)();
373031
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
373028
373032
  const isCodeVisible = (0, stores_1.useAppSelector)((state) => state.editor.isCodeVisible);
373029
373033
  const saving = (0, stores_1.useAppSelector)((state) => state.editor.saving);
373030
373034
  const userId = (0, stores_1.useAppSelector)((state) => state.user.userId);
@@ -373052,7 +373056,7 @@ const SharedProjectBar = () => {
373052
373056
  },
373053
373057
  }));
373054
373058
  };
373055
- 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 }) })] }));
373059
+ 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" })] })] }));
373056
373060
  };
373057
373061
  exports.SharedProjectBar = SharedProjectBar;
373058
373062
 
@@ -373121,7 +373125,7 @@ const ShareButton = (props) => {
373121
373125
  }, [dispatch, shareLinks]);
373122
373126
  const canShare = Boolean(shareLinks);
373123
373127
  const { hovered, hoverProps } = (0, useHover_1.useHover)();
373124
- 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 })] }));
373128
+ 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)(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 })] }));
373125
373129
  };
373126
373130
  exports["default"] = ShareButton;
373127
373131
 
@@ -373264,10 +373268,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
373264
373268
  const jsx_runtime_1 = __webpack_require__(74848);
373265
373269
  const classnames_1 = __importDefault(__webpack_require__(46942));
373266
373270
  const styles_module_scss_1 = __importDefault(__webpack_require__(28188));
373267
- const Tooltip = ({ message, visible = false, position = "bottom", className, style, }) => {
373271
+ const Tooltip = ({ message, visible = false, position = "bottom", size = "default", className, style, }) => {
373268
373272
  if (!visible)
373269
373273
  return null;
373270
- 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 }));
373274
+ 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 }));
373271
373275
  };
373272
373276
  exports["default"] = Tooltip;
373273
373277
 
@@ -373308,7 +373312,7 @@ const WebComponentProject = ({ nameEditable = false, sidebarOptions = [], packag
373308
373312
  return () => clearTimeout(timeout);
373309
373313
  }, [project]);
373310
373314
  renderer.link = function (data) {
373311
- return `<a href="${data.href}" target="_blank" rel="noreferrer"
373315
+ return `<a href="${data.href}" target="_blank" rel="noreferrer"
373312
373316
  }">${data.text}</a>`;
373313
373317
  };
373314
373318
  marked_1.marked.setOptions({
@@ -373539,10 +373543,10 @@ const WebComponentLoader = (props) => {
373539
373543
  (0, react_1.useEffect)(() => {
373540
373544
  // Create a script element to save the existing Prism object if there is one
373541
373545
  const script = document.createElement("script");
373542
- script.textContent = `
373543
- if (window.Prism) {
373544
- window.syntaxHighlight = window.Prism;
373545
- }
373546
+ script.textContent = `
373547
+ if (window.Prism) {
373548
+ window.syntaxHighlight = window.Prism;
373549
+ }
373546
373550
  `;
373547
373551
  // Append the script to the document body
373548
373552
  document.body.appendChild(script);
@@ -384594,7 +384598,7 @@ module.exports = webpackAsyncContext;
384594
384598
  /***/ 24427:
384595
384599
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
384596
384600
 
384597
- module.exports = __webpack_require__.p + "assets/PyodideWorkerb1409749c37aedc47dc8.js";
384601
+ module.exports = __webpack_require__.p + "assets/PyodideWorker5d8b7bf9f06568fe4573.js";
384598
384602
 
384599
384603
  /***/ }),
384600
384604