gwchq-textjam 0.2.7 → 0.2.9
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/LICENSE.txt +202 -202
- package/README.md +266 -266
- package/dist/assets/{PyodideWorker36d2ab735d3886128aa9.js → PyodideWorkerdeabb0560f66f0f43f49.js} +776 -776
- package/dist/assets/{pygalef3b78a56cb1d66beb61.js → pygalc0b4f32d2d2cc5a0c638.js} +495 -495
- package/dist/index.js +2294 -2271
- package/dist/style.css +2 -2
- package/package.json +297 -297
package/dist/index.js
CHANGED
|
@@ -68206,7 +68206,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
68206
68206
|
});
|
|
68207
68207
|
|
|
68208
68208
|
;// ./src/assets/editor/pyodide/shims/pygal.js?url
|
|
68209
|
-
const pygalurl_namespaceObject = __webpack_require__.p + "assets/
|
|
68209
|
+
const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalc0b4f32d2d2cc5a0c638.js";
|
|
68210
68210
|
;// ./src/assets/editor/pyodide/packages/turtle-0.0.1-py3-none-any.whl?url
|
|
68211
68211
|
const turtle_0_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "assets/turtle-0.0.1-py3-none-any0c3147a3e0c3188b2544.whl";
|
|
68212
68212
|
;// ./src/assets/editor/pyodide/packages/p5-0.0.1-py3-none-any.whl?url
|
|
@@ -68344,8 +68344,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68344
68344
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68345
68345
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68346
68346
|
/* harmony export */ });
|
|
68347
|
-
/* harmony import */ var
|
|
68348
|
-
/* harmony import */ var
|
|
68347
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
68348
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
|
|
68349
68349
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68350
68350
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
|
|
68351
68351
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
@@ -68369,7 +68369,7 @@ var DraggableTab = _ref => {
|
|
|
68369
68369
|
panelIndex,
|
|
68370
68370
|
fileIndex
|
|
68371
68371
|
} = _ref,
|
|
68372
|
-
otherProps = (0,
|
|
68372
|
+
otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
|
|
68373
68373
|
var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
|
|
68374
68374
|
var openFilesCount = openFiles[panelIndex].length;
|
|
68375
68375
|
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
@@ -68386,7 +68386,7 @@ var DraggableTab = _ref => {
|
|
|
68386
68386
|
switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
|
|
68387
68387
|
}
|
|
68388
68388
|
};
|
|
68389
|
-
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,
|
|
68389
|
+
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)({
|
|
68390
68390
|
onClick: e => {
|
|
68391
68391
|
e.stopPropagation();
|
|
68392
68392
|
switchToFileTab(panelIndex, fileIndex);
|
|
@@ -68404,7 +68404,7 @@ var DraggableTab = _ref => {
|
|
|
68404
68404
|
draggableProps,
|
|
68405
68405
|
dragHandleProps
|
|
68406
68406
|
} = _ref2;
|
|
68407
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,
|
|
68407
|
+
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)({
|
|
68408
68408
|
className: "draggable-tab",
|
|
68409
68409
|
ref: innerRef
|
|
68410
68410
|
}, draggableProps), dragHandleProps), {}, {
|
|
@@ -68426,8 +68426,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68426
68426
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68427
68427
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68428
68428
|
/* harmony export */ });
|
|
68429
|
-
/* harmony import */ var
|
|
68430
|
-
/* harmony import */ var
|
|
68429
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
|
|
68430
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
|
|
68431
68431
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68432
68432
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
|
|
68433
68433
|
/* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
|
|
@@ -68446,8 +68446,8 @@ var DroppableTabList = _ref => {
|
|
|
68446
68446
|
children: _children,
|
|
68447
68447
|
index
|
|
68448
68448
|
} = _ref,
|
|
68449
|
-
otherProps = (0,
|
|
68450
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,
|
|
68449
|
+
otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
|
|
68450
|
+
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), {}, {
|
|
68451
68451
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
|
|
68452
68452
|
direction: "horizontal",
|
|
68453
68453
|
droppableId: index.toString(),
|
|
@@ -68457,7 +68457,7 @@ var DroppableTabList = _ref => {
|
|
|
68457
68457
|
droppableProps,
|
|
68458
68458
|
placeholder
|
|
68459
68459
|
} = _ref2;
|
|
68460
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,
|
|
68460
|
+
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)({
|
|
68461
68461
|
className: "droppable-tab-list"
|
|
68462
68462
|
}, droppableProps), {}, {
|
|
68463
68463
|
ref: innerRef,
|
|
@@ -102218,8 +102218,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
102218
102218
|
|
|
102219
102219
|
|
|
102220
102220
|
// TODO: refactor existing modals
|
|
102221
|
-
/** !deprecated!
|
|
102222
|
-
* use BaseModal from `index.tsx` instead
|
|
102221
|
+
/** !deprecated!
|
|
102222
|
+
* use BaseModal from `index.tsx` instead
|
|
102223
102223
|
*/
|
|
102224
102224
|
|
|
102225
102225
|
var BaseModal = _ref => {
|
|
@@ -103011,7 +103011,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
103011
103011
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
103012
103012
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
103013
103013
|
/* harmony export */ });
|
|
103014
|
-
/* harmony import */ var
|
|
103014
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
103015
103015
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
103016
103016
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
103017
103017
|
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
|
|
@@ -103091,7 +103091,7 @@ var ProjectName = _ref => {
|
|
|
103091
103091
|
id: "project_name_label",
|
|
103092
103092
|
className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
|
|
103093
103093
|
children: "Project Name"
|
|
103094
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,
|
|
103094
|
+
}), /*#__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)({
|
|
103095
103095
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
|
|
103096
103096
|
}, hoverProps), {}, {
|
|
103097
103097
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
|
|
@@ -116654,6 +116654,115 @@ function escapeName(str, charsToEscape) {
|
|
|
116654
116654
|
|
|
116655
116655
|
|
|
116656
116656
|
|
|
116657
|
+
/***/ }),
|
|
116658
|
+
|
|
116659
|
+
/***/ 16450:
|
|
116660
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
116661
|
+
|
|
116662
|
+
|
|
116663
|
+
|
|
116664
|
+
var isValue = __webpack_require__(48175)
|
|
116665
|
+
, ensureValue = __webpack_require__(34809)
|
|
116666
|
+
, ensurePlainFunction = __webpack_require__(90251)
|
|
116667
|
+
, copy = __webpack_require__(30203)
|
|
116668
|
+
, normalizeOptions = __webpack_require__(90148)
|
|
116669
|
+
, map = __webpack_require__(30498);
|
|
116670
|
+
|
|
116671
|
+
var bind = Function.prototype.bind
|
|
116672
|
+
, defineProperty = Object.defineProperty
|
|
116673
|
+
, hasOwnProperty = Object.prototype.hasOwnProperty
|
|
116674
|
+
, define;
|
|
116675
|
+
|
|
116676
|
+
define = function (name, desc, options) {
|
|
116677
|
+
var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
|
|
116678
|
+
dgs = copy(desc);
|
|
116679
|
+
delete dgs.writable;
|
|
116680
|
+
delete dgs.value;
|
|
116681
|
+
dgs.get = function () {
|
|
116682
|
+
if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
|
|
116683
|
+
desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
|
|
116684
|
+
defineProperty(this, name, desc);
|
|
116685
|
+
return this[name];
|
|
116686
|
+
};
|
|
116687
|
+
return dgs;
|
|
116688
|
+
};
|
|
116689
|
+
|
|
116690
|
+
module.exports = function (props/*, options*/) {
|
|
116691
|
+
var options = normalizeOptions(arguments[1]);
|
|
116692
|
+
if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
|
|
116693
|
+
return map(props, function (desc, name) { return define(name, desc, options); });
|
|
116694
|
+
};
|
|
116695
|
+
|
|
116696
|
+
|
|
116697
|
+
/***/ }),
|
|
116698
|
+
|
|
116699
|
+
/***/ 58263:
|
|
116700
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
116701
|
+
|
|
116702
|
+
|
|
116703
|
+
|
|
116704
|
+
var isValue = __webpack_require__(48175)
|
|
116705
|
+
, isPlainFunction = __webpack_require__(6873)
|
|
116706
|
+
, assign = __webpack_require__(16596)
|
|
116707
|
+
, normalizeOpts = __webpack_require__(90148)
|
|
116708
|
+
, contains = __webpack_require__(70214);
|
|
116709
|
+
|
|
116710
|
+
var d = (module.exports = function (dscr, value/*, options*/) {
|
|
116711
|
+
var c, e, w, options, desc;
|
|
116712
|
+
if (arguments.length < 2 || typeof dscr !== "string") {
|
|
116713
|
+
options = value;
|
|
116714
|
+
value = dscr;
|
|
116715
|
+
dscr = null;
|
|
116716
|
+
} else {
|
|
116717
|
+
options = arguments[2];
|
|
116718
|
+
}
|
|
116719
|
+
if (isValue(dscr)) {
|
|
116720
|
+
c = contains.call(dscr, "c");
|
|
116721
|
+
e = contains.call(dscr, "e");
|
|
116722
|
+
w = contains.call(dscr, "w");
|
|
116723
|
+
} else {
|
|
116724
|
+
c = w = true;
|
|
116725
|
+
e = false;
|
|
116726
|
+
}
|
|
116727
|
+
|
|
116728
|
+
desc = { value: value, configurable: c, enumerable: e, writable: w };
|
|
116729
|
+
return !options ? desc : assign(normalizeOpts(options), desc);
|
|
116730
|
+
});
|
|
116731
|
+
|
|
116732
|
+
d.gs = function (dscr, get, set/*, options*/) {
|
|
116733
|
+
var c, e, options, desc;
|
|
116734
|
+
if (typeof dscr !== "string") {
|
|
116735
|
+
options = set;
|
|
116736
|
+
set = get;
|
|
116737
|
+
get = dscr;
|
|
116738
|
+
dscr = null;
|
|
116739
|
+
} else {
|
|
116740
|
+
options = arguments[3];
|
|
116741
|
+
}
|
|
116742
|
+
if (!isValue(get)) {
|
|
116743
|
+
get = undefined;
|
|
116744
|
+
} else if (!isPlainFunction(get)) {
|
|
116745
|
+
options = get;
|
|
116746
|
+
get = set = undefined;
|
|
116747
|
+
} else if (!isValue(set)) {
|
|
116748
|
+
set = undefined;
|
|
116749
|
+
} else if (!isPlainFunction(set)) {
|
|
116750
|
+
options = set;
|
|
116751
|
+
set = undefined;
|
|
116752
|
+
}
|
|
116753
|
+
if (isValue(dscr)) {
|
|
116754
|
+
c = contains.call(dscr, "c");
|
|
116755
|
+
e = contains.call(dscr, "e");
|
|
116756
|
+
} else {
|
|
116757
|
+
c = true;
|
|
116758
|
+
e = false;
|
|
116759
|
+
}
|
|
116760
|
+
|
|
116761
|
+
desc = { get: get, set: set, configurable: c, enumerable: e };
|
|
116762
|
+
return !options ? desc : assign(normalizeOpts(options), desc);
|
|
116763
|
+
};
|
|
116764
|
+
|
|
116765
|
+
|
|
116657
116766
|
/***/ }),
|
|
116658
116767
|
|
|
116659
116768
|
/***/ 83999:
|
|
@@ -131482,115 +131591,6 @@ year.every = function(k) {
|
|
|
131482
131591
|
var years = year.range;
|
|
131483
131592
|
|
|
131484
131593
|
|
|
131485
|
-
/***/ }),
|
|
131486
|
-
|
|
131487
|
-
/***/ 16450:
|
|
131488
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
131489
|
-
|
|
131490
|
-
|
|
131491
|
-
|
|
131492
|
-
var isValue = __webpack_require__(48175)
|
|
131493
|
-
, ensureValue = __webpack_require__(34809)
|
|
131494
|
-
, ensurePlainFunction = __webpack_require__(90251)
|
|
131495
|
-
, copy = __webpack_require__(30203)
|
|
131496
|
-
, normalizeOptions = __webpack_require__(90148)
|
|
131497
|
-
, map = __webpack_require__(30498);
|
|
131498
|
-
|
|
131499
|
-
var bind = Function.prototype.bind
|
|
131500
|
-
, defineProperty = Object.defineProperty
|
|
131501
|
-
, hasOwnProperty = Object.prototype.hasOwnProperty
|
|
131502
|
-
, define;
|
|
131503
|
-
|
|
131504
|
-
define = function (name, desc, options) {
|
|
131505
|
-
var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
|
|
131506
|
-
dgs = copy(desc);
|
|
131507
|
-
delete dgs.writable;
|
|
131508
|
-
delete dgs.value;
|
|
131509
|
-
dgs.get = function () {
|
|
131510
|
-
if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
|
|
131511
|
-
desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
|
|
131512
|
-
defineProperty(this, name, desc);
|
|
131513
|
-
return this[name];
|
|
131514
|
-
};
|
|
131515
|
-
return dgs;
|
|
131516
|
-
};
|
|
131517
|
-
|
|
131518
|
-
module.exports = function (props/*, options*/) {
|
|
131519
|
-
var options = normalizeOptions(arguments[1]);
|
|
131520
|
-
if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
|
|
131521
|
-
return map(props, function (desc, name) { return define(name, desc, options); });
|
|
131522
|
-
};
|
|
131523
|
-
|
|
131524
|
-
|
|
131525
|
-
/***/ }),
|
|
131526
|
-
|
|
131527
|
-
/***/ 58263:
|
|
131528
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
131529
|
-
|
|
131530
|
-
|
|
131531
|
-
|
|
131532
|
-
var isValue = __webpack_require__(48175)
|
|
131533
|
-
, isPlainFunction = __webpack_require__(6873)
|
|
131534
|
-
, assign = __webpack_require__(16596)
|
|
131535
|
-
, normalizeOpts = __webpack_require__(90148)
|
|
131536
|
-
, contains = __webpack_require__(70214);
|
|
131537
|
-
|
|
131538
|
-
var d = (module.exports = function (dscr, value/*, options*/) {
|
|
131539
|
-
var c, e, w, options, desc;
|
|
131540
|
-
if (arguments.length < 2 || typeof dscr !== "string") {
|
|
131541
|
-
options = value;
|
|
131542
|
-
value = dscr;
|
|
131543
|
-
dscr = null;
|
|
131544
|
-
} else {
|
|
131545
|
-
options = arguments[2];
|
|
131546
|
-
}
|
|
131547
|
-
if (isValue(dscr)) {
|
|
131548
|
-
c = contains.call(dscr, "c");
|
|
131549
|
-
e = contains.call(dscr, "e");
|
|
131550
|
-
w = contains.call(dscr, "w");
|
|
131551
|
-
} else {
|
|
131552
|
-
c = w = true;
|
|
131553
|
-
e = false;
|
|
131554
|
-
}
|
|
131555
|
-
|
|
131556
|
-
desc = { value: value, configurable: c, enumerable: e, writable: w };
|
|
131557
|
-
return !options ? desc : assign(normalizeOpts(options), desc);
|
|
131558
|
-
});
|
|
131559
|
-
|
|
131560
|
-
d.gs = function (dscr, get, set/*, options*/) {
|
|
131561
|
-
var c, e, options, desc;
|
|
131562
|
-
if (typeof dscr !== "string") {
|
|
131563
|
-
options = set;
|
|
131564
|
-
set = get;
|
|
131565
|
-
get = dscr;
|
|
131566
|
-
dscr = null;
|
|
131567
|
-
} else {
|
|
131568
|
-
options = arguments[3];
|
|
131569
|
-
}
|
|
131570
|
-
if (!isValue(get)) {
|
|
131571
|
-
get = undefined;
|
|
131572
|
-
} else if (!isPlainFunction(get)) {
|
|
131573
|
-
options = get;
|
|
131574
|
-
get = set = undefined;
|
|
131575
|
-
} else if (!isValue(set)) {
|
|
131576
|
-
set = undefined;
|
|
131577
|
-
} else if (!isPlainFunction(set)) {
|
|
131578
|
-
options = set;
|
|
131579
|
-
set = undefined;
|
|
131580
|
-
}
|
|
131581
|
-
if (isValue(dscr)) {
|
|
131582
|
-
c = contains.call(dscr, "c");
|
|
131583
|
-
e = contains.call(dscr, "e");
|
|
131584
|
-
} else {
|
|
131585
|
-
c = true;
|
|
131586
|
-
e = false;
|
|
131587
|
-
}
|
|
131588
|
-
|
|
131589
|
-
desc = { get: get, set: set, configurable: c, enumerable: e };
|
|
131590
|
-
return !options ? desc : assign(normalizeOpts(options), desc);
|
|
131591
|
-
};
|
|
131592
|
-
|
|
131593
|
-
|
|
131594
131594
|
/***/ }),
|
|
131595
131595
|
|
|
131596
131596
|
/***/ 30041:
|
|
@@ -142924,7 +142924,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142924
142924
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142925
142925
|
/* harmony export */ });
|
|
142926
142926
|
// extracted by mini-css-extract-plugin
|
|
142927
|
-
/* 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","
|
|
142927
|
+
/* 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","versionDate":"styles-module__versionDate--OLHbO","loadingButton":"styles-module__loadingButton--77kAZ"});
|
|
142928
142928
|
|
|
142929
142929
|
/***/ }),
|
|
142930
142930
|
|
|
@@ -148182,324 +148182,6 @@ function hsl2rgb(hsl) {
|
|
|
148182
148182
|
}
|
|
148183
148183
|
|
|
148184
148184
|
|
|
148185
|
-
/***/ }),
|
|
148186
|
-
|
|
148187
|
-
/***/ 9793:
|
|
148188
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
148189
|
-
|
|
148190
|
-
|
|
148191
|
-
|
|
148192
|
-
var annAttrs = __webpack_require__(84676);
|
|
148193
|
-
var overrideAll = (__webpack_require__(70756).overrideAll);
|
|
148194
|
-
var templatedArray = (__webpack_require__(79338).templatedArray);
|
|
148195
|
-
|
|
148196
|
-
module.exports = overrideAll(templatedArray('annotation', {
|
|
148197
|
-
visible: annAttrs.visible,
|
|
148198
|
-
x: {
|
|
148199
|
-
valType: 'any',
|
|
148200
|
-
description: [
|
|
148201
|
-
'Sets the annotation\'s x position.'
|
|
148202
|
-
].join(' ')
|
|
148203
|
-
},
|
|
148204
|
-
y: {
|
|
148205
|
-
valType: 'any',
|
|
148206
|
-
description: [
|
|
148207
|
-
'Sets the annotation\'s y position.'
|
|
148208
|
-
].join(' ')
|
|
148209
|
-
},
|
|
148210
|
-
z: {
|
|
148211
|
-
valType: 'any',
|
|
148212
|
-
description: [
|
|
148213
|
-
'Sets the annotation\'s z position.'
|
|
148214
|
-
].join(' ')
|
|
148215
|
-
},
|
|
148216
|
-
ax: {
|
|
148217
|
-
valType: 'number',
|
|
148218
|
-
description: [
|
|
148219
|
-
'Sets the x component of the arrow tail about the arrow head (in pixels).'
|
|
148220
|
-
].join(' ')
|
|
148221
|
-
},
|
|
148222
|
-
ay: {
|
|
148223
|
-
valType: 'number',
|
|
148224
|
-
description: [
|
|
148225
|
-
'Sets the y component of the arrow tail about the arrow head (in pixels).'
|
|
148226
|
-
].join(' ')
|
|
148227
|
-
},
|
|
148228
|
-
|
|
148229
|
-
xanchor: annAttrs.xanchor,
|
|
148230
|
-
xshift: annAttrs.xshift,
|
|
148231
|
-
yanchor: annAttrs.yanchor,
|
|
148232
|
-
yshift: annAttrs.yshift,
|
|
148233
|
-
|
|
148234
|
-
text: annAttrs.text,
|
|
148235
|
-
textangle: annAttrs.textangle,
|
|
148236
|
-
font: annAttrs.font,
|
|
148237
|
-
width: annAttrs.width,
|
|
148238
|
-
height: annAttrs.height,
|
|
148239
|
-
opacity: annAttrs.opacity,
|
|
148240
|
-
align: annAttrs.align,
|
|
148241
|
-
valign: annAttrs.valign,
|
|
148242
|
-
bgcolor: annAttrs.bgcolor,
|
|
148243
|
-
bordercolor: annAttrs.bordercolor,
|
|
148244
|
-
borderpad: annAttrs.borderpad,
|
|
148245
|
-
borderwidth: annAttrs.borderwidth,
|
|
148246
|
-
showarrow: annAttrs.showarrow,
|
|
148247
|
-
arrowcolor: annAttrs.arrowcolor,
|
|
148248
|
-
arrowhead: annAttrs.arrowhead,
|
|
148249
|
-
startarrowhead: annAttrs.startarrowhead,
|
|
148250
|
-
arrowside: annAttrs.arrowside,
|
|
148251
|
-
arrowsize: annAttrs.arrowsize,
|
|
148252
|
-
startarrowsize: annAttrs.startarrowsize,
|
|
148253
|
-
arrowwidth: annAttrs.arrowwidth,
|
|
148254
|
-
standoff: annAttrs.standoff,
|
|
148255
|
-
startstandoff: annAttrs.startstandoff,
|
|
148256
|
-
hovertext: annAttrs.hovertext,
|
|
148257
|
-
hoverlabel: annAttrs.hoverlabel,
|
|
148258
|
-
captureevents: annAttrs.captureevents,
|
|
148259
|
-
|
|
148260
|
-
// maybes later?
|
|
148261
|
-
// clicktoshow: annAttrs.clicktoshow,
|
|
148262
|
-
// xclick: annAttrs.xclick,
|
|
148263
|
-
// yclick: annAttrs.yclick,
|
|
148264
|
-
|
|
148265
|
-
// not needed!
|
|
148266
|
-
// axref: 'pixel'
|
|
148267
|
-
// ayref: 'pixel'
|
|
148268
|
-
// xref: 'x'
|
|
148269
|
-
// yref: 'y
|
|
148270
|
-
// zref: 'z'
|
|
148271
|
-
}), 'calc', 'from-root');
|
|
148272
|
-
|
|
148273
|
-
|
|
148274
|
-
/***/ }),
|
|
148275
|
-
|
|
148276
|
-
/***/ 58121:
|
|
148277
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
148278
|
-
|
|
148279
|
-
|
|
148280
|
-
|
|
148281
|
-
var Lib = __webpack_require__(30991);
|
|
148282
|
-
var Axes = __webpack_require__(15076);
|
|
148283
|
-
|
|
148284
|
-
module.exports = function convert(scene) {
|
|
148285
|
-
var fullSceneLayout = scene.fullSceneLayout;
|
|
148286
|
-
var anns = fullSceneLayout.annotations;
|
|
148287
|
-
|
|
148288
|
-
for(var i = 0; i < anns.length; i++) {
|
|
148289
|
-
mockAnnAxes(anns[i], scene);
|
|
148290
|
-
}
|
|
148291
|
-
|
|
148292
|
-
scene.fullLayout._infolayer
|
|
148293
|
-
.selectAll('.annotation-' + scene.id)
|
|
148294
|
-
.remove();
|
|
148295
|
-
};
|
|
148296
|
-
|
|
148297
|
-
function mockAnnAxes(ann, scene) {
|
|
148298
|
-
var fullSceneLayout = scene.fullSceneLayout;
|
|
148299
|
-
var domain = fullSceneLayout.domain;
|
|
148300
|
-
var size = scene.fullLayout._size;
|
|
148301
|
-
|
|
148302
|
-
var base = {
|
|
148303
|
-
// this gets fill in on render
|
|
148304
|
-
pdata: null,
|
|
148305
|
-
|
|
148306
|
-
// to get setConvert to not execute cleanly
|
|
148307
|
-
type: 'linear',
|
|
148308
|
-
|
|
148309
|
-
// don't try to update them on `editable: true`
|
|
148310
|
-
autorange: false,
|
|
148311
|
-
|
|
148312
|
-
// set infinite range so that annotation draw routine
|
|
148313
|
-
// does not try to remove 'outside-range' annotations,
|
|
148314
|
-
// this case is handled in the render loop
|
|
148315
|
-
range: [-Infinity, Infinity]
|
|
148316
|
-
};
|
|
148317
|
-
|
|
148318
|
-
ann._xa = {};
|
|
148319
|
-
Lib.extendFlat(ann._xa, base);
|
|
148320
|
-
Axes.setConvert(ann._xa);
|
|
148321
|
-
ann._xa._offset = size.l + domain.x[0] * size.w;
|
|
148322
|
-
ann._xa.l2p = function() {
|
|
148323
|
-
return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
|
|
148324
|
-
};
|
|
148325
|
-
|
|
148326
|
-
ann._ya = {};
|
|
148327
|
-
Lib.extendFlat(ann._ya, base);
|
|
148328
|
-
Axes.setConvert(ann._ya);
|
|
148329
|
-
ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
|
|
148330
|
-
ann._ya.l2p = function() {
|
|
148331
|
-
return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
|
|
148332
|
-
};
|
|
148333
|
-
}
|
|
148334
|
-
|
|
148335
|
-
|
|
148336
|
-
/***/ }),
|
|
148337
|
-
|
|
148338
|
-
/***/ 41926:
|
|
148339
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
148340
|
-
|
|
148341
|
-
|
|
148342
|
-
|
|
148343
|
-
var Lib = __webpack_require__(30991);
|
|
148344
|
-
var Axes = __webpack_require__(15076);
|
|
148345
|
-
var handleArrayContainerDefaults = __webpack_require__(21238);
|
|
148346
|
-
var handleAnnotationCommonDefaults = __webpack_require__(84081);
|
|
148347
|
-
var attributes = __webpack_require__(9793);
|
|
148348
|
-
|
|
148349
|
-
module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
|
|
148350
|
-
handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
|
|
148351
|
-
name: 'annotations',
|
|
148352
|
-
handleItemDefaults: handleAnnotationDefaults,
|
|
148353
|
-
fullLayout: opts.fullLayout
|
|
148354
|
-
});
|
|
148355
|
-
};
|
|
148356
|
-
|
|
148357
|
-
function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
|
|
148358
|
-
function coerce(attr, dflt) {
|
|
148359
|
-
return Lib.coerce(annIn, annOut, attributes, attr, dflt);
|
|
148360
|
-
}
|
|
148361
|
-
|
|
148362
|
-
function coercePosition(axLetter) {
|
|
148363
|
-
var axName = axLetter + 'axis';
|
|
148364
|
-
|
|
148365
|
-
// mock in such way that getFromId grabs correct 3D axis
|
|
148366
|
-
var gdMock = { _fullLayout: {} };
|
|
148367
|
-
gdMock._fullLayout[axName] = sceneLayout[axName];
|
|
148368
|
-
|
|
148369
|
-
return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
|
|
148370
|
-
}
|
|
148371
|
-
|
|
148372
|
-
|
|
148373
|
-
var visible = coerce('visible');
|
|
148374
|
-
if(!visible) return;
|
|
148375
|
-
|
|
148376
|
-
handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
|
|
148377
|
-
|
|
148378
|
-
coercePosition('x');
|
|
148379
|
-
coercePosition('y');
|
|
148380
|
-
coercePosition('z');
|
|
148381
|
-
|
|
148382
|
-
// if you have one coordinate you should all three
|
|
148383
|
-
Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
|
|
148384
|
-
|
|
148385
|
-
// hard-set here for completeness
|
|
148386
|
-
annOut.xref = 'x';
|
|
148387
|
-
annOut.yref = 'y';
|
|
148388
|
-
annOut.zref = 'z';
|
|
148389
|
-
|
|
148390
|
-
coerce('xanchor');
|
|
148391
|
-
coerce('yanchor');
|
|
148392
|
-
coerce('xshift');
|
|
148393
|
-
coerce('yshift');
|
|
148394
|
-
|
|
148395
|
-
if(annOut.showarrow) {
|
|
148396
|
-
annOut.axref = 'pixel';
|
|
148397
|
-
annOut.ayref = 'pixel';
|
|
148398
|
-
|
|
148399
|
-
// TODO maybe default values should be bigger than the 2D case?
|
|
148400
|
-
coerce('ax', -10);
|
|
148401
|
-
coerce('ay', -30);
|
|
148402
|
-
|
|
148403
|
-
// if you have one part of arrow length you should have both
|
|
148404
|
-
Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
|
|
148405
|
-
}
|
|
148406
|
-
}
|
|
148407
|
-
|
|
148408
|
-
|
|
148409
|
-
/***/ }),
|
|
148410
|
-
|
|
148411
|
-
/***/ 13802:
|
|
148412
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
148413
|
-
|
|
148414
|
-
|
|
148415
|
-
|
|
148416
|
-
var drawRaw = (__webpack_require__(47995).drawRaw);
|
|
148417
|
-
var project = __webpack_require__(51344);
|
|
148418
|
-
var axLetters = ['x', 'y', 'z'];
|
|
148419
|
-
|
|
148420
|
-
module.exports = function draw(scene) {
|
|
148421
|
-
var fullSceneLayout = scene.fullSceneLayout;
|
|
148422
|
-
var dataScale = scene.dataScale;
|
|
148423
|
-
var anns = fullSceneLayout.annotations;
|
|
148424
|
-
|
|
148425
|
-
for(var i = 0; i < anns.length; i++) {
|
|
148426
|
-
var ann = anns[i];
|
|
148427
|
-
var annotationIsOffscreen = false;
|
|
148428
|
-
|
|
148429
|
-
for(var j = 0; j < 3; j++) {
|
|
148430
|
-
var axLetter = axLetters[j];
|
|
148431
|
-
var pos = ann[axLetter];
|
|
148432
|
-
var ax = fullSceneLayout[axLetter + 'axis'];
|
|
148433
|
-
var posFraction = ax.r2fraction(pos);
|
|
148434
|
-
|
|
148435
|
-
if(posFraction < 0 || posFraction > 1) {
|
|
148436
|
-
annotationIsOffscreen = true;
|
|
148437
|
-
break;
|
|
148438
|
-
}
|
|
148439
|
-
}
|
|
148440
|
-
|
|
148441
|
-
if(annotationIsOffscreen) {
|
|
148442
|
-
scene.fullLayout._infolayer
|
|
148443
|
-
.select('.annotation-' + scene.id + '[data-index="' + i + '"]')
|
|
148444
|
-
.remove();
|
|
148445
|
-
} else {
|
|
148446
|
-
ann._pdata = project(scene.glplot.cameraParams, [
|
|
148447
|
-
fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
|
|
148448
|
-
fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
|
|
148449
|
-
fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
|
|
148450
|
-
]);
|
|
148451
|
-
|
|
148452
|
-
drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
|
|
148453
|
-
}
|
|
148454
|
-
}
|
|
148455
|
-
};
|
|
148456
|
-
|
|
148457
|
-
|
|
148458
|
-
/***/ }),
|
|
148459
|
-
|
|
148460
|
-
/***/ 86578:
|
|
148461
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
148462
|
-
|
|
148463
|
-
|
|
148464
|
-
|
|
148465
|
-
var Registry = __webpack_require__(13936);
|
|
148466
|
-
var Lib = __webpack_require__(30991);
|
|
148467
|
-
|
|
148468
|
-
module.exports = {
|
|
148469
|
-
moduleType: 'component',
|
|
148470
|
-
name: 'annotations3d',
|
|
148471
|
-
|
|
148472
|
-
schema: {
|
|
148473
|
-
subplots: {
|
|
148474
|
-
scene: {annotations: __webpack_require__(9793)}
|
|
148475
|
-
}
|
|
148476
|
-
},
|
|
148477
|
-
|
|
148478
|
-
layoutAttributes: __webpack_require__(9793),
|
|
148479
|
-
handleDefaults: __webpack_require__(41926),
|
|
148480
|
-
includeBasePlot: includeGL3D,
|
|
148481
|
-
|
|
148482
|
-
convert: __webpack_require__(58121),
|
|
148483
|
-
draw: __webpack_require__(13802)
|
|
148484
|
-
};
|
|
148485
|
-
|
|
148486
|
-
function includeGL3D(layoutIn, layoutOut) {
|
|
148487
|
-
var GL3D = Registry.subplotsRegistry.gl3d;
|
|
148488
|
-
if(!GL3D) return;
|
|
148489
|
-
|
|
148490
|
-
var attrRegex = GL3D.attrRegex;
|
|
148491
|
-
|
|
148492
|
-
var keys = Object.keys(layoutIn);
|
|
148493
|
-
for(var i = 0; i < keys.length; i++) {
|
|
148494
|
-
var k = keys[i];
|
|
148495
|
-
if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
|
|
148496
|
-
Lib.pushUnique(layoutOut._basePlotModules, GL3D);
|
|
148497
|
-
Lib.pushUnique(layoutOut._subplots.gl3d, k);
|
|
148498
|
-
}
|
|
148499
|
-
}
|
|
148500
|
-
}
|
|
148501
|
-
|
|
148502
|
-
|
|
148503
148185
|
/***/ }),
|
|
148504
148186
|
|
|
148505
148187
|
/***/ 2595:
|
|
@@ -150473,6 +150155,324 @@ module.exports = {
|
|
|
150473
150155
|
};
|
|
150474
150156
|
|
|
150475
150157
|
|
|
150158
|
+
/***/ }),
|
|
150159
|
+
|
|
150160
|
+
/***/ 9793:
|
|
150161
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150162
|
+
|
|
150163
|
+
|
|
150164
|
+
|
|
150165
|
+
var annAttrs = __webpack_require__(84676);
|
|
150166
|
+
var overrideAll = (__webpack_require__(70756).overrideAll);
|
|
150167
|
+
var templatedArray = (__webpack_require__(79338).templatedArray);
|
|
150168
|
+
|
|
150169
|
+
module.exports = overrideAll(templatedArray('annotation', {
|
|
150170
|
+
visible: annAttrs.visible,
|
|
150171
|
+
x: {
|
|
150172
|
+
valType: 'any',
|
|
150173
|
+
description: [
|
|
150174
|
+
'Sets the annotation\'s x position.'
|
|
150175
|
+
].join(' ')
|
|
150176
|
+
},
|
|
150177
|
+
y: {
|
|
150178
|
+
valType: 'any',
|
|
150179
|
+
description: [
|
|
150180
|
+
'Sets the annotation\'s y position.'
|
|
150181
|
+
].join(' ')
|
|
150182
|
+
},
|
|
150183
|
+
z: {
|
|
150184
|
+
valType: 'any',
|
|
150185
|
+
description: [
|
|
150186
|
+
'Sets the annotation\'s z position.'
|
|
150187
|
+
].join(' ')
|
|
150188
|
+
},
|
|
150189
|
+
ax: {
|
|
150190
|
+
valType: 'number',
|
|
150191
|
+
description: [
|
|
150192
|
+
'Sets the x component of the arrow tail about the arrow head (in pixels).'
|
|
150193
|
+
].join(' ')
|
|
150194
|
+
},
|
|
150195
|
+
ay: {
|
|
150196
|
+
valType: 'number',
|
|
150197
|
+
description: [
|
|
150198
|
+
'Sets the y component of the arrow tail about the arrow head (in pixels).'
|
|
150199
|
+
].join(' ')
|
|
150200
|
+
},
|
|
150201
|
+
|
|
150202
|
+
xanchor: annAttrs.xanchor,
|
|
150203
|
+
xshift: annAttrs.xshift,
|
|
150204
|
+
yanchor: annAttrs.yanchor,
|
|
150205
|
+
yshift: annAttrs.yshift,
|
|
150206
|
+
|
|
150207
|
+
text: annAttrs.text,
|
|
150208
|
+
textangle: annAttrs.textangle,
|
|
150209
|
+
font: annAttrs.font,
|
|
150210
|
+
width: annAttrs.width,
|
|
150211
|
+
height: annAttrs.height,
|
|
150212
|
+
opacity: annAttrs.opacity,
|
|
150213
|
+
align: annAttrs.align,
|
|
150214
|
+
valign: annAttrs.valign,
|
|
150215
|
+
bgcolor: annAttrs.bgcolor,
|
|
150216
|
+
bordercolor: annAttrs.bordercolor,
|
|
150217
|
+
borderpad: annAttrs.borderpad,
|
|
150218
|
+
borderwidth: annAttrs.borderwidth,
|
|
150219
|
+
showarrow: annAttrs.showarrow,
|
|
150220
|
+
arrowcolor: annAttrs.arrowcolor,
|
|
150221
|
+
arrowhead: annAttrs.arrowhead,
|
|
150222
|
+
startarrowhead: annAttrs.startarrowhead,
|
|
150223
|
+
arrowside: annAttrs.arrowside,
|
|
150224
|
+
arrowsize: annAttrs.arrowsize,
|
|
150225
|
+
startarrowsize: annAttrs.startarrowsize,
|
|
150226
|
+
arrowwidth: annAttrs.arrowwidth,
|
|
150227
|
+
standoff: annAttrs.standoff,
|
|
150228
|
+
startstandoff: annAttrs.startstandoff,
|
|
150229
|
+
hovertext: annAttrs.hovertext,
|
|
150230
|
+
hoverlabel: annAttrs.hoverlabel,
|
|
150231
|
+
captureevents: annAttrs.captureevents,
|
|
150232
|
+
|
|
150233
|
+
// maybes later?
|
|
150234
|
+
// clicktoshow: annAttrs.clicktoshow,
|
|
150235
|
+
// xclick: annAttrs.xclick,
|
|
150236
|
+
// yclick: annAttrs.yclick,
|
|
150237
|
+
|
|
150238
|
+
// not needed!
|
|
150239
|
+
// axref: 'pixel'
|
|
150240
|
+
// ayref: 'pixel'
|
|
150241
|
+
// xref: 'x'
|
|
150242
|
+
// yref: 'y
|
|
150243
|
+
// zref: 'z'
|
|
150244
|
+
}), 'calc', 'from-root');
|
|
150245
|
+
|
|
150246
|
+
|
|
150247
|
+
/***/ }),
|
|
150248
|
+
|
|
150249
|
+
/***/ 58121:
|
|
150250
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150251
|
+
|
|
150252
|
+
|
|
150253
|
+
|
|
150254
|
+
var Lib = __webpack_require__(30991);
|
|
150255
|
+
var Axes = __webpack_require__(15076);
|
|
150256
|
+
|
|
150257
|
+
module.exports = function convert(scene) {
|
|
150258
|
+
var fullSceneLayout = scene.fullSceneLayout;
|
|
150259
|
+
var anns = fullSceneLayout.annotations;
|
|
150260
|
+
|
|
150261
|
+
for(var i = 0; i < anns.length; i++) {
|
|
150262
|
+
mockAnnAxes(anns[i], scene);
|
|
150263
|
+
}
|
|
150264
|
+
|
|
150265
|
+
scene.fullLayout._infolayer
|
|
150266
|
+
.selectAll('.annotation-' + scene.id)
|
|
150267
|
+
.remove();
|
|
150268
|
+
};
|
|
150269
|
+
|
|
150270
|
+
function mockAnnAxes(ann, scene) {
|
|
150271
|
+
var fullSceneLayout = scene.fullSceneLayout;
|
|
150272
|
+
var domain = fullSceneLayout.domain;
|
|
150273
|
+
var size = scene.fullLayout._size;
|
|
150274
|
+
|
|
150275
|
+
var base = {
|
|
150276
|
+
// this gets fill in on render
|
|
150277
|
+
pdata: null,
|
|
150278
|
+
|
|
150279
|
+
// to get setConvert to not execute cleanly
|
|
150280
|
+
type: 'linear',
|
|
150281
|
+
|
|
150282
|
+
// don't try to update them on `editable: true`
|
|
150283
|
+
autorange: false,
|
|
150284
|
+
|
|
150285
|
+
// set infinite range so that annotation draw routine
|
|
150286
|
+
// does not try to remove 'outside-range' annotations,
|
|
150287
|
+
// this case is handled in the render loop
|
|
150288
|
+
range: [-Infinity, Infinity]
|
|
150289
|
+
};
|
|
150290
|
+
|
|
150291
|
+
ann._xa = {};
|
|
150292
|
+
Lib.extendFlat(ann._xa, base);
|
|
150293
|
+
Axes.setConvert(ann._xa);
|
|
150294
|
+
ann._xa._offset = size.l + domain.x[0] * size.w;
|
|
150295
|
+
ann._xa.l2p = function() {
|
|
150296
|
+
return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
|
|
150297
|
+
};
|
|
150298
|
+
|
|
150299
|
+
ann._ya = {};
|
|
150300
|
+
Lib.extendFlat(ann._ya, base);
|
|
150301
|
+
Axes.setConvert(ann._ya);
|
|
150302
|
+
ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
|
|
150303
|
+
ann._ya.l2p = function() {
|
|
150304
|
+
return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
|
|
150305
|
+
};
|
|
150306
|
+
}
|
|
150307
|
+
|
|
150308
|
+
|
|
150309
|
+
/***/ }),
|
|
150310
|
+
|
|
150311
|
+
/***/ 41926:
|
|
150312
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150313
|
+
|
|
150314
|
+
|
|
150315
|
+
|
|
150316
|
+
var Lib = __webpack_require__(30991);
|
|
150317
|
+
var Axes = __webpack_require__(15076);
|
|
150318
|
+
var handleArrayContainerDefaults = __webpack_require__(21238);
|
|
150319
|
+
var handleAnnotationCommonDefaults = __webpack_require__(84081);
|
|
150320
|
+
var attributes = __webpack_require__(9793);
|
|
150321
|
+
|
|
150322
|
+
module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
|
|
150323
|
+
handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
|
|
150324
|
+
name: 'annotations',
|
|
150325
|
+
handleItemDefaults: handleAnnotationDefaults,
|
|
150326
|
+
fullLayout: opts.fullLayout
|
|
150327
|
+
});
|
|
150328
|
+
};
|
|
150329
|
+
|
|
150330
|
+
function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
|
|
150331
|
+
function coerce(attr, dflt) {
|
|
150332
|
+
return Lib.coerce(annIn, annOut, attributes, attr, dflt);
|
|
150333
|
+
}
|
|
150334
|
+
|
|
150335
|
+
function coercePosition(axLetter) {
|
|
150336
|
+
var axName = axLetter + 'axis';
|
|
150337
|
+
|
|
150338
|
+
// mock in such way that getFromId grabs correct 3D axis
|
|
150339
|
+
var gdMock = { _fullLayout: {} };
|
|
150340
|
+
gdMock._fullLayout[axName] = sceneLayout[axName];
|
|
150341
|
+
|
|
150342
|
+
return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
|
|
150343
|
+
}
|
|
150344
|
+
|
|
150345
|
+
|
|
150346
|
+
var visible = coerce('visible');
|
|
150347
|
+
if(!visible) return;
|
|
150348
|
+
|
|
150349
|
+
handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
|
|
150350
|
+
|
|
150351
|
+
coercePosition('x');
|
|
150352
|
+
coercePosition('y');
|
|
150353
|
+
coercePosition('z');
|
|
150354
|
+
|
|
150355
|
+
// if you have one coordinate you should all three
|
|
150356
|
+
Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
|
|
150357
|
+
|
|
150358
|
+
// hard-set here for completeness
|
|
150359
|
+
annOut.xref = 'x';
|
|
150360
|
+
annOut.yref = 'y';
|
|
150361
|
+
annOut.zref = 'z';
|
|
150362
|
+
|
|
150363
|
+
coerce('xanchor');
|
|
150364
|
+
coerce('yanchor');
|
|
150365
|
+
coerce('xshift');
|
|
150366
|
+
coerce('yshift');
|
|
150367
|
+
|
|
150368
|
+
if(annOut.showarrow) {
|
|
150369
|
+
annOut.axref = 'pixel';
|
|
150370
|
+
annOut.ayref = 'pixel';
|
|
150371
|
+
|
|
150372
|
+
// TODO maybe default values should be bigger than the 2D case?
|
|
150373
|
+
coerce('ax', -10);
|
|
150374
|
+
coerce('ay', -30);
|
|
150375
|
+
|
|
150376
|
+
// if you have one part of arrow length you should have both
|
|
150377
|
+
Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
|
|
150378
|
+
}
|
|
150379
|
+
}
|
|
150380
|
+
|
|
150381
|
+
|
|
150382
|
+
/***/ }),
|
|
150383
|
+
|
|
150384
|
+
/***/ 13802:
|
|
150385
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150386
|
+
|
|
150387
|
+
|
|
150388
|
+
|
|
150389
|
+
var drawRaw = (__webpack_require__(47995).drawRaw);
|
|
150390
|
+
var project = __webpack_require__(51344);
|
|
150391
|
+
var axLetters = ['x', 'y', 'z'];
|
|
150392
|
+
|
|
150393
|
+
module.exports = function draw(scene) {
|
|
150394
|
+
var fullSceneLayout = scene.fullSceneLayout;
|
|
150395
|
+
var dataScale = scene.dataScale;
|
|
150396
|
+
var anns = fullSceneLayout.annotations;
|
|
150397
|
+
|
|
150398
|
+
for(var i = 0; i < anns.length; i++) {
|
|
150399
|
+
var ann = anns[i];
|
|
150400
|
+
var annotationIsOffscreen = false;
|
|
150401
|
+
|
|
150402
|
+
for(var j = 0; j < 3; j++) {
|
|
150403
|
+
var axLetter = axLetters[j];
|
|
150404
|
+
var pos = ann[axLetter];
|
|
150405
|
+
var ax = fullSceneLayout[axLetter + 'axis'];
|
|
150406
|
+
var posFraction = ax.r2fraction(pos);
|
|
150407
|
+
|
|
150408
|
+
if(posFraction < 0 || posFraction > 1) {
|
|
150409
|
+
annotationIsOffscreen = true;
|
|
150410
|
+
break;
|
|
150411
|
+
}
|
|
150412
|
+
}
|
|
150413
|
+
|
|
150414
|
+
if(annotationIsOffscreen) {
|
|
150415
|
+
scene.fullLayout._infolayer
|
|
150416
|
+
.select('.annotation-' + scene.id + '[data-index="' + i + '"]')
|
|
150417
|
+
.remove();
|
|
150418
|
+
} else {
|
|
150419
|
+
ann._pdata = project(scene.glplot.cameraParams, [
|
|
150420
|
+
fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
|
|
150421
|
+
fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
|
|
150422
|
+
fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
|
|
150423
|
+
]);
|
|
150424
|
+
|
|
150425
|
+
drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
|
|
150426
|
+
}
|
|
150427
|
+
}
|
|
150428
|
+
};
|
|
150429
|
+
|
|
150430
|
+
|
|
150431
|
+
/***/ }),
|
|
150432
|
+
|
|
150433
|
+
/***/ 86578:
|
|
150434
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150435
|
+
|
|
150436
|
+
|
|
150437
|
+
|
|
150438
|
+
var Registry = __webpack_require__(13936);
|
|
150439
|
+
var Lib = __webpack_require__(30991);
|
|
150440
|
+
|
|
150441
|
+
module.exports = {
|
|
150442
|
+
moduleType: 'component',
|
|
150443
|
+
name: 'annotations3d',
|
|
150444
|
+
|
|
150445
|
+
schema: {
|
|
150446
|
+
subplots: {
|
|
150447
|
+
scene: {annotations: __webpack_require__(9793)}
|
|
150448
|
+
}
|
|
150449
|
+
},
|
|
150450
|
+
|
|
150451
|
+
layoutAttributes: __webpack_require__(9793),
|
|
150452
|
+
handleDefaults: __webpack_require__(41926),
|
|
150453
|
+
includeBasePlot: includeGL3D,
|
|
150454
|
+
|
|
150455
|
+
convert: __webpack_require__(58121),
|
|
150456
|
+
draw: __webpack_require__(13802)
|
|
150457
|
+
};
|
|
150458
|
+
|
|
150459
|
+
function includeGL3D(layoutIn, layoutOut) {
|
|
150460
|
+
var GL3D = Registry.subplotsRegistry.gl3d;
|
|
150461
|
+
if(!GL3D) return;
|
|
150462
|
+
|
|
150463
|
+
var attrRegex = GL3D.attrRegex;
|
|
150464
|
+
|
|
150465
|
+
var keys = Object.keys(layoutIn);
|
|
150466
|
+
for(var i = 0; i < keys.length; i++) {
|
|
150467
|
+
var k = keys[i];
|
|
150468
|
+
if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
|
|
150469
|
+
Lib.pushUnique(layoutOut._basePlotModules, GL3D);
|
|
150470
|
+
Lib.pushUnique(layoutOut._subplots.gl3d, k);
|
|
150471
|
+
}
|
|
150472
|
+
}
|
|
150473
|
+
}
|
|
150474
|
+
|
|
150475
|
+
|
|
150476
150476
|
/***/ }),
|
|
150477
150477
|
|
|
150478
150478
|
/***/ 27639:
|
|
@@ -248705,595 +248705,6 @@ function isValidZ(z) {
|
|
|
248705
248705
|
}
|
|
248706
248706
|
|
|
248707
248707
|
|
|
248708
|
-
/***/ }),
|
|
248709
|
-
|
|
248710
|
-
/***/ 42124:
|
|
248711
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
248712
|
-
|
|
248713
|
-
|
|
248714
|
-
|
|
248715
|
-
var histogramAttrs = __webpack_require__(71250);
|
|
248716
|
-
var makeBinAttrs = __webpack_require__(9284);
|
|
248717
|
-
var heatmapAttrs = __webpack_require__(68300);
|
|
248718
|
-
var baseAttrs = __webpack_require__(35667);
|
|
248719
|
-
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
248720
|
-
var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
|
|
248721
|
-
var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
|
|
248722
|
-
var colorScaleAttrs = __webpack_require__(17957);
|
|
248723
|
-
|
|
248724
|
-
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
248725
|
-
|
|
248726
|
-
module.exports = extendFlat(
|
|
248727
|
-
{
|
|
248728
|
-
x: histogramAttrs.x,
|
|
248729
|
-
y: histogramAttrs.y,
|
|
248730
|
-
|
|
248731
|
-
z: {
|
|
248732
|
-
valType: 'data_array',
|
|
248733
|
-
editType: 'calc',
|
|
248734
|
-
description: 'Sets the aggregation data.'
|
|
248735
|
-
},
|
|
248736
|
-
marker: {
|
|
248737
|
-
color: {
|
|
248738
|
-
valType: 'data_array',
|
|
248739
|
-
editType: 'calc',
|
|
248740
|
-
description: 'Sets the aggregation data.'
|
|
248741
|
-
},
|
|
248742
|
-
editType: 'calc'
|
|
248743
|
-
},
|
|
248744
|
-
|
|
248745
|
-
histnorm: histogramAttrs.histnorm,
|
|
248746
|
-
histfunc: histogramAttrs.histfunc,
|
|
248747
|
-
nbinsx: histogramAttrs.nbinsx,
|
|
248748
|
-
xbins: makeBinAttrs('x'),
|
|
248749
|
-
nbinsy: histogramAttrs.nbinsy,
|
|
248750
|
-
ybins: makeBinAttrs('y'),
|
|
248751
|
-
autobinx: histogramAttrs.autobinx,
|
|
248752
|
-
autobiny: histogramAttrs.autobiny,
|
|
248753
|
-
|
|
248754
|
-
bingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
248755
|
-
description: [
|
|
248756
|
-
'Set the `xbingroup` and `ybingroup` default prefix',
|
|
248757
|
-
'For example, setting a `bingroup` of *1* on two histogram2d traces',
|
|
248758
|
-
'will make them their x-bins and y-bins match separately.'
|
|
248759
|
-
].join(' ')
|
|
248760
|
-
}),
|
|
248761
|
-
xbingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
248762
|
-
description: [
|
|
248763
|
-
'Set a group of histogram traces which will have compatible x-bin settings.',
|
|
248764
|
-
'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
|
|
248765
|
-
'(on axes of the same axis type) can have compatible x-bin settings.',
|
|
248766
|
-
'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
|
|
248767
|
-
].join(' ')
|
|
248768
|
-
}),
|
|
248769
|
-
ybingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
248770
|
-
description: [
|
|
248771
|
-
'Set a group of histogram traces which will have compatible y-bin settings.',
|
|
248772
|
-
'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
|
|
248773
|
-
'(on axes of the same axis type) can have compatible y-bin settings.',
|
|
248774
|
-
'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
|
|
248775
|
-
].join(' ')
|
|
248776
|
-
}),
|
|
248777
|
-
|
|
248778
|
-
xgap: heatmapAttrs.xgap,
|
|
248779
|
-
ygap: heatmapAttrs.ygap,
|
|
248780
|
-
zsmooth: heatmapAttrs.zsmooth,
|
|
248781
|
-
xhoverformat: axisHoverFormat('x'),
|
|
248782
|
-
yhoverformat: axisHoverFormat('y'),
|
|
248783
|
-
zhoverformat: axisHoverFormat('z', 1),
|
|
248784
|
-
hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
|
|
248785
|
-
texttemplate: texttemplateAttrs({
|
|
248786
|
-
arrayOk: false,
|
|
248787
|
-
editType: 'plot'
|
|
248788
|
-
}, {
|
|
248789
|
-
keys: 'z'
|
|
248790
|
-
}),
|
|
248791
|
-
textfont: heatmapAttrs.textfont,
|
|
248792
|
-
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
|
|
248793
|
-
},
|
|
248794
|
-
colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
|
|
248795
|
-
);
|
|
248796
|
-
|
|
248797
|
-
|
|
248798
|
-
/***/ }),
|
|
248799
|
-
|
|
248800
|
-
/***/ 32492:
|
|
248801
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
248802
|
-
|
|
248803
|
-
|
|
248804
|
-
|
|
248805
|
-
var Lib = __webpack_require__(30991);
|
|
248806
|
-
var Axes = __webpack_require__(15076);
|
|
248807
|
-
|
|
248808
|
-
var binFunctions = __webpack_require__(47260);
|
|
248809
|
-
var normFunctions = __webpack_require__(855);
|
|
248810
|
-
var doAvg = __webpack_require__(26756);
|
|
248811
|
-
var getBinSpanLabelRound = __webpack_require__(41574);
|
|
248812
|
-
var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
|
|
248813
|
-
|
|
248814
|
-
module.exports = function calc(gd, trace) {
|
|
248815
|
-
var xa = Axes.getFromId(gd, trace.xaxis);
|
|
248816
|
-
var ya = Axes.getFromId(gd, trace.yaxis);
|
|
248817
|
-
|
|
248818
|
-
var xcalendar = trace.xcalendar;
|
|
248819
|
-
var ycalendar = trace.ycalendar;
|
|
248820
|
-
var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
|
|
248821
|
-
var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
|
|
248822
|
-
var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
|
|
248823
|
-
var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
|
|
248824
|
-
|
|
248825
|
-
var i, j, n, m;
|
|
248826
|
-
|
|
248827
|
-
// calculate the bins
|
|
248828
|
-
var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
|
|
248829
|
-
var xBinSpec = xBinsAndPos[0];
|
|
248830
|
-
var xPos0 = xBinsAndPos[1];
|
|
248831
|
-
var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
|
|
248832
|
-
var yBinSpec = yBinsAndPos[0];
|
|
248833
|
-
var yPos0 = yBinsAndPos[1];
|
|
248834
|
-
|
|
248835
|
-
var serieslen = trace._length;
|
|
248836
|
-
if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
|
|
248837
|
-
if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
|
|
248838
|
-
|
|
248839
|
-
// make the empty bin array & scale the map
|
|
248840
|
-
var z = [];
|
|
248841
|
-
var onecol = [];
|
|
248842
|
-
var zerocol = [];
|
|
248843
|
-
var nonuniformBinsX = typeof xBinSpec.size === 'string';
|
|
248844
|
-
var nonuniformBinsY = typeof yBinSpec.size === 'string';
|
|
248845
|
-
var xEdges = [];
|
|
248846
|
-
var yEdges = [];
|
|
248847
|
-
var xbins = nonuniformBinsX ? xEdges : xBinSpec;
|
|
248848
|
-
var ybins = nonuniformBinsY ? yEdges : yBinSpec;
|
|
248849
|
-
var total = 0;
|
|
248850
|
-
var counts = [];
|
|
248851
|
-
var inputPoints = [];
|
|
248852
|
-
var norm = trace.histnorm;
|
|
248853
|
-
var func = trace.histfunc;
|
|
248854
|
-
var densitynorm = norm.indexOf('density') !== -1;
|
|
248855
|
-
var extremefunc = func === 'max' || func === 'min';
|
|
248856
|
-
var sizeinit = extremefunc ? null : 0;
|
|
248857
|
-
var binfunc = binFunctions.count;
|
|
248858
|
-
var normfunc = normFunctions[norm];
|
|
248859
|
-
var doavg = false;
|
|
248860
|
-
var xinc = [];
|
|
248861
|
-
var yinc = [];
|
|
248862
|
-
|
|
248863
|
-
// set a binning function other than count?
|
|
248864
|
-
// for binning functions: check first for 'z',
|
|
248865
|
-
// then 'mc' in case we had a colored scatter plot
|
|
248866
|
-
// and want to transfer these colors to the 2D histo
|
|
248867
|
-
// TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
|
|
248868
|
-
var rawCounterData = ('z' in trace) ?
|
|
248869
|
-
trace.z :
|
|
248870
|
-
(('marker' in trace && Array.isArray(trace.marker.color)) ?
|
|
248871
|
-
trace.marker.color : '');
|
|
248872
|
-
if(rawCounterData && func !== 'count') {
|
|
248873
|
-
doavg = func === 'avg';
|
|
248874
|
-
binfunc = binFunctions[func];
|
|
248875
|
-
}
|
|
248876
|
-
|
|
248877
|
-
// decrease end a little in case of rounding errors
|
|
248878
|
-
var xBinSize = xBinSpec.size;
|
|
248879
|
-
var xBinStart = xr2c(xBinSpec.start);
|
|
248880
|
-
var xBinEnd = xr2c(xBinSpec.end) +
|
|
248881
|
-
(xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
|
|
248882
|
-
|
|
248883
|
-
for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
|
|
248884
|
-
onecol.push(sizeinit);
|
|
248885
|
-
xEdges.push(i);
|
|
248886
|
-
if(doavg) zerocol.push(0);
|
|
248887
|
-
}
|
|
248888
|
-
xEdges.push(i);
|
|
248889
|
-
|
|
248890
|
-
var nx = onecol.length;
|
|
248891
|
-
var dx = (i - xBinStart) / nx;
|
|
248892
|
-
var x0 = xc2r(xBinStart + dx / 2);
|
|
248893
|
-
|
|
248894
|
-
var yBinSize = yBinSpec.size;
|
|
248895
|
-
var yBinStart = yr2c(yBinSpec.start);
|
|
248896
|
-
var yBinEnd = yr2c(yBinSpec.end) +
|
|
248897
|
-
(yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
|
|
248898
|
-
|
|
248899
|
-
for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
|
|
248900
|
-
z.push(onecol.slice());
|
|
248901
|
-
yEdges.push(i);
|
|
248902
|
-
var ipCol = new Array(nx);
|
|
248903
|
-
for(j = 0; j < nx; j++) ipCol[j] = [];
|
|
248904
|
-
inputPoints.push(ipCol);
|
|
248905
|
-
if(doavg) counts.push(zerocol.slice());
|
|
248906
|
-
}
|
|
248907
|
-
yEdges.push(i);
|
|
248908
|
-
|
|
248909
|
-
var ny = z.length;
|
|
248910
|
-
var dy = (i - yBinStart) / ny;
|
|
248911
|
-
var y0 = yc2r(yBinStart + dy / 2);
|
|
248912
|
-
|
|
248913
|
-
if(densitynorm) {
|
|
248914
|
-
xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
|
|
248915
|
-
yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
|
|
248916
|
-
}
|
|
248917
|
-
|
|
248918
|
-
// for date axes we need bin bounds to be calcdata. For nonuniform bins
|
|
248919
|
-
// we already have this, but uniform with start/end/size they're still strings.
|
|
248920
|
-
if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
|
|
248921
|
-
if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
|
|
248922
|
-
|
|
248923
|
-
// put data into bins
|
|
248924
|
-
var uniqueValsPerX = true;
|
|
248925
|
-
var uniqueValsPerY = true;
|
|
248926
|
-
var xVals = new Array(nx);
|
|
248927
|
-
var yVals = new Array(ny);
|
|
248928
|
-
var xGapLow = Infinity;
|
|
248929
|
-
var xGapHigh = Infinity;
|
|
248930
|
-
var yGapLow = Infinity;
|
|
248931
|
-
var yGapHigh = Infinity;
|
|
248932
|
-
for(i = 0; i < serieslen; i++) {
|
|
248933
|
-
var xi = xPos0[i];
|
|
248934
|
-
var yi = yPos0[i];
|
|
248935
|
-
n = Lib.findBin(xi, xbins);
|
|
248936
|
-
m = Lib.findBin(yi, ybins);
|
|
248937
|
-
if(n >= 0 && n < nx && m >= 0 && m < ny) {
|
|
248938
|
-
total += binfunc(n, i, z[m], rawCounterData, counts[m]);
|
|
248939
|
-
inputPoints[m][n].push(i);
|
|
248940
|
-
|
|
248941
|
-
if(uniqueValsPerX) {
|
|
248942
|
-
if(xVals[n] === undefined) xVals[n] = xi;
|
|
248943
|
-
else if(xVals[n] !== xi) uniqueValsPerX = false;
|
|
248944
|
-
}
|
|
248945
|
-
if(uniqueValsPerY) {
|
|
248946
|
-
if(yVals[m] === undefined) yVals[m] = yi;
|
|
248947
|
-
else if(yVals[m] !== yi) uniqueValsPerY = false;
|
|
248948
|
-
}
|
|
248949
|
-
|
|
248950
|
-
xGapLow = Math.min(xGapLow, xi - xEdges[n]);
|
|
248951
|
-
xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
|
|
248952
|
-
yGapLow = Math.min(yGapLow, yi - yEdges[m]);
|
|
248953
|
-
yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
|
|
248954
|
-
}
|
|
248955
|
-
}
|
|
248956
|
-
// normalize, if needed
|
|
248957
|
-
if(doavg) {
|
|
248958
|
-
for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
|
|
248959
|
-
}
|
|
248960
|
-
if(normfunc) {
|
|
248961
|
-
for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
|
|
248962
|
-
}
|
|
248963
|
-
|
|
248964
|
-
return {
|
|
248965
|
-
x: xPos0,
|
|
248966
|
-
xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
|
|
248967
|
-
x0: x0,
|
|
248968
|
-
dx: dx,
|
|
248969
|
-
y: yPos0,
|
|
248970
|
-
yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
|
|
248971
|
-
y0: y0,
|
|
248972
|
-
dy: dy,
|
|
248973
|
-
z: z,
|
|
248974
|
-
pts: inputPoints
|
|
248975
|
-
};
|
|
248976
|
-
};
|
|
248977
|
-
|
|
248978
|
-
function makeIncrements(len, bins, dv, nonuniform) {
|
|
248979
|
-
var out = new Array(len);
|
|
248980
|
-
var i;
|
|
248981
|
-
if(nonuniform) {
|
|
248982
|
-
for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
|
|
248983
|
-
} else {
|
|
248984
|
-
var inc = 1 / dv;
|
|
248985
|
-
for(i = 0; i < len; i++) out[i] = inc;
|
|
248986
|
-
}
|
|
248987
|
-
return out;
|
|
248988
|
-
}
|
|
248989
|
-
|
|
248990
|
-
function binsToCalc(r2c, bins) {
|
|
248991
|
-
return {
|
|
248992
|
-
start: r2c(bins.start),
|
|
248993
|
-
end: r2c(bins.end),
|
|
248994
|
-
size: bins.size
|
|
248995
|
-
};
|
|
248996
|
-
}
|
|
248997
|
-
|
|
248998
|
-
function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
|
|
248999
|
-
var i;
|
|
249000
|
-
var len = edges.length - 1;
|
|
249001
|
-
var out = new Array(len);
|
|
249002
|
-
var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
|
|
249003
|
-
|
|
249004
|
-
for(i = 0; i < len; i++) {
|
|
249005
|
-
var v = (uniqueVals || [])[i];
|
|
249006
|
-
out[i] = v === undefined ?
|
|
249007
|
-
[roundFn(edges[i]), roundFn(edges[i + 1], true)] :
|
|
249008
|
-
[v, v];
|
|
249009
|
-
}
|
|
249010
|
-
return out;
|
|
249011
|
-
}
|
|
249012
|
-
|
|
249013
|
-
|
|
249014
|
-
/***/ }),
|
|
249015
|
-
|
|
249016
|
-
/***/ 15611:
|
|
249017
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249018
|
-
|
|
249019
|
-
|
|
249020
|
-
|
|
249021
|
-
var Lib = __webpack_require__(30991);
|
|
249022
|
-
|
|
249023
|
-
var handleSampleDefaults = __webpack_require__(6236);
|
|
249024
|
-
var handleStyleDefaults = __webpack_require__(25157);
|
|
249025
|
-
var colorscaleDefaults = __webpack_require__(13682);
|
|
249026
|
-
var handleHeatmapLabelDefaults = __webpack_require__(52340);
|
|
249027
|
-
var attributes = __webpack_require__(42124);
|
|
249028
|
-
|
|
249029
|
-
|
|
249030
|
-
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
249031
|
-
function coerce(attr, dflt) {
|
|
249032
|
-
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
249033
|
-
}
|
|
249034
|
-
|
|
249035
|
-
handleSampleDefaults(traceIn, traceOut, coerce, layout);
|
|
249036
|
-
if(traceOut.visible === false) return;
|
|
249037
|
-
|
|
249038
|
-
handleStyleDefaults(traceIn, traceOut, coerce, layout);
|
|
249039
|
-
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
|
|
249040
|
-
coerce('hovertemplate');
|
|
249041
|
-
|
|
249042
|
-
handleHeatmapLabelDefaults(coerce, layout);
|
|
249043
|
-
|
|
249044
|
-
coerce('xhoverformat');
|
|
249045
|
-
coerce('yhoverformat');
|
|
249046
|
-
};
|
|
249047
|
-
|
|
249048
|
-
|
|
249049
|
-
/***/ }),
|
|
249050
|
-
|
|
249051
|
-
/***/ 94587:
|
|
249052
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249053
|
-
|
|
249054
|
-
|
|
249055
|
-
|
|
249056
|
-
var heatmapHover = __webpack_require__(85243);
|
|
249057
|
-
var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
|
|
249058
|
-
|
|
249059
|
-
module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
|
|
249060
|
-
var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
|
|
249061
|
-
|
|
249062
|
-
if(!pts) return;
|
|
249063
|
-
|
|
249064
|
-
pointData = pts[0];
|
|
249065
|
-
var indices = pointData.index;
|
|
249066
|
-
var ny = indices[0];
|
|
249067
|
-
var nx = indices[1];
|
|
249068
|
-
var cd0 = pointData.cd[0];
|
|
249069
|
-
var trace = cd0.trace;
|
|
249070
|
-
var xRange = cd0.xRanges[nx];
|
|
249071
|
-
var yRange = cd0.yRanges[ny];
|
|
249072
|
-
|
|
249073
|
-
pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
|
|
249074
|
-
pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
|
|
249075
|
-
|
|
249076
|
-
return pts;
|
|
249077
|
-
};
|
|
249078
|
-
|
|
249079
|
-
|
|
249080
|
-
/***/ }),
|
|
249081
|
-
|
|
249082
|
-
/***/ 3617:
|
|
249083
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249084
|
-
|
|
249085
|
-
|
|
249086
|
-
|
|
249087
|
-
module.exports = {
|
|
249088
|
-
attributes: __webpack_require__(42124),
|
|
249089
|
-
supplyDefaults: __webpack_require__(15611),
|
|
249090
|
-
crossTraceDefaults: __webpack_require__(34294),
|
|
249091
|
-
calc: __webpack_require__(91980),
|
|
249092
|
-
plot: __webpack_require__(29406),
|
|
249093
|
-
layerName: 'heatmaplayer',
|
|
249094
|
-
colorbar: __webpack_require__(90165),
|
|
249095
|
-
style: __webpack_require__(58756),
|
|
249096
|
-
hoverPoints: __webpack_require__(94587),
|
|
249097
|
-
eventData: __webpack_require__(63870),
|
|
249098
|
-
|
|
249099
|
-
moduleType: 'trace',
|
|
249100
|
-
name: 'histogram2d',
|
|
249101
|
-
basePlotModule: __webpack_require__(47885),
|
|
249102
|
-
categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
|
|
249103
|
-
meta: {
|
|
249104
|
-
hrName: 'histogram_2d',
|
|
249105
|
-
description: [
|
|
249106
|
-
'The sample data from which statistics are computed is set in `x`',
|
|
249107
|
-
'and `y` (where `x` and `y` represent marginal distributions,',
|
|
249108
|
-
'binning is set in `xbins` and `ybins` in this case)',
|
|
249109
|
-
'or `z` (where `z` represent the 2D distribution and binning set,',
|
|
249110
|
-
'binning is set by `x` and `y` in this case).',
|
|
249111
|
-
'The resulting distribution is visualized as a heatmap.'
|
|
249112
|
-
].join(' ')
|
|
249113
|
-
}
|
|
249114
|
-
};
|
|
249115
|
-
|
|
249116
|
-
|
|
249117
|
-
/***/ }),
|
|
249118
|
-
|
|
249119
|
-
/***/ 6236:
|
|
249120
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249121
|
-
|
|
249122
|
-
|
|
249123
|
-
|
|
249124
|
-
var Registry = __webpack_require__(13936);
|
|
249125
|
-
var Lib = __webpack_require__(30991);
|
|
249126
|
-
|
|
249127
|
-
module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
|
|
249128
|
-
var x = coerce('x');
|
|
249129
|
-
var y = coerce('y');
|
|
249130
|
-
var xlen = Lib.minRowLength(x);
|
|
249131
|
-
var ylen = Lib.minRowLength(y);
|
|
249132
|
-
|
|
249133
|
-
// we could try to accept x0 and dx, etc...
|
|
249134
|
-
// but that's a pretty weird use case.
|
|
249135
|
-
// for now require both x and y explicitly specified.
|
|
249136
|
-
if(!xlen || !ylen) {
|
|
249137
|
-
traceOut.visible = false;
|
|
249138
|
-
return;
|
|
249139
|
-
}
|
|
249140
|
-
|
|
249141
|
-
traceOut._length = Math.min(xlen, ylen);
|
|
249142
|
-
|
|
249143
|
-
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
|
|
249144
|
-
handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
|
|
249145
|
-
|
|
249146
|
-
// if marker.color is an array, we can use it in aggregation instead of z
|
|
249147
|
-
var hasAggregationData = coerce('z') || coerce('marker.color');
|
|
249148
|
-
|
|
249149
|
-
if(hasAggregationData) coerce('histfunc');
|
|
249150
|
-
coerce('histnorm');
|
|
249151
|
-
|
|
249152
|
-
// Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
|
|
249153
|
-
// autobin(x|y) are only included here to appease Plotly.validate
|
|
249154
|
-
coerce('autobinx');
|
|
249155
|
-
coerce('autobiny');
|
|
249156
|
-
};
|
|
249157
|
-
|
|
249158
|
-
|
|
249159
|
-
/***/ }),
|
|
249160
|
-
|
|
249161
|
-
/***/ 34872:
|
|
249162
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249163
|
-
|
|
249164
|
-
|
|
249165
|
-
|
|
249166
|
-
var histogram2dAttrs = __webpack_require__(42124);
|
|
249167
|
-
var contourAttrs = __webpack_require__(70318);
|
|
249168
|
-
var colorScaleAttrs = __webpack_require__(17957);
|
|
249169
|
-
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
249170
|
-
|
|
249171
|
-
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
249172
|
-
|
|
249173
|
-
module.exports = extendFlat({
|
|
249174
|
-
x: histogram2dAttrs.x,
|
|
249175
|
-
y: histogram2dAttrs.y,
|
|
249176
|
-
z: histogram2dAttrs.z,
|
|
249177
|
-
marker: histogram2dAttrs.marker,
|
|
249178
|
-
|
|
249179
|
-
histnorm: histogram2dAttrs.histnorm,
|
|
249180
|
-
histfunc: histogram2dAttrs.histfunc,
|
|
249181
|
-
nbinsx: histogram2dAttrs.nbinsx,
|
|
249182
|
-
xbins: histogram2dAttrs.xbins,
|
|
249183
|
-
nbinsy: histogram2dAttrs.nbinsy,
|
|
249184
|
-
ybins: histogram2dAttrs.ybins,
|
|
249185
|
-
autobinx: histogram2dAttrs.autobinx,
|
|
249186
|
-
autobiny: histogram2dAttrs.autobiny,
|
|
249187
|
-
|
|
249188
|
-
bingroup: histogram2dAttrs.bingroup,
|
|
249189
|
-
xbingroup: histogram2dAttrs.xbingroup,
|
|
249190
|
-
ybingroup: histogram2dAttrs.ybingroup,
|
|
249191
|
-
|
|
249192
|
-
autocontour: contourAttrs.autocontour,
|
|
249193
|
-
ncontours: contourAttrs.ncontours,
|
|
249194
|
-
contours: contourAttrs.contours,
|
|
249195
|
-
line: {
|
|
249196
|
-
color: contourAttrs.line.color,
|
|
249197
|
-
width: extendFlat({}, contourAttrs.line.width, {
|
|
249198
|
-
dflt: 0.5,
|
|
249199
|
-
description: 'Sets the contour line width in (in px)'
|
|
249200
|
-
}),
|
|
249201
|
-
dash: contourAttrs.line.dash,
|
|
249202
|
-
smoothing: contourAttrs.line.smoothing,
|
|
249203
|
-
editType: 'plot'
|
|
249204
|
-
},
|
|
249205
|
-
xhoverformat: axisHoverFormat('x'),
|
|
249206
|
-
yhoverformat: axisHoverFormat('y'),
|
|
249207
|
-
zhoverformat: axisHoverFormat('z', 1),
|
|
249208
|
-
hovertemplate: histogram2dAttrs.hovertemplate,
|
|
249209
|
-
texttemplate: contourAttrs.texttemplate,
|
|
249210
|
-
textfont: contourAttrs.textfont
|
|
249211
|
-
},
|
|
249212
|
-
colorScaleAttrs('', {
|
|
249213
|
-
cLetter: 'z',
|
|
249214
|
-
editTypeOverride: 'calc'
|
|
249215
|
-
})
|
|
249216
|
-
);
|
|
249217
|
-
|
|
249218
|
-
|
|
249219
|
-
/***/ }),
|
|
249220
|
-
|
|
249221
|
-
/***/ 14319:
|
|
249222
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249223
|
-
|
|
249224
|
-
|
|
249225
|
-
|
|
249226
|
-
var Lib = __webpack_require__(30991);
|
|
249227
|
-
|
|
249228
|
-
var handleSampleDefaults = __webpack_require__(6236);
|
|
249229
|
-
var handleContoursDefaults = __webpack_require__(657);
|
|
249230
|
-
var handleStyleDefaults = __webpack_require__(74619);
|
|
249231
|
-
var handleHeatmapLabelDefaults = __webpack_require__(52340);
|
|
249232
|
-
var attributes = __webpack_require__(34872);
|
|
249233
|
-
|
|
249234
|
-
|
|
249235
|
-
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
249236
|
-
function coerce(attr, dflt) {
|
|
249237
|
-
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
249238
|
-
}
|
|
249239
|
-
|
|
249240
|
-
function coerce2(attr) {
|
|
249241
|
-
return Lib.coerce2(traceIn, traceOut, attributes, attr);
|
|
249242
|
-
}
|
|
249243
|
-
|
|
249244
|
-
handleSampleDefaults(traceIn, traceOut, coerce, layout);
|
|
249245
|
-
if(traceOut.visible === false) return;
|
|
249246
|
-
|
|
249247
|
-
handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
|
|
249248
|
-
handleStyleDefaults(traceIn, traceOut, coerce, layout);
|
|
249249
|
-
coerce('xhoverformat');
|
|
249250
|
-
coerce('yhoverformat');
|
|
249251
|
-
coerce('hovertemplate');
|
|
249252
|
-
if(
|
|
249253
|
-
traceOut.contours &&
|
|
249254
|
-
traceOut.contours.coloring === 'heatmap'
|
|
249255
|
-
) {
|
|
249256
|
-
handleHeatmapLabelDefaults(coerce, layout);
|
|
249257
|
-
}
|
|
249258
|
-
};
|
|
249259
|
-
|
|
249260
|
-
|
|
249261
|
-
/***/ }),
|
|
249262
|
-
|
|
249263
|
-
/***/ 60613:
|
|
249264
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
249265
|
-
|
|
249266
|
-
|
|
249267
|
-
|
|
249268
|
-
module.exports = {
|
|
249269
|
-
attributes: __webpack_require__(34872),
|
|
249270
|
-
supplyDefaults: __webpack_require__(14319),
|
|
249271
|
-
crossTraceDefaults: __webpack_require__(34294),
|
|
249272
|
-
calc: __webpack_require__(3274),
|
|
249273
|
-
plot: (__webpack_require__(32664).plot),
|
|
249274
|
-
layerName: 'contourlayer',
|
|
249275
|
-
style: __webpack_require__(72690),
|
|
249276
|
-
colorbar: __webpack_require__(70307),
|
|
249277
|
-
hoverPoints: __webpack_require__(52353),
|
|
249278
|
-
|
|
249279
|
-
moduleType: 'trace',
|
|
249280
|
-
name: 'histogram2dcontour',
|
|
249281
|
-
basePlotModule: __webpack_require__(47885),
|
|
249282
|
-
categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
|
|
249283
|
-
meta: {
|
|
249284
|
-
hrName: 'histogram_2d_contour',
|
|
249285
|
-
description: [
|
|
249286
|
-
'The sample data from which statistics are computed is set in `x`',
|
|
249287
|
-
'and `y` (where `x` and `y` represent marginal distributions,',
|
|
249288
|
-
'binning is set in `xbins` and `ybins` in this case)',
|
|
249289
|
-
'or `z` (where `z` represent the 2D distribution and binning set,',
|
|
249290
|
-
'binning is set by `x` and `y` in this case).',
|
|
249291
|
-
'The resulting distribution is visualized as a contour plot.'
|
|
249292
|
-
].join(' ')
|
|
249293
|
-
}
|
|
249294
|
-
};
|
|
249295
|
-
|
|
249296
|
-
|
|
249297
248708
|
/***/ }),
|
|
249298
248709
|
|
|
249299
248710
|
/***/ 71250:
|
|
@@ -251002,6 +250413,595 @@ module.exports = {
|
|
|
251002
250413
|
};
|
|
251003
250414
|
|
|
251004
250415
|
|
|
250416
|
+
/***/ }),
|
|
250417
|
+
|
|
250418
|
+
/***/ 42124:
|
|
250419
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250420
|
+
|
|
250421
|
+
|
|
250422
|
+
|
|
250423
|
+
var histogramAttrs = __webpack_require__(71250);
|
|
250424
|
+
var makeBinAttrs = __webpack_require__(9284);
|
|
250425
|
+
var heatmapAttrs = __webpack_require__(68300);
|
|
250426
|
+
var baseAttrs = __webpack_require__(35667);
|
|
250427
|
+
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
250428
|
+
var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
|
|
250429
|
+
var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
|
|
250430
|
+
var colorScaleAttrs = __webpack_require__(17957);
|
|
250431
|
+
|
|
250432
|
+
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
250433
|
+
|
|
250434
|
+
module.exports = extendFlat(
|
|
250435
|
+
{
|
|
250436
|
+
x: histogramAttrs.x,
|
|
250437
|
+
y: histogramAttrs.y,
|
|
250438
|
+
|
|
250439
|
+
z: {
|
|
250440
|
+
valType: 'data_array',
|
|
250441
|
+
editType: 'calc',
|
|
250442
|
+
description: 'Sets the aggregation data.'
|
|
250443
|
+
},
|
|
250444
|
+
marker: {
|
|
250445
|
+
color: {
|
|
250446
|
+
valType: 'data_array',
|
|
250447
|
+
editType: 'calc',
|
|
250448
|
+
description: 'Sets the aggregation data.'
|
|
250449
|
+
},
|
|
250450
|
+
editType: 'calc'
|
|
250451
|
+
},
|
|
250452
|
+
|
|
250453
|
+
histnorm: histogramAttrs.histnorm,
|
|
250454
|
+
histfunc: histogramAttrs.histfunc,
|
|
250455
|
+
nbinsx: histogramAttrs.nbinsx,
|
|
250456
|
+
xbins: makeBinAttrs('x'),
|
|
250457
|
+
nbinsy: histogramAttrs.nbinsy,
|
|
250458
|
+
ybins: makeBinAttrs('y'),
|
|
250459
|
+
autobinx: histogramAttrs.autobinx,
|
|
250460
|
+
autobiny: histogramAttrs.autobiny,
|
|
250461
|
+
|
|
250462
|
+
bingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
250463
|
+
description: [
|
|
250464
|
+
'Set the `xbingroup` and `ybingroup` default prefix',
|
|
250465
|
+
'For example, setting a `bingroup` of *1* on two histogram2d traces',
|
|
250466
|
+
'will make them their x-bins and y-bins match separately.'
|
|
250467
|
+
].join(' ')
|
|
250468
|
+
}),
|
|
250469
|
+
xbingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
250470
|
+
description: [
|
|
250471
|
+
'Set a group of histogram traces which will have compatible x-bin settings.',
|
|
250472
|
+
'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
|
|
250473
|
+
'(on axes of the same axis type) can have compatible x-bin settings.',
|
|
250474
|
+
'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
|
|
250475
|
+
].join(' ')
|
|
250476
|
+
}),
|
|
250477
|
+
ybingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
250478
|
+
description: [
|
|
250479
|
+
'Set a group of histogram traces which will have compatible y-bin settings.',
|
|
250480
|
+
'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
|
|
250481
|
+
'(on axes of the same axis type) can have compatible y-bin settings.',
|
|
250482
|
+
'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
|
|
250483
|
+
].join(' ')
|
|
250484
|
+
}),
|
|
250485
|
+
|
|
250486
|
+
xgap: heatmapAttrs.xgap,
|
|
250487
|
+
ygap: heatmapAttrs.ygap,
|
|
250488
|
+
zsmooth: heatmapAttrs.zsmooth,
|
|
250489
|
+
xhoverformat: axisHoverFormat('x'),
|
|
250490
|
+
yhoverformat: axisHoverFormat('y'),
|
|
250491
|
+
zhoverformat: axisHoverFormat('z', 1),
|
|
250492
|
+
hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
|
|
250493
|
+
texttemplate: texttemplateAttrs({
|
|
250494
|
+
arrayOk: false,
|
|
250495
|
+
editType: 'plot'
|
|
250496
|
+
}, {
|
|
250497
|
+
keys: 'z'
|
|
250498
|
+
}),
|
|
250499
|
+
textfont: heatmapAttrs.textfont,
|
|
250500
|
+
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
|
|
250501
|
+
},
|
|
250502
|
+
colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
|
|
250503
|
+
);
|
|
250504
|
+
|
|
250505
|
+
|
|
250506
|
+
/***/ }),
|
|
250507
|
+
|
|
250508
|
+
/***/ 32492:
|
|
250509
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250510
|
+
|
|
250511
|
+
|
|
250512
|
+
|
|
250513
|
+
var Lib = __webpack_require__(30991);
|
|
250514
|
+
var Axes = __webpack_require__(15076);
|
|
250515
|
+
|
|
250516
|
+
var binFunctions = __webpack_require__(47260);
|
|
250517
|
+
var normFunctions = __webpack_require__(855);
|
|
250518
|
+
var doAvg = __webpack_require__(26756);
|
|
250519
|
+
var getBinSpanLabelRound = __webpack_require__(41574);
|
|
250520
|
+
var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
|
|
250521
|
+
|
|
250522
|
+
module.exports = function calc(gd, trace) {
|
|
250523
|
+
var xa = Axes.getFromId(gd, trace.xaxis);
|
|
250524
|
+
var ya = Axes.getFromId(gd, trace.yaxis);
|
|
250525
|
+
|
|
250526
|
+
var xcalendar = trace.xcalendar;
|
|
250527
|
+
var ycalendar = trace.ycalendar;
|
|
250528
|
+
var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
|
|
250529
|
+
var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
|
|
250530
|
+
var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
|
|
250531
|
+
var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
|
|
250532
|
+
|
|
250533
|
+
var i, j, n, m;
|
|
250534
|
+
|
|
250535
|
+
// calculate the bins
|
|
250536
|
+
var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
|
|
250537
|
+
var xBinSpec = xBinsAndPos[0];
|
|
250538
|
+
var xPos0 = xBinsAndPos[1];
|
|
250539
|
+
var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
|
|
250540
|
+
var yBinSpec = yBinsAndPos[0];
|
|
250541
|
+
var yPos0 = yBinsAndPos[1];
|
|
250542
|
+
|
|
250543
|
+
var serieslen = trace._length;
|
|
250544
|
+
if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
|
|
250545
|
+
if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
|
|
250546
|
+
|
|
250547
|
+
// make the empty bin array & scale the map
|
|
250548
|
+
var z = [];
|
|
250549
|
+
var onecol = [];
|
|
250550
|
+
var zerocol = [];
|
|
250551
|
+
var nonuniformBinsX = typeof xBinSpec.size === 'string';
|
|
250552
|
+
var nonuniformBinsY = typeof yBinSpec.size === 'string';
|
|
250553
|
+
var xEdges = [];
|
|
250554
|
+
var yEdges = [];
|
|
250555
|
+
var xbins = nonuniformBinsX ? xEdges : xBinSpec;
|
|
250556
|
+
var ybins = nonuniformBinsY ? yEdges : yBinSpec;
|
|
250557
|
+
var total = 0;
|
|
250558
|
+
var counts = [];
|
|
250559
|
+
var inputPoints = [];
|
|
250560
|
+
var norm = trace.histnorm;
|
|
250561
|
+
var func = trace.histfunc;
|
|
250562
|
+
var densitynorm = norm.indexOf('density') !== -1;
|
|
250563
|
+
var extremefunc = func === 'max' || func === 'min';
|
|
250564
|
+
var sizeinit = extremefunc ? null : 0;
|
|
250565
|
+
var binfunc = binFunctions.count;
|
|
250566
|
+
var normfunc = normFunctions[norm];
|
|
250567
|
+
var doavg = false;
|
|
250568
|
+
var xinc = [];
|
|
250569
|
+
var yinc = [];
|
|
250570
|
+
|
|
250571
|
+
// set a binning function other than count?
|
|
250572
|
+
// for binning functions: check first for 'z',
|
|
250573
|
+
// then 'mc' in case we had a colored scatter plot
|
|
250574
|
+
// and want to transfer these colors to the 2D histo
|
|
250575
|
+
// TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
|
|
250576
|
+
var rawCounterData = ('z' in trace) ?
|
|
250577
|
+
trace.z :
|
|
250578
|
+
(('marker' in trace && Array.isArray(trace.marker.color)) ?
|
|
250579
|
+
trace.marker.color : '');
|
|
250580
|
+
if(rawCounterData && func !== 'count') {
|
|
250581
|
+
doavg = func === 'avg';
|
|
250582
|
+
binfunc = binFunctions[func];
|
|
250583
|
+
}
|
|
250584
|
+
|
|
250585
|
+
// decrease end a little in case of rounding errors
|
|
250586
|
+
var xBinSize = xBinSpec.size;
|
|
250587
|
+
var xBinStart = xr2c(xBinSpec.start);
|
|
250588
|
+
var xBinEnd = xr2c(xBinSpec.end) +
|
|
250589
|
+
(xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
|
|
250590
|
+
|
|
250591
|
+
for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
|
|
250592
|
+
onecol.push(sizeinit);
|
|
250593
|
+
xEdges.push(i);
|
|
250594
|
+
if(doavg) zerocol.push(0);
|
|
250595
|
+
}
|
|
250596
|
+
xEdges.push(i);
|
|
250597
|
+
|
|
250598
|
+
var nx = onecol.length;
|
|
250599
|
+
var dx = (i - xBinStart) / nx;
|
|
250600
|
+
var x0 = xc2r(xBinStart + dx / 2);
|
|
250601
|
+
|
|
250602
|
+
var yBinSize = yBinSpec.size;
|
|
250603
|
+
var yBinStart = yr2c(yBinSpec.start);
|
|
250604
|
+
var yBinEnd = yr2c(yBinSpec.end) +
|
|
250605
|
+
(yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
|
|
250606
|
+
|
|
250607
|
+
for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
|
|
250608
|
+
z.push(onecol.slice());
|
|
250609
|
+
yEdges.push(i);
|
|
250610
|
+
var ipCol = new Array(nx);
|
|
250611
|
+
for(j = 0; j < nx; j++) ipCol[j] = [];
|
|
250612
|
+
inputPoints.push(ipCol);
|
|
250613
|
+
if(doavg) counts.push(zerocol.slice());
|
|
250614
|
+
}
|
|
250615
|
+
yEdges.push(i);
|
|
250616
|
+
|
|
250617
|
+
var ny = z.length;
|
|
250618
|
+
var dy = (i - yBinStart) / ny;
|
|
250619
|
+
var y0 = yc2r(yBinStart + dy / 2);
|
|
250620
|
+
|
|
250621
|
+
if(densitynorm) {
|
|
250622
|
+
xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
|
|
250623
|
+
yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
|
|
250624
|
+
}
|
|
250625
|
+
|
|
250626
|
+
// for date axes we need bin bounds to be calcdata. For nonuniform bins
|
|
250627
|
+
// we already have this, but uniform with start/end/size they're still strings.
|
|
250628
|
+
if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
|
|
250629
|
+
if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
|
|
250630
|
+
|
|
250631
|
+
// put data into bins
|
|
250632
|
+
var uniqueValsPerX = true;
|
|
250633
|
+
var uniqueValsPerY = true;
|
|
250634
|
+
var xVals = new Array(nx);
|
|
250635
|
+
var yVals = new Array(ny);
|
|
250636
|
+
var xGapLow = Infinity;
|
|
250637
|
+
var xGapHigh = Infinity;
|
|
250638
|
+
var yGapLow = Infinity;
|
|
250639
|
+
var yGapHigh = Infinity;
|
|
250640
|
+
for(i = 0; i < serieslen; i++) {
|
|
250641
|
+
var xi = xPos0[i];
|
|
250642
|
+
var yi = yPos0[i];
|
|
250643
|
+
n = Lib.findBin(xi, xbins);
|
|
250644
|
+
m = Lib.findBin(yi, ybins);
|
|
250645
|
+
if(n >= 0 && n < nx && m >= 0 && m < ny) {
|
|
250646
|
+
total += binfunc(n, i, z[m], rawCounterData, counts[m]);
|
|
250647
|
+
inputPoints[m][n].push(i);
|
|
250648
|
+
|
|
250649
|
+
if(uniqueValsPerX) {
|
|
250650
|
+
if(xVals[n] === undefined) xVals[n] = xi;
|
|
250651
|
+
else if(xVals[n] !== xi) uniqueValsPerX = false;
|
|
250652
|
+
}
|
|
250653
|
+
if(uniqueValsPerY) {
|
|
250654
|
+
if(yVals[m] === undefined) yVals[m] = yi;
|
|
250655
|
+
else if(yVals[m] !== yi) uniqueValsPerY = false;
|
|
250656
|
+
}
|
|
250657
|
+
|
|
250658
|
+
xGapLow = Math.min(xGapLow, xi - xEdges[n]);
|
|
250659
|
+
xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
|
|
250660
|
+
yGapLow = Math.min(yGapLow, yi - yEdges[m]);
|
|
250661
|
+
yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
|
|
250662
|
+
}
|
|
250663
|
+
}
|
|
250664
|
+
// normalize, if needed
|
|
250665
|
+
if(doavg) {
|
|
250666
|
+
for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
|
|
250667
|
+
}
|
|
250668
|
+
if(normfunc) {
|
|
250669
|
+
for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
|
|
250670
|
+
}
|
|
250671
|
+
|
|
250672
|
+
return {
|
|
250673
|
+
x: xPos0,
|
|
250674
|
+
xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
|
|
250675
|
+
x0: x0,
|
|
250676
|
+
dx: dx,
|
|
250677
|
+
y: yPos0,
|
|
250678
|
+
yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
|
|
250679
|
+
y0: y0,
|
|
250680
|
+
dy: dy,
|
|
250681
|
+
z: z,
|
|
250682
|
+
pts: inputPoints
|
|
250683
|
+
};
|
|
250684
|
+
};
|
|
250685
|
+
|
|
250686
|
+
function makeIncrements(len, bins, dv, nonuniform) {
|
|
250687
|
+
var out = new Array(len);
|
|
250688
|
+
var i;
|
|
250689
|
+
if(nonuniform) {
|
|
250690
|
+
for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
|
|
250691
|
+
} else {
|
|
250692
|
+
var inc = 1 / dv;
|
|
250693
|
+
for(i = 0; i < len; i++) out[i] = inc;
|
|
250694
|
+
}
|
|
250695
|
+
return out;
|
|
250696
|
+
}
|
|
250697
|
+
|
|
250698
|
+
function binsToCalc(r2c, bins) {
|
|
250699
|
+
return {
|
|
250700
|
+
start: r2c(bins.start),
|
|
250701
|
+
end: r2c(bins.end),
|
|
250702
|
+
size: bins.size
|
|
250703
|
+
};
|
|
250704
|
+
}
|
|
250705
|
+
|
|
250706
|
+
function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
|
|
250707
|
+
var i;
|
|
250708
|
+
var len = edges.length - 1;
|
|
250709
|
+
var out = new Array(len);
|
|
250710
|
+
var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
|
|
250711
|
+
|
|
250712
|
+
for(i = 0; i < len; i++) {
|
|
250713
|
+
var v = (uniqueVals || [])[i];
|
|
250714
|
+
out[i] = v === undefined ?
|
|
250715
|
+
[roundFn(edges[i]), roundFn(edges[i + 1], true)] :
|
|
250716
|
+
[v, v];
|
|
250717
|
+
}
|
|
250718
|
+
return out;
|
|
250719
|
+
}
|
|
250720
|
+
|
|
250721
|
+
|
|
250722
|
+
/***/ }),
|
|
250723
|
+
|
|
250724
|
+
/***/ 15611:
|
|
250725
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250726
|
+
|
|
250727
|
+
|
|
250728
|
+
|
|
250729
|
+
var Lib = __webpack_require__(30991);
|
|
250730
|
+
|
|
250731
|
+
var handleSampleDefaults = __webpack_require__(6236);
|
|
250732
|
+
var handleStyleDefaults = __webpack_require__(25157);
|
|
250733
|
+
var colorscaleDefaults = __webpack_require__(13682);
|
|
250734
|
+
var handleHeatmapLabelDefaults = __webpack_require__(52340);
|
|
250735
|
+
var attributes = __webpack_require__(42124);
|
|
250736
|
+
|
|
250737
|
+
|
|
250738
|
+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
250739
|
+
function coerce(attr, dflt) {
|
|
250740
|
+
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
250741
|
+
}
|
|
250742
|
+
|
|
250743
|
+
handleSampleDefaults(traceIn, traceOut, coerce, layout);
|
|
250744
|
+
if(traceOut.visible === false) return;
|
|
250745
|
+
|
|
250746
|
+
handleStyleDefaults(traceIn, traceOut, coerce, layout);
|
|
250747
|
+
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
|
|
250748
|
+
coerce('hovertemplate');
|
|
250749
|
+
|
|
250750
|
+
handleHeatmapLabelDefaults(coerce, layout);
|
|
250751
|
+
|
|
250752
|
+
coerce('xhoverformat');
|
|
250753
|
+
coerce('yhoverformat');
|
|
250754
|
+
};
|
|
250755
|
+
|
|
250756
|
+
|
|
250757
|
+
/***/ }),
|
|
250758
|
+
|
|
250759
|
+
/***/ 94587:
|
|
250760
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250761
|
+
|
|
250762
|
+
|
|
250763
|
+
|
|
250764
|
+
var heatmapHover = __webpack_require__(85243);
|
|
250765
|
+
var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
|
|
250766
|
+
|
|
250767
|
+
module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
|
|
250768
|
+
var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
|
|
250769
|
+
|
|
250770
|
+
if(!pts) return;
|
|
250771
|
+
|
|
250772
|
+
pointData = pts[0];
|
|
250773
|
+
var indices = pointData.index;
|
|
250774
|
+
var ny = indices[0];
|
|
250775
|
+
var nx = indices[1];
|
|
250776
|
+
var cd0 = pointData.cd[0];
|
|
250777
|
+
var trace = cd0.trace;
|
|
250778
|
+
var xRange = cd0.xRanges[nx];
|
|
250779
|
+
var yRange = cd0.yRanges[ny];
|
|
250780
|
+
|
|
250781
|
+
pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
|
|
250782
|
+
pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
|
|
250783
|
+
|
|
250784
|
+
return pts;
|
|
250785
|
+
};
|
|
250786
|
+
|
|
250787
|
+
|
|
250788
|
+
/***/ }),
|
|
250789
|
+
|
|
250790
|
+
/***/ 3617:
|
|
250791
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250792
|
+
|
|
250793
|
+
|
|
250794
|
+
|
|
250795
|
+
module.exports = {
|
|
250796
|
+
attributes: __webpack_require__(42124),
|
|
250797
|
+
supplyDefaults: __webpack_require__(15611),
|
|
250798
|
+
crossTraceDefaults: __webpack_require__(34294),
|
|
250799
|
+
calc: __webpack_require__(91980),
|
|
250800
|
+
plot: __webpack_require__(29406),
|
|
250801
|
+
layerName: 'heatmaplayer',
|
|
250802
|
+
colorbar: __webpack_require__(90165),
|
|
250803
|
+
style: __webpack_require__(58756),
|
|
250804
|
+
hoverPoints: __webpack_require__(94587),
|
|
250805
|
+
eventData: __webpack_require__(63870),
|
|
250806
|
+
|
|
250807
|
+
moduleType: 'trace',
|
|
250808
|
+
name: 'histogram2d',
|
|
250809
|
+
basePlotModule: __webpack_require__(47885),
|
|
250810
|
+
categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
|
|
250811
|
+
meta: {
|
|
250812
|
+
hrName: 'histogram_2d',
|
|
250813
|
+
description: [
|
|
250814
|
+
'The sample data from which statistics are computed is set in `x`',
|
|
250815
|
+
'and `y` (where `x` and `y` represent marginal distributions,',
|
|
250816
|
+
'binning is set in `xbins` and `ybins` in this case)',
|
|
250817
|
+
'or `z` (where `z` represent the 2D distribution and binning set,',
|
|
250818
|
+
'binning is set by `x` and `y` in this case).',
|
|
250819
|
+
'The resulting distribution is visualized as a heatmap.'
|
|
250820
|
+
].join(' ')
|
|
250821
|
+
}
|
|
250822
|
+
};
|
|
250823
|
+
|
|
250824
|
+
|
|
250825
|
+
/***/ }),
|
|
250826
|
+
|
|
250827
|
+
/***/ 6236:
|
|
250828
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250829
|
+
|
|
250830
|
+
|
|
250831
|
+
|
|
250832
|
+
var Registry = __webpack_require__(13936);
|
|
250833
|
+
var Lib = __webpack_require__(30991);
|
|
250834
|
+
|
|
250835
|
+
module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
|
|
250836
|
+
var x = coerce('x');
|
|
250837
|
+
var y = coerce('y');
|
|
250838
|
+
var xlen = Lib.minRowLength(x);
|
|
250839
|
+
var ylen = Lib.minRowLength(y);
|
|
250840
|
+
|
|
250841
|
+
// we could try to accept x0 and dx, etc...
|
|
250842
|
+
// but that's a pretty weird use case.
|
|
250843
|
+
// for now require both x and y explicitly specified.
|
|
250844
|
+
if(!xlen || !ylen) {
|
|
250845
|
+
traceOut.visible = false;
|
|
250846
|
+
return;
|
|
250847
|
+
}
|
|
250848
|
+
|
|
250849
|
+
traceOut._length = Math.min(xlen, ylen);
|
|
250850
|
+
|
|
250851
|
+
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
|
|
250852
|
+
handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
|
|
250853
|
+
|
|
250854
|
+
// if marker.color is an array, we can use it in aggregation instead of z
|
|
250855
|
+
var hasAggregationData = coerce('z') || coerce('marker.color');
|
|
250856
|
+
|
|
250857
|
+
if(hasAggregationData) coerce('histfunc');
|
|
250858
|
+
coerce('histnorm');
|
|
250859
|
+
|
|
250860
|
+
// Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
|
|
250861
|
+
// autobin(x|y) are only included here to appease Plotly.validate
|
|
250862
|
+
coerce('autobinx');
|
|
250863
|
+
coerce('autobiny');
|
|
250864
|
+
};
|
|
250865
|
+
|
|
250866
|
+
|
|
250867
|
+
/***/ }),
|
|
250868
|
+
|
|
250869
|
+
/***/ 34872:
|
|
250870
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250871
|
+
|
|
250872
|
+
|
|
250873
|
+
|
|
250874
|
+
var histogram2dAttrs = __webpack_require__(42124);
|
|
250875
|
+
var contourAttrs = __webpack_require__(70318);
|
|
250876
|
+
var colorScaleAttrs = __webpack_require__(17957);
|
|
250877
|
+
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
250878
|
+
|
|
250879
|
+
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
250880
|
+
|
|
250881
|
+
module.exports = extendFlat({
|
|
250882
|
+
x: histogram2dAttrs.x,
|
|
250883
|
+
y: histogram2dAttrs.y,
|
|
250884
|
+
z: histogram2dAttrs.z,
|
|
250885
|
+
marker: histogram2dAttrs.marker,
|
|
250886
|
+
|
|
250887
|
+
histnorm: histogram2dAttrs.histnorm,
|
|
250888
|
+
histfunc: histogram2dAttrs.histfunc,
|
|
250889
|
+
nbinsx: histogram2dAttrs.nbinsx,
|
|
250890
|
+
xbins: histogram2dAttrs.xbins,
|
|
250891
|
+
nbinsy: histogram2dAttrs.nbinsy,
|
|
250892
|
+
ybins: histogram2dAttrs.ybins,
|
|
250893
|
+
autobinx: histogram2dAttrs.autobinx,
|
|
250894
|
+
autobiny: histogram2dAttrs.autobiny,
|
|
250895
|
+
|
|
250896
|
+
bingroup: histogram2dAttrs.bingroup,
|
|
250897
|
+
xbingroup: histogram2dAttrs.xbingroup,
|
|
250898
|
+
ybingroup: histogram2dAttrs.ybingroup,
|
|
250899
|
+
|
|
250900
|
+
autocontour: contourAttrs.autocontour,
|
|
250901
|
+
ncontours: contourAttrs.ncontours,
|
|
250902
|
+
contours: contourAttrs.contours,
|
|
250903
|
+
line: {
|
|
250904
|
+
color: contourAttrs.line.color,
|
|
250905
|
+
width: extendFlat({}, contourAttrs.line.width, {
|
|
250906
|
+
dflt: 0.5,
|
|
250907
|
+
description: 'Sets the contour line width in (in px)'
|
|
250908
|
+
}),
|
|
250909
|
+
dash: contourAttrs.line.dash,
|
|
250910
|
+
smoothing: contourAttrs.line.smoothing,
|
|
250911
|
+
editType: 'plot'
|
|
250912
|
+
},
|
|
250913
|
+
xhoverformat: axisHoverFormat('x'),
|
|
250914
|
+
yhoverformat: axisHoverFormat('y'),
|
|
250915
|
+
zhoverformat: axisHoverFormat('z', 1),
|
|
250916
|
+
hovertemplate: histogram2dAttrs.hovertemplate,
|
|
250917
|
+
texttemplate: contourAttrs.texttemplate,
|
|
250918
|
+
textfont: contourAttrs.textfont
|
|
250919
|
+
},
|
|
250920
|
+
colorScaleAttrs('', {
|
|
250921
|
+
cLetter: 'z',
|
|
250922
|
+
editTypeOverride: 'calc'
|
|
250923
|
+
})
|
|
250924
|
+
);
|
|
250925
|
+
|
|
250926
|
+
|
|
250927
|
+
/***/ }),
|
|
250928
|
+
|
|
250929
|
+
/***/ 14319:
|
|
250930
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250931
|
+
|
|
250932
|
+
|
|
250933
|
+
|
|
250934
|
+
var Lib = __webpack_require__(30991);
|
|
250935
|
+
|
|
250936
|
+
var handleSampleDefaults = __webpack_require__(6236);
|
|
250937
|
+
var handleContoursDefaults = __webpack_require__(657);
|
|
250938
|
+
var handleStyleDefaults = __webpack_require__(74619);
|
|
250939
|
+
var handleHeatmapLabelDefaults = __webpack_require__(52340);
|
|
250940
|
+
var attributes = __webpack_require__(34872);
|
|
250941
|
+
|
|
250942
|
+
|
|
250943
|
+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
250944
|
+
function coerce(attr, dflt) {
|
|
250945
|
+
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
250946
|
+
}
|
|
250947
|
+
|
|
250948
|
+
function coerce2(attr) {
|
|
250949
|
+
return Lib.coerce2(traceIn, traceOut, attributes, attr);
|
|
250950
|
+
}
|
|
250951
|
+
|
|
250952
|
+
handleSampleDefaults(traceIn, traceOut, coerce, layout);
|
|
250953
|
+
if(traceOut.visible === false) return;
|
|
250954
|
+
|
|
250955
|
+
handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
|
|
250956
|
+
handleStyleDefaults(traceIn, traceOut, coerce, layout);
|
|
250957
|
+
coerce('xhoverformat');
|
|
250958
|
+
coerce('yhoverformat');
|
|
250959
|
+
coerce('hovertemplate');
|
|
250960
|
+
if(
|
|
250961
|
+
traceOut.contours &&
|
|
250962
|
+
traceOut.contours.coloring === 'heatmap'
|
|
250963
|
+
) {
|
|
250964
|
+
handleHeatmapLabelDefaults(coerce, layout);
|
|
250965
|
+
}
|
|
250966
|
+
};
|
|
250967
|
+
|
|
250968
|
+
|
|
250969
|
+
/***/ }),
|
|
250970
|
+
|
|
250971
|
+
/***/ 60613:
|
|
250972
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250973
|
+
|
|
250974
|
+
|
|
250975
|
+
|
|
250976
|
+
module.exports = {
|
|
250977
|
+
attributes: __webpack_require__(34872),
|
|
250978
|
+
supplyDefaults: __webpack_require__(14319),
|
|
250979
|
+
crossTraceDefaults: __webpack_require__(34294),
|
|
250980
|
+
calc: __webpack_require__(3274),
|
|
250981
|
+
plot: (__webpack_require__(32664).plot),
|
|
250982
|
+
layerName: 'contourlayer',
|
|
250983
|
+
style: __webpack_require__(72690),
|
|
250984
|
+
colorbar: __webpack_require__(70307),
|
|
250985
|
+
hoverPoints: __webpack_require__(52353),
|
|
250986
|
+
|
|
250987
|
+
moduleType: 'trace',
|
|
250988
|
+
name: 'histogram2dcontour',
|
|
250989
|
+
basePlotModule: __webpack_require__(47885),
|
|
250990
|
+
categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
|
|
250991
|
+
meta: {
|
|
250992
|
+
hrName: 'histogram_2d_contour',
|
|
250993
|
+
description: [
|
|
250994
|
+
'The sample data from which statistics are computed is set in `x`',
|
|
250995
|
+
'and `y` (where `x` and `y` represent marginal distributions,',
|
|
250996
|
+
'binning is set in `xbins` and `ybins` in this case)',
|
|
250997
|
+
'or `z` (where `z` represent the 2D distribution and binning set,',
|
|
250998
|
+
'binning is set by `x` and `y` in this case).',
|
|
250999
|
+
'The resulting distribution is visualized as a contour plot.'
|
|
251000
|
+
].join(' ')
|
|
251001
|
+
}
|
|
251002
|
+
};
|
|
251003
|
+
|
|
251004
|
+
|
|
251005
251005
|
/***/ }),
|
|
251006
251006
|
|
|
251007
251007
|
/***/ 48223:
|
|
@@ -267191,993 +267191,6 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
|
|
|
267191
267191
|
};
|
|
267192
267192
|
|
|
267193
267193
|
|
|
267194
|
-
/***/ }),
|
|
267195
|
-
|
|
267196
|
-
/***/ 1015:
|
|
267197
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
267198
|
-
|
|
267199
|
-
|
|
267200
|
-
|
|
267201
|
-
var scatterAttrs = __webpack_require__(86854);
|
|
267202
|
-
var fontAttrs = __webpack_require__(70827);
|
|
267203
|
-
var colorAttributes = __webpack_require__(17957);
|
|
267204
|
-
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
267205
|
-
var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
|
|
267206
|
-
var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
|
|
267207
|
-
var baseAttrs = __webpack_require__(35667);
|
|
267208
|
-
var DASHES = __webpack_require__(68828);
|
|
267209
|
-
|
|
267210
|
-
var MARKER_SYMBOLS = __webpack_require__(98993);
|
|
267211
|
-
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
267212
|
-
var overrideAll = (__webpack_require__(70756).overrideAll);
|
|
267213
|
-
var sortObjectKeys = __webpack_require__(99124);
|
|
267214
|
-
|
|
267215
|
-
var scatterLineAttrs = scatterAttrs.line;
|
|
267216
|
-
var scatterMarkerAttrs = scatterAttrs.marker;
|
|
267217
|
-
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
|
|
267218
|
-
|
|
267219
|
-
var lineAttrs = extendFlat({
|
|
267220
|
-
width: scatterLineAttrs.width,
|
|
267221
|
-
dash: {
|
|
267222
|
-
valType: 'enumerated',
|
|
267223
|
-
values: sortObjectKeys(DASHES),
|
|
267224
|
-
dflt: 'solid',
|
|
267225
|
-
description: 'Sets the dash style of the lines.'
|
|
267226
|
-
}
|
|
267227
|
-
}, colorAttributes('line'));
|
|
267228
|
-
|
|
267229
|
-
function makeProjectionAttr(axLetter) {
|
|
267230
|
-
return {
|
|
267231
|
-
show: {
|
|
267232
|
-
valType: 'boolean',
|
|
267233
|
-
dflt: false,
|
|
267234
|
-
description: [
|
|
267235
|
-
'Sets whether or not projections are shown along the',
|
|
267236
|
-
axLetter, 'axis.'
|
|
267237
|
-
].join(' ')
|
|
267238
|
-
},
|
|
267239
|
-
opacity: {
|
|
267240
|
-
valType: 'number',
|
|
267241
|
-
min: 0,
|
|
267242
|
-
max: 1,
|
|
267243
|
-
dflt: 1,
|
|
267244
|
-
description: 'Sets the projection color.'
|
|
267245
|
-
},
|
|
267246
|
-
scale: {
|
|
267247
|
-
valType: 'number',
|
|
267248
|
-
min: 0,
|
|
267249
|
-
max: 10,
|
|
267250
|
-
dflt: 2 / 3,
|
|
267251
|
-
description: [
|
|
267252
|
-
'Sets the scale factor determining the size of the',
|
|
267253
|
-
'projection marker points.'
|
|
267254
|
-
].join(' ')
|
|
267255
|
-
}
|
|
267256
|
-
};
|
|
267257
|
-
}
|
|
267258
|
-
|
|
267259
|
-
var attrs = module.exports = overrideAll({
|
|
267260
|
-
x: scatterAttrs.x,
|
|
267261
|
-
y: scatterAttrs.y,
|
|
267262
|
-
z: {
|
|
267263
|
-
valType: 'data_array',
|
|
267264
|
-
description: 'Sets the z coordinates.'
|
|
267265
|
-
},
|
|
267266
|
-
|
|
267267
|
-
text: extendFlat({}, scatterAttrs.text, {
|
|
267268
|
-
description: [
|
|
267269
|
-
'Sets text elements associated with each (x,y,z) triplet.',
|
|
267270
|
-
'If a single string, the same string appears over',
|
|
267271
|
-
'all the data points.',
|
|
267272
|
-
'If an array of string, the items are mapped in order to the',
|
|
267273
|
-
'this trace\'s (x,y,z) coordinates.',
|
|
267274
|
-
'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
|
|
267275
|
-
'these elements will be seen in the hover labels.'
|
|
267276
|
-
].join(' ')
|
|
267277
|
-
}),
|
|
267278
|
-
texttemplate: texttemplateAttrs({}, {
|
|
267279
|
-
|
|
267280
|
-
}),
|
|
267281
|
-
hovertext: extendFlat({}, scatterAttrs.hovertext, {
|
|
267282
|
-
description: [
|
|
267283
|
-
'Sets text elements associated with each (x,y,z) triplet.',
|
|
267284
|
-
'If a single string, the same string appears over',
|
|
267285
|
-
'all the data points.',
|
|
267286
|
-
'If an array of string, the items are mapped in order to the',
|
|
267287
|
-
'this trace\'s (x,y,z) coordinates.',
|
|
267288
|
-
'To be seen, trace `hoverinfo` must contain a *text* flag.'
|
|
267289
|
-
].join(' ')
|
|
267290
|
-
}),
|
|
267291
|
-
hovertemplate: hovertemplateAttrs(),
|
|
267292
|
-
|
|
267293
|
-
xhoverformat: axisHoverFormat('x'),
|
|
267294
|
-
yhoverformat: axisHoverFormat('y'),
|
|
267295
|
-
zhoverformat: axisHoverFormat('z'),
|
|
267296
|
-
|
|
267297
|
-
mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
|
|
267298
|
-
{dflt: 'lines+markers'}),
|
|
267299
|
-
surfaceaxis: {
|
|
267300
|
-
valType: 'enumerated',
|
|
267301
|
-
values: [-1, 0, 1, 2],
|
|
267302
|
-
dflt: -1,
|
|
267303
|
-
description: [
|
|
267304
|
-
'If *-1*, the scatter points are not fill with a surface',
|
|
267305
|
-
'If *0*, *1*, *2*, the scatter points are filled with',
|
|
267306
|
-
'a Delaunay surface about the x, y, z respectively.'
|
|
267307
|
-
].join(' ')
|
|
267308
|
-
},
|
|
267309
|
-
surfacecolor: {
|
|
267310
|
-
valType: 'color',
|
|
267311
|
-
description: 'Sets the surface fill color.'
|
|
267312
|
-
},
|
|
267313
|
-
projection: {
|
|
267314
|
-
x: makeProjectionAttr('x'),
|
|
267315
|
-
y: makeProjectionAttr('y'),
|
|
267316
|
-
z: makeProjectionAttr('z')
|
|
267317
|
-
},
|
|
267318
|
-
|
|
267319
|
-
connectgaps: scatterAttrs.connectgaps,
|
|
267320
|
-
line: lineAttrs,
|
|
267321
|
-
|
|
267322
|
-
marker: extendFlat({ // Parity with scatter.js?
|
|
267323
|
-
symbol: {
|
|
267324
|
-
valType: 'enumerated',
|
|
267325
|
-
values: sortObjectKeys(MARKER_SYMBOLS),
|
|
267326
|
-
dflt: 'circle',
|
|
267327
|
-
arrayOk: true,
|
|
267328
|
-
description: 'Sets the marker symbol type.'
|
|
267329
|
-
},
|
|
267330
|
-
size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
|
|
267331
|
-
sizeref: scatterMarkerAttrs.sizeref,
|
|
267332
|
-
sizemin: scatterMarkerAttrs.sizemin,
|
|
267333
|
-
sizemode: scatterMarkerAttrs.sizemode,
|
|
267334
|
-
opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
|
|
267335
|
-
arrayOk: false,
|
|
267336
|
-
description: [
|
|
267337
|
-
'Sets the marker opacity.',
|
|
267338
|
-
'Note that the marker opacity for scatter3d traces',
|
|
267339
|
-
'must be a scalar value for performance reasons.',
|
|
267340
|
-
'To set a blending opacity value',
|
|
267341
|
-
'(i.e. which is not transparent), set *marker.color*',
|
|
267342
|
-
'to an rgba color and use its alpha channel.'
|
|
267343
|
-
].join(' ')
|
|
267344
|
-
}),
|
|
267345
|
-
colorbar: scatterMarkerAttrs.colorbar,
|
|
267346
|
-
|
|
267347
|
-
line: extendFlat({
|
|
267348
|
-
width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
|
|
267349
|
-
},
|
|
267350
|
-
colorAttributes('marker.line')
|
|
267351
|
-
)
|
|
267352
|
-
},
|
|
267353
|
-
colorAttributes('marker')
|
|
267354
|
-
),
|
|
267355
|
-
|
|
267356
|
-
textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
|
|
267357
|
-
textfont: fontAttrs({
|
|
267358
|
-
noFontShadow: true,
|
|
267359
|
-
noFontLineposition: true,
|
|
267360
|
-
noFontTextcase: true,
|
|
267361
|
-
editType: 'calc',
|
|
267362
|
-
colorEditType: 'style',
|
|
267363
|
-
arrayOk: true,
|
|
267364
|
-
variantValues: ['normal', 'small-caps'],
|
|
267365
|
-
description: 'Sets the text font.'
|
|
267366
|
-
}),
|
|
267367
|
-
|
|
267368
|
-
opacity: baseAttrs.opacity,
|
|
267369
|
-
|
|
267370
|
-
hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
|
|
267371
|
-
}, 'calc', 'nested');
|
|
267372
|
-
|
|
267373
|
-
attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
|
|
267374
|
-
|
|
267375
|
-
|
|
267376
|
-
/***/ }),
|
|
267377
|
-
|
|
267378
|
-
/***/ 30935:
|
|
267379
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
267380
|
-
|
|
267381
|
-
|
|
267382
|
-
|
|
267383
|
-
var arraysToCalcdata = __webpack_require__(47213);
|
|
267384
|
-
var calcColorscale = __webpack_require__(59498);
|
|
267385
|
-
|
|
267386
|
-
/**
|
|
267387
|
-
* This is a kludge to put the array attributes into
|
|
267388
|
-
* calcdata the way Scatter.plot does, so that legends and
|
|
267389
|
-
* popovers know what to do with them.
|
|
267390
|
-
*/
|
|
267391
|
-
module.exports = function calc(gd, trace) {
|
|
267392
|
-
var cd = [{x: false, y: false, trace: trace, t: {}}];
|
|
267393
|
-
|
|
267394
|
-
arraysToCalcdata(cd, trace);
|
|
267395
|
-
calcColorscale(gd, trace);
|
|
267396
|
-
|
|
267397
|
-
return cd;
|
|
267398
|
-
};
|
|
267399
|
-
|
|
267400
|
-
|
|
267401
|
-
/***/ }),
|
|
267402
|
-
|
|
267403
|
-
/***/ 77681:
|
|
267404
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
267405
|
-
|
|
267406
|
-
|
|
267407
|
-
|
|
267408
|
-
var Registry = __webpack_require__(13936);
|
|
267409
|
-
|
|
267410
|
-
function calculateAxisErrors(data, params, scaleFactor, axis) {
|
|
267411
|
-
if(!params || !params.visible) return null;
|
|
267412
|
-
|
|
267413
|
-
var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
|
|
267414
|
-
var result = new Array(data.length);
|
|
267415
|
-
|
|
267416
|
-
for(var i = 0; i < data.length; i++) {
|
|
267417
|
-
var errors = computeError(+data[i], i);
|
|
267418
|
-
|
|
267419
|
-
if(axis.type === 'log') {
|
|
267420
|
-
var point = axis.c2l(data[i]);
|
|
267421
|
-
var min = data[i] - errors[0];
|
|
267422
|
-
var max = data[i] + errors[1];
|
|
267423
|
-
|
|
267424
|
-
result[i] = [
|
|
267425
|
-
(axis.c2l(min, true) - point) * scaleFactor,
|
|
267426
|
-
(axis.c2l(max, true) - point) * scaleFactor
|
|
267427
|
-
];
|
|
267428
|
-
|
|
267429
|
-
// Keep track of the lower error bound which isn't negative!
|
|
267430
|
-
if(min > 0) {
|
|
267431
|
-
var lower = axis.c2l(min);
|
|
267432
|
-
if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
|
|
267433
|
-
axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
|
|
267434
|
-
}
|
|
267435
|
-
} else {
|
|
267436
|
-
result[i] = [
|
|
267437
|
-
-errors[0] * scaleFactor,
|
|
267438
|
-
errors[1] * scaleFactor
|
|
267439
|
-
];
|
|
267440
|
-
}
|
|
267441
|
-
}
|
|
267442
|
-
|
|
267443
|
-
return result;
|
|
267444
|
-
}
|
|
267445
|
-
|
|
267446
|
-
function dataLength(array) {
|
|
267447
|
-
for(var i = 0; i < array.length; i++) {
|
|
267448
|
-
if(array[i]) return array[i].length;
|
|
267449
|
-
}
|
|
267450
|
-
return 0;
|
|
267451
|
-
}
|
|
267452
|
-
|
|
267453
|
-
function calculateErrors(data, scaleFactor, sceneLayout) {
|
|
267454
|
-
var errors = [
|
|
267455
|
-
calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
|
|
267456
|
-
calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
|
|
267457
|
-
calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
|
|
267458
|
-
];
|
|
267459
|
-
|
|
267460
|
-
var n = dataLength(errors);
|
|
267461
|
-
if(n === 0) return null;
|
|
267462
|
-
|
|
267463
|
-
var errorBounds = new Array(n);
|
|
267464
|
-
|
|
267465
|
-
for(var i = 0; i < n; i++) {
|
|
267466
|
-
var bound = [[0, 0, 0], [0, 0, 0]];
|
|
267467
|
-
|
|
267468
|
-
for(var j = 0; j < 3; j++) {
|
|
267469
|
-
if(errors[j]) {
|
|
267470
|
-
for(var k = 0; k < 2; k++) {
|
|
267471
|
-
bound[k][j] = errors[j][i][k];
|
|
267472
|
-
}
|
|
267473
|
-
}
|
|
267474
|
-
}
|
|
267475
|
-
|
|
267476
|
-
errorBounds[i] = bound;
|
|
267477
|
-
}
|
|
267478
|
-
|
|
267479
|
-
return errorBounds;
|
|
267480
|
-
}
|
|
267481
|
-
|
|
267482
|
-
module.exports = calculateErrors;
|
|
267483
|
-
|
|
267484
|
-
|
|
267485
|
-
/***/ }),
|
|
267486
|
-
|
|
267487
|
-
/***/ 93219:
|
|
267488
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
267489
|
-
|
|
267490
|
-
|
|
267491
|
-
|
|
267492
|
-
var createLinePlot = (__webpack_require__(46000).gl_line3d);
|
|
267493
|
-
var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
|
|
267494
|
-
var createErrorBars = (__webpack_require__(46000).gl_error3d);
|
|
267495
|
-
var createMesh = (__webpack_require__(46000).gl_mesh3d);
|
|
267496
|
-
var triangulate = (__webpack_require__(46000).delaunay_triangulate);
|
|
267497
|
-
|
|
267498
|
-
var Lib = __webpack_require__(30991);
|
|
267499
|
-
var str2RgbaArray = __webpack_require__(44960);
|
|
267500
|
-
var formatColor = (__webpack_require__(592).formatColor);
|
|
267501
|
-
var makeBubbleSizeFn = __webpack_require__(42581);
|
|
267502
|
-
var DASH_PATTERNS = __webpack_require__(68828);
|
|
267503
|
-
var MARKER_SYMBOLS = __webpack_require__(98993);
|
|
267504
|
-
|
|
267505
|
-
var Axes = __webpack_require__(15076);
|
|
267506
|
-
var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
|
|
267507
|
-
|
|
267508
|
-
var calculateError = __webpack_require__(77681);
|
|
267509
|
-
|
|
267510
|
-
function LineWithMarkers(scene, uid) {
|
|
267511
|
-
this.scene = scene;
|
|
267512
|
-
this.uid = uid;
|
|
267513
|
-
this.linePlot = null;
|
|
267514
|
-
this.scatterPlot = null;
|
|
267515
|
-
this.errorBars = null;
|
|
267516
|
-
this.textMarkers = null;
|
|
267517
|
-
this.delaunayMesh = null;
|
|
267518
|
-
this.color = null;
|
|
267519
|
-
this.mode = '';
|
|
267520
|
-
this.dataPoints = [];
|
|
267521
|
-
this.axesBounds = [
|
|
267522
|
-
[-Infinity, -Infinity, -Infinity],
|
|
267523
|
-
[Infinity, Infinity, Infinity]
|
|
267524
|
-
];
|
|
267525
|
-
this.textLabels = null;
|
|
267526
|
-
this.data = null;
|
|
267527
|
-
}
|
|
267528
|
-
|
|
267529
|
-
var proto = LineWithMarkers.prototype;
|
|
267530
|
-
|
|
267531
|
-
proto.handlePick = function(selection) {
|
|
267532
|
-
if(selection.object &&
|
|
267533
|
-
(selection.object === this.linePlot ||
|
|
267534
|
-
selection.object === this.delaunayMesh ||
|
|
267535
|
-
selection.object === this.textMarkers ||
|
|
267536
|
-
selection.object === this.scatterPlot)
|
|
267537
|
-
) {
|
|
267538
|
-
var ind = selection.index = selection.data.index;
|
|
267539
|
-
|
|
267540
|
-
if(selection.object.highlight) {
|
|
267541
|
-
selection.object.highlight(null);
|
|
267542
|
-
}
|
|
267543
|
-
if(this.scatterPlot) {
|
|
267544
|
-
selection.object = this.scatterPlot;
|
|
267545
|
-
this.scatterPlot.highlight(selection.data);
|
|
267546
|
-
}
|
|
267547
|
-
|
|
267548
|
-
selection.textLabel = '';
|
|
267549
|
-
if(this.textLabels) {
|
|
267550
|
-
if(Lib.isArrayOrTypedArray(this.textLabels)) {
|
|
267551
|
-
if(this.textLabels[ind] || this.textLabels[ind] === 0) {
|
|
267552
|
-
selection.textLabel = this.textLabels[ind];
|
|
267553
|
-
}
|
|
267554
|
-
} else {
|
|
267555
|
-
selection.textLabel = this.textLabels;
|
|
267556
|
-
}
|
|
267557
|
-
}
|
|
267558
|
-
|
|
267559
|
-
selection.traceCoordinate = [
|
|
267560
|
-
this.data.x[ind],
|
|
267561
|
-
this.data.y[ind],
|
|
267562
|
-
this.data.z[ind]
|
|
267563
|
-
];
|
|
267564
|
-
|
|
267565
|
-
return true;
|
|
267566
|
-
}
|
|
267567
|
-
};
|
|
267568
|
-
|
|
267569
|
-
function constructDelaunay(points, color, axis) {
|
|
267570
|
-
var u = (axis + 1) % 3;
|
|
267571
|
-
var v = (axis + 2) % 3;
|
|
267572
|
-
var filteredPoints = [];
|
|
267573
|
-
var filteredIds = [];
|
|
267574
|
-
var i;
|
|
267575
|
-
|
|
267576
|
-
for(i = 0; i < points.length; ++i) {
|
|
267577
|
-
var p = points[i];
|
|
267578
|
-
if(isNaN(p[u]) || !isFinite(p[u]) ||
|
|
267579
|
-
isNaN(p[v]) || !isFinite(p[v])) {
|
|
267580
|
-
continue;
|
|
267581
|
-
}
|
|
267582
|
-
filteredPoints.push([p[u], p[v]]);
|
|
267583
|
-
filteredIds.push(i);
|
|
267584
|
-
}
|
|
267585
|
-
var cells = triangulate(filteredPoints);
|
|
267586
|
-
for(i = 0; i < cells.length; ++i) {
|
|
267587
|
-
var c = cells[i];
|
|
267588
|
-
for(var j = 0; j < c.length; ++j) {
|
|
267589
|
-
c[j] = filteredIds[c[j]];
|
|
267590
|
-
}
|
|
267591
|
-
}
|
|
267592
|
-
return {
|
|
267593
|
-
positions: points,
|
|
267594
|
-
cells: cells,
|
|
267595
|
-
meshColor: color
|
|
267596
|
-
};
|
|
267597
|
-
}
|
|
267598
|
-
|
|
267599
|
-
function calculateErrorParams(errors) {
|
|
267600
|
-
var capSize = [0.0, 0.0, 0.0];
|
|
267601
|
-
var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
|
|
267602
|
-
var lineWidth = [1.0, 1.0, 1.0];
|
|
267603
|
-
|
|
267604
|
-
for(var i = 0; i < 3; i++) {
|
|
267605
|
-
var e = errors[i];
|
|
267606
|
-
|
|
267607
|
-
if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
|
|
267608
|
-
if(!e || !e.visible) continue;
|
|
267609
|
-
|
|
267610
|
-
capSize[i] = e.width / 2; // ballpark rescaling
|
|
267611
|
-
color[i] = str2RgbaArray(e.color);
|
|
267612
|
-
lineWidth[i] = e.thickness;
|
|
267613
|
-
}
|
|
267614
|
-
|
|
267615
|
-
return {capSize: capSize, color: color, lineWidth: lineWidth};
|
|
267616
|
-
}
|
|
267617
|
-
|
|
267618
|
-
function parseAlignmentX(a) {
|
|
267619
|
-
if(a === null || a === undefined) return 0;
|
|
267620
|
-
|
|
267621
|
-
return (a.indexOf('left') > -1) ? -1 :
|
|
267622
|
-
(a.indexOf('right') > -1) ? 1 : 0;
|
|
267623
|
-
}
|
|
267624
|
-
|
|
267625
|
-
function parseAlignmentY(a) {
|
|
267626
|
-
if(a === null || a === undefined) return 0;
|
|
267627
|
-
|
|
267628
|
-
return (a.indexOf('top') > -1) ? -1 :
|
|
267629
|
-
(a.indexOf('bottom') > -1) ? 1 : 0;
|
|
267630
|
-
}
|
|
267631
|
-
|
|
267632
|
-
function calculateTextOffset(tp) {
|
|
267633
|
-
// Read out text properties
|
|
267634
|
-
|
|
267635
|
-
var defaultAlignmentX = 0;
|
|
267636
|
-
var defaultAlignmentY = 0;
|
|
267637
|
-
|
|
267638
|
-
var textOffset = [
|
|
267639
|
-
defaultAlignmentX,
|
|
267640
|
-
defaultAlignmentY
|
|
267641
|
-
];
|
|
267642
|
-
|
|
267643
|
-
if(Array.isArray(tp)) {
|
|
267644
|
-
for(var i = 0; i < tp.length; i++) {
|
|
267645
|
-
textOffset[i] = [
|
|
267646
|
-
defaultAlignmentX,
|
|
267647
|
-
defaultAlignmentY
|
|
267648
|
-
];
|
|
267649
|
-
if(tp[i]) {
|
|
267650
|
-
textOffset[i][0] = parseAlignmentX(tp[i]);
|
|
267651
|
-
textOffset[i][1] = parseAlignmentY(tp[i]);
|
|
267652
|
-
}
|
|
267653
|
-
}
|
|
267654
|
-
} else {
|
|
267655
|
-
textOffset[0] = parseAlignmentX(tp);
|
|
267656
|
-
textOffset[1] = parseAlignmentY(tp);
|
|
267657
|
-
}
|
|
267658
|
-
|
|
267659
|
-
return textOffset;
|
|
267660
|
-
}
|
|
267661
|
-
|
|
267662
|
-
|
|
267663
|
-
function calculateSize(sizeIn, sizeFn) {
|
|
267664
|
-
// rough parity with Plotly 2D markers
|
|
267665
|
-
return sizeFn(sizeIn * 4);
|
|
267666
|
-
}
|
|
267667
|
-
|
|
267668
|
-
function calculateSymbol(symbolIn) {
|
|
267669
|
-
return MARKER_SYMBOLS[symbolIn];
|
|
267670
|
-
}
|
|
267671
|
-
|
|
267672
|
-
function formatParam(paramIn, len, calculate, dflt, extraFn) {
|
|
267673
|
-
var paramOut = null;
|
|
267674
|
-
|
|
267675
|
-
if(Lib.isArrayOrTypedArray(paramIn)) {
|
|
267676
|
-
paramOut = [];
|
|
267677
|
-
|
|
267678
|
-
for(var i = 0; i < len; i++) {
|
|
267679
|
-
if(paramIn[i] === undefined) paramOut[i] = dflt;
|
|
267680
|
-
else paramOut[i] = calculate(paramIn[i], extraFn);
|
|
267681
|
-
}
|
|
267682
|
-
} else paramOut = calculate(paramIn, Lib.identity);
|
|
267683
|
-
|
|
267684
|
-
return paramOut;
|
|
267685
|
-
}
|
|
267686
|
-
|
|
267687
|
-
|
|
267688
|
-
function convertPlotlyOptions(scene, data) {
|
|
267689
|
-
var points = [];
|
|
267690
|
-
var sceneLayout = scene.fullSceneLayout;
|
|
267691
|
-
var scaleFactor = scene.dataScale;
|
|
267692
|
-
var xaxis = sceneLayout.xaxis;
|
|
267693
|
-
var yaxis = sceneLayout.yaxis;
|
|
267694
|
-
var zaxis = sceneLayout.zaxis;
|
|
267695
|
-
var marker = data.marker;
|
|
267696
|
-
var line = data.line;
|
|
267697
|
-
var x = data.x || [];
|
|
267698
|
-
var y = data.y || [];
|
|
267699
|
-
var z = data.z || [];
|
|
267700
|
-
var len = x.length;
|
|
267701
|
-
var xcalendar = data.xcalendar;
|
|
267702
|
-
var ycalendar = data.ycalendar;
|
|
267703
|
-
var zcalendar = data.zcalendar;
|
|
267704
|
-
var xc, yc, zc;
|
|
267705
|
-
var params, i;
|
|
267706
|
-
var text;
|
|
267707
|
-
|
|
267708
|
-
// Convert points
|
|
267709
|
-
for(i = 0; i < len; i++) {
|
|
267710
|
-
// sanitize numbers and apply transforms based on axes.type
|
|
267711
|
-
xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
|
|
267712
|
-
yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
|
|
267713
|
-
zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
|
|
267714
|
-
|
|
267715
|
-
points[i] = [xc, yc, zc];
|
|
267716
|
-
}
|
|
267717
|
-
|
|
267718
|
-
// convert text
|
|
267719
|
-
if(Array.isArray(data.text)) {
|
|
267720
|
-
text = data.text;
|
|
267721
|
-
} else if(Lib.isTypedArray(data.text)) {
|
|
267722
|
-
text = Array.from(data.text);
|
|
267723
|
-
} else if(data.text !== undefined) {
|
|
267724
|
-
text = new Array(len);
|
|
267725
|
-
for(i = 0; i < len; i++) text[i] = data.text;
|
|
267726
|
-
}
|
|
267727
|
-
|
|
267728
|
-
function formatter(axName, val) {
|
|
267729
|
-
var ax = sceneLayout[axName];
|
|
267730
|
-
return Axes.tickText(ax, ax.d2l(val), true).text;
|
|
267731
|
-
}
|
|
267732
|
-
|
|
267733
|
-
// check texttemplate
|
|
267734
|
-
var texttemplate = data.texttemplate;
|
|
267735
|
-
if(texttemplate) {
|
|
267736
|
-
var fullLayout = scene.fullLayout;
|
|
267737
|
-
var d3locale = fullLayout._d3locale;
|
|
267738
|
-
var isArray = Array.isArray(texttemplate);
|
|
267739
|
-
var N = isArray ? Math.min(texttemplate.length, len) : len;
|
|
267740
|
-
var txt = isArray ?
|
|
267741
|
-
function(i) { return texttemplate[i]; } :
|
|
267742
|
-
function() { return texttemplate; };
|
|
267743
|
-
|
|
267744
|
-
text = new Array(N);
|
|
267745
|
-
|
|
267746
|
-
for(i = 0; i < N; i++) {
|
|
267747
|
-
var d = {x: x[i], y: y[i], z: z[i]};
|
|
267748
|
-
var labels = {
|
|
267749
|
-
xLabel: formatter('xaxis', x[i]),
|
|
267750
|
-
yLabel: formatter('yaxis', y[i]),
|
|
267751
|
-
zLabel: formatter('zaxis', z[i])
|
|
267752
|
-
};
|
|
267753
|
-
var pointValues = {};
|
|
267754
|
-
appendArrayPointValue(pointValues, data, i);
|
|
267755
|
-
var meta = data._meta || {};
|
|
267756
|
-
text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
|
|
267757
|
-
}
|
|
267758
|
-
}
|
|
267759
|
-
|
|
267760
|
-
// Build object parameters
|
|
267761
|
-
params = {
|
|
267762
|
-
position: points,
|
|
267763
|
-
mode: data.mode,
|
|
267764
|
-
text: text
|
|
267765
|
-
};
|
|
267766
|
-
|
|
267767
|
-
if('line' in data) {
|
|
267768
|
-
params.lineColor = formatColor(line, 1, len);
|
|
267769
|
-
params.lineWidth = line.width;
|
|
267770
|
-
params.lineDashes = line.dash;
|
|
267771
|
-
}
|
|
267772
|
-
|
|
267773
|
-
if('marker' in data) {
|
|
267774
|
-
var sizeFn = makeBubbleSizeFn(data);
|
|
267775
|
-
|
|
267776
|
-
params.scatterColor = formatColor(marker, 1, len);
|
|
267777
|
-
params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
|
|
267778
|
-
params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
|
|
267779
|
-
params.scatterLineWidth = marker.line.width; // arrayOk === false
|
|
267780
|
-
params.scatterLineColor = formatColor(marker.line, 1, len);
|
|
267781
|
-
params.scatterAngle = 0;
|
|
267782
|
-
}
|
|
267783
|
-
|
|
267784
|
-
if('textposition' in data) {
|
|
267785
|
-
params.textOffset = calculateTextOffset(data.textposition);
|
|
267786
|
-
params.textColor = formatColor(data.textfont, 1, len);
|
|
267787
|
-
params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
|
|
267788
|
-
params.textFontFamily = data.textfont.family;
|
|
267789
|
-
params.textFontWeight = data.textfont.weight;
|
|
267790
|
-
params.textFontStyle = data.textfont.style;
|
|
267791
|
-
params.textFontVariant = data.textfont.variant;
|
|
267792
|
-
params.textAngle = 0;
|
|
267793
|
-
}
|
|
267794
|
-
|
|
267795
|
-
var dims = ['x', 'y', 'z'];
|
|
267796
|
-
params.project = [false, false, false];
|
|
267797
|
-
params.projectScale = [1, 1, 1];
|
|
267798
|
-
params.projectOpacity = [1, 1, 1];
|
|
267799
|
-
for(i = 0; i < 3; ++i) {
|
|
267800
|
-
var projection = data.projection[dims[i]];
|
|
267801
|
-
if((params.project[i] = projection.show)) {
|
|
267802
|
-
params.projectOpacity[i] = projection.opacity;
|
|
267803
|
-
params.projectScale[i] = projection.scale;
|
|
267804
|
-
}
|
|
267805
|
-
}
|
|
267806
|
-
|
|
267807
|
-
params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
|
|
267808
|
-
|
|
267809
|
-
var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
|
|
267810
|
-
params.errorColor = errorParams.color;
|
|
267811
|
-
params.errorLineWidth = errorParams.lineWidth;
|
|
267812
|
-
params.errorCapSize = errorParams.capSize;
|
|
267813
|
-
|
|
267814
|
-
params.delaunayAxis = data.surfaceaxis;
|
|
267815
|
-
params.delaunayColor = str2RgbaArray(data.surfacecolor);
|
|
267816
|
-
|
|
267817
|
-
return params;
|
|
267818
|
-
}
|
|
267819
|
-
|
|
267820
|
-
function _arrayToColor(color) {
|
|
267821
|
-
if(Lib.isArrayOrTypedArray(color)) {
|
|
267822
|
-
var c = color[0];
|
|
267823
|
-
|
|
267824
|
-
if(Lib.isArrayOrTypedArray(c)) color = c;
|
|
267825
|
-
|
|
267826
|
-
return 'rgb(' + color.slice(0, 3).map(function(x) {
|
|
267827
|
-
return Math.round(x * 255);
|
|
267828
|
-
}) + ')';
|
|
267829
|
-
}
|
|
267830
|
-
|
|
267831
|
-
return null;
|
|
267832
|
-
}
|
|
267833
|
-
|
|
267834
|
-
function arrayToColor(colors) {
|
|
267835
|
-
if(!Lib.isArrayOrTypedArray(colors)) {
|
|
267836
|
-
return null;
|
|
267837
|
-
}
|
|
267838
|
-
|
|
267839
|
-
if((colors.length === 4) && (typeof colors[0] === 'number')) {
|
|
267840
|
-
return _arrayToColor(colors);
|
|
267841
|
-
}
|
|
267842
|
-
|
|
267843
|
-
return colors.map(_arrayToColor);
|
|
267844
|
-
}
|
|
267845
|
-
|
|
267846
|
-
proto.update = function(data) {
|
|
267847
|
-
var gl = this.scene.glplot.gl;
|
|
267848
|
-
var lineOptions;
|
|
267849
|
-
var scatterOptions;
|
|
267850
|
-
var errorOptions;
|
|
267851
|
-
var textOptions;
|
|
267852
|
-
var dashPattern = DASH_PATTERNS.solid;
|
|
267853
|
-
|
|
267854
|
-
// Save data
|
|
267855
|
-
this.data = data;
|
|
267856
|
-
|
|
267857
|
-
// Run data conversion
|
|
267858
|
-
var options = convertPlotlyOptions(this.scene, data);
|
|
267859
|
-
|
|
267860
|
-
if('mode' in options) {
|
|
267861
|
-
this.mode = options.mode;
|
|
267862
|
-
}
|
|
267863
|
-
if('lineDashes' in options) {
|
|
267864
|
-
if(options.lineDashes in DASH_PATTERNS) {
|
|
267865
|
-
dashPattern = DASH_PATTERNS[options.lineDashes];
|
|
267866
|
-
}
|
|
267867
|
-
}
|
|
267868
|
-
|
|
267869
|
-
this.color = arrayToColor(options.scatterColor) ||
|
|
267870
|
-
arrayToColor(options.lineColor);
|
|
267871
|
-
|
|
267872
|
-
// Save data points
|
|
267873
|
-
this.dataPoints = options.position;
|
|
267874
|
-
|
|
267875
|
-
lineOptions = {
|
|
267876
|
-
gl: this.scene.glplot.gl,
|
|
267877
|
-
position: options.position,
|
|
267878
|
-
color: options.lineColor,
|
|
267879
|
-
lineWidth: options.lineWidth || 1,
|
|
267880
|
-
dashes: dashPattern[0],
|
|
267881
|
-
dashScale: dashPattern[1],
|
|
267882
|
-
opacity: data.opacity,
|
|
267883
|
-
connectGaps: data.connectgaps
|
|
267884
|
-
};
|
|
267885
|
-
|
|
267886
|
-
if(this.mode.indexOf('lines') !== -1) {
|
|
267887
|
-
if(this.linePlot) this.linePlot.update(lineOptions);
|
|
267888
|
-
else {
|
|
267889
|
-
this.linePlot = createLinePlot(lineOptions);
|
|
267890
|
-
this.linePlot._trace = this;
|
|
267891
|
-
this.scene.glplot.add(this.linePlot);
|
|
267892
|
-
}
|
|
267893
|
-
} else if(this.linePlot) {
|
|
267894
|
-
this.scene.glplot.remove(this.linePlot);
|
|
267895
|
-
this.linePlot.dispose();
|
|
267896
|
-
this.linePlot = null;
|
|
267897
|
-
}
|
|
267898
|
-
|
|
267899
|
-
// N.B. marker.opacity must be a scalar for performance
|
|
267900
|
-
var scatterOpacity = data.opacity;
|
|
267901
|
-
if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
|
|
267902
|
-
|
|
267903
|
-
scatterOptions = {
|
|
267904
|
-
gl: this.scene.glplot.gl,
|
|
267905
|
-
position: options.position,
|
|
267906
|
-
color: options.scatterColor,
|
|
267907
|
-
size: options.scatterSize,
|
|
267908
|
-
glyph: options.scatterMarker,
|
|
267909
|
-
opacity: scatterOpacity,
|
|
267910
|
-
orthographic: true,
|
|
267911
|
-
lineWidth: options.scatterLineWidth,
|
|
267912
|
-
lineColor: options.scatterLineColor,
|
|
267913
|
-
project: options.project,
|
|
267914
|
-
projectScale: options.projectScale,
|
|
267915
|
-
projectOpacity: options.projectOpacity
|
|
267916
|
-
};
|
|
267917
|
-
|
|
267918
|
-
if(this.mode.indexOf('markers') !== -1) {
|
|
267919
|
-
if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
|
|
267920
|
-
else {
|
|
267921
|
-
this.scatterPlot = createScatterPlot(scatterOptions);
|
|
267922
|
-
this.scatterPlot._trace = this;
|
|
267923
|
-
this.scatterPlot.highlightScale = 1;
|
|
267924
|
-
this.scene.glplot.add(this.scatterPlot);
|
|
267925
|
-
}
|
|
267926
|
-
} else if(this.scatterPlot) {
|
|
267927
|
-
this.scene.glplot.remove(this.scatterPlot);
|
|
267928
|
-
this.scatterPlot.dispose();
|
|
267929
|
-
this.scatterPlot = null;
|
|
267930
|
-
}
|
|
267931
|
-
|
|
267932
|
-
textOptions = {
|
|
267933
|
-
gl: this.scene.glplot.gl,
|
|
267934
|
-
position: options.position,
|
|
267935
|
-
glyph: options.text,
|
|
267936
|
-
color: options.textColor,
|
|
267937
|
-
size: options.textSize,
|
|
267938
|
-
angle: options.textAngle,
|
|
267939
|
-
alignment: options.textOffset,
|
|
267940
|
-
font: options.textFontFamily,
|
|
267941
|
-
fontWeight: options.textFontWeight,
|
|
267942
|
-
fontStyle: options.textFontStyle,
|
|
267943
|
-
fontVariant: options.textFontVariant,
|
|
267944
|
-
orthographic: true,
|
|
267945
|
-
lineWidth: 0,
|
|
267946
|
-
project: false,
|
|
267947
|
-
opacity: data.opacity
|
|
267948
|
-
};
|
|
267949
|
-
|
|
267950
|
-
this.textLabels = data.hovertext || data.text;
|
|
267951
|
-
|
|
267952
|
-
if(this.mode.indexOf('text') !== -1) {
|
|
267953
|
-
if(this.textMarkers) this.textMarkers.update(textOptions);
|
|
267954
|
-
else {
|
|
267955
|
-
this.textMarkers = createScatterPlot(textOptions);
|
|
267956
|
-
this.textMarkers._trace = this;
|
|
267957
|
-
this.textMarkers.highlightScale = 1;
|
|
267958
|
-
this.scene.glplot.add(this.textMarkers);
|
|
267959
|
-
}
|
|
267960
|
-
} else if(this.textMarkers) {
|
|
267961
|
-
this.scene.glplot.remove(this.textMarkers);
|
|
267962
|
-
this.textMarkers.dispose();
|
|
267963
|
-
this.textMarkers = null;
|
|
267964
|
-
}
|
|
267965
|
-
|
|
267966
|
-
errorOptions = {
|
|
267967
|
-
gl: this.scene.glplot.gl,
|
|
267968
|
-
position: options.position,
|
|
267969
|
-
color: options.errorColor,
|
|
267970
|
-
error: options.errorBounds,
|
|
267971
|
-
lineWidth: options.errorLineWidth,
|
|
267972
|
-
capSize: options.errorCapSize,
|
|
267973
|
-
opacity: data.opacity
|
|
267974
|
-
};
|
|
267975
|
-
if(this.errorBars) {
|
|
267976
|
-
if(options.errorBounds) {
|
|
267977
|
-
this.errorBars.update(errorOptions);
|
|
267978
|
-
} else {
|
|
267979
|
-
this.scene.glplot.remove(this.errorBars);
|
|
267980
|
-
this.errorBars.dispose();
|
|
267981
|
-
this.errorBars = null;
|
|
267982
|
-
}
|
|
267983
|
-
} else if(options.errorBounds) {
|
|
267984
|
-
this.errorBars = createErrorBars(errorOptions);
|
|
267985
|
-
this.errorBars._trace = this;
|
|
267986
|
-
this.scene.glplot.add(this.errorBars);
|
|
267987
|
-
}
|
|
267988
|
-
|
|
267989
|
-
if(options.delaunayAxis >= 0) {
|
|
267990
|
-
var delaunayOptions = constructDelaunay(
|
|
267991
|
-
options.position,
|
|
267992
|
-
options.delaunayColor,
|
|
267993
|
-
options.delaunayAxis
|
|
267994
|
-
);
|
|
267995
|
-
delaunayOptions.opacity = data.opacity;
|
|
267996
|
-
|
|
267997
|
-
if(this.delaunayMesh) {
|
|
267998
|
-
this.delaunayMesh.update(delaunayOptions);
|
|
267999
|
-
} else {
|
|
268000
|
-
delaunayOptions.gl = gl;
|
|
268001
|
-
this.delaunayMesh = createMesh(delaunayOptions);
|
|
268002
|
-
this.delaunayMesh._trace = this;
|
|
268003
|
-
this.scene.glplot.add(this.delaunayMesh);
|
|
268004
|
-
}
|
|
268005
|
-
} else if(this.delaunayMesh) {
|
|
268006
|
-
this.scene.glplot.remove(this.delaunayMesh);
|
|
268007
|
-
this.delaunayMesh.dispose();
|
|
268008
|
-
this.delaunayMesh = null;
|
|
268009
|
-
}
|
|
268010
|
-
};
|
|
268011
|
-
|
|
268012
|
-
proto.dispose = function() {
|
|
268013
|
-
if(this.linePlot) {
|
|
268014
|
-
this.scene.glplot.remove(this.linePlot);
|
|
268015
|
-
this.linePlot.dispose();
|
|
268016
|
-
}
|
|
268017
|
-
if(this.scatterPlot) {
|
|
268018
|
-
this.scene.glplot.remove(this.scatterPlot);
|
|
268019
|
-
this.scatterPlot.dispose();
|
|
268020
|
-
}
|
|
268021
|
-
if(this.errorBars) {
|
|
268022
|
-
this.scene.glplot.remove(this.errorBars);
|
|
268023
|
-
this.errorBars.dispose();
|
|
268024
|
-
}
|
|
268025
|
-
if(this.textMarkers) {
|
|
268026
|
-
this.scene.glplot.remove(this.textMarkers);
|
|
268027
|
-
this.textMarkers.dispose();
|
|
268028
|
-
}
|
|
268029
|
-
if(this.delaunayMesh) {
|
|
268030
|
-
this.scene.glplot.remove(this.delaunayMesh);
|
|
268031
|
-
this.delaunayMesh.dispose();
|
|
268032
|
-
}
|
|
268033
|
-
};
|
|
268034
|
-
|
|
268035
|
-
function createLineWithMarkers(scene, data) {
|
|
268036
|
-
var plot = new LineWithMarkers(scene, data.uid);
|
|
268037
|
-
plot.update(data);
|
|
268038
|
-
return plot;
|
|
268039
|
-
}
|
|
268040
|
-
|
|
268041
|
-
module.exports = createLineWithMarkers;
|
|
268042
|
-
|
|
268043
|
-
|
|
268044
|
-
/***/ }),
|
|
268045
|
-
|
|
268046
|
-
/***/ 13744:
|
|
268047
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
268048
|
-
|
|
268049
|
-
|
|
268050
|
-
|
|
268051
|
-
var Registry = __webpack_require__(13936);
|
|
268052
|
-
var Lib = __webpack_require__(30991);
|
|
268053
|
-
|
|
268054
|
-
var subTypes = __webpack_require__(33068);
|
|
268055
|
-
var handleMarkerDefaults = __webpack_require__(15294);
|
|
268056
|
-
var handleLineDefaults = __webpack_require__(82094);
|
|
268057
|
-
var handleTextDefaults = __webpack_require__(94729);
|
|
268058
|
-
|
|
268059
|
-
var attributes = __webpack_require__(1015);
|
|
268060
|
-
|
|
268061
|
-
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
268062
|
-
function coerce(attr, dflt) {
|
|
268063
|
-
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
268064
|
-
}
|
|
268065
|
-
|
|
268066
|
-
var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
|
|
268067
|
-
if(!len) {
|
|
268068
|
-
traceOut.visible = false;
|
|
268069
|
-
return;
|
|
268070
|
-
}
|
|
268071
|
-
|
|
268072
|
-
coerce('text');
|
|
268073
|
-
coerce('hovertext');
|
|
268074
|
-
coerce('hovertemplate');
|
|
268075
|
-
coerce('xhoverformat');
|
|
268076
|
-
coerce('yhoverformat');
|
|
268077
|
-
coerce('zhoverformat');
|
|
268078
|
-
|
|
268079
|
-
coerce('mode');
|
|
268080
|
-
|
|
268081
|
-
if(subTypes.hasMarkers(traceOut)) {
|
|
268082
|
-
handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
|
|
268083
|
-
}
|
|
268084
|
-
|
|
268085
|
-
if(subTypes.hasLines(traceOut)) {
|
|
268086
|
-
coerce('connectgaps');
|
|
268087
|
-
handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
|
|
268088
|
-
}
|
|
268089
|
-
|
|
268090
|
-
if(subTypes.hasText(traceOut)) {
|
|
268091
|
-
coerce('texttemplate');
|
|
268092
|
-
handleTextDefaults(traceIn, traceOut, layout, coerce, {
|
|
268093
|
-
noSelect: true,
|
|
268094
|
-
noFontShadow: true,
|
|
268095
|
-
noFontLineposition: true,
|
|
268096
|
-
noFontTextcase: true,
|
|
268097
|
-
});
|
|
268098
|
-
}
|
|
268099
|
-
|
|
268100
|
-
var lineColor = (traceOut.line || {}).color;
|
|
268101
|
-
var markerColor = (traceOut.marker || {}).color;
|
|
268102
|
-
if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
|
|
268103
|
-
|
|
268104
|
-
var dims = ['x', 'y', 'z'];
|
|
268105
|
-
for(var i = 0; i < 3; ++i) {
|
|
268106
|
-
var projection = 'projection.' + dims[i];
|
|
268107
|
-
if(coerce(projection + '.show')) {
|
|
268108
|
-
coerce(projection + '.opacity');
|
|
268109
|
-
coerce(projection + '.scale');
|
|
268110
|
-
}
|
|
268111
|
-
}
|
|
268112
|
-
|
|
268113
|
-
var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
|
|
268114
|
-
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
|
|
268115
|
-
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
|
|
268116
|
-
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
|
|
268117
|
-
};
|
|
268118
|
-
|
|
268119
|
-
function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
|
|
268120
|
-
var len = 0;
|
|
268121
|
-
var x = coerce('x');
|
|
268122
|
-
var y = coerce('y');
|
|
268123
|
-
var z = coerce('z');
|
|
268124
|
-
|
|
268125
|
-
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
|
|
268126
|
-
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
|
|
268127
|
-
|
|
268128
|
-
if(x && y && z) {
|
|
268129
|
-
// TODO: what happens if one is missing?
|
|
268130
|
-
len = Math.min(x.length, y.length, z.length);
|
|
268131
|
-
traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
|
|
268132
|
-
}
|
|
268133
|
-
|
|
268134
|
-
return len;
|
|
268135
|
-
}
|
|
268136
|
-
|
|
268137
|
-
|
|
268138
|
-
/***/ }),
|
|
268139
|
-
|
|
268140
|
-
/***/ 68860:
|
|
268141
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
268142
|
-
|
|
268143
|
-
|
|
268144
|
-
|
|
268145
|
-
module.exports = {
|
|
268146
|
-
plot: __webpack_require__(93219),
|
|
268147
|
-
attributes: __webpack_require__(1015),
|
|
268148
|
-
markerSymbols: __webpack_require__(98993),
|
|
268149
|
-
supplyDefaults: __webpack_require__(13744),
|
|
268150
|
-
colorbar: [
|
|
268151
|
-
{
|
|
268152
|
-
container: 'marker',
|
|
268153
|
-
min: 'cmin',
|
|
268154
|
-
max: 'cmax'
|
|
268155
|
-
}, {
|
|
268156
|
-
container: 'line',
|
|
268157
|
-
min: 'cmin',
|
|
268158
|
-
max: 'cmax'
|
|
268159
|
-
}
|
|
268160
|
-
],
|
|
268161
|
-
calc: __webpack_require__(30935),
|
|
268162
|
-
|
|
268163
|
-
moduleType: 'trace',
|
|
268164
|
-
name: 'scatter3d',
|
|
268165
|
-
basePlotModule: __webpack_require__(68137),
|
|
268166
|
-
categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
|
|
268167
|
-
meta: {
|
|
268168
|
-
hrName: 'scatter_3d',
|
|
268169
|
-
description: [
|
|
268170
|
-
'The data visualized as scatter point or lines in 3D dimension',
|
|
268171
|
-
'is set in `x`, `y`, `z`.',
|
|
268172
|
-
'Text (appearing either on the chart or on hover only) is via `text`.',
|
|
268173
|
-
'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
|
|
268174
|
-
'Projections are achieved via `projection`.',
|
|
268175
|
-
'Surface fills are achieved via `surfaceaxis`.'
|
|
268176
|
-
].join(' ')
|
|
268177
|
-
}
|
|
268178
|
-
};
|
|
268179
|
-
|
|
268180
|
-
|
|
268181
267194
|
/***/ }),
|
|
268182
267195
|
|
|
268183
267196
|
/***/ 47213:
|
|
@@ -272108,6 +271121,993 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
|
|
|
272108
271121
|
};
|
|
272109
271122
|
|
|
272110
271123
|
|
|
271124
|
+
/***/ }),
|
|
271125
|
+
|
|
271126
|
+
/***/ 1015:
|
|
271127
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271128
|
+
|
|
271129
|
+
|
|
271130
|
+
|
|
271131
|
+
var scatterAttrs = __webpack_require__(86854);
|
|
271132
|
+
var fontAttrs = __webpack_require__(70827);
|
|
271133
|
+
var colorAttributes = __webpack_require__(17957);
|
|
271134
|
+
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
271135
|
+
var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
|
|
271136
|
+
var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
|
|
271137
|
+
var baseAttrs = __webpack_require__(35667);
|
|
271138
|
+
var DASHES = __webpack_require__(68828);
|
|
271139
|
+
|
|
271140
|
+
var MARKER_SYMBOLS = __webpack_require__(98993);
|
|
271141
|
+
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
271142
|
+
var overrideAll = (__webpack_require__(70756).overrideAll);
|
|
271143
|
+
var sortObjectKeys = __webpack_require__(99124);
|
|
271144
|
+
|
|
271145
|
+
var scatterLineAttrs = scatterAttrs.line;
|
|
271146
|
+
var scatterMarkerAttrs = scatterAttrs.marker;
|
|
271147
|
+
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
|
|
271148
|
+
|
|
271149
|
+
var lineAttrs = extendFlat({
|
|
271150
|
+
width: scatterLineAttrs.width,
|
|
271151
|
+
dash: {
|
|
271152
|
+
valType: 'enumerated',
|
|
271153
|
+
values: sortObjectKeys(DASHES),
|
|
271154
|
+
dflt: 'solid',
|
|
271155
|
+
description: 'Sets the dash style of the lines.'
|
|
271156
|
+
}
|
|
271157
|
+
}, colorAttributes('line'));
|
|
271158
|
+
|
|
271159
|
+
function makeProjectionAttr(axLetter) {
|
|
271160
|
+
return {
|
|
271161
|
+
show: {
|
|
271162
|
+
valType: 'boolean',
|
|
271163
|
+
dflt: false,
|
|
271164
|
+
description: [
|
|
271165
|
+
'Sets whether or not projections are shown along the',
|
|
271166
|
+
axLetter, 'axis.'
|
|
271167
|
+
].join(' ')
|
|
271168
|
+
},
|
|
271169
|
+
opacity: {
|
|
271170
|
+
valType: 'number',
|
|
271171
|
+
min: 0,
|
|
271172
|
+
max: 1,
|
|
271173
|
+
dflt: 1,
|
|
271174
|
+
description: 'Sets the projection color.'
|
|
271175
|
+
},
|
|
271176
|
+
scale: {
|
|
271177
|
+
valType: 'number',
|
|
271178
|
+
min: 0,
|
|
271179
|
+
max: 10,
|
|
271180
|
+
dflt: 2 / 3,
|
|
271181
|
+
description: [
|
|
271182
|
+
'Sets the scale factor determining the size of the',
|
|
271183
|
+
'projection marker points.'
|
|
271184
|
+
].join(' ')
|
|
271185
|
+
}
|
|
271186
|
+
};
|
|
271187
|
+
}
|
|
271188
|
+
|
|
271189
|
+
var attrs = module.exports = overrideAll({
|
|
271190
|
+
x: scatterAttrs.x,
|
|
271191
|
+
y: scatterAttrs.y,
|
|
271192
|
+
z: {
|
|
271193
|
+
valType: 'data_array',
|
|
271194
|
+
description: 'Sets the z coordinates.'
|
|
271195
|
+
},
|
|
271196
|
+
|
|
271197
|
+
text: extendFlat({}, scatterAttrs.text, {
|
|
271198
|
+
description: [
|
|
271199
|
+
'Sets text elements associated with each (x,y,z) triplet.',
|
|
271200
|
+
'If a single string, the same string appears over',
|
|
271201
|
+
'all the data points.',
|
|
271202
|
+
'If an array of string, the items are mapped in order to the',
|
|
271203
|
+
'this trace\'s (x,y,z) coordinates.',
|
|
271204
|
+
'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
|
|
271205
|
+
'these elements will be seen in the hover labels.'
|
|
271206
|
+
].join(' ')
|
|
271207
|
+
}),
|
|
271208
|
+
texttemplate: texttemplateAttrs({}, {
|
|
271209
|
+
|
|
271210
|
+
}),
|
|
271211
|
+
hovertext: extendFlat({}, scatterAttrs.hovertext, {
|
|
271212
|
+
description: [
|
|
271213
|
+
'Sets text elements associated with each (x,y,z) triplet.',
|
|
271214
|
+
'If a single string, the same string appears over',
|
|
271215
|
+
'all the data points.',
|
|
271216
|
+
'If an array of string, the items are mapped in order to the',
|
|
271217
|
+
'this trace\'s (x,y,z) coordinates.',
|
|
271218
|
+
'To be seen, trace `hoverinfo` must contain a *text* flag.'
|
|
271219
|
+
].join(' ')
|
|
271220
|
+
}),
|
|
271221
|
+
hovertemplate: hovertemplateAttrs(),
|
|
271222
|
+
|
|
271223
|
+
xhoverformat: axisHoverFormat('x'),
|
|
271224
|
+
yhoverformat: axisHoverFormat('y'),
|
|
271225
|
+
zhoverformat: axisHoverFormat('z'),
|
|
271226
|
+
|
|
271227
|
+
mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
|
|
271228
|
+
{dflt: 'lines+markers'}),
|
|
271229
|
+
surfaceaxis: {
|
|
271230
|
+
valType: 'enumerated',
|
|
271231
|
+
values: [-1, 0, 1, 2],
|
|
271232
|
+
dflt: -1,
|
|
271233
|
+
description: [
|
|
271234
|
+
'If *-1*, the scatter points are not fill with a surface',
|
|
271235
|
+
'If *0*, *1*, *2*, the scatter points are filled with',
|
|
271236
|
+
'a Delaunay surface about the x, y, z respectively.'
|
|
271237
|
+
].join(' ')
|
|
271238
|
+
},
|
|
271239
|
+
surfacecolor: {
|
|
271240
|
+
valType: 'color',
|
|
271241
|
+
description: 'Sets the surface fill color.'
|
|
271242
|
+
},
|
|
271243
|
+
projection: {
|
|
271244
|
+
x: makeProjectionAttr('x'),
|
|
271245
|
+
y: makeProjectionAttr('y'),
|
|
271246
|
+
z: makeProjectionAttr('z')
|
|
271247
|
+
},
|
|
271248
|
+
|
|
271249
|
+
connectgaps: scatterAttrs.connectgaps,
|
|
271250
|
+
line: lineAttrs,
|
|
271251
|
+
|
|
271252
|
+
marker: extendFlat({ // Parity with scatter.js?
|
|
271253
|
+
symbol: {
|
|
271254
|
+
valType: 'enumerated',
|
|
271255
|
+
values: sortObjectKeys(MARKER_SYMBOLS),
|
|
271256
|
+
dflt: 'circle',
|
|
271257
|
+
arrayOk: true,
|
|
271258
|
+
description: 'Sets the marker symbol type.'
|
|
271259
|
+
},
|
|
271260
|
+
size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
|
|
271261
|
+
sizeref: scatterMarkerAttrs.sizeref,
|
|
271262
|
+
sizemin: scatterMarkerAttrs.sizemin,
|
|
271263
|
+
sizemode: scatterMarkerAttrs.sizemode,
|
|
271264
|
+
opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
|
|
271265
|
+
arrayOk: false,
|
|
271266
|
+
description: [
|
|
271267
|
+
'Sets the marker opacity.',
|
|
271268
|
+
'Note that the marker opacity for scatter3d traces',
|
|
271269
|
+
'must be a scalar value for performance reasons.',
|
|
271270
|
+
'To set a blending opacity value',
|
|
271271
|
+
'(i.e. which is not transparent), set *marker.color*',
|
|
271272
|
+
'to an rgba color and use its alpha channel.'
|
|
271273
|
+
].join(' ')
|
|
271274
|
+
}),
|
|
271275
|
+
colorbar: scatterMarkerAttrs.colorbar,
|
|
271276
|
+
|
|
271277
|
+
line: extendFlat({
|
|
271278
|
+
width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
|
|
271279
|
+
},
|
|
271280
|
+
colorAttributes('marker.line')
|
|
271281
|
+
)
|
|
271282
|
+
},
|
|
271283
|
+
colorAttributes('marker')
|
|
271284
|
+
),
|
|
271285
|
+
|
|
271286
|
+
textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
|
|
271287
|
+
textfont: fontAttrs({
|
|
271288
|
+
noFontShadow: true,
|
|
271289
|
+
noFontLineposition: true,
|
|
271290
|
+
noFontTextcase: true,
|
|
271291
|
+
editType: 'calc',
|
|
271292
|
+
colorEditType: 'style',
|
|
271293
|
+
arrayOk: true,
|
|
271294
|
+
variantValues: ['normal', 'small-caps'],
|
|
271295
|
+
description: 'Sets the text font.'
|
|
271296
|
+
}),
|
|
271297
|
+
|
|
271298
|
+
opacity: baseAttrs.opacity,
|
|
271299
|
+
|
|
271300
|
+
hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
|
|
271301
|
+
}, 'calc', 'nested');
|
|
271302
|
+
|
|
271303
|
+
attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
|
|
271304
|
+
|
|
271305
|
+
|
|
271306
|
+
/***/ }),
|
|
271307
|
+
|
|
271308
|
+
/***/ 30935:
|
|
271309
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271310
|
+
|
|
271311
|
+
|
|
271312
|
+
|
|
271313
|
+
var arraysToCalcdata = __webpack_require__(47213);
|
|
271314
|
+
var calcColorscale = __webpack_require__(59498);
|
|
271315
|
+
|
|
271316
|
+
/**
|
|
271317
|
+
* This is a kludge to put the array attributes into
|
|
271318
|
+
* calcdata the way Scatter.plot does, so that legends and
|
|
271319
|
+
* popovers know what to do with them.
|
|
271320
|
+
*/
|
|
271321
|
+
module.exports = function calc(gd, trace) {
|
|
271322
|
+
var cd = [{x: false, y: false, trace: trace, t: {}}];
|
|
271323
|
+
|
|
271324
|
+
arraysToCalcdata(cd, trace);
|
|
271325
|
+
calcColorscale(gd, trace);
|
|
271326
|
+
|
|
271327
|
+
return cd;
|
|
271328
|
+
};
|
|
271329
|
+
|
|
271330
|
+
|
|
271331
|
+
/***/ }),
|
|
271332
|
+
|
|
271333
|
+
/***/ 77681:
|
|
271334
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271335
|
+
|
|
271336
|
+
|
|
271337
|
+
|
|
271338
|
+
var Registry = __webpack_require__(13936);
|
|
271339
|
+
|
|
271340
|
+
function calculateAxisErrors(data, params, scaleFactor, axis) {
|
|
271341
|
+
if(!params || !params.visible) return null;
|
|
271342
|
+
|
|
271343
|
+
var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
|
|
271344
|
+
var result = new Array(data.length);
|
|
271345
|
+
|
|
271346
|
+
for(var i = 0; i < data.length; i++) {
|
|
271347
|
+
var errors = computeError(+data[i], i);
|
|
271348
|
+
|
|
271349
|
+
if(axis.type === 'log') {
|
|
271350
|
+
var point = axis.c2l(data[i]);
|
|
271351
|
+
var min = data[i] - errors[0];
|
|
271352
|
+
var max = data[i] + errors[1];
|
|
271353
|
+
|
|
271354
|
+
result[i] = [
|
|
271355
|
+
(axis.c2l(min, true) - point) * scaleFactor,
|
|
271356
|
+
(axis.c2l(max, true) - point) * scaleFactor
|
|
271357
|
+
];
|
|
271358
|
+
|
|
271359
|
+
// Keep track of the lower error bound which isn't negative!
|
|
271360
|
+
if(min > 0) {
|
|
271361
|
+
var lower = axis.c2l(min);
|
|
271362
|
+
if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
|
|
271363
|
+
axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
|
|
271364
|
+
}
|
|
271365
|
+
} else {
|
|
271366
|
+
result[i] = [
|
|
271367
|
+
-errors[0] * scaleFactor,
|
|
271368
|
+
errors[1] * scaleFactor
|
|
271369
|
+
];
|
|
271370
|
+
}
|
|
271371
|
+
}
|
|
271372
|
+
|
|
271373
|
+
return result;
|
|
271374
|
+
}
|
|
271375
|
+
|
|
271376
|
+
function dataLength(array) {
|
|
271377
|
+
for(var i = 0; i < array.length; i++) {
|
|
271378
|
+
if(array[i]) return array[i].length;
|
|
271379
|
+
}
|
|
271380
|
+
return 0;
|
|
271381
|
+
}
|
|
271382
|
+
|
|
271383
|
+
function calculateErrors(data, scaleFactor, sceneLayout) {
|
|
271384
|
+
var errors = [
|
|
271385
|
+
calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
|
|
271386
|
+
calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
|
|
271387
|
+
calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
|
|
271388
|
+
];
|
|
271389
|
+
|
|
271390
|
+
var n = dataLength(errors);
|
|
271391
|
+
if(n === 0) return null;
|
|
271392
|
+
|
|
271393
|
+
var errorBounds = new Array(n);
|
|
271394
|
+
|
|
271395
|
+
for(var i = 0; i < n; i++) {
|
|
271396
|
+
var bound = [[0, 0, 0], [0, 0, 0]];
|
|
271397
|
+
|
|
271398
|
+
for(var j = 0; j < 3; j++) {
|
|
271399
|
+
if(errors[j]) {
|
|
271400
|
+
for(var k = 0; k < 2; k++) {
|
|
271401
|
+
bound[k][j] = errors[j][i][k];
|
|
271402
|
+
}
|
|
271403
|
+
}
|
|
271404
|
+
}
|
|
271405
|
+
|
|
271406
|
+
errorBounds[i] = bound;
|
|
271407
|
+
}
|
|
271408
|
+
|
|
271409
|
+
return errorBounds;
|
|
271410
|
+
}
|
|
271411
|
+
|
|
271412
|
+
module.exports = calculateErrors;
|
|
271413
|
+
|
|
271414
|
+
|
|
271415
|
+
/***/ }),
|
|
271416
|
+
|
|
271417
|
+
/***/ 93219:
|
|
271418
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271419
|
+
|
|
271420
|
+
|
|
271421
|
+
|
|
271422
|
+
var createLinePlot = (__webpack_require__(46000).gl_line3d);
|
|
271423
|
+
var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
|
|
271424
|
+
var createErrorBars = (__webpack_require__(46000).gl_error3d);
|
|
271425
|
+
var createMesh = (__webpack_require__(46000).gl_mesh3d);
|
|
271426
|
+
var triangulate = (__webpack_require__(46000).delaunay_triangulate);
|
|
271427
|
+
|
|
271428
|
+
var Lib = __webpack_require__(30991);
|
|
271429
|
+
var str2RgbaArray = __webpack_require__(44960);
|
|
271430
|
+
var formatColor = (__webpack_require__(592).formatColor);
|
|
271431
|
+
var makeBubbleSizeFn = __webpack_require__(42581);
|
|
271432
|
+
var DASH_PATTERNS = __webpack_require__(68828);
|
|
271433
|
+
var MARKER_SYMBOLS = __webpack_require__(98993);
|
|
271434
|
+
|
|
271435
|
+
var Axes = __webpack_require__(15076);
|
|
271436
|
+
var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
|
|
271437
|
+
|
|
271438
|
+
var calculateError = __webpack_require__(77681);
|
|
271439
|
+
|
|
271440
|
+
function LineWithMarkers(scene, uid) {
|
|
271441
|
+
this.scene = scene;
|
|
271442
|
+
this.uid = uid;
|
|
271443
|
+
this.linePlot = null;
|
|
271444
|
+
this.scatterPlot = null;
|
|
271445
|
+
this.errorBars = null;
|
|
271446
|
+
this.textMarkers = null;
|
|
271447
|
+
this.delaunayMesh = null;
|
|
271448
|
+
this.color = null;
|
|
271449
|
+
this.mode = '';
|
|
271450
|
+
this.dataPoints = [];
|
|
271451
|
+
this.axesBounds = [
|
|
271452
|
+
[-Infinity, -Infinity, -Infinity],
|
|
271453
|
+
[Infinity, Infinity, Infinity]
|
|
271454
|
+
];
|
|
271455
|
+
this.textLabels = null;
|
|
271456
|
+
this.data = null;
|
|
271457
|
+
}
|
|
271458
|
+
|
|
271459
|
+
var proto = LineWithMarkers.prototype;
|
|
271460
|
+
|
|
271461
|
+
proto.handlePick = function(selection) {
|
|
271462
|
+
if(selection.object &&
|
|
271463
|
+
(selection.object === this.linePlot ||
|
|
271464
|
+
selection.object === this.delaunayMesh ||
|
|
271465
|
+
selection.object === this.textMarkers ||
|
|
271466
|
+
selection.object === this.scatterPlot)
|
|
271467
|
+
) {
|
|
271468
|
+
var ind = selection.index = selection.data.index;
|
|
271469
|
+
|
|
271470
|
+
if(selection.object.highlight) {
|
|
271471
|
+
selection.object.highlight(null);
|
|
271472
|
+
}
|
|
271473
|
+
if(this.scatterPlot) {
|
|
271474
|
+
selection.object = this.scatterPlot;
|
|
271475
|
+
this.scatterPlot.highlight(selection.data);
|
|
271476
|
+
}
|
|
271477
|
+
|
|
271478
|
+
selection.textLabel = '';
|
|
271479
|
+
if(this.textLabels) {
|
|
271480
|
+
if(Lib.isArrayOrTypedArray(this.textLabels)) {
|
|
271481
|
+
if(this.textLabels[ind] || this.textLabels[ind] === 0) {
|
|
271482
|
+
selection.textLabel = this.textLabels[ind];
|
|
271483
|
+
}
|
|
271484
|
+
} else {
|
|
271485
|
+
selection.textLabel = this.textLabels;
|
|
271486
|
+
}
|
|
271487
|
+
}
|
|
271488
|
+
|
|
271489
|
+
selection.traceCoordinate = [
|
|
271490
|
+
this.data.x[ind],
|
|
271491
|
+
this.data.y[ind],
|
|
271492
|
+
this.data.z[ind]
|
|
271493
|
+
];
|
|
271494
|
+
|
|
271495
|
+
return true;
|
|
271496
|
+
}
|
|
271497
|
+
};
|
|
271498
|
+
|
|
271499
|
+
function constructDelaunay(points, color, axis) {
|
|
271500
|
+
var u = (axis + 1) % 3;
|
|
271501
|
+
var v = (axis + 2) % 3;
|
|
271502
|
+
var filteredPoints = [];
|
|
271503
|
+
var filteredIds = [];
|
|
271504
|
+
var i;
|
|
271505
|
+
|
|
271506
|
+
for(i = 0; i < points.length; ++i) {
|
|
271507
|
+
var p = points[i];
|
|
271508
|
+
if(isNaN(p[u]) || !isFinite(p[u]) ||
|
|
271509
|
+
isNaN(p[v]) || !isFinite(p[v])) {
|
|
271510
|
+
continue;
|
|
271511
|
+
}
|
|
271512
|
+
filteredPoints.push([p[u], p[v]]);
|
|
271513
|
+
filteredIds.push(i);
|
|
271514
|
+
}
|
|
271515
|
+
var cells = triangulate(filteredPoints);
|
|
271516
|
+
for(i = 0; i < cells.length; ++i) {
|
|
271517
|
+
var c = cells[i];
|
|
271518
|
+
for(var j = 0; j < c.length; ++j) {
|
|
271519
|
+
c[j] = filteredIds[c[j]];
|
|
271520
|
+
}
|
|
271521
|
+
}
|
|
271522
|
+
return {
|
|
271523
|
+
positions: points,
|
|
271524
|
+
cells: cells,
|
|
271525
|
+
meshColor: color
|
|
271526
|
+
};
|
|
271527
|
+
}
|
|
271528
|
+
|
|
271529
|
+
function calculateErrorParams(errors) {
|
|
271530
|
+
var capSize = [0.0, 0.0, 0.0];
|
|
271531
|
+
var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
|
|
271532
|
+
var lineWidth = [1.0, 1.0, 1.0];
|
|
271533
|
+
|
|
271534
|
+
for(var i = 0; i < 3; i++) {
|
|
271535
|
+
var e = errors[i];
|
|
271536
|
+
|
|
271537
|
+
if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
|
|
271538
|
+
if(!e || !e.visible) continue;
|
|
271539
|
+
|
|
271540
|
+
capSize[i] = e.width / 2; // ballpark rescaling
|
|
271541
|
+
color[i] = str2RgbaArray(e.color);
|
|
271542
|
+
lineWidth[i] = e.thickness;
|
|
271543
|
+
}
|
|
271544
|
+
|
|
271545
|
+
return {capSize: capSize, color: color, lineWidth: lineWidth};
|
|
271546
|
+
}
|
|
271547
|
+
|
|
271548
|
+
function parseAlignmentX(a) {
|
|
271549
|
+
if(a === null || a === undefined) return 0;
|
|
271550
|
+
|
|
271551
|
+
return (a.indexOf('left') > -1) ? -1 :
|
|
271552
|
+
(a.indexOf('right') > -1) ? 1 : 0;
|
|
271553
|
+
}
|
|
271554
|
+
|
|
271555
|
+
function parseAlignmentY(a) {
|
|
271556
|
+
if(a === null || a === undefined) return 0;
|
|
271557
|
+
|
|
271558
|
+
return (a.indexOf('top') > -1) ? -1 :
|
|
271559
|
+
(a.indexOf('bottom') > -1) ? 1 : 0;
|
|
271560
|
+
}
|
|
271561
|
+
|
|
271562
|
+
function calculateTextOffset(tp) {
|
|
271563
|
+
// Read out text properties
|
|
271564
|
+
|
|
271565
|
+
var defaultAlignmentX = 0;
|
|
271566
|
+
var defaultAlignmentY = 0;
|
|
271567
|
+
|
|
271568
|
+
var textOffset = [
|
|
271569
|
+
defaultAlignmentX,
|
|
271570
|
+
defaultAlignmentY
|
|
271571
|
+
];
|
|
271572
|
+
|
|
271573
|
+
if(Array.isArray(tp)) {
|
|
271574
|
+
for(var i = 0; i < tp.length; i++) {
|
|
271575
|
+
textOffset[i] = [
|
|
271576
|
+
defaultAlignmentX,
|
|
271577
|
+
defaultAlignmentY
|
|
271578
|
+
];
|
|
271579
|
+
if(tp[i]) {
|
|
271580
|
+
textOffset[i][0] = parseAlignmentX(tp[i]);
|
|
271581
|
+
textOffset[i][1] = parseAlignmentY(tp[i]);
|
|
271582
|
+
}
|
|
271583
|
+
}
|
|
271584
|
+
} else {
|
|
271585
|
+
textOffset[0] = parseAlignmentX(tp);
|
|
271586
|
+
textOffset[1] = parseAlignmentY(tp);
|
|
271587
|
+
}
|
|
271588
|
+
|
|
271589
|
+
return textOffset;
|
|
271590
|
+
}
|
|
271591
|
+
|
|
271592
|
+
|
|
271593
|
+
function calculateSize(sizeIn, sizeFn) {
|
|
271594
|
+
// rough parity with Plotly 2D markers
|
|
271595
|
+
return sizeFn(sizeIn * 4);
|
|
271596
|
+
}
|
|
271597
|
+
|
|
271598
|
+
function calculateSymbol(symbolIn) {
|
|
271599
|
+
return MARKER_SYMBOLS[symbolIn];
|
|
271600
|
+
}
|
|
271601
|
+
|
|
271602
|
+
function formatParam(paramIn, len, calculate, dflt, extraFn) {
|
|
271603
|
+
var paramOut = null;
|
|
271604
|
+
|
|
271605
|
+
if(Lib.isArrayOrTypedArray(paramIn)) {
|
|
271606
|
+
paramOut = [];
|
|
271607
|
+
|
|
271608
|
+
for(var i = 0; i < len; i++) {
|
|
271609
|
+
if(paramIn[i] === undefined) paramOut[i] = dflt;
|
|
271610
|
+
else paramOut[i] = calculate(paramIn[i], extraFn);
|
|
271611
|
+
}
|
|
271612
|
+
} else paramOut = calculate(paramIn, Lib.identity);
|
|
271613
|
+
|
|
271614
|
+
return paramOut;
|
|
271615
|
+
}
|
|
271616
|
+
|
|
271617
|
+
|
|
271618
|
+
function convertPlotlyOptions(scene, data) {
|
|
271619
|
+
var points = [];
|
|
271620
|
+
var sceneLayout = scene.fullSceneLayout;
|
|
271621
|
+
var scaleFactor = scene.dataScale;
|
|
271622
|
+
var xaxis = sceneLayout.xaxis;
|
|
271623
|
+
var yaxis = sceneLayout.yaxis;
|
|
271624
|
+
var zaxis = sceneLayout.zaxis;
|
|
271625
|
+
var marker = data.marker;
|
|
271626
|
+
var line = data.line;
|
|
271627
|
+
var x = data.x || [];
|
|
271628
|
+
var y = data.y || [];
|
|
271629
|
+
var z = data.z || [];
|
|
271630
|
+
var len = x.length;
|
|
271631
|
+
var xcalendar = data.xcalendar;
|
|
271632
|
+
var ycalendar = data.ycalendar;
|
|
271633
|
+
var zcalendar = data.zcalendar;
|
|
271634
|
+
var xc, yc, zc;
|
|
271635
|
+
var params, i;
|
|
271636
|
+
var text;
|
|
271637
|
+
|
|
271638
|
+
// Convert points
|
|
271639
|
+
for(i = 0; i < len; i++) {
|
|
271640
|
+
// sanitize numbers and apply transforms based on axes.type
|
|
271641
|
+
xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
|
|
271642
|
+
yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
|
|
271643
|
+
zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
|
|
271644
|
+
|
|
271645
|
+
points[i] = [xc, yc, zc];
|
|
271646
|
+
}
|
|
271647
|
+
|
|
271648
|
+
// convert text
|
|
271649
|
+
if(Array.isArray(data.text)) {
|
|
271650
|
+
text = data.text;
|
|
271651
|
+
} else if(Lib.isTypedArray(data.text)) {
|
|
271652
|
+
text = Array.from(data.text);
|
|
271653
|
+
} else if(data.text !== undefined) {
|
|
271654
|
+
text = new Array(len);
|
|
271655
|
+
for(i = 0; i < len; i++) text[i] = data.text;
|
|
271656
|
+
}
|
|
271657
|
+
|
|
271658
|
+
function formatter(axName, val) {
|
|
271659
|
+
var ax = sceneLayout[axName];
|
|
271660
|
+
return Axes.tickText(ax, ax.d2l(val), true).text;
|
|
271661
|
+
}
|
|
271662
|
+
|
|
271663
|
+
// check texttemplate
|
|
271664
|
+
var texttemplate = data.texttemplate;
|
|
271665
|
+
if(texttemplate) {
|
|
271666
|
+
var fullLayout = scene.fullLayout;
|
|
271667
|
+
var d3locale = fullLayout._d3locale;
|
|
271668
|
+
var isArray = Array.isArray(texttemplate);
|
|
271669
|
+
var N = isArray ? Math.min(texttemplate.length, len) : len;
|
|
271670
|
+
var txt = isArray ?
|
|
271671
|
+
function(i) { return texttemplate[i]; } :
|
|
271672
|
+
function() { return texttemplate; };
|
|
271673
|
+
|
|
271674
|
+
text = new Array(N);
|
|
271675
|
+
|
|
271676
|
+
for(i = 0; i < N; i++) {
|
|
271677
|
+
var d = {x: x[i], y: y[i], z: z[i]};
|
|
271678
|
+
var labels = {
|
|
271679
|
+
xLabel: formatter('xaxis', x[i]),
|
|
271680
|
+
yLabel: formatter('yaxis', y[i]),
|
|
271681
|
+
zLabel: formatter('zaxis', z[i])
|
|
271682
|
+
};
|
|
271683
|
+
var pointValues = {};
|
|
271684
|
+
appendArrayPointValue(pointValues, data, i);
|
|
271685
|
+
var meta = data._meta || {};
|
|
271686
|
+
text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
|
|
271687
|
+
}
|
|
271688
|
+
}
|
|
271689
|
+
|
|
271690
|
+
// Build object parameters
|
|
271691
|
+
params = {
|
|
271692
|
+
position: points,
|
|
271693
|
+
mode: data.mode,
|
|
271694
|
+
text: text
|
|
271695
|
+
};
|
|
271696
|
+
|
|
271697
|
+
if('line' in data) {
|
|
271698
|
+
params.lineColor = formatColor(line, 1, len);
|
|
271699
|
+
params.lineWidth = line.width;
|
|
271700
|
+
params.lineDashes = line.dash;
|
|
271701
|
+
}
|
|
271702
|
+
|
|
271703
|
+
if('marker' in data) {
|
|
271704
|
+
var sizeFn = makeBubbleSizeFn(data);
|
|
271705
|
+
|
|
271706
|
+
params.scatterColor = formatColor(marker, 1, len);
|
|
271707
|
+
params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
|
|
271708
|
+
params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
|
|
271709
|
+
params.scatterLineWidth = marker.line.width; // arrayOk === false
|
|
271710
|
+
params.scatterLineColor = formatColor(marker.line, 1, len);
|
|
271711
|
+
params.scatterAngle = 0;
|
|
271712
|
+
}
|
|
271713
|
+
|
|
271714
|
+
if('textposition' in data) {
|
|
271715
|
+
params.textOffset = calculateTextOffset(data.textposition);
|
|
271716
|
+
params.textColor = formatColor(data.textfont, 1, len);
|
|
271717
|
+
params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
|
|
271718
|
+
params.textFontFamily = data.textfont.family;
|
|
271719
|
+
params.textFontWeight = data.textfont.weight;
|
|
271720
|
+
params.textFontStyle = data.textfont.style;
|
|
271721
|
+
params.textFontVariant = data.textfont.variant;
|
|
271722
|
+
params.textAngle = 0;
|
|
271723
|
+
}
|
|
271724
|
+
|
|
271725
|
+
var dims = ['x', 'y', 'z'];
|
|
271726
|
+
params.project = [false, false, false];
|
|
271727
|
+
params.projectScale = [1, 1, 1];
|
|
271728
|
+
params.projectOpacity = [1, 1, 1];
|
|
271729
|
+
for(i = 0; i < 3; ++i) {
|
|
271730
|
+
var projection = data.projection[dims[i]];
|
|
271731
|
+
if((params.project[i] = projection.show)) {
|
|
271732
|
+
params.projectOpacity[i] = projection.opacity;
|
|
271733
|
+
params.projectScale[i] = projection.scale;
|
|
271734
|
+
}
|
|
271735
|
+
}
|
|
271736
|
+
|
|
271737
|
+
params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
|
|
271738
|
+
|
|
271739
|
+
var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
|
|
271740
|
+
params.errorColor = errorParams.color;
|
|
271741
|
+
params.errorLineWidth = errorParams.lineWidth;
|
|
271742
|
+
params.errorCapSize = errorParams.capSize;
|
|
271743
|
+
|
|
271744
|
+
params.delaunayAxis = data.surfaceaxis;
|
|
271745
|
+
params.delaunayColor = str2RgbaArray(data.surfacecolor);
|
|
271746
|
+
|
|
271747
|
+
return params;
|
|
271748
|
+
}
|
|
271749
|
+
|
|
271750
|
+
function _arrayToColor(color) {
|
|
271751
|
+
if(Lib.isArrayOrTypedArray(color)) {
|
|
271752
|
+
var c = color[0];
|
|
271753
|
+
|
|
271754
|
+
if(Lib.isArrayOrTypedArray(c)) color = c;
|
|
271755
|
+
|
|
271756
|
+
return 'rgb(' + color.slice(0, 3).map(function(x) {
|
|
271757
|
+
return Math.round(x * 255);
|
|
271758
|
+
}) + ')';
|
|
271759
|
+
}
|
|
271760
|
+
|
|
271761
|
+
return null;
|
|
271762
|
+
}
|
|
271763
|
+
|
|
271764
|
+
function arrayToColor(colors) {
|
|
271765
|
+
if(!Lib.isArrayOrTypedArray(colors)) {
|
|
271766
|
+
return null;
|
|
271767
|
+
}
|
|
271768
|
+
|
|
271769
|
+
if((colors.length === 4) && (typeof colors[0] === 'number')) {
|
|
271770
|
+
return _arrayToColor(colors);
|
|
271771
|
+
}
|
|
271772
|
+
|
|
271773
|
+
return colors.map(_arrayToColor);
|
|
271774
|
+
}
|
|
271775
|
+
|
|
271776
|
+
proto.update = function(data) {
|
|
271777
|
+
var gl = this.scene.glplot.gl;
|
|
271778
|
+
var lineOptions;
|
|
271779
|
+
var scatterOptions;
|
|
271780
|
+
var errorOptions;
|
|
271781
|
+
var textOptions;
|
|
271782
|
+
var dashPattern = DASH_PATTERNS.solid;
|
|
271783
|
+
|
|
271784
|
+
// Save data
|
|
271785
|
+
this.data = data;
|
|
271786
|
+
|
|
271787
|
+
// Run data conversion
|
|
271788
|
+
var options = convertPlotlyOptions(this.scene, data);
|
|
271789
|
+
|
|
271790
|
+
if('mode' in options) {
|
|
271791
|
+
this.mode = options.mode;
|
|
271792
|
+
}
|
|
271793
|
+
if('lineDashes' in options) {
|
|
271794
|
+
if(options.lineDashes in DASH_PATTERNS) {
|
|
271795
|
+
dashPattern = DASH_PATTERNS[options.lineDashes];
|
|
271796
|
+
}
|
|
271797
|
+
}
|
|
271798
|
+
|
|
271799
|
+
this.color = arrayToColor(options.scatterColor) ||
|
|
271800
|
+
arrayToColor(options.lineColor);
|
|
271801
|
+
|
|
271802
|
+
// Save data points
|
|
271803
|
+
this.dataPoints = options.position;
|
|
271804
|
+
|
|
271805
|
+
lineOptions = {
|
|
271806
|
+
gl: this.scene.glplot.gl,
|
|
271807
|
+
position: options.position,
|
|
271808
|
+
color: options.lineColor,
|
|
271809
|
+
lineWidth: options.lineWidth || 1,
|
|
271810
|
+
dashes: dashPattern[0],
|
|
271811
|
+
dashScale: dashPattern[1],
|
|
271812
|
+
opacity: data.opacity,
|
|
271813
|
+
connectGaps: data.connectgaps
|
|
271814
|
+
};
|
|
271815
|
+
|
|
271816
|
+
if(this.mode.indexOf('lines') !== -1) {
|
|
271817
|
+
if(this.linePlot) this.linePlot.update(lineOptions);
|
|
271818
|
+
else {
|
|
271819
|
+
this.linePlot = createLinePlot(lineOptions);
|
|
271820
|
+
this.linePlot._trace = this;
|
|
271821
|
+
this.scene.glplot.add(this.linePlot);
|
|
271822
|
+
}
|
|
271823
|
+
} else if(this.linePlot) {
|
|
271824
|
+
this.scene.glplot.remove(this.linePlot);
|
|
271825
|
+
this.linePlot.dispose();
|
|
271826
|
+
this.linePlot = null;
|
|
271827
|
+
}
|
|
271828
|
+
|
|
271829
|
+
// N.B. marker.opacity must be a scalar for performance
|
|
271830
|
+
var scatterOpacity = data.opacity;
|
|
271831
|
+
if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
|
|
271832
|
+
|
|
271833
|
+
scatterOptions = {
|
|
271834
|
+
gl: this.scene.glplot.gl,
|
|
271835
|
+
position: options.position,
|
|
271836
|
+
color: options.scatterColor,
|
|
271837
|
+
size: options.scatterSize,
|
|
271838
|
+
glyph: options.scatterMarker,
|
|
271839
|
+
opacity: scatterOpacity,
|
|
271840
|
+
orthographic: true,
|
|
271841
|
+
lineWidth: options.scatterLineWidth,
|
|
271842
|
+
lineColor: options.scatterLineColor,
|
|
271843
|
+
project: options.project,
|
|
271844
|
+
projectScale: options.projectScale,
|
|
271845
|
+
projectOpacity: options.projectOpacity
|
|
271846
|
+
};
|
|
271847
|
+
|
|
271848
|
+
if(this.mode.indexOf('markers') !== -1) {
|
|
271849
|
+
if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
|
|
271850
|
+
else {
|
|
271851
|
+
this.scatterPlot = createScatterPlot(scatterOptions);
|
|
271852
|
+
this.scatterPlot._trace = this;
|
|
271853
|
+
this.scatterPlot.highlightScale = 1;
|
|
271854
|
+
this.scene.glplot.add(this.scatterPlot);
|
|
271855
|
+
}
|
|
271856
|
+
} else if(this.scatterPlot) {
|
|
271857
|
+
this.scene.glplot.remove(this.scatterPlot);
|
|
271858
|
+
this.scatterPlot.dispose();
|
|
271859
|
+
this.scatterPlot = null;
|
|
271860
|
+
}
|
|
271861
|
+
|
|
271862
|
+
textOptions = {
|
|
271863
|
+
gl: this.scene.glplot.gl,
|
|
271864
|
+
position: options.position,
|
|
271865
|
+
glyph: options.text,
|
|
271866
|
+
color: options.textColor,
|
|
271867
|
+
size: options.textSize,
|
|
271868
|
+
angle: options.textAngle,
|
|
271869
|
+
alignment: options.textOffset,
|
|
271870
|
+
font: options.textFontFamily,
|
|
271871
|
+
fontWeight: options.textFontWeight,
|
|
271872
|
+
fontStyle: options.textFontStyle,
|
|
271873
|
+
fontVariant: options.textFontVariant,
|
|
271874
|
+
orthographic: true,
|
|
271875
|
+
lineWidth: 0,
|
|
271876
|
+
project: false,
|
|
271877
|
+
opacity: data.opacity
|
|
271878
|
+
};
|
|
271879
|
+
|
|
271880
|
+
this.textLabels = data.hovertext || data.text;
|
|
271881
|
+
|
|
271882
|
+
if(this.mode.indexOf('text') !== -1) {
|
|
271883
|
+
if(this.textMarkers) this.textMarkers.update(textOptions);
|
|
271884
|
+
else {
|
|
271885
|
+
this.textMarkers = createScatterPlot(textOptions);
|
|
271886
|
+
this.textMarkers._trace = this;
|
|
271887
|
+
this.textMarkers.highlightScale = 1;
|
|
271888
|
+
this.scene.glplot.add(this.textMarkers);
|
|
271889
|
+
}
|
|
271890
|
+
} else if(this.textMarkers) {
|
|
271891
|
+
this.scene.glplot.remove(this.textMarkers);
|
|
271892
|
+
this.textMarkers.dispose();
|
|
271893
|
+
this.textMarkers = null;
|
|
271894
|
+
}
|
|
271895
|
+
|
|
271896
|
+
errorOptions = {
|
|
271897
|
+
gl: this.scene.glplot.gl,
|
|
271898
|
+
position: options.position,
|
|
271899
|
+
color: options.errorColor,
|
|
271900
|
+
error: options.errorBounds,
|
|
271901
|
+
lineWidth: options.errorLineWidth,
|
|
271902
|
+
capSize: options.errorCapSize,
|
|
271903
|
+
opacity: data.opacity
|
|
271904
|
+
};
|
|
271905
|
+
if(this.errorBars) {
|
|
271906
|
+
if(options.errorBounds) {
|
|
271907
|
+
this.errorBars.update(errorOptions);
|
|
271908
|
+
} else {
|
|
271909
|
+
this.scene.glplot.remove(this.errorBars);
|
|
271910
|
+
this.errorBars.dispose();
|
|
271911
|
+
this.errorBars = null;
|
|
271912
|
+
}
|
|
271913
|
+
} else if(options.errorBounds) {
|
|
271914
|
+
this.errorBars = createErrorBars(errorOptions);
|
|
271915
|
+
this.errorBars._trace = this;
|
|
271916
|
+
this.scene.glplot.add(this.errorBars);
|
|
271917
|
+
}
|
|
271918
|
+
|
|
271919
|
+
if(options.delaunayAxis >= 0) {
|
|
271920
|
+
var delaunayOptions = constructDelaunay(
|
|
271921
|
+
options.position,
|
|
271922
|
+
options.delaunayColor,
|
|
271923
|
+
options.delaunayAxis
|
|
271924
|
+
);
|
|
271925
|
+
delaunayOptions.opacity = data.opacity;
|
|
271926
|
+
|
|
271927
|
+
if(this.delaunayMesh) {
|
|
271928
|
+
this.delaunayMesh.update(delaunayOptions);
|
|
271929
|
+
} else {
|
|
271930
|
+
delaunayOptions.gl = gl;
|
|
271931
|
+
this.delaunayMesh = createMesh(delaunayOptions);
|
|
271932
|
+
this.delaunayMesh._trace = this;
|
|
271933
|
+
this.scene.glplot.add(this.delaunayMesh);
|
|
271934
|
+
}
|
|
271935
|
+
} else if(this.delaunayMesh) {
|
|
271936
|
+
this.scene.glplot.remove(this.delaunayMesh);
|
|
271937
|
+
this.delaunayMesh.dispose();
|
|
271938
|
+
this.delaunayMesh = null;
|
|
271939
|
+
}
|
|
271940
|
+
};
|
|
271941
|
+
|
|
271942
|
+
proto.dispose = function() {
|
|
271943
|
+
if(this.linePlot) {
|
|
271944
|
+
this.scene.glplot.remove(this.linePlot);
|
|
271945
|
+
this.linePlot.dispose();
|
|
271946
|
+
}
|
|
271947
|
+
if(this.scatterPlot) {
|
|
271948
|
+
this.scene.glplot.remove(this.scatterPlot);
|
|
271949
|
+
this.scatterPlot.dispose();
|
|
271950
|
+
}
|
|
271951
|
+
if(this.errorBars) {
|
|
271952
|
+
this.scene.glplot.remove(this.errorBars);
|
|
271953
|
+
this.errorBars.dispose();
|
|
271954
|
+
}
|
|
271955
|
+
if(this.textMarkers) {
|
|
271956
|
+
this.scene.glplot.remove(this.textMarkers);
|
|
271957
|
+
this.textMarkers.dispose();
|
|
271958
|
+
}
|
|
271959
|
+
if(this.delaunayMesh) {
|
|
271960
|
+
this.scene.glplot.remove(this.delaunayMesh);
|
|
271961
|
+
this.delaunayMesh.dispose();
|
|
271962
|
+
}
|
|
271963
|
+
};
|
|
271964
|
+
|
|
271965
|
+
function createLineWithMarkers(scene, data) {
|
|
271966
|
+
var plot = new LineWithMarkers(scene, data.uid);
|
|
271967
|
+
plot.update(data);
|
|
271968
|
+
return plot;
|
|
271969
|
+
}
|
|
271970
|
+
|
|
271971
|
+
module.exports = createLineWithMarkers;
|
|
271972
|
+
|
|
271973
|
+
|
|
271974
|
+
/***/ }),
|
|
271975
|
+
|
|
271976
|
+
/***/ 13744:
|
|
271977
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271978
|
+
|
|
271979
|
+
|
|
271980
|
+
|
|
271981
|
+
var Registry = __webpack_require__(13936);
|
|
271982
|
+
var Lib = __webpack_require__(30991);
|
|
271983
|
+
|
|
271984
|
+
var subTypes = __webpack_require__(33068);
|
|
271985
|
+
var handleMarkerDefaults = __webpack_require__(15294);
|
|
271986
|
+
var handleLineDefaults = __webpack_require__(82094);
|
|
271987
|
+
var handleTextDefaults = __webpack_require__(94729);
|
|
271988
|
+
|
|
271989
|
+
var attributes = __webpack_require__(1015);
|
|
271990
|
+
|
|
271991
|
+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
271992
|
+
function coerce(attr, dflt) {
|
|
271993
|
+
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
271994
|
+
}
|
|
271995
|
+
|
|
271996
|
+
var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
|
|
271997
|
+
if(!len) {
|
|
271998
|
+
traceOut.visible = false;
|
|
271999
|
+
return;
|
|
272000
|
+
}
|
|
272001
|
+
|
|
272002
|
+
coerce('text');
|
|
272003
|
+
coerce('hovertext');
|
|
272004
|
+
coerce('hovertemplate');
|
|
272005
|
+
coerce('xhoverformat');
|
|
272006
|
+
coerce('yhoverformat');
|
|
272007
|
+
coerce('zhoverformat');
|
|
272008
|
+
|
|
272009
|
+
coerce('mode');
|
|
272010
|
+
|
|
272011
|
+
if(subTypes.hasMarkers(traceOut)) {
|
|
272012
|
+
handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
|
|
272013
|
+
}
|
|
272014
|
+
|
|
272015
|
+
if(subTypes.hasLines(traceOut)) {
|
|
272016
|
+
coerce('connectgaps');
|
|
272017
|
+
handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
|
|
272018
|
+
}
|
|
272019
|
+
|
|
272020
|
+
if(subTypes.hasText(traceOut)) {
|
|
272021
|
+
coerce('texttemplate');
|
|
272022
|
+
handleTextDefaults(traceIn, traceOut, layout, coerce, {
|
|
272023
|
+
noSelect: true,
|
|
272024
|
+
noFontShadow: true,
|
|
272025
|
+
noFontLineposition: true,
|
|
272026
|
+
noFontTextcase: true,
|
|
272027
|
+
});
|
|
272028
|
+
}
|
|
272029
|
+
|
|
272030
|
+
var lineColor = (traceOut.line || {}).color;
|
|
272031
|
+
var markerColor = (traceOut.marker || {}).color;
|
|
272032
|
+
if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
|
|
272033
|
+
|
|
272034
|
+
var dims = ['x', 'y', 'z'];
|
|
272035
|
+
for(var i = 0; i < 3; ++i) {
|
|
272036
|
+
var projection = 'projection.' + dims[i];
|
|
272037
|
+
if(coerce(projection + '.show')) {
|
|
272038
|
+
coerce(projection + '.opacity');
|
|
272039
|
+
coerce(projection + '.scale');
|
|
272040
|
+
}
|
|
272041
|
+
}
|
|
272042
|
+
|
|
272043
|
+
var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
|
|
272044
|
+
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
|
|
272045
|
+
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
|
|
272046
|
+
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
|
|
272047
|
+
};
|
|
272048
|
+
|
|
272049
|
+
function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
|
|
272050
|
+
var len = 0;
|
|
272051
|
+
var x = coerce('x');
|
|
272052
|
+
var y = coerce('y');
|
|
272053
|
+
var z = coerce('z');
|
|
272054
|
+
|
|
272055
|
+
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
|
|
272056
|
+
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
|
|
272057
|
+
|
|
272058
|
+
if(x && y && z) {
|
|
272059
|
+
// TODO: what happens if one is missing?
|
|
272060
|
+
len = Math.min(x.length, y.length, z.length);
|
|
272061
|
+
traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
|
|
272062
|
+
}
|
|
272063
|
+
|
|
272064
|
+
return len;
|
|
272065
|
+
}
|
|
272066
|
+
|
|
272067
|
+
|
|
272068
|
+
/***/ }),
|
|
272069
|
+
|
|
272070
|
+
/***/ 68860:
|
|
272071
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
272072
|
+
|
|
272073
|
+
|
|
272074
|
+
|
|
272075
|
+
module.exports = {
|
|
272076
|
+
plot: __webpack_require__(93219),
|
|
272077
|
+
attributes: __webpack_require__(1015),
|
|
272078
|
+
markerSymbols: __webpack_require__(98993),
|
|
272079
|
+
supplyDefaults: __webpack_require__(13744),
|
|
272080
|
+
colorbar: [
|
|
272081
|
+
{
|
|
272082
|
+
container: 'marker',
|
|
272083
|
+
min: 'cmin',
|
|
272084
|
+
max: 'cmax'
|
|
272085
|
+
}, {
|
|
272086
|
+
container: 'line',
|
|
272087
|
+
min: 'cmin',
|
|
272088
|
+
max: 'cmax'
|
|
272089
|
+
}
|
|
272090
|
+
],
|
|
272091
|
+
calc: __webpack_require__(30935),
|
|
272092
|
+
|
|
272093
|
+
moduleType: 'trace',
|
|
272094
|
+
name: 'scatter3d',
|
|
272095
|
+
basePlotModule: __webpack_require__(68137),
|
|
272096
|
+
categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
|
|
272097
|
+
meta: {
|
|
272098
|
+
hrName: 'scatter_3d',
|
|
272099
|
+
description: [
|
|
272100
|
+
'The data visualized as scatter point or lines in 3D dimension',
|
|
272101
|
+
'is set in `x`, `y`, `z`.',
|
|
272102
|
+
'Text (appearing either on the chart or on hover only) is via `text`.',
|
|
272103
|
+
'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
|
|
272104
|
+
'Projections are achieved via `projection`.',
|
|
272105
|
+
'Surface fills are achieved via `surfaceaxis`.'
|
|
272106
|
+
].join(' ')
|
|
272107
|
+
}
|
|
272108
|
+
};
|
|
272109
|
+
|
|
272110
|
+
|
|
272111
272111
|
/***/ }),
|
|
272112
272112
|
|
|
272113
272113
|
/***/ 44771:
|
|
@@ -369447,7 +369447,7 @@ function HtmlRunner() {
|
|
|
369447
369447
|
const iframeClasses = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
|
|
369448
369448
|
[styles_module_scss_1.default.codeHasBeenRun]: codeHasBeenRun,
|
|
369449
369449
|
});
|
|
369450
|
-
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: "\
|
|
369450
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.htmlrunnerContainer, children: [(0, jsx_runtime_1.jsx)(OutputTabPanel_1.OutputTabPanel, { title: "Preview", icon: preview_svg_1.default, readOnly: readOnly, extraTabContent: codeHasBeenRun && openInNewTabLink, tabPanelClassName: styles_module_scss_1.default.previewHtml, children: error ? ((0, jsx_runtime_1.jsx)("div", { className: iframeClasses, children: (0, jsx_runtime_1.jsx)(NotFoundPage_1.NotFoundPage, {}) })) : ((0, jsx_runtime_1.jsx)("iframe", { className: iframeClasses, sandbox: "allow-scripts allow-same-origin allow-modals allow-popups", referrerPolicy: "strict-origin-when-cross-origin", allow: "\n accelerometer 'none';\n camera 'none';\n encrypted-media;\n fullscreen;\n picture-in-picture;\n geolocation 'none';\n gyroscope 'none';\n magnetometer 'none';\n microphone 'none';\n midi 'none';\n payment 'none';\n usb 'none';\n ", id: "output-frame", title: "HTML Output Preview", ref: output, onLoad: iframeReload })) }), !isPreviewMode && ((0, jsx_runtime_1.jsx)(ResizableWithHandle_1.default, { "data-testid": "proj-console-container", handleDirection: "top", defaultHeight: "50%", className: styles_module_scss_1.default.resizeContainer, handleClassName: styles_module_scss_1.default.resizeHandleContainer, children: (0, jsx_runtime_1.jsx)(OutputTabPanel_1.OutputTabPanel, { title: "Console", icon: console_svg_1.default, readOnly: readOnly, children: (0, jsx_runtime_1.jsx)(HtmlConsole_1.default, { consoleLogs: consoleLogs }) }) }))] }));
|
|
369451
369451
|
}
|
|
369452
369452
|
exports["default"] = HtmlRunner;
|
|
369453
369453
|
|
|
@@ -369829,234 +369829,234 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
369829
369829
|
exports.consoleOverrideScript = exports.disableLocalStorageScript = void 0;
|
|
369830
369830
|
// insert script to disable access to specific localStorage keys
|
|
369831
369831
|
// localstorage.getItem() is a potential security risk when executing untrusted code
|
|
369832
|
-
exports.disableLocalStorageScript = `
|
|
369833
|
-
<script>
|
|
369834
|
-
(function() {
|
|
369835
|
-
const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
|
|
369836
|
-
const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
|
|
369837
|
-
const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
|
|
369838
|
-
const originalClear = window.localStorage.clear.bind(window.localStorage);
|
|
369839
|
-
|
|
369840
|
-
const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
|
|
369841
|
-
|
|
369842
|
-
Object.defineProperty(window, 'localStorage', {
|
|
369843
|
-
value: {
|
|
369844
|
-
getItem: function(key) {
|
|
369845
|
-
if (isDisallowedKey(key)) {
|
|
369846
|
-
console.log(\`localStorage.getItem for "\${key}" is disabled\`);
|
|
369847
|
-
return null;
|
|
369848
|
-
}
|
|
369849
|
-
return originalGetItem(key);
|
|
369850
|
-
},
|
|
369851
|
-
setItem: function(key, value) {
|
|
369852
|
-
if (isDisallowedKey(key)) {
|
|
369853
|
-
console.log(\`localStorage.setItem for "\${key}" is disabled\`);
|
|
369854
|
-
return;
|
|
369855
|
-
}
|
|
369856
|
-
return originalSetItem(key, value);
|
|
369857
|
-
},
|
|
369858
|
-
removeItem: function(key) {
|
|
369859
|
-
if (isDisallowedKey(key)) {
|
|
369860
|
-
console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
|
|
369861
|
-
return;
|
|
369862
|
-
}
|
|
369863
|
-
return originalRemoveItem(key);
|
|
369864
|
-
},
|
|
369865
|
-
clear: function() {
|
|
369866
|
-
console.log('localStorage.clear is disabled');
|
|
369867
|
-
return;
|
|
369868
|
-
}
|
|
369869
|
-
},
|
|
369870
|
-
writable: false,
|
|
369871
|
-
configurable: false
|
|
369872
|
-
});
|
|
369873
|
-
})();
|
|
369874
|
-
</script>
|
|
369832
|
+
exports.disableLocalStorageScript = `
|
|
369833
|
+
<script>
|
|
369834
|
+
(function() {
|
|
369835
|
+
const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
|
|
369836
|
+
const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
|
|
369837
|
+
const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
|
|
369838
|
+
const originalClear = window.localStorage.clear.bind(window.localStorage);
|
|
369839
|
+
|
|
369840
|
+
const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
|
|
369841
|
+
|
|
369842
|
+
Object.defineProperty(window, 'localStorage', {
|
|
369843
|
+
value: {
|
|
369844
|
+
getItem: function(key) {
|
|
369845
|
+
if (isDisallowedKey(key)) {
|
|
369846
|
+
console.log(\`localStorage.getItem for "\${key}" is disabled\`);
|
|
369847
|
+
return null;
|
|
369848
|
+
}
|
|
369849
|
+
return originalGetItem(key);
|
|
369850
|
+
},
|
|
369851
|
+
setItem: function(key, value) {
|
|
369852
|
+
if (isDisallowedKey(key)) {
|
|
369853
|
+
console.log(\`localStorage.setItem for "\${key}" is disabled\`);
|
|
369854
|
+
return;
|
|
369855
|
+
}
|
|
369856
|
+
return originalSetItem(key, value);
|
|
369857
|
+
},
|
|
369858
|
+
removeItem: function(key) {
|
|
369859
|
+
if (isDisallowedKey(key)) {
|
|
369860
|
+
console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
|
|
369861
|
+
return;
|
|
369862
|
+
}
|
|
369863
|
+
return originalRemoveItem(key);
|
|
369864
|
+
},
|
|
369865
|
+
clear: function() {
|
|
369866
|
+
console.log('localStorage.clear is disabled');
|
|
369867
|
+
return;
|
|
369868
|
+
}
|
|
369869
|
+
},
|
|
369870
|
+
writable: false,
|
|
369871
|
+
configurable: false
|
|
369872
|
+
});
|
|
369873
|
+
})();
|
|
369874
|
+
</script>
|
|
369875
369875
|
`;
|
|
369876
369876
|
const MAX_DEPTH = 5; // Maximum depth for object serialization to prevent infinite recursion
|
|
369877
369877
|
// Override console methods to send logs to parent window and serialize complex objects
|
|
369878
|
-
exports.consoleOverrideScript = `
|
|
369879
|
-
<script>
|
|
369880
|
-
(function() {
|
|
369881
|
-
const SerializedType = {
|
|
369882
|
-
Null: "null",
|
|
369883
|
-
Undefined: "undefined",
|
|
369884
|
-
Boolean: "boolean",
|
|
369885
|
-
Number: "number",
|
|
369886
|
-
String: "string",
|
|
369887
|
-
Array: "array",
|
|
369888
|
-
Object: "object",
|
|
369889
|
-
};
|
|
369890
|
-
|
|
369891
|
-
const original = {};
|
|
369892
|
-
const methods = ["log", "error", "warn", "info", "debug", "assert"];
|
|
369893
|
-
|
|
369894
|
-
function getTimestamp() {
|
|
369895
|
-
const now = new Date();
|
|
369896
|
-
const pad = (n) => String(n).padStart(2, '0');
|
|
369897
|
-
|
|
369898
|
-
return (
|
|
369899
|
-
now.getFullYear() + '-' +
|
|
369900
|
-
pad(now.getMonth() + 1) + '-' +
|
|
369901
|
-
pad(now.getDate()) + ' ' +
|
|
369902
|
-
pad(now.getHours()) + ':' +
|
|
369903
|
-
pad(now.getMinutes()) + ':' +
|
|
369904
|
-
pad(now.getSeconds()) + '.' +
|
|
369905
|
-
pad(Math.floor(now.getMilliseconds() / 10))
|
|
369906
|
-
);
|
|
369907
|
-
}
|
|
369908
|
-
|
|
369909
|
-
function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
|
|
369910
|
-
if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
|
|
369911
|
-
|
|
369912
|
-
if (arg && typeof arg === "object") {
|
|
369913
|
-
if (visited.has(arg)) {
|
|
369914
|
-
return { "type": SerializedType.String, "value": "[Circular reference]" };
|
|
369915
|
-
}
|
|
369916
|
-
visited.add(arg);
|
|
369917
|
-
}
|
|
369918
|
-
|
|
369919
|
-
const type = typeof arg;
|
|
369920
|
-
if (arg === null) return { "type": SerializedType.Null, "value": "null" };
|
|
369921
|
-
if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
|
|
369922
|
-
if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
|
|
369923
|
-
if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
|
|
369924
|
-
if (type === "string") return { "type": SerializedType.String, "value": arg };
|
|
369925
|
-
|
|
369926
|
-
if (Array.isArray(arg)) {
|
|
369927
|
-
return {
|
|
369928
|
-
"type": SerializedType.Array,
|
|
369929
|
-
"value": arg.map(item => serialize(item, depth + 1, maxDepth))
|
|
369930
|
-
};
|
|
369931
|
-
}
|
|
369932
|
-
|
|
369933
|
-
if (type === "object" && arg !== null) {
|
|
369934
|
-
const props = {};
|
|
369935
|
-
try {
|
|
369936
|
-
for (let key in arg) {
|
|
369937
|
-
if (arg.hasOwnProperty(key)) {
|
|
369938
|
-
props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
|
|
369939
|
-
}
|
|
369940
|
-
}
|
|
369941
|
-
} catch (error) {
|
|
369942
|
-
console.error("Error serializing object property:", error);
|
|
369943
|
-
}
|
|
369944
|
-
return { "type": SerializedType.Object, "value": props };
|
|
369945
|
-
}
|
|
369946
|
-
|
|
369947
|
-
return { "type": SerializedType.String, "value": String(arg) };
|
|
369948
|
-
}
|
|
369949
|
-
|
|
369950
|
-
methods.forEach(m => {
|
|
369951
|
-
original[m] = console[m] || function(){};
|
|
369952
|
-
|
|
369953
|
-
console[m] = function(...args) {
|
|
369954
|
-
const timestamp = getTimestamp();
|
|
369955
|
-
|
|
369956
|
-
let level = m;
|
|
369957
|
-
let serializedArgs = args.map(arg => serialize(arg));
|
|
369958
|
-
|
|
369959
|
-
if (m === "assert") {
|
|
369960
|
-
const condition = Boolean(args[0]);
|
|
369961
|
-
const messageArgs = args.slice(1);
|
|
369962
|
-
|
|
369963
|
-
serializedArgs =
|
|
369964
|
-
messageArgs.length > 0
|
|
369965
|
-
? messageArgs.map(arg => serialize(arg))
|
|
369966
|
-
: [
|
|
369967
|
-
{
|
|
369968
|
-
"type": "string",
|
|
369969
|
-
"value": condition ? "Assertion passed" : "Assertion failed",
|
|
369970
|
-
},
|
|
369971
|
-
];
|
|
369972
|
-
|
|
369973
|
-
level = condition ? "log" : "error";
|
|
369974
|
-
}
|
|
369975
|
-
|
|
369976
|
-
window.parent.postMessage({
|
|
369977
|
-
"type": "console",
|
|
369978
|
-
"method": level,
|
|
369979
|
-
"data": serializedArgs,
|
|
369980
|
-
"timestamp": timestamp
|
|
369981
|
-
}, "*");
|
|
369982
|
-
|
|
369983
|
-
original[m](...args);
|
|
369984
|
-
};
|
|
369985
|
-
});
|
|
369986
|
-
|
|
369987
|
-
window.addEventListener("error", function(event) {
|
|
369988
|
-
const timestamp = getTimestamp();
|
|
369989
|
-
const error = event.error;
|
|
369990
|
-
|
|
369991
|
-
let message;
|
|
369992
|
-
if (error && error.name && error.message) {
|
|
369993
|
-
message = error.name + ": " + error.message;
|
|
369994
|
-
} else if (event.message) {
|
|
369995
|
-
message = event.message;
|
|
369996
|
-
} else {
|
|
369997
|
-
message = "Unknown JavaScript error";
|
|
369998
|
-
}
|
|
369999
|
-
|
|
370000
|
-
let displayFilename = event.filename;
|
|
370001
|
-
|
|
370002
|
-
if (
|
|
370003
|
-
typeof displayFilename === "string" &&
|
|
370004
|
-
displayFilename.startsWith("blob:")
|
|
370005
|
-
) {
|
|
370006
|
-
const sourceMap = window.__blobSourceMap__ || {};
|
|
370007
|
-
const mappedFilename = sourceMap[displayFilename];
|
|
370008
|
-
|
|
370009
|
-
if (mappedFilename) {
|
|
370010
|
-
displayFilename = mappedFilename;
|
|
370011
|
-
} else {
|
|
370012
|
-
const meta = document.querySelector("meta[filename]");
|
|
370013
|
-
displayFilename =
|
|
370014
|
-
(meta && meta.getAttribute("filename")) || "preview";
|
|
370015
|
-
}
|
|
370016
|
-
}
|
|
370017
|
-
|
|
370018
|
-
const location =
|
|
370019
|
-
displayFilename || event.lineno || event.colno
|
|
370020
|
-
? " at " +
|
|
370021
|
-
[displayFilename, event.lineno, event.colno]
|
|
370022
|
-
.filter(Boolean)
|
|
370023
|
-
.join(":")
|
|
370024
|
-
: "";
|
|
370025
|
-
|
|
370026
|
-
window.parent.postMessage({
|
|
370027
|
-
"type": "console",
|
|
370028
|
-
"method": "error",
|
|
370029
|
-
"data": [
|
|
370030
|
-
{ "type": "string", "value": message + location }
|
|
370031
|
-
],
|
|
370032
|
-
"timestamp": timestamp
|
|
370033
|
-
}, "*");
|
|
370034
|
-
});
|
|
370035
|
-
|
|
370036
|
-
window.addEventListener("unhandledrejection", function(event) {
|
|
370037
|
-
const timestamp = getTimestamp();
|
|
370038
|
-
const reason = event.reason;
|
|
370039
|
-
|
|
370040
|
-
let message;
|
|
370041
|
-
if (reason && reason.name && reason.message) {
|
|
370042
|
-
message = reason.name + ": " + reason.message;
|
|
370043
|
-
} else if (typeof reason === "string") {
|
|
370044
|
-
message = "UnhandledPromiseRejection: " + reason;
|
|
370045
|
-
} else {
|
|
370046
|
-
message = "UnhandledPromiseRejection: " + String(reason);
|
|
370047
|
-
}
|
|
370048
|
-
|
|
370049
|
-
window.parent.postMessage({
|
|
370050
|
-
"type": "console",
|
|
370051
|
-
"method": "error",
|
|
370052
|
-
"data": [
|
|
370053
|
-
{ "type": "string", "value": message }
|
|
370054
|
-
],
|
|
370055
|
-
"timestamp": timestamp
|
|
370056
|
-
}, "*");
|
|
370057
|
-
});
|
|
370058
|
-
})();
|
|
370059
|
-
</script>
|
|
369878
|
+
exports.consoleOverrideScript = `
|
|
369879
|
+
<script>
|
|
369880
|
+
(function() {
|
|
369881
|
+
const SerializedType = {
|
|
369882
|
+
Null: "null",
|
|
369883
|
+
Undefined: "undefined",
|
|
369884
|
+
Boolean: "boolean",
|
|
369885
|
+
Number: "number",
|
|
369886
|
+
String: "string",
|
|
369887
|
+
Array: "array",
|
|
369888
|
+
Object: "object",
|
|
369889
|
+
};
|
|
369890
|
+
|
|
369891
|
+
const original = {};
|
|
369892
|
+
const methods = ["log", "error", "warn", "info", "debug", "assert"];
|
|
369893
|
+
|
|
369894
|
+
function getTimestamp() {
|
|
369895
|
+
const now = new Date();
|
|
369896
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
369897
|
+
|
|
369898
|
+
return (
|
|
369899
|
+
now.getFullYear() + '-' +
|
|
369900
|
+
pad(now.getMonth() + 1) + '-' +
|
|
369901
|
+
pad(now.getDate()) + ' ' +
|
|
369902
|
+
pad(now.getHours()) + ':' +
|
|
369903
|
+
pad(now.getMinutes()) + ':' +
|
|
369904
|
+
pad(now.getSeconds()) + '.' +
|
|
369905
|
+
pad(Math.floor(now.getMilliseconds() / 10))
|
|
369906
|
+
);
|
|
369907
|
+
}
|
|
369908
|
+
|
|
369909
|
+
function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
|
|
369910
|
+
if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
|
|
369911
|
+
|
|
369912
|
+
if (arg && typeof arg === "object") {
|
|
369913
|
+
if (visited.has(arg)) {
|
|
369914
|
+
return { "type": SerializedType.String, "value": "[Circular reference]" };
|
|
369915
|
+
}
|
|
369916
|
+
visited.add(arg);
|
|
369917
|
+
}
|
|
369918
|
+
|
|
369919
|
+
const type = typeof arg;
|
|
369920
|
+
if (arg === null) return { "type": SerializedType.Null, "value": "null" };
|
|
369921
|
+
if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
|
|
369922
|
+
if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
|
|
369923
|
+
if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
|
|
369924
|
+
if (type === "string") return { "type": SerializedType.String, "value": arg };
|
|
369925
|
+
|
|
369926
|
+
if (Array.isArray(arg)) {
|
|
369927
|
+
return {
|
|
369928
|
+
"type": SerializedType.Array,
|
|
369929
|
+
"value": arg.map(item => serialize(item, depth + 1, maxDepth))
|
|
369930
|
+
};
|
|
369931
|
+
}
|
|
369932
|
+
|
|
369933
|
+
if (type === "object" && arg !== null) {
|
|
369934
|
+
const props = {};
|
|
369935
|
+
try {
|
|
369936
|
+
for (let key in arg) {
|
|
369937
|
+
if (arg.hasOwnProperty(key)) {
|
|
369938
|
+
props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
|
|
369939
|
+
}
|
|
369940
|
+
}
|
|
369941
|
+
} catch (error) {
|
|
369942
|
+
console.error("Error serializing object property:", error);
|
|
369943
|
+
}
|
|
369944
|
+
return { "type": SerializedType.Object, "value": props };
|
|
369945
|
+
}
|
|
369946
|
+
|
|
369947
|
+
return { "type": SerializedType.String, "value": String(arg) };
|
|
369948
|
+
}
|
|
369949
|
+
|
|
369950
|
+
methods.forEach(m => {
|
|
369951
|
+
original[m] = console[m] || function(){};
|
|
369952
|
+
|
|
369953
|
+
console[m] = function(...args) {
|
|
369954
|
+
const timestamp = getTimestamp();
|
|
369955
|
+
|
|
369956
|
+
let level = m;
|
|
369957
|
+
let serializedArgs = args.map(arg => serialize(arg));
|
|
369958
|
+
|
|
369959
|
+
if (m === "assert") {
|
|
369960
|
+
const condition = Boolean(args[0]);
|
|
369961
|
+
const messageArgs = args.slice(1);
|
|
369962
|
+
|
|
369963
|
+
serializedArgs =
|
|
369964
|
+
messageArgs.length > 0
|
|
369965
|
+
? messageArgs.map(arg => serialize(arg))
|
|
369966
|
+
: [
|
|
369967
|
+
{
|
|
369968
|
+
"type": "string",
|
|
369969
|
+
"value": condition ? "Assertion passed" : "Assertion failed",
|
|
369970
|
+
},
|
|
369971
|
+
];
|
|
369972
|
+
|
|
369973
|
+
level = condition ? "log" : "error";
|
|
369974
|
+
}
|
|
369975
|
+
|
|
369976
|
+
window.parent.postMessage({
|
|
369977
|
+
"type": "console",
|
|
369978
|
+
"method": level,
|
|
369979
|
+
"data": serializedArgs,
|
|
369980
|
+
"timestamp": timestamp
|
|
369981
|
+
}, "*");
|
|
369982
|
+
|
|
369983
|
+
original[m](...args);
|
|
369984
|
+
};
|
|
369985
|
+
});
|
|
369986
|
+
|
|
369987
|
+
window.addEventListener("error", function(event) {
|
|
369988
|
+
const timestamp = getTimestamp();
|
|
369989
|
+
const error = event.error;
|
|
369990
|
+
|
|
369991
|
+
let message;
|
|
369992
|
+
if (error && error.name && error.message) {
|
|
369993
|
+
message = error.name + ": " + error.message;
|
|
369994
|
+
} else if (event.message) {
|
|
369995
|
+
message = event.message;
|
|
369996
|
+
} else {
|
|
369997
|
+
message = "Unknown JavaScript error";
|
|
369998
|
+
}
|
|
369999
|
+
|
|
370000
|
+
let displayFilename = event.filename;
|
|
370001
|
+
|
|
370002
|
+
if (
|
|
370003
|
+
typeof displayFilename === "string" &&
|
|
370004
|
+
displayFilename.startsWith("blob:")
|
|
370005
|
+
) {
|
|
370006
|
+
const sourceMap = window.__blobSourceMap__ || {};
|
|
370007
|
+
const mappedFilename = sourceMap[displayFilename];
|
|
370008
|
+
|
|
370009
|
+
if (mappedFilename) {
|
|
370010
|
+
displayFilename = mappedFilename;
|
|
370011
|
+
} else {
|
|
370012
|
+
const meta = document.querySelector("meta[filename]");
|
|
370013
|
+
displayFilename =
|
|
370014
|
+
(meta && meta.getAttribute("filename")) || "preview";
|
|
370015
|
+
}
|
|
370016
|
+
}
|
|
370017
|
+
|
|
370018
|
+
const location =
|
|
370019
|
+
displayFilename || event.lineno || event.colno
|
|
370020
|
+
? " at " +
|
|
370021
|
+
[displayFilename, event.lineno, event.colno]
|
|
370022
|
+
.filter(Boolean)
|
|
370023
|
+
.join(":")
|
|
370024
|
+
: "";
|
|
370025
|
+
|
|
370026
|
+
window.parent.postMessage({
|
|
370027
|
+
"type": "console",
|
|
370028
|
+
"method": "error",
|
|
370029
|
+
"data": [
|
|
370030
|
+
{ "type": "string", "value": message + location }
|
|
370031
|
+
],
|
|
370032
|
+
"timestamp": timestamp
|
|
370033
|
+
}, "*");
|
|
370034
|
+
});
|
|
370035
|
+
|
|
370036
|
+
window.addEventListener("unhandledrejection", function(event) {
|
|
370037
|
+
const timestamp = getTimestamp();
|
|
370038
|
+
const reason = event.reason;
|
|
370039
|
+
|
|
370040
|
+
let message;
|
|
370041
|
+
if (reason && reason.name && reason.message) {
|
|
370042
|
+
message = reason.name + ": " + reason.message;
|
|
370043
|
+
} else if (typeof reason === "string") {
|
|
370044
|
+
message = "UnhandledPromiseRejection: " + reason;
|
|
370045
|
+
} else {
|
|
370046
|
+
message = "UnhandledPromiseRejection: " + String(reason);
|
|
370047
|
+
}
|
|
370048
|
+
|
|
370049
|
+
window.parent.postMessage({
|
|
370050
|
+
"type": "console",
|
|
370051
|
+
"method": "error",
|
|
370052
|
+
"data": [
|
|
370053
|
+
{ "type": "string", "value": message }
|
|
370054
|
+
],
|
|
370055
|
+
"timestamp": timestamp
|
|
370056
|
+
}, "*");
|
|
370057
|
+
});
|
|
370058
|
+
})();
|
|
370059
|
+
</script>
|
|
370060
370060
|
`;
|
|
370061
370061
|
|
|
370062
370062
|
|
|
@@ -371931,46 +371931,62 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
371931
371931
|
};
|
|
371932
371932
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
371933
371933
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
371934
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
371935
371934
|
const styles_module_scss_1 = __importDefault(__webpack_require__(49871));
|
|
371936
|
-
const styles_module_scss_2 = __importDefault(__webpack_require__(41809));
|
|
371937
371935
|
const EditorSlice_1 = __webpack_require__(68512);
|
|
371938
371936
|
const types_1 = __webpack_require__(92932);
|
|
371939
371937
|
const react_redux_1 = __webpack_require__(14062);
|
|
371940
|
-
const BaseModal_1 =
|
|
371938
|
+
const BaseModal_1 = __webpack_require__(30659);
|
|
371941
371939
|
const restore_svg_1 = __importDefault(__webpack_require__(503));
|
|
371942
|
-
const alert_svg_1 = __importDefault(__webpack_require__(11367));
|
|
371943
371940
|
const Button_1 = __importDefault(__webpack_require__(60232));
|
|
371944
371941
|
const SvgIcon_1 = __webpack_require__(82917);
|
|
371945
|
-
const close_svg_1 = __importDefault(__webpack_require__(80181));
|
|
371946
371942
|
const stores_1 = __webpack_require__(32132);
|
|
371943
|
+
const selectors_1 = __webpack_require__(43551);
|
|
371944
|
+
const react_1 = __webpack_require__(51649);
|
|
371945
|
+
const SpinnerDotted_1 = __webpack_require__(79458);
|
|
371946
|
+
const Text_1 = __webpack_require__(82803);
|
|
371947
371947
|
const ProjectHistoryModal = () => {
|
|
371948
371948
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
371949
371949
|
const isModalOpen = (0, stores_1.useAppSelector)((state) => state.editor.modalWindowShowing === types_1.ModalType.RESTORE_VERSION);
|
|
371950
371950
|
const commits = (0, stores_1.useAppSelector)((state) => state.editor.commits);
|
|
371951
371951
|
const args = (0, stores_1.useAppSelector)((state) => state.editor.modalWindowArgs);
|
|
371952
|
-
const
|
|
371953
|
-
const
|
|
371952
|
+
const isProjectDirty = (0, stores_1.useAppSelector)(selectors_1.selectProjectDirtyState);
|
|
371953
|
+
const isSaveTriggered = (0, stores_1.useAppSelector)((state) => state.editor.saveTriggered);
|
|
371954
|
+
const [isSubmitted, setIsSubmitted] = (0, react_1.useState)(false);
|
|
371955
|
+
const shouldSave = (0, react_1.useRef)(isProjectDirty);
|
|
371956
|
+
const handleClose = () => {
|
|
371957
|
+
dispatch((0, EditorSlice_1.closeModal)());
|
|
371958
|
+
};
|
|
371959
|
+
const revert = (0, react_1.useCallback)(() => {
|
|
371954
371960
|
if (args?.type === types_1.ModalType.RESTORE_VERSION && args.commitId) {
|
|
371955
371961
|
dispatch((0, EditorSlice_1.revertProject)({
|
|
371956
371962
|
commitId: args.commitId,
|
|
371957
371963
|
resetProject: true,
|
|
371958
|
-
saveChanges: true,
|
|
371959
371964
|
}));
|
|
371960
371965
|
}
|
|
371961
371966
|
dispatch((0, EditorSlice_1.closeModal)());
|
|
371967
|
+
}, [args, dispatch]);
|
|
371968
|
+
const handleSubmit = () => {
|
|
371969
|
+
if (shouldSave.current === true) {
|
|
371970
|
+
dispatch((0, EditorSlice_1.setSaveTriggered)(true));
|
|
371971
|
+
}
|
|
371972
|
+
else {
|
|
371973
|
+
revert();
|
|
371974
|
+
}
|
|
371975
|
+
setIsSubmitted(true);
|
|
371962
371976
|
};
|
|
371977
|
+
(0, react_1.useEffect)(() => {
|
|
371978
|
+
if (isSubmitted && isModalOpen && shouldSave.current && !isSaveTriggered) {
|
|
371979
|
+
revert();
|
|
371980
|
+
}
|
|
371981
|
+
}, [isModalOpen, isSaveTriggered, isSubmitted, revert]);
|
|
371963
371982
|
const commitTimestamp = args?.type === types_1.ModalType.RESTORE_VERSION
|
|
371964
371983
|
? commits?.find((c) => c.id === args.commitId)?.createdAtFormatted
|
|
371965
371984
|
: undefined;
|
|
371966
|
-
|
|
371967
|
-
|
|
371968
|
-
|
|
371969
|
-
|
|
371970
|
-
|
|
371971
|
-
// @ts-ignore
|
|
371972
|
-
(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiaryGray", buttonText: "Cancel", onClickHandler: handleClose }, "cancel"),
|
|
371973
|
-
], children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_2.default.headerContainer, children: [(0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 32, SvgElement: restore_svg_1.default, className: `${styles_module_scss_2.default.headerText} ${styles_module_scss_1.default.headerIcon}` }), (0, jsx_runtime_1.jsx)("div", { className: `${styles_module_scss_2.default.headerText} ${styles_module_scss_1.default.headerText}`, children: "Restore Version" })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.containerBox, children: ["You are about to restore the version from:", (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.versionDate, children: commitTimestamp }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.messageContainer, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 18, SvgElement: alert_svg_1.default, className: `${styles_module_scss_2.default.headerText} ${styles_module_scss_1.default.headerIcon}` }) }), (0, jsx_runtime_1.jsx)("div", { children: "Restoring a version of a file is non-destructive. The restored content will become a new version at the top of history. You can always go back to the version you just had." })] })] })] }) }));
|
|
371985
|
+
const restoreButtonText = isSubmitted ? ((0, jsx_runtime_1.jsxs)("span", { className: styles_module_scss_1.default.loadingButton, children: [(0, jsx_runtime_1.jsx)(SpinnerDotted_1.SpinnerDotted, {}), " Restoring"] })) : ("Restore");
|
|
371986
|
+
return ((0, jsx_runtime_1.jsx)(BaseModal_1.BaseModal, { width: 454, isOpen: isModalOpen, modalLabel: "Restore version", closeModal: handleClose, headerIcon: (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 32, SvgElement: restore_svg_1.default }), header: "Restore Version", body: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, children: "You are about to restore the version from:" }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.versionDate, children: commitTimestamp })] }), infoText: "Restoring a version of a file is non-destructive. The restored content will become a new version at the top of history. You can always go back to the version you just had.", buttons: [
|
|
371987
|
+
(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiaryGray", buttonText: "Cancel", disabled: isSubmitted, onClickHandler: handleClose }, "cancel"),
|
|
371988
|
+
(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "secondary", buttonText: restoreButtonText, disabled: isSubmitted, onClickHandler: handleSubmit }, "restore"),
|
|
371989
|
+
] }));
|
|
371974
371990
|
};
|
|
371975
371991
|
exports["default"] = ProjectHistoryModal;
|
|
371976
371992
|
|
|
@@ -371999,11 +372015,15 @@ const Text_1 = __webpack_require__(82803);
|
|
|
371999
372015
|
const LeaveFlowSlice_1 = __webpack_require__(52990);
|
|
372000
372016
|
const SpinnerDotted_1 = __webpack_require__(79458);
|
|
372001
372017
|
const styles_module_scss_1 = __importDefault(__webpack_require__(79730));
|
|
372018
|
+
const useProjectCache_1 = __webpack_require__(69557);
|
|
372019
|
+
const projectTabSync_1 = __webpack_require__(48235);
|
|
372002
372020
|
const SaveBeforeLeaveModal = () => {
|
|
372003
372021
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
372004
372022
|
const isSaving = (0, stores_1.useAppSelector)((state) => state.editor.saving === types_1.SavingState.PROCESS);
|
|
372005
372023
|
const leaveFlowStatus = (0, stores_1.useAppSelector)((state) => state.leaveFlow?.status);
|
|
372006
372024
|
const leaveFlowId = (0, stores_1.useAppSelector)((state) => state.leaveFlow?.requestId);
|
|
372025
|
+
const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
|
|
372026
|
+
const { upsertCacheValue } = (0, useProjectCache_1.useProjectCache)();
|
|
372007
372027
|
const isModalOpen = [
|
|
372008
372028
|
LeaveFlowSlice_1.LeaveFlowStatus.CONFIRMING,
|
|
372009
372029
|
LeaveFlowSlice_1.LeaveFlowStatus.SAVING,
|
|
@@ -372011,7 +372031,14 @@ const SaveBeforeLeaveModal = () => {
|
|
|
372011
372031
|
const handleClose = () => {
|
|
372012
372032
|
dispatch((0, LeaveFlowSlice_1.leaveCancelled)({ requestId: leaveFlowId }));
|
|
372013
372033
|
};
|
|
372014
|
-
const handleLeaveConfirmed = () => {
|
|
372034
|
+
const handleLeaveConfirmed = async () => {
|
|
372035
|
+
if (project?.identifier) {
|
|
372036
|
+
upsertCacheValue(project.identifier, project)
|
|
372037
|
+
.then(() => {
|
|
372038
|
+
(0, projectTabSync_1.notifyProjectUpdated)(project.identifier);
|
|
372039
|
+
})
|
|
372040
|
+
.catch(console.error);
|
|
372041
|
+
}
|
|
372015
372042
|
dispatch((0, LeaveFlowSlice_1.leaveConfirmed)({ requestId: leaveFlowId }));
|
|
372016
372043
|
};
|
|
372017
372044
|
const handleSaveConfirmed = () => {
|
|
@@ -372686,10 +372713,10 @@ const WebComponentLoader = (props) => {
|
|
|
372686
372713
|
(0, react_1.useEffect)(() => {
|
|
372687
372714
|
// Create a script element to save the existing Prism object if there is one
|
|
372688
372715
|
const script = document.createElement("script");
|
|
372689
|
-
script.textContent = `
|
|
372690
|
-
if (window.Prism) {
|
|
372691
|
-
window.syntaxHighlight = window.Prism;
|
|
372692
|
-
}
|
|
372716
|
+
script.textContent = `
|
|
372717
|
+
if (window.Prism) {
|
|
372718
|
+
window.syntaxHighlight = window.Prism;
|
|
372719
|
+
}
|
|
372693
372720
|
`;
|
|
372694
372721
|
// Append the script to the document body
|
|
372695
372722
|
document.body.appendChild(script);
|
|
@@ -374293,10 +374320,6 @@ exports.EditorSlice = (0, toolkit_1.createSlice)({
|
|
|
374293
374320
|
},
|
|
374294
374321
|
revertProject: (state, action) => {
|
|
374295
374322
|
state.commitIdLoadTriggered = action.payload.commitId;
|
|
374296
|
-
// TODO: enable in HQ-8587
|
|
374297
|
-
// if (action.payload.saveChanges) {
|
|
374298
|
-
// state.saveTriggered = true;
|
|
374299
|
-
// }
|
|
374300
374323
|
if (action.payload.resetProject) {
|
|
374301
374324
|
state.loading = types_1.LoadingState.IDLE;
|
|
374302
374325
|
}
|
|
@@ -383483,7 +383506,7 @@ module.exports = webpackAsyncContext;
|
|
|
383483
383506
|
/***/ 24427:
|
|
383484
383507
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
383485
383508
|
|
|
383486
|
-
module.exports = __webpack_require__.p + "assets/
|
|
383509
|
+
module.exports = __webpack_require__.p + "assets/PyodideWorkerdeabb0560f66f0f43f49.js";
|
|
383487
383510
|
|
|
383488
383511
|
/***/ }),
|
|
383489
383512
|
|