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