gwchq-textjam 0.2.3 → 0.2.5
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/{pygalef3b78a56cb1d66beb61.js → pygalc0b4f32d2d2cc5a0c638.js} +495 -495
- package/dist/index.js +2274 -2296
- package/dist/style.css +3 -3
- package/package.json +296 -296
package/dist/index.js
CHANGED
|
@@ -64600,8 +64600,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
64600
64600
|
|
|
64601
64601
|
function SvgGwcLogo(props) {
|
|
64602
64602
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
|
|
64603
|
-
|
|
64604
|
-
height: 44,
|
|
64603
|
+
viewBox: "0 0 44 44",
|
|
64605
64604
|
fill: "none",
|
|
64606
64605
|
xmlns: "http://www.w3.org/2000/svg"
|
|
64607
64606
|
}, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
|
|
@@ -65891,14 +65890,13 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
65891
65890
|
|
|
65892
65891
|
function SvgShare(props) {
|
|
65893
65892
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
|
|
65894
|
-
|
|
65895
|
-
height: 20,
|
|
65893
|
+
viewBox: "0 0 19 20",
|
|
65896
65894
|
fill: "none",
|
|
65897
65895
|
xmlns: "http://www.w3.org/2000/svg"
|
|
65898
65896
|
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
|
|
65899
65897
|
d: "M6.031 11.359l6.147 3.582m-.009-9.882L6.031 8.641M17.2 3.7a2.7 2.7 0 11-5.4 0 2.7 2.7 0 015.4 0zM6.4 10A2.7 2.7 0 111 10a2.7 2.7 0 015.4 0zm10.8 6.3a2.7 2.7 0 11-5.4 0 2.7 2.7 0 015.4 0z",
|
|
65900
65898
|
stroke: "#003046",
|
|
65901
|
-
strokeWidth:
|
|
65899
|
+
strokeWidth: 1.5,
|
|
65902
65900
|
strokeLinecap: "round",
|
|
65903
65901
|
strokeLinejoin: "round"
|
|
65904
65902
|
})));
|
|
@@ -66150,8 +66148,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
66150
66148
|
|
|
66151
66149
|
function SvgTextJamLogo(props) {
|
|
66152
66150
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
|
|
66153
|
-
|
|
66154
|
-
height: 36,
|
|
66151
|
+
viewBox: "0 0 155 36",
|
|
66155
66152
|
fill: "none",
|
|
66156
66153
|
xmlns: "http://www.w3.org/2000/svg"
|
|
66157
66154
|
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
|
|
@@ -68209,7 +68206,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
68209
68206
|
});
|
|
68210
68207
|
|
|
68211
68208
|
;// ./src/assets/editor/pyodide/shims/pygal.js?url
|
|
68212
|
-
const pygalurl_namespaceObject = __webpack_require__.p + "assets/
|
|
68209
|
+
const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalc0b4f32d2d2cc5a0c638.js";
|
|
68213
68210
|
;// ./src/assets/editor/pyodide/packages/turtle-0.0.1-py3-none-any.whl?url
|
|
68214
68211
|
const turtle_0_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "assets/turtle-0.0.1-py3-none-any0c3147a3e0c3188b2544.whl";
|
|
68215
68212
|
;// ./src/assets/editor/pyodide/packages/p5-0.0.1-py3-none-any.whl?url
|
|
@@ -68347,8 +68344,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68347
68344
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68348
68345
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68349
68346
|
/* harmony export */ });
|
|
68350
|
-
/* harmony import */ var
|
|
68351
|
-
/* harmony import */ var
|
|
68347
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
68348
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
|
|
68352
68349
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68353
68350
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
|
|
68354
68351
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
@@ -68372,7 +68369,7 @@ var DraggableTab = _ref => {
|
|
|
68372
68369
|
panelIndex,
|
|
68373
68370
|
fileIndex
|
|
68374
68371
|
} = _ref,
|
|
68375
|
-
otherProps = (0,
|
|
68372
|
+
otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
|
|
68376
68373
|
var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
|
|
68377
68374
|
var openFilesCount = openFiles[panelIndex].length;
|
|
68378
68375
|
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
@@ -68389,7 +68386,7 @@ var DraggableTab = _ref => {
|
|
|
68389
68386
|
switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
|
|
68390
68387
|
}
|
|
68391
68388
|
};
|
|
68392
|
-
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,
|
|
68389
|
+
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
68393
68390
|
onClick: e => {
|
|
68394
68391
|
e.stopPropagation();
|
|
68395
68392
|
switchToFileTab(panelIndex, fileIndex);
|
|
@@ -68407,7 +68404,7 @@ var DraggableTab = _ref => {
|
|
|
68407
68404
|
draggableProps,
|
|
68408
68405
|
dragHandleProps
|
|
68409
68406
|
} = _ref2;
|
|
68410
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,
|
|
68407
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
68411
68408
|
className: "draggable-tab",
|
|
68412
68409
|
ref: innerRef
|
|
68413
68410
|
}, draggableProps), dragHandleProps), {}, {
|
|
@@ -68429,8 +68426,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68429
68426
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68430
68427
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68431
68428
|
/* harmony export */ });
|
|
68432
|
-
/* harmony import */ var
|
|
68433
|
-
/* harmony import */ var
|
|
68429
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
|
|
68430
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
|
|
68434
68431
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68435
68432
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
|
|
68436
68433
|
/* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
|
|
@@ -68449,8 +68446,8 @@ var DroppableTabList = _ref => {
|
|
|
68449
68446
|
children: _children,
|
|
68450
68447
|
index
|
|
68451
68448
|
} = _ref,
|
|
68452
|
-
otherProps = (0,
|
|
68453
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,
|
|
68449
|
+
otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
|
|
68450
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
|
|
68454
68451
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
|
|
68455
68452
|
direction: "horizontal",
|
|
68456
68453
|
droppableId: index.toString(),
|
|
@@ -68460,7 +68457,7 @@ var DroppableTabList = _ref => {
|
|
|
68460
68457
|
droppableProps,
|
|
68461
68458
|
placeholder
|
|
68462
68459
|
} = _ref2;
|
|
68463
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,
|
|
68460
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
|
|
68464
68461
|
className: "droppable-tab-list"
|
|
68465
68462
|
}, droppableProps), {}, {
|
|
68466
68463
|
ref: innerRef,
|
|
@@ -102221,8 +102218,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
102221
102218
|
|
|
102222
102219
|
|
|
102223
102220
|
// TODO: refactor existing modals
|
|
102224
|
-
/** !deprecated!
|
|
102225
|
-
* use BaseModal from `index.tsx` instead
|
|
102221
|
+
/** !deprecated!
|
|
102222
|
+
* use BaseModal from `index.tsx` instead
|
|
102226
102223
|
*/
|
|
102227
102224
|
|
|
102228
102225
|
var BaseModal = _ref => {
|
|
@@ -102918,7 +102915,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
102918
102915
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
102919
102916
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
102920
102917
|
/* harmony export */ });
|
|
102921
|
-
/* harmony import */ var
|
|
102918
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
102922
102919
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
102923
102920
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
102924
102921
|
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
|
|
@@ -102998,7 +102995,7 @@ var ProjectName = _ref => {
|
|
|
102998
102995
|
id: "project_name_label",
|
|
102999
102996
|
className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
|
|
103000
102997
|
children: "Project Name"
|
|
103001
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,
|
|
102998
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
103002
102999
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
|
|
103003
103000
|
}, hoverProps), {}, {
|
|
103004
103001
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
|
|
@@ -116561,6 +116558,115 @@ function escapeName(str, charsToEscape) {
|
|
|
116561
116558
|
|
|
116562
116559
|
|
|
116563
116560
|
|
|
116561
|
+
/***/ }),
|
|
116562
|
+
|
|
116563
|
+
/***/ 16450:
|
|
116564
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
116565
|
+
|
|
116566
|
+
|
|
116567
|
+
|
|
116568
|
+
var isValue = __webpack_require__(48175)
|
|
116569
|
+
, ensureValue = __webpack_require__(34809)
|
|
116570
|
+
, ensurePlainFunction = __webpack_require__(90251)
|
|
116571
|
+
, copy = __webpack_require__(30203)
|
|
116572
|
+
, normalizeOptions = __webpack_require__(90148)
|
|
116573
|
+
, map = __webpack_require__(30498);
|
|
116574
|
+
|
|
116575
|
+
var bind = Function.prototype.bind
|
|
116576
|
+
, defineProperty = Object.defineProperty
|
|
116577
|
+
, hasOwnProperty = Object.prototype.hasOwnProperty
|
|
116578
|
+
, define;
|
|
116579
|
+
|
|
116580
|
+
define = function (name, desc, options) {
|
|
116581
|
+
var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
|
|
116582
|
+
dgs = copy(desc);
|
|
116583
|
+
delete dgs.writable;
|
|
116584
|
+
delete dgs.value;
|
|
116585
|
+
dgs.get = function () {
|
|
116586
|
+
if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
|
|
116587
|
+
desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
|
|
116588
|
+
defineProperty(this, name, desc);
|
|
116589
|
+
return this[name];
|
|
116590
|
+
};
|
|
116591
|
+
return dgs;
|
|
116592
|
+
};
|
|
116593
|
+
|
|
116594
|
+
module.exports = function (props/*, options*/) {
|
|
116595
|
+
var options = normalizeOptions(arguments[1]);
|
|
116596
|
+
if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
|
|
116597
|
+
return map(props, function (desc, name) { return define(name, desc, options); });
|
|
116598
|
+
};
|
|
116599
|
+
|
|
116600
|
+
|
|
116601
|
+
/***/ }),
|
|
116602
|
+
|
|
116603
|
+
/***/ 58263:
|
|
116604
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
116605
|
+
|
|
116606
|
+
|
|
116607
|
+
|
|
116608
|
+
var isValue = __webpack_require__(48175)
|
|
116609
|
+
, isPlainFunction = __webpack_require__(6873)
|
|
116610
|
+
, assign = __webpack_require__(16596)
|
|
116611
|
+
, normalizeOpts = __webpack_require__(90148)
|
|
116612
|
+
, contains = __webpack_require__(70214);
|
|
116613
|
+
|
|
116614
|
+
var d = (module.exports = function (dscr, value/*, options*/) {
|
|
116615
|
+
var c, e, w, options, desc;
|
|
116616
|
+
if (arguments.length < 2 || typeof dscr !== "string") {
|
|
116617
|
+
options = value;
|
|
116618
|
+
value = dscr;
|
|
116619
|
+
dscr = null;
|
|
116620
|
+
} else {
|
|
116621
|
+
options = arguments[2];
|
|
116622
|
+
}
|
|
116623
|
+
if (isValue(dscr)) {
|
|
116624
|
+
c = contains.call(dscr, "c");
|
|
116625
|
+
e = contains.call(dscr, "e");
|
|
116626
|
+
w = contains.call(dscr, "w");
|
|
116627
|
+
} else {
|
|
116628
|
+
c = w = true;
|
|
116629
|
+
e = false;
|
|
116630
|
+
}
|
|
116631
|
+
|
|
116632
|
+
desc = { value: value, configurable: c, enumerable: e, writable: w };
|
|
116633
|
+
return !options ? desc : assign(normalizeOpts(options), desc);
|
|
116634
|
+
});
|
|
116635
|
+
|
|
116636
|
+
d.gs = function (dscr, get, set/*, options*/) {
|
|
116637
|
+
var c, e, options, desc;
|
|
116638
|
+
if (typeof dscr !== "string") {
|
|
116639
|
+
options = set;
|
|
116640
|
+
set = get;
|
|
116641
|
+
get = dscr;
|
|
116642
|
+
dscr = null;
|
|
116643
|
+
} else {
|
|
116644
|
+
options = arguments[3];
|
|
116645
|
+
}
|
|
116646
|
+
if (!isValue(get)) {
|
|
116647
|
+
get = undefined;
|
|
116648
|
+
} else if (!isPlainFunction(get)) {
|
|
116649
|
+
options = get;
|
|
116650
|
+
get = set = undefined;
|
|
116651
|
+
} else if (!isValue(set)) {
|
|
116652
|
+
set = undefined;
|
|
116653
|
+
} else if (!isPlainFunction(set)) {
|
|
116654
|
+
options = set;
|
|
116655
|
+
set = undefined;
|
|
116656
|
+
}
|
|
116657
|
+
if (isValue(dscr)) {
|
|
116658
|
+
c = contains.call(dscr, "c");
|
|
116659
|
+
e = contains.call(dscr, "e");
|
|
116660
|
+
} else {
|
|
116661
|
+
c = true;
|
|
116662
|
+
e = false;
|
|
116663
|
+
}
|
|
116664
|
+
|
|
116665
|
+
desc = { get: get, set: set, configurable: c, enumerable: e };
|
|
116666
|
+
return !options ? desc : assign(normalizeOpts(options), desc);
|
|
116667
|
+
};
|
|
116668
|
+
|
|
116669
|
+
|
|
116564
116670
|
/***/ }),
|
|
116565
116671
|
|
|
116566
116672
|
/***/ 83999:
|
|
@@ -131389,115 +131495,6 @@ year.every = function(k) {
|
|
|
131389
131495
|
var years = year.range;
|
|
131390
131496
|
|
|
131391
131497
|
|
|
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
131498
|
/***/ }),
|
|
131502
131499
|
|
|
131503
131500
|
/***/ 30041:
|
|
@@ -142795,7 +142792,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142795
142792
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142796
142793
|
/* harmony export */ });
|
|
142797
142794
|
// extracted by mini-css-extract-plugin
|
|
142798
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","sidebar":"styles-module__sidebar--Fu5Qi","
|
|
142795
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","sidebar":"styles-module__sidebar--Fu5Qi","bar":"styles-module__bar--fOlLf","optionsTop":"styles-module__optionsTop--2jNbs","optionsBottom":"styles-module__optionsBottom--PtwF4","option":"styles-module__option--MOGCu","userOption":"styles-module__userOption--qGt5j","selected":"styles-module__selected--avjSK","panel":"styles-module__panel--bHhSv","panelWithFooter":"styles-module__panelWithFooter--5ItsY","panelHeading":"styles-module__panelHeading--GRNt0","panelHeader":"styles-module__panelHeader--bAHfN","panelContent":"styles-module__panelContent--X7kot","panelButtons":"styles-module__panelButtons---y4S-","panelFooter":"styles-module__panelFooter--T1y-s"});
|
|
142799
142796
|
|
|
142800
142797
|
/***/ }),
|
|
142801
142798
|
|
|
@@ -148089,324 +148086,6 @@ function hsl2rgb(hsl) {
|
|
|
148089
148086
|
}
|
|
148090
148087
|
|
|
148091
148088
|
|
|
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
|
-
|
|
148410
148089
|
/***/ }),
|
|
148411
148090
|
|
|
148412
148091
|
/***/ 2595:
|
|
@@ -150380,6 +150059,324 @@ module.exports = {
|
|
|
150380
150059
|
};
|
|
150381
150060
|
|
|
150382
150061
|
|
|
150062
|
+
/***/ }),
|
|
150063
|
+
|
|
150064
|
+
/***/ 9793:
|
|
150065
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150066
|
+
|
|
150067
|
+
|
|
150068
|
+
|
|
150069
|
+
var annAttrs = __webpack_require__(84676);
|
|
150070
|
+
var overrideAll = (__webpack_require__(70756).overrideAll);
|
|
150071
|
+
var templatedArray = (__webpack_require__(79338).templatedArray);
|
|
150072
|
+
|
|
150073
|
+
module.exports = overrideAll(templatedArray('annotation', {
|
|
150074
|
+
visible: annAttrs.visible,
|
|
150075
|
+
x: {
|
|
150076
|
+
valType: 'any',
|
|
150077
|
+
description: [
|
|
150078
|
+
'Sets the annotation\'s x position.'
|
|
150079
|
+
].join(' ')
|
|
150080
|
+
},
|
|
150081
|
+
y: {
|
|
150082
|
+
valType: 'any',
|
|
150083
|
+
description: [
|
|
150084
|
+
'Sets the annotation\'s y position.'
|
|
150085
|
+
].join(' ')
|
|
150086
|
+
},
|
|
150087
|
+
z: {
|
|
150088
|
+
valType: 'any',
|
|
150089
|
+
description: [
|
|
150090
|
+
'Sets the annotation\'s z position.'
|
|
150091
|
+
].join(' ')
|
|
150092
|
+
},
|
|
150093
|
+
ax: {
|
|
150094
|
+
valType: 'number',
|
|
150095
|
+
description: [
|
|
150096
|
+
'Sets the x component of the arrow tail about the arrow head (in pixels).'
|
|
150097
|
+
].join(' ')
|
|
150098
|
+
},
|
|
150099
|
+
ay: {
|
|
150100
|
+
valType: 'number',
|
|
150101
|
+
description: [
|
|
150102
|
+
'Sets the y component of the arrow tail about the arrow head (in pixels).'
|
|
150103
|
+
].join(' ')
|
|
150104
|
+
},
|
|
150105
|
+
|
|
150106
|
+
xanchor: annAttrs.xanchor,
|
|
150107
|
+
xshift: annAttrs.xshift,
|
|
150108
|
+
yanchor: annAttrs.yanchor,
|
|
150109
|
+
yshift: annAttrs.yshift,
|
|
150110
|
+
|
|
150111
|
+
text: annAttrs.text,
|
|
150112
|
+
textangle: annAttrs.textangle,
|
|
150113
|
+
font: annAttrs.font,
|
|
150114
|
+
width: annAttrs.width,
|
|
150115
|
+
height: annAttrs.height,
|
|
150116
|
+
opacity: annAttrs.opacity,
|
|
150117
|
+
align: annAttrs.align,
|
|
150118
|
+
valign: annAttrs.valign,
|
|
150119
|
+
bgcolor: annAttrs.bgcolor,
|
|
150120
|
+
bordercolor: annAttrs.bordercolor,
|
|
150121
|
+
borderpad: annAttrs.borderpad,
|
|
150122
|
+
borderwidth: annAttrs.borderwidth,
|
|
150123
|
+
showarrow: annAttrs.showarrow,
|
|
150124
|
+
arrowcolor: annAttrs.arrowcolor,
|
|
150125
|
+
arrowhead: annAttrs.arrowhead,
|
|
150126
|
+
startarrowhead: annAttrs.startarrowhead,
|
|
150127
|
+
arrowside: annAttrs.arrowside,
|
|
150128
|
+
arrowsize: annAttrs.arrowsize,
|
|
150129
|
+
startarrowsize: annAttrs.startarrowsize,
|
|
150130
|
+
arrowwidth: annAttrs.arrowwidth,
|
|
150131
|
+
standoff: annAttrs.standoff,
|
|
150132
|
+
startstandoff: annAttrs.startstandoff,
|
|
150133
|
+
hovertext: annAttrs.hovertext,
|
|
150134
|
+
hoverlabel: annAttrs.hoverlabel,
|
|
150135
|
+
captureevents: annAttrs.captureevents,
|
|
150136
|
+
|
|
150137
|
+
// maybes later?
|
|
150138
|
+
// clicktoshow: annAttrs.clicktoshow,
|
|
150139
|
+
// xclick: annAttrs.xclick,
|
|
150140
|
+
// yclick: annAttrs.yclick,
|
|
150141
|
+
|
|
150142
|
+
// not needed!
|
|
150143
|
+
// axref: 'pixel'
|
|
150144
|
+
// ayref: 'pixel'
|
|
150145
|
+
// xref: 'x'
|
|
150146
|
+
// yref: 'y
|
|
150147
|
+
// zref: 'z'
|
|
150148
|
+
}), 'calc', 'from-root');
|
|
150149
|
+
|
|
150150
|
+
|
|
150151
|
+
/***/ }),
|
|
150152
|
+
|
|
150153
|
+
/***/ 58121:
|
|
150154
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150155
|
+
|
|
150156
|
+
|
|
150157
|
+
|
|
150158
|
+
var Lib = __webpack_require__(30991);
|
|
150159
|
+
var Axes = __webpack_require__(15076);
|
|
150160
|
+
|
|
150161
|
+
module.exports = function convert(scene) {
|
|
150162
|
+
var fullSceneLayout = scene.fullSceneLayout;
|
|
150163
|
+
var anns = fullSceneLayout.annotations;
|
|
150164
|
+
|
|
150165
|
+
for(var i = 0; i < anns.length; i++) {
|
|
150166
|
+
mockAnnAxes(anns[i], scene);
|
|
150167
|
+
}
|
|
150168
|
+
|
|
150169
|
+
scene.fullLayout._infolayer
|
|
150170
|
+
.selectAll('.annotation-' + scene.id)
|
|
150171
|
+
.remove();
|
|
150172
|
+
};
|
|
150173
|
+
|
|
150174
|
+
function mockAnnAxes(ann, scene) {
|
|
150175
|
+
var fullSceneLayout = scene.fullSceneLayout;
|
|
150176
|
+
var domain = fullSceneLayout.domain;
|
|
150177
|
+
var size = scene.fullLayout._size;
|
|
150178
|
+
|
|
150179
|
+
var base = {
|
|
150180
|
+
// this gets fill in on render
|
|
150181
|
+
pdata: null,
|
|
150182
|
+
|
|
150183
|
+
// to get setConvert to not execute cleanly
|
|
150184
|
+
type: 'linear',
|
|
150185
|
+
|
|
150186
|
+
// don't try to update them on `editable: true`
|
|
150187
|
+
autorange: false,
|
|
150188
|
+
|
|
150189
|
+
// set infinite range so that annotation draw routine
|
|
150190
|
+
// does not try to remove 'outside-range' annotations,
|
|
150191
|
+
// this case is handled in the render loop
|
|
150192
|
+
range: [-Infinity, Infinity]
|
|
150193
|
+
};
|
|
150194
|
+
|
|
150195
|
+
ann._xa = {};
|
|
150196
|
+
Lib.extendFlat(ann._xa, base);
|
|
150197
|
+
Axes.setConvert(ann._xa);
|
|
150198
|
+
ann._xa._offset = size.l + domain.x[0] * size.w;
|
|
150199
|
+
ann._xa.l2p = function() {
|
|
150200
|
+
return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
|
|
150201
|
+
};
|
|
150202
|
+
|
|
150203
|
+
ann._ya = {};
|
|
150204
|
+
Lib.extendFlat(ann._ya, base);
|
|
150205
|
+
Axes.setConvert(ann._ya);
|
|
150206
|
+
ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
|
|
150207
|
+
ann._ya.l2p = function() {
|
|
150208
|
+
return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
|
|
150209
|
+
};
|
|
150210
|
+
}
|
|
150211
|
+
|
|
150212
|
+
|
|
150213
|
+
/***/ }),
|
|
150214
|
+
|
|
150215
|
+
/***/ 41926:
|
|
150216
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150217
|
+
|
|
150218
|
+
|
|
150219
|
+
|
|
150220
|
+
var Lib = __webpack_require__(30991);
|
|
150221
|
+
var Axes = __webpack_require__(15076);
|
|
150222
|
+
var handleArrayContainerDefaults = __webpack_require__(21238);
|
|
150223
|
+
var handleAnnotationCommonDefaults = __webpack_require__(84081);
|
|
150224
|
+
var attributes = __webpack_require__(9793);
|
|
150225
|
+
|
|
150226
|
+
module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
|
|
150227
|
+
handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
|
|
150228
|
+
name: 'annotations',
|
|
150229
|
+
handleItemDefaults: handleAnnotationDefaults,
|
|
150230
|
+
fullLayout: opts.fullLayout
|
|
150231
|
+
});
|
|
150232
|
+
};
|
|
150233
|
+
|
|
150234
|
+
function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
|
|
150235
|
+
function coerce(attr, dflt) {
|
|
150236
|
+
return Lib.coerce(annIn, annOut, attributes, attr, dflt);
|
|
150237
|
+
}
|
|
150238
|
+
|
|
150239
|
+
function coercePosition(axLetter) {
|
|
150240
|
+
var axName = axLetter + 'axis';
|
|
150241
|
+
|
|
150242
|
+
// mock in such way that getFromId grabs correct 3D axis
|
|
150243
|
+
var gdMock = { _fullLayout: {} };
|
|
150244
|
+
gdMock._fullLayout[axName] = sceneLayout[axName];
|
|
150245
|
+
|
|
150246
|
+
return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
|
|
150247
|
+
}
|
|
150248
|
+
|
|
150249
|
+
|
|
150250
|
+
var visible = coerce('visible');
|
|
150251
|
+
if(!visible) return;
|
|
150252
|
+
|
|
150253
|
+
handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
|
|
150254
|
+
|
|
150255
|
+
coercePosition('x');
|
|
150256
|
+
coercePosition('y');
|
|
150257
|
+
coercePosition('z');
|
|
150258
|
+
|
|
150259
|
+
// if you have one coordinate you should all three
|
|
150260
|
+
Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
|
|
150261
|
+
|
|
150262
|
+
// hard-set here for completeness
|
|
150263
|
+
annOut.xref = 'x';
|
|
150264
|
+
annOut.yref = 'y';
|
|
150265
|
+
annOut.zref = 'z';
|
|
150266
|
+
|
|
150267
|
+
coerce('xanchor');
|
|
150268
|
+
coerce('yanchor');
|
|
150269
|
+
coerce('xshift');
|
|
150270
|
+
coerce('yshift');
|
|
150271
|
+
|
|
150272
|
+
if(annOut.showarrow) {
|
|
150273
|
+
annOut.axref = 'pixel';
|
|
150274
|
+
annOut.ayref = 'pixel';
|
|
150275
|
+
|
|
150276
|
+
// TODO maybe default values should be bigger than the 2D case?
|
|
150277
|
+
coerce('ax', -10);
|
|
150278
|
+
coerce('ay', -30);
|
|
150279
|
+
|
|
150280
|
+
// if you have one part of arrow length you should have both
|
|
150281
|
+
Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
|
|
150282
|
+
}
|
|
150283
|
+
}
|
|
150284
|
+
|
|
150285
|
+
|
|
150286
|
+
/***/ }),
|
|
150287
|
+
|
|
150288
|
+
/***/ 13802:
|
|
150289
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150290
|
+
|
|
150291
|
+
|
|
150292
|
+
|
|
150293
|
+
var drawRaw = (__webpack_require__(47995).drawRaw);
|
|
150294
|
+
var project = __webpack_require__(51344);
|
|
150295
|
+
var axLetters = ['x', 'y', 'z'];
|
|
150296
|
+
|
|
150297
|
+
module.exports = function draw(scene) {
|
|
150298
|
+
var fullSceneLayout = scene.fullSceneLayout;
|
|
150299
|
+
var dataScale = scene.dataScale;
|
|
150300
|
+
var anns = fullSceneLayout.annotations;
|
|
150301
|
+
|
|
150302
|
+
for(var i = 0; i < anns.length; i++) {
|
|
150303
|
+
var ann = anns[i];
|
|
150304
|
+
var annotationIsOffscreen = false;
|
|
150305
|
+
|
|
150306
|
+
for(var j = 0; j < 3; j++) {
|
|
150307
|
+
var axLetter = axLetters[j];
|
|
150308
|
+
var pos = ann[axLetter];
|
|
150309
|
+
var ax = fullSceneLayout[axLetter + 'axis'];
|
|
150310
|
+
var posFraction = ax.r2fraction(pos);
|
|
150311
|
+
|
|
150312
|
+
if(posFraction < 0 || posFraction > 1) {
|
|
150313
|
+
annotationIsOffscreen = true;
|
|
150314
|
+
break;
|
|
150315
|
+
}
|
|
150316
|
+
}
|
|
150317
|
+
|
|
150318
|
+
if(annotationIsOffscreen) {
|
|
150319
|
+
scene.fullLayout._infolayer
|
|
150320
|
+
.select('.annotation-' + scene.id + '[data-index="' + i + '"]')
|
|
150321
|
+
.remove();
|
|
150322
|
+
} else {
|
|
150323
|
+
ann._pdata = project(scene.glplot.cameraParams, [
|
|
150324
|
+
fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
|
|
150325
|
+
fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
|
|
150326
|
+
fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
|
|
150327
|
+
]);
|
|
150328
|
+
|
|
150329
|
+
drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
|
|
150330
|
+
}
|
|
150331
|
+
}
|
|
150332
|
+
};
|
|
150333
|
+
|
|
150334
|
+
|
|
150335
|
+
/***/ }),
|
|
150336
|
+
|
|
150337
|
+
/***/ 86578:
|
|
150338
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
150339
|
+
|
|
150340
|
+
|
|
150341
|
+
|
|
150342
|
+
var Registry = __webpack_require__(13936);
|
|
150343
|
+
var Lib = __webpack_require__(30991);
|
|
150344
|
+
|
|
150345
|
+
module.exports = {
|
|
150346
|
+
moduleType: 'component',
|
|
150347
|
+
name: 'annotations3d',
|
|
150348
|
+
|
|
150349
|
+
schema: {
|
|
150350
|
+
subplots: {
|
|
150351
|
+
scene: {annotations: __webpack_require__(9793)}
|
|
150352
|
+
}
|
|
150353
|
+
},
|
|
150354
|
+
|
|
150355
|
+
layoutAttributes: __webpack_require__(9793),
|
|
150356
|
+
handleDefaults: __webpack_require__(41926),
|
|
150357
|
+
includeBasePlot: includeGL3D,
|
|
150358
|
+
|
|
150359
|
+
convert: __webpack_require__(58121),
|
|
150360
|
+
draw: __webpack_require__(13802)
|
|
150361
|
+
};
|
|
150362
|
+
|
|
150363
|
+
function includeGL3D(layoutIn, layoutOut) {
|
|
150364
|
+
var GL3D = Registry.subplotsRegistry.gl3d;
|
|
150365
|
+
if(!GL3D) return;
|
|
150366
|
+
|
|
150367
|
+
var attrRegex = GL3D.attrRegex;
|
|
150368
|
+
|
|
150369
|
+
var keys = Object.keys(layoutIn);
|
|
150370
|
+
for(var i = 0; i < keys.length; i++) {
|
|
150371
|
+
var k = keys[i];
|
|
150372
|
+
if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
|
|
150373
|
+
Lib.pushUnique(layoutOut._basePlotModules, GL3D);
|
|
150374
|
+
Lib.pushUnique(layoutOut._subplots.gl3d, k);
|
|
150375
|
+
}
|
|
150376
|
+
}
|
|
150377
|
+
}
|
|
150378
|
+
|
|
150379
|
+
|
|
150383
150380
|
/***/ }),
|
|
150384
150381
|
|
|
150385
150382
|
/***/ 27639:
|
|
@@ -248612,595 +248609,6 @@ function isValidZ(z) {
|
|
|
248612
248609
|
}
|
|
248613
248610
|
|
|
248614
248611
|
|
|
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
|
-
|
|
249204
248612
|
/***/ }),
|
|
249205
248613
|
|
|
249206
248614
|
/***/ 71250:
|
|
@@ -250909,6 +250317,595 @@ module.exports = {
|
|
|
250909
250317
|
};
|
|
250910
250318
|
|
|
250911
250319
|
|
|
250320
|
+
/***/ }),
|
|
250321
|
+
|
|
250322
|
+
/***/ 42124:
|
|
250323
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250324
|
+
|
|
250325
|
+
|
|
250326
|
+
|
|
250327
|
+
var histogramAttrs = __webpack_require__(71250);
|
|
250328
|
+
var makeBinAttrs = __webpack_require__(9284);
|
|
250329
|
+
var heatmapAttrs = __webpack_require__(68300);
|
|
250330
|
+
var baseAttrs = __webpack_require__(35667);
|
|
250331
|
+
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
250332
|
+
var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
|
|
250333
|
+
var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
|
|
250334
|
+
var colorScaleAttrs = __webpack_require__(17957);
|
|
250335
|
+
|
|
250336
|
+
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
250337
|
+
|
|
250338
|
+
module.exports = extendFlat(
|
|
250339
|
+
{
|
|
250340
|
+
x: histogramAttrs.x,
|
|
250341
|
+
y: histogramAttrs.y,
|
|
250342
|
+
|
|
250343
|
+
z: {
|
|
250344
|
+
valType: 'data_array',
|
|
250345
|
+
editType: 'calc',
|
|
250346
|
+
description: 'Sets the aggregation data.'
|
|
250347
|
+
},
|
|
250348
|
+
marker: {
|
|
250349
|
+
color: {
|
|
250350
|
+
valType: 'data_array',
|
|
250351
|
+
editType: 'calc',
|
|
250352
|
+
description: 'Sets the aggregation data.'
|
|
250353
|
+
},
|
|
250354
|
+
editType: 'calc'
|
|
250355
|
+
},
|
|
250356
|
+
|
|
250357
|
+
histnorm: histogramAttrs.histnorm,
|
|
250358
|
+
histfunc: histogramAttrs.histfunc,
|
|
250359
|
+
nbinsx: histogramAttrs.nbinsx,
|
|
250360
|
+
xbins: makeBinAttrs('x'),
|
|
250361
|
+
nbinsy: histogramAttrs.nbinsy,
|
|
250362
|
+
ybins: makeBinAttrs('y'),
|
|
250363
|
+
autobinx: histogramAttrs.autobinx,
|
|
250364
|
+
autobiny: histogramAttrs.autobiny,
|
|
250365
|
+
|
|
250366
|
+
bingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
250367
|
+
description: [
|
|
250368
|
+
'Set the `xbingroup` and `ybingroup` default prefix',
|
|
250369
|
+
'For example, setting a `bingroup` of *1* on two histogram2d traces',
|
|
250370
|
+
'will make them their x-bins and y-bins match separately.'
|
|
250371
|
+
].join(' ')
|
|
250372
|
+
}),
|
|
250373
|
+
xbingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
250374
|
+
description: [
|
|
250375
|
+
'Set a group of histogram traces which will have compatible x-bin settings.',
|
|
250376
|
+
'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
|
|
250377
|
+
'(on axes of the same axis type) can have compatible x-bin settings.',
|
|
250378
|
+
'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
|
|
250379
|
+
].join(' ')
|
|
250380
|
+
}),
|
|
250381
|
+
ybingroup: extendFlat({}, histogramAttrs.bingroup, {
|
|
250382
|
+
description: [
|
|
250383
|
+
'Set a group of histogram traces which will have compatible y-bin settings.',
|
|
250384
|
+
'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
|
|
250385
|
+
'(on axes of the same axis type) can have compatible y-bin settings.',
|
|
250386
|
+
'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
|
|
250387
|
+
].join(' ')
|
|
250388
|
+
}),
|
|
250389
|
+
|
|
250390
|
+
xgap: heatmapAttrs.xgap,
|
|
250391
|
+
ygap: heatmapAttrs.ygap,
|
|
250392
|
+
zsmooth: heatmapAttrs.zsmooth,
|
|
250393
|
+
xhoverformat: axisHoverFormat('x'),
|
|
250394
|
+
yhoverformat: axisHoverFormat('y'),
|
|
250395
|
+
zhoverformat: axisHoverFormat('z', 1),
|
|
250396
|
+
hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
|
|
250397
|
+
texttemplate: texttemplateAttrs({
|
|
250398
|
+
arrayOk: false,
|
|
250399
|
+
editType: 'plot'
|
|
250400
|
+
}, {
|
|
250401
|
+
keys: 'z'
|
|
250402
|
+
}),
|
|
250403
|
+
textfont: heatmapAttrs.textfont,
|
|
250404
|
+
showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
|
|
250405
|
+
},
|
|
250406
|
+
colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
|
|
250407
|
+
);
|
|
250408
|
+
|
|
250409
|
+
|
|
250410
|
+
/***/ }),
|
|
250411
|
+
|
|
250412
|
+
/***/ 32492:
|
|
250413
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250414
|
+
|
|
250415
|
+
|
|
250416
|
+
|
|
250417
|
+
var Lib = __webpack_require__(30991);
|
|
250418
|
+
var Axes = __webpack_require__(15076);
|
|
250419
|
+
|
|
250420
|
+
var binFunctions = __webpack_require__(47260);
|
|
250421
|
+
var normFunctions = __webpack_require__(855);
|
|
250422
|
+
var doAvg = __webpack_require__(26756);
|
|
250423
|
+
var getBinSpanLabelRound = __webpack_require__(41574);
|
|
250424
|
+
var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
|
|
250425
|
+
|
|
250426
|
+
module.exports = function calc(gd, trace) {
|
|
250427
|
+
var xa = Axes.getFromId(gd, trace.xaxis);
|
|
250428
|
+
var ya = Axes.getFromId(gd, trace.yaxis);
|
|
250429
|
+
|
|
250430
|
+
var xcalendar = trace.xcalendar;
|
|
250431
|
+
var ycalendar = trace.ycalendar;
|
|
250432
|
+
var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
|
|
250433
|
+
var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
|
|
250434
|
+
var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
|
|
250435
|
+
var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
|
|
250436
|
+
|
|
250437
|
+
var i, j, n, m;
|
|
250438
|
+
|
|
250439
|
+
// calculate the bins
|
|
250440
|
+
var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
|
|
250441
|
+
var xBinSpec = xBinsAndPos[0];
|
|
250442
|
+
var xPos0 = xBinsAndPos[1];
|
|
250443
|
+
var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
|
|
250444
|
+
var yBinSpec = yBinsAndPos[0];
|
|
250445
|
+
var yPos0 = yBinsAndPos[1];
|
|
250446
|
+
|
|
250447
|
+
var serieslen = trace._length;
|
|
250448
|
+
if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
|
|
250449
|
+
if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
|
|
250450
|
+
|
|
250451
|
+
// make the empty bin array & scale the map
|
|
250452
|
+
var z = [];
|
|
250453
|
+
var onecol = [];
|
|
250454
|
+
var zerocol = [];
|
|
250455
|
+
var nonuniformBinsX = typeof xBinSpec.size === 'string';
|
|
250456
|
+
var nonuniformBinsY = typeof yBinSpec.size === 'string';
|
|
250457
|
+
var xEdges = [];
|
|
250458
|
+
var yEdges = [];
|
|
250459
|
+
var xbins = nonuniformBinsX ? xEdges : xBinSpec;
|
|
250460
|
+
var ybins = nonuniformBinsY ? yEdges : yBinSpec;
|
|
250461
|
+
var total = 0;
|
|
250462
|
+
var counts = [];
|
|
250463
|
+
var inputPoints = [];
|
|
250464
|
+
var norm = trace.histnorm;
|
|
250465
|
+
var func = trace.histfunc;
|
|
250466
|
+
var densitynorm = norm.indexOf('density') !== -1;
|
|
250467
|
+
var extremefunc = func === 'max' || func === 'min';
|
|
250468
|
+
var sizeinit = extremefunc ? null : 0;
|
|
250469
|
+
var binfunc = binFunctions.count;
|
|
250470
|
+
var normfunc = normFunctions[norm];
|
|
250471
|
+
var doavg = false;
|
|
250472
|
+
var xinc = [];
|
|
250473
|
+
var yinc = [];
|
|
250474
|
+
|
|
250475
|
+
// set a binning function other than count?
|
|
250476
|
+
// for binning functions: check first for 'z',
|
|
250477
|
+
// then 'mc' in case we had a colored scatter plot
|
|
250478
|
+
// and want to transfer these colors to the 2D histo
|
|
250479
|
+
// TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
|
|
250480
|
+
var rawCounterData = ('z' in trace) ?
|
|
250481
|
+
trace.z :
|
|
250482
|
+
(('marker' in trace && Array.isArray(trace.marker.color)) ?
|
|
250483
|
+
trace.marker.color : '');
|
|
250484
|
+
if(rawCounterData && func !== 'count') {
|
|
250485
|
+
doavg = func === 'avg';
|
|
250486
|
+
binfunc = binFunctions[func];
|
|
250487
|
+
}
|
|
250488
|
+
|
|
250489
|
+
// decrease end a little in case of rounding errors
|
|
250490
|
+
var xBinSize = xBinSpec.size;
|
|
250491
|
+
var xBinStart = xr2c(xBinSpec.start);
|
|
250492
|
+
var xBinEnd = xr2c(xBinSpec.end) +
|
|
250493
|
+
(xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
|
|
250494
|
+
|
|
250495
|
+
for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
|
|
250496
|
+
onecol.push(sizeinit);
|
|
250497
|
+
xEdges.push(i);
|
|
250498
|
+
if(doavg) zerocol.push(0);
|
|
250499
|
+
}
|
|
250500
|
+
xEdges.push(i);
|
|
250501
|
+
|
|
250502
|
+
var nx = onecol.length;
|
|
250503
|
+
var dx = (i - xBinStart) / nx;
|
|
250504
|
+
var x0 = xc2r(xBinStart + dx / 2);
|
|
250505
|
+
|
|
250506
|
+
var yBinSize = yBinSpec.size;
|
|
250507
|
+
var yBinStart = yr2c(yBinSpec.start);
|
|
250508
|
+
var yBinEnd = yr2c(yBinSpec.end) +
|
|
250509
|
+
(yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
|
|
250510
|
+
|
|
250511
|
+
for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
|
|
250512
|
+
z.push(onecol.slice());
|
|
250513
|
+
yEdges.push(i);
|
|
250514
|
+
var ipCol = new Array(nx);
|
|
250515
|
+
for(j = 0; j < nx; j++) ipCol[j] = [];
|
|
250516
|
+
inputPoints.push(ipCol);
|
|
250517
|
+
if(doavg) counts.push(zerocol.slice());
|
|
250518
|
+
}
|
|
250519
|
+
yEdges.push(i);
|
|
250520
|
+
|
|
250521
|
+
var ny = z.length;
|
|
250522
|
+
var dy = (i - yBinStart) / ny;
|
|
250523
|
+
var y0 = yc2r(yBinStart + dy / 2);
|
|
250524
|
+
|
|
250525
|
+
if(densitynorm) {
|
|
250526
|
+
xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
|
|
250527
|
+
yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
|
|
250528
|
+
}
|
|
250529
|
+
|
|
250530
|
+
// for date axes we need bin bounds to be calcdata. For nonuniform bins
|
|
250531
|
+
// we already have this, but uniform with start/end/size they're still strings.
|
|
250532
|
+
if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
|
|
250533
|
+
if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
|
|
250534
|
+
|
|
250535
|
+
// put data into bins
|
|
250536
|
+
var uniqueValsPerX = true;
|
|
250537
|
+
var uniqueValsPerY = true;
|
|
250538
|
+
var xVals = new Array(nx);
|
|
250539
|
+
var yVals = new Array(ny);
|
|
250540
|
+
var xGapLow = Infinity;
|
|
250541
|
+
var xGapHigh = Infinity;
|
|
250542
|
+
var yGapLow = Infinity;
|
|
250543
|
+
var yGapHigh = Infinity;
|
|
250544
|
+
for(i = 0; i < serieslen; i++) {
|
|
250545
|
+
var xi = xPos0[i];
|
|
250546
|
+
var yi = yPos0[i];
|
|
250547
|
+
n = Lib.findBin(xi, xbins);
|
|
250548
|
+
m = Lib.findBin(yi, ybins);
|
|
250549
|
+
if(n >= 0 && n < nx && m >= 0 && m < ny) {
|
|
250550
|
+
total += binfunc(n, i, z[m], rawCounterData, counts[m]);
|
|
250551
|
+
inputPoints[m][n].push(i);
|
|
250552
|
+
|
|
250553
|
+
if(uniqueValsPerX) {
|
|
250554
|
+
if(xVals[n] === undefined) xVals[n] = xi;
|
|
250555
|
+
else if(xVals[n] !== xi) uniqueValsPerX = false;
|
|
250556
|
+
}
|
|
250557
|
+
if(uniqueValsPerY) {
|
|
250558
|
+
if(yVals[m] === undefined) yVals[m] = yi;
|
|
250559
|
+
else if(yVals[m] !== yi) uniqueValsPerY = false;
|
|
250560
|
+
}
|
|
250561
|
+
|
|
250562
|
+
xGapLow = Math.min(xGapLow, xi - xEdges[n]);
|
|
250563
|
+
xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
|
|
250564
|
+
yGapLow = Math.min(yGapLow, yi - yEdges[m]);
|
|
250565
|
+
yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
|
|
250566
|
+
}
|
|
250567
|
+
}
|
|
250568
|
+
// normalize, if needed
|
|
250569
|
+
if(doavg) {
|
|
250570
|
+
for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
|
|
250571
|
+
}
|
|
250572
|
+
if(normfunc) {
|
|
250573
|
+
for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
|
|
250574
|
+
}
|
|
250575
|
+
|
|
250576
|
+
return {
|
|
250577
|
+
x: xPos0,
|
|
250578
|
+
xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
|
|
250579
|
+
x0: x0,
|
|
250580
|
+
dx: dx,
|
|
250581
|
+
y: yPos0,
|
|
250582
|
+
yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
|
|
250583
|
+
y0: y0,
|
|
250584
|
+
dy: dy,
|
|
250585
|
+
z: z,
|
|
250586
|
+
pts: inputPoints
|
|
250587
|
+
};
|
|
250588
|
+
};
|
|
250589
|
+
|
|
250590
|
+
function makeIncrements(len, bins, dv, nonuniform) {
|
|
250591
|
+
var out = new Array(len);
|
|
250592
|
+
var i;
|
|
250593
|
+
if(nonuniform) {
|
|
250594
|
+
for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
|
|
250595
|
+
} else {
|
|
250596
|
+
var inc = 1 / dv;
|
|
250597
|
+
for(i = 0; i < len; i++) out[i] = inc;
|
|
250598
|
+
}
|
|
250599
|
+
return out;
|
|
250600
|
+
}
|
|
250601
|
+
|
|
250602
|
+
function binsToCalc(r2c, bins) {
|
|
250603
|
+
return {
|
|
250604
|
+
start: r2c(bins.start),
|
|
250605
|
+
end: r2c(bins.end),
|
|
250606
|
+
size: bins.size
|
|
250607
|
+
};
|
|
250608
|
+
}
|
|
250609
|
+
|
|
250610
|
+
function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
|
|
250611
|
+
var i;
|
|
250612
|
+
var len = edges.length - 1;
|
|
250613
|
+
var out = new Array(len);
|
|
250614
|
+
var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
|
|
250615
|
+
|
|
250616
|
+
for(i = 0; i < len; i++) {
|
|
250617
|
+
var v = (uniqueVals || [])[i];
|
|
250618
|
+
out[i] = v === undefined ?
|
|
250619
|
+
[roundFn(edges[i]), roundFn(edges[i + 1], true)] :
|
|
250620
|
+
[v, v];
|
|
250621
|
+
}
|
|
250622
|
+
return out;
|
|
250623
|
+
}
|
|
250624
|
+
|
|
250625
|
+
|
|
250626
|
+
/***/ }),
|
|
250627
|
+
|
|
250628
|
+
/***/ 15611:
|
|
250629
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250630
|
+
|
|
250631
|
+
|
|
250632
|
+
|
|
250633
|
+
var Lib = __webpack_require__(30991);
|
|
250634
|
+
|
|
250635
|
+
var handleSampleDefaults = __webpack_require__(6236);
|
|
250636
|
+
var handleStyleDefaults = __webpack_require__(25157);
|
|
250637
|
+
var colorscaleDefaults = __webpack_require__(13682);
|
|
250638
|
+
var handleHeatmapLabelDefaults = __webpack_require__(52340);
|
|
250639
|
+
var attributes = __webpack_require__(42124);
|
|
250640
|
+
|
|
250641
|
+
|
|
250642
|
+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
250643
|
+
function coerce(attr, dflt) {
|
|
250644
|
+
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
250645
|
+
}
|
|
250646
|
+
|
|
250647
|
+
handleSampleDefaults(traceIn, traceOut, coerce, layout);
|
|
250648
|
+
if(traceOut.visible === false) return;
|
|
250649
|
+
|
|
250650
|
+
handleStyleDefaults(traceIn, traceOut, coerce, layout);
|
|
250651
|
+
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
|
|
250652
|
+
coerce('hovertemplate');
|
|
250653
|
+
|
|
250654
|
+
handleHeatmapLabelDefaults(coerce, layout);
|
|
250655
|
+
|
|
250656
|
+
coerce('xhoverformat');
|
|
250657
|
+
coerce('yhoverformat');
|
|
250658
|
+
};
|
|
250659
|
+
|
|
250660
|
+
|
|
250661
|
+
/***/ }),
|
|
250662
|
+
|
|
250663
|
+
/***/ 94587:
|
|
250664
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250665
|
+
|
|
250666
|
+
|
|
250667
|
+
|
|
250668
|
+
var heatmapHover = __webpack_require__(85243);
|
|
250669
|
+
var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
|
|
250670
|
+
|
|
250671
|
+
module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
|
|
250672
|
+
var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
|
|
250673
|
+
|
|
250674
|
+
if(!pts) return;
|
|
250675
|
+
|
|
250676
|
+
pointData = pts[0];
|
|
250677
|
+
var indices = pointData.index;
|
|
250678
|
+
var ny = indices[0];
|
|
250679
|
+
var nx = indices[1];
|
|
250680
|
+
var cd0 = pointData.cd[0];
|
|
250681
|
+
var trace = cd0.trace;
|
|
250682
|
+
var xRange = cd0.xRanges[nx];
|
|
250683
|
+
var yRange = cd0.yRanges[ny];
|
|
250684
|
+
|
|
250685
|
+
pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
|
|
250686
|
+
pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
|
|
250687
|
+
|
|
250688
|
+
return pts;
|
|
250689
|
+
};
|
|
250690
|
+
|
|
250691
|
+
|
|
250692
|
+
/***/ }),
|
|
250693
|
+
|
|
250694
|
+
/***/ 3617:
|
|
250695
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250696
|
+
|
|
250697
|
+
|
|
250698
|
+
|
|
250699
|
+
module.exports = {
|
|
250700
|
+
attributes: __webpack_require__(42124),
|
|
250701
|
+
supplyDefaults: __webpack_require__(15611),
|
|
250702
|
+
crossTraceDefaults: __webpack_require__(34294),
|
|
250703
|
+
calc: __webpack_require__(91980),
|
|
250704
|
+
plot: __webpack_require__(29406),
|
|
250705
|
+
layerName: 'heatmaplayer',
|
|
250706
|
+
colorbar: __webpack_require__(90165),
|
|
250707
|
+
style: __webpack_require__(58756),
|
|
250708
|
+
hoverPoints: __webpack_require__(94587),
|
|
250709
|
+
eventData: __webpack_require__(63870),
|
|
250710
|
+
|
|
250711
|
+
moduleType: 'trace',
|
|
250712
|
+
name: 'histogram2d',
|
|
250713
|
+
basePlotModule: __webpack_require__(47885),
|
|
250714
|
+
categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
|
|
250715
|
+
meta: {
|
|
250716
|
+
hrName: 'histogram_2d',
|
|
250717
|
+
description: [
|
|
250718
|
+
'The sample data from which statistics are computed is set in `x`',
|
|
250719
|
+
'and `y` (where `x` and `y` represent marginal distributions,',
|
|
250720
|
+
'binning is set in `xbins` and `ybins` in this case)',
|
|
250721
|
+
'or `z` (where `z` represent the 2D distribution and binning set,',
|
|
250722
|
+
'binning is set by `x` and `y` in this case).',
|
|
250723
|
+
'The resulting distribution is visualized as a heatmap.'
|
|
250724
|
+
].join(' ')
|
|
250725
|
+
}
|
|
250726
|
+
};
|
|
250727
|
+
|
|
250728
|
+
|
|
250729
|
+
/***/ }),
|
|
250730
|
+
|
|
250731
|
+
/***/ 6236:
|
|
250732
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250733
|
+
|
|
250734
|
+
|
|
250735
|
+
|
|
250736
|
+
var Registry = __webpack_require__(13936);
|
|
250737
|
+
var Lib = __webpack_require__(30991);
|
|
250738
|
+
|
|
250739
|
+
module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
|
|
250740
|
+
var x = coerce('x');
|
|
250741
|
+
var y = coerce('y');
|
|
250742
|
+
var xlen = Lib.minRowLength(x);
|
|
250743
|
+
var ylen = Lib.minRowLength(y);
|
|
250744
|
+
|
|
250745
|
+
// we could try to accept x0 and dx, etc...
|
|
250746
|
+
// but that's a pretty weird use case.
|
|
250747
|
+
// for now require both x and y explicitly specified.
|
|
250748
|
+
if(!xlen || !ylen) {
|
|
250749
|
+
traceOut.visible = false;
|
|
250750
|
+
return;
|
|
250751
|
+
}
|
|
250752
|
+
|
|
250753
|
+
traceOut._length = Math.min(xlen, ylen);
|
|
250754
|
+
|
|
250755
|
+
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
|
|
250756
|
+
handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
|
|
250757
|
+
|
|
250758
|
+
// if marker.color is an array, we can use it in aggregation instead of z
|
|
250759
|
+
var hasAggregationData = coerce('z') || coerce('marker.color');
|
|
250760
|
+
|
|
250761
|
+
if(hasAggregationData) coerce('histfunc');
|
|
250762
|
+
coerce('histnorm');
|
|
250763
|
+
|
|
250764
|
+
// Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
|
|
250765
|
+
// autobin(x|y) are only included here to appease Plotly.validate
|
|
250766
|
+
coerce('autobinx');
|
|
250767
|
+
coerce('autobiny');
|
|
250768
|
+
};
|
|
250769
|
+
|
|
250770
|
+
|
|
250771
|
+
/***/ }),
|
|
250772
|
+
|
|
250773
|
+
/***/ 34872:
|
|
250774
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250775
|
+
|
|
250776
|
+
|
|
250777
|
+
|
|
250778
|
+
var histogram2dAttrs = __webpack_require__(42124);
|
|
250779
|
+
var contourAttrs = __webpack_require__(70318);
|
|
250780
|
+
var colorScaleAttrs = __webpack_require__(17957);
|
|
250781
|
+
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
250782
|
+
|
|
250783
|
+
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
250784
|
+
|
|
250785
|
+
module.exports = extendFlat({
|
|
250786
|
+
x: histogram2dAttrs.x,
|
|
250787
|
+
y: histogram2dAttrs.y,
|
|
250788
|
+
z: histogram2dAttrs.z,
|
|
250789
|
+
marker: histogram2dAttrs.marker,
|
|
250790
|
+
|
|
250791
|
+
histnorm: histogram2dAttrs.histnorm,
|
|
250792
|
+
histfunc: histogram2dAttrs.histfunc,
|
|
250793
|
+
nbinsx: histogram2dAttrs.nbinsx,
|
|
250794
|
+
xbins: histogram2dAttrs.xbins,
|
|
250795
|
+
nbinsy: histogram2dAttrs.nbinsy,
|
|
250796
|
+
ybins: histogram2dAttrs.ybins,
|
|
250797
|
+
autobinx: histogram2dAttrs.autobinx,
|
|
250798
|
+
autobiny: histogram2dAttrs.autobiny,
|
|
250799
|
+
|
|
250800
|
+
bingroup: histogram2dAttrs.bingroup,
|
|
250801
|
+
xbingroup: histogram2dAttrs.xbingroup,
|
|
250802
|
+
ybingroup: histogram2dAttrs.ybingroup,
|
|
250803
|
+
|
|
250804
|
+
autocontour: contourAttrs.autocontour,
|
|
250805
|
+
ncontours: contourAttrs.ncontours,
|
|
250806
|
+
contours: contourAttrs.contours,
|
|
250807
|
+
line: {
|
|
250808
|
+
color: contourAttrs.line.color,
|
|
250809
|
+
width: extendFlat({}, contourAttrs.line.width, {
|
|
250810
|
+
dflt: 0.5,
|
|
250811
|
+
description: 'Sets the contour line width in (in px)'
|
|
250812
|
+
}),
|
|
250813
|
+
dash: contourAttrs.line.dash,
|
|
250814
|
+
smoothing: contourAttrs.line.smoothing,
|
|
250815
|
+
editType: 'plot'
|
|
250816
|
+
},
|
|
250817
|
+
xhoverformat: axisHoverFormat('x'),
|
|
250818
|
+
yhoverformat: axisHoverFormat('y'),
|
|
250819
|
+
zhoverformat: axisHoverFormat('z', 1),
|
|
250820
|
+
hovertemplate: histogram2dAttrs.hovertemplate,
|
|
250821
|
+
texttemplate: contourAttrs.texttemplate,
|
|
250822
|
+
textfont: contourAttrs.textfont
|
|
250823
|
+
},
|
|
250824
|
+
colorScaleAttrs('', {
|
|
250825
|
+
cLetter: 'z',
|
|
250826
|
+
editTypeOverride: 'calc'
|
|
250827
|
+
})
|
|
250828
|
+
);
|
|
250829
|
+
|
|
250830
|
+
|
|
250831
|
+
/***/ }),
|
|
250832
|
+
|
|
250833
|
+
/***/ 14319:
|
|
250834
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250835
|
+
|
|
250836
|
+
|
|
250837
|
+
|
|
250838
|
+
var Lib = __webpack_require__(30991);
|
|
250839
|
+
|
|
250840
|
+
var handleSampleDefaults = __webpack_require__(6236);
|
|
250841
|
+
var handleContoursDefaults = __webpack_require__(657);
|
|
250842
|
+
var handleStyleDefaults = __webpack_require__(74619);
|
|
250843
|
+
var handleHeatmapLabelDefaults = __webpack_require__(52340);
|
|
250844
|
+
var attributes = __webpack_require__(34872);
|
|
250845
|
+
|
|
250846
|
+
|
|
250847
|
+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
250848
|
+
function coerce(attr, dflt) {
|
|
250849
|
+
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
250850
|
+
}
|
|
250851
|
+
|
|
250852
|
+
function coerce2(attr) {
|
|
250853
|
+
return Lib.coerce2(traceIn, traceOut, attributes, attr);
|
|
250854
|
+
}
|
|
250855
|
+
|
|
250856
|
+
handleSampleDefaults(traceIn, traceOut, coerce, layout);
|
|
250857
|
+
if(traceOut.visible === false) return;
|
|
250858
|
+
|
|
250859
|
+
handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
|
|
250860
|
+
handleStyleDefaults(traceIn, traceOut, coerce, layout);
|
|
250861
|
+
coerce('xhoverformat');
|
|
250862
|
+
coerce('yhoverformat');
|
|
250863
|
+
coerce('hovertemplate');
|
|
250864
|
+
if(
|
|
250865
|
+
traceOut.contours &&
|
|
250866
|
+
traceOut.contours.coloring === 'heatmap'
|
|
250867
|
+
) {
|
|
250868
|
+
handleHeatmapLabelDefaults(coerce, layout);
|
|
250869
|
+
}
|
|
250870
|
+
};
|
|
250871
|
+
|
|
250872
|
+
|
|
250873
|
+
/***/ }),
|
|
250874
|
+
|
|
250875
|
+
/***/ 60613:
|
|
250876
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
250877
|
+
|
|
250878
|
+
|
|
250879
|
+
|
|
250880
|
+
module.exports = {
|
|
250881
|
+
attributes: __webpack_require__(34872),
|
|
250882
|
+
supplyDefaults: __webpack_require__(14319),
|
|
250883
|
+
crossTraceDefaults: __webpack_require__(34294),
|
|
250884
|
+
calc: __webpack_require__(3274),
|
|
250885
|
+
plot: (__webpack_require__(32664).plot),
|
|
250886
|
+
layerName: 'contourlayer',
|
|
250887
|
+
style: __webpack_require__(72690),
|
|
250888
|
+
colorbar: __webpack_require__(70307),
|
|
250889
|
+
hoverPoints: __webpack_require__(52353),
|
|
250890
|
+
|
|
250891
|
+
moduleType: 'trace',
|
|
250892
|
+
name: 'histogram2dcontour',
|
|
250893
|
+
basePlotModule: __webpack_require__(47885),
|
|
250894
|
+
categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
|
|
250895
|
+
meta: {
|
|
250896
|
+
hrName: 'histogram_2d_contour',
|
|
250897
|
+
description: [
|
|
250898
|
+
'The sample data from which statistics are computed is set in `x`',
|
|
250899
|
+
'and `y` (where `x` and `y` represent marginal distributions,',
|
|
250900
|
+
'binning is set in `xbins` and `ybins` in this case)',
|
|
250901
|
+
'or `z` (where `z` represent the 2D distribution and binning set,',
|
|
250902
|
+
'binning is set by `x` and `y` in this case).',
|
|
250903
|
+
'The resulting distribution is visualized as a contour plot.'
|
|
250904
|
+
].join(' ')
|
|
250905
|
+
}
|
|
250906
|
+
};
|
|
250907
|
+
|
|
250908
|
+
|
|
250912
250909
|
/***/ }),
|
|
250913
250910
|
|
|
250914
250911
|
/***/ 48223:
|
|
@@ -267098,993 +267095,6 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
|
|
|
267098
267095
|
};
|
|
267099
267096
|
|
|
267100
267097
|
|
|
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
|
-
|
|
268088
267098
|
/***/ }),
|
|
268089
267099
|
|
|
268090
267100
|
/***/ 47213:
|
|
@@ -272015,6 +271025,993 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
|
|
|
272015
271025
|
};
|
|
272016
271026
|
|
|
272017
271027
|
|
|
271028
|
+
/***/ }),
|
|
271029
|
+
|
|
271030
|
+
/***/ 1015:
|
|
271031
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271032
|
+
|
|
271033
|
+
|
|
271034
|
+
|
|
271035
|
+
var scatterAttrs = __webpack_require__(86854);
|
|
271036
|
+
var fontAttrs = __webpack_require__(70827);
|
|
271037
|
+
var colorAttributes = __webpack_require__(17957);
|
|
271038
|
+
var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
|
|
271039
|
+
var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
|
|
271040
|
+
var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
|
|
271041
|
+
var baseAttrs = __webpack_require__(35667);
|
|
271042
|
+
var DASHES = __webpack_require__(68828);
|
|
271043
|
+
|
|
271044
|
+
var MARKER_SYMBOLS = __webpack_require__(98993);
|
|
271045
|
+
var extendFlat = (__webpack_require__(91307).extendFlat);
|
|
271046
|
+
var overrideAll = (__webpack_require__(70756).overrideAll);
|
|
271047
|
+
var sortObjectKeys = __webpack_require__(99124);
|
|
271048
|
+
|
|
271049
|
+
var scatterLineAttrs = scatterAttrs.line;
|
|
271050
|
+
var scatterMarkerAttrs = scatterAttrs.marker;
|
|
271051
|
+
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
|
|
271052
|
+
|
|
271053
|
+
var lineAttrs = extendFlat({
|
|
271054
|
+
width: scatterLineAttrs.width,
|
|
271055
|
+
dash: {
|
|
271056
|
+
valType: 'enumerated',
|
|
271057
|
+
values: sortObjectKeys(DASHES),
|
|
271058
|
+
dflt: 'solid',
|
|
271059
|
+
description: 'Sets the dash style of the lines.'
|
|
271060
|
+
}
|
|
271061
|
+
}, colorAttributes('line'));
|
|
271062
|
+
|
|
271063
|
+
function makeProjectionAttr(axLetter) {
|
|
271064
|
+
return {
|
|
271065
|
+
show: {
|
|
271066
|
+
valType: 'boolean',
|
|
271067
|
+
dflt: false,
|
|
271068
|
+
description: [
|
|
271069
|
+
'Sets whether or not projections are shown along the',
|
|
271070
|
+
axLetter, 'axis.'
|
|
271071
|
+
].join(' ')
|
|
271072
|
+
},
|
|
271073
|
+
opacity: {
|
|
271074
|
+
valType: 'number',
|
|
271075
|
+
min: 0,
|
|
271076
|
+
max: 1,
|
|
271077
|
+
dflt: 1,
|
|
271078
|
+
description: 'Sets the projection color.'
|
|
271079
|
+
},
|
|
271080
|
+
scale: {
|
|
271081
|
+
valType: 'number',
|
|
271082
|
+
min: 0,
|
|
271083
|
+
max: 10,
|
|
271084
|
+
dflt: 2 / 3,
|
|
271085
|
+
description: [
|
|
271086
|
+
'Sets the scale factor determining the size of the',
|
|
271087
|
+
'projection marker points.'
|
|
271088
|
+
].join(' ')
|
|
271089
|
+
}
|
|
271090
|
+
};
|
|
271091
|
+
}
|
|
271092
|
+
|
|
271093
|
+
var attrs = module.exports = overrideAll({
|
|
271094
|
+
x: scatterAttrs.x,
|
|
271095
|
+
y: scatterAttrs.y,
|
|
271096
|
+
z: {
|
|
271097
|
+
valType: 'data_array',
|
|
271098
|
+
description: 'Sets the z coordinates.'
|
|
271099
|
+
},
|
|
271100
|
+
|
|
271101
|
+
text: extendFlat({}, scatterAttrs.text, {
|
|
271102
|
+
description: [
|
|
271103
|
+
'Sets text elements associated with each (x,y,z) triplet.',
|
|
271104
|
+
'If a single string, the same string appears over',
|
|
271105
|
+
'all the data points.',
|
|
271106
|
+
'If an array of string, the items are mapped in order to the',
|
|
271107
|
+
'this trace\'s (x,y,z) coordinates.',
|
|
271108
|
+
'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
|
|
271109
|
+
'these elements will be seen in the hover labels.'
|
|
271110
|
+
].join(' ')
|
|
271111
|
+
}),
|
|
271112
|
+
texttemplate: texttemplateAttrs({}, {
|
|
271113
|
+
|
|
271114
|
+
}),
|
|
271115
|
+
hovertext: extendFlat({}, scatterAttrs.hovertext, {
|
|
271116
|
+
description: [
|
|
271117
|
+
'Sets text elements associated with each (x,y,z) triplet.',
|
|
271118
|
+
'If a single string, the same string appears over',
|
|
271119
|
+
'all the data points.',
|
|
271120
|
+
'If an array of string, the items are mapped in order to the',
|
|
271121
|
+
'this trace\'s (x,y,z) coordinates.',
|
|
271122
|
+
'To be seen, trace `hoverinfo` must contain a *text* flag.'
|
|
271123
|
+
].join(' ')
|
|
271124
|
+
}),
|
|
271125
|
+
hovertemplate: hovertemplateAttrs(),
|
|
271126
|
+
|
|
271127
|
+
xhoverformat: axisHoverFormat('x'),
|
|
271128
|
+
yhoverformat: axisHoverFormat('y'),
|
|
271129
|
+
zhoverformat: axisHoverFormat('z'),
|
|
271130
|
+
|
|
271131
|
+
mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
|
|
271132
|
+
{dflt: 'lines+markers'}),
|
|
271133
|
+
surfaceaxis: {
|
|
271134
|
+
valType: 'enumerated',
|
|
271135
|
+
values: [-1, 0, 1, 2],
|
|
271136
|
+
dflt: -1,
|
|
271137
|
+
description: [
|
|
271138
|
+
'If *-1*, the scatter points are not fill with a surface',
|
|
271139
|
+
'If *0*, *1*, *2*, the scatter points are filled with',
|
|
271140
|
+
'a Delaunay surface about the x, y, z respectively.'
|
|
271141
|
+
].join(' ')
|
|
271142
|
+
},
|
|
271143
|
+
surfacecolor: {
|
|
271144
|
+
valType: 'color',
|
|
271145
|
+
description: 'Sets the surface fill color.'
|
|
271146
|
+
},
|
|
271147
|
+
projection: {
|
|
271148
|
+
x: makeProjectionAttr('x'),
|
|
271149
|
+
y: makeProjectionAttr('y'),
|
|
271150
|
+
z: makeProjectionAttr('z')
|
|
271151
|
+
},
|
|
271152
|
+
|
|
271153
|
+
connectgaps: scatterAttrs.connectgaps,
|
|
271154
|
+
line: lineAttrs,
|
|
271155
|
+
|
|
271156
|
+
marker: extendFlat({ // Parity with scatter.js?
|
|
271157
|
+
symbol: {
|
|
271158
|
+
valType: 'enumerated',
|
|
271159
|
+
values: sortObjectKeys(MARKER_SYMBOLS),
|
|
271160
|
+
dflt: 'circle',
|
|
271161
|
+
arrayOk: true,
|
|
271162
|
+
description: 'Sets the marker symbol type.'
|
|
271163
|
+
},
|
|
271164
|
+
size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
|
|
271165
|
+
sizeref: scatterMarkerAttrs.sizeref,
|
|
271166
|
+
sizemin: scatterMarkerAttrs.sizemin,
|
|
271167
|
+
sizemode: scatterMarkerAttrs.sizemode,
|
|
271168
|
+
opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
|
|
271169
|
+
arrayOk: false,
|
|
271170
|
+
description: [
|
|
271171
|
+
'Sets the marker opacity.',
|
|
271172
|
+
'Note that the marker opacity for scatter3d traces',
|
|
271173
|
+
'must be a scalar value for performance reasons.',
|
|
271174
|
+
'To set a blending opacity value',
|
|
271175
|
+
'(i.e. which is not transparent), set *marker.color*',
|
|
271176
|
+
'to an rgba color and use its alpha channel.'
|
|
271177
|
+
].join(' ')
|
|
271178
|
+
}),
|
|
271179
|
+
colorbar: scatterMarkerAttrs.colorbar,
|
|
271180
|
+
|
|
271181
|
+
line: extendFlat({
|
|
271182
|
+
width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
|
|
271183
|
+
},
|
|
271184
|
+
colorAttributes('marker.line')
|
|
271185
|
+
)
|
|
271186
|
+
},
|
|
271187
|
+
colorAttributes('marker')
|
|
271188
|
+
),
|
|
271189
|
+
|
|
271190
|
+
textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
|
|
271191
|
+
textfont: fontAttrs({
|
|
271192
|
+
noFontShadow: true,
|
|
271193
|
+
noFontLineposition: true,
|
|
271194
|
+
noFontTextcase: true,
|
|
271195
|
+
editType: 'calc',
|
|
271196
|
+
colorEditType: 'style',
|
|
271197
|
+
arrayOk: true,
|
|
271198
|
+
variantValues: ['normal', 'small-caps'],
|
|
271199
|
+
description: 'Sets the text font.'
|
|
271200
|
+
}),
|
|
271201
|
+
|
|
271202
|
+
opacity: baseAttrs.opacity,
|
|
271203
|
+
|
|
271204
|
+
hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
|
|
271205
|
+
}, 'calc', 'nested');
|
|
271206
|
+
|
|
271207
|
+
attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
|
|
271208
|
+
|
|
271209
|
+
|
|
271210
|
+
/***/ }),
|
|
271211
|
+
|
|
271212
|
+
/***/ 30935:
|
|
271213
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271214
|
+
|
|
271215
|
+
|
|
271216
|
+
|
|
271217
|
+
var arraysToCalcdata = __webpack_require__(47213);
|
|
271218
|
+
var calcColorscale = __webpack_require__(59498);
|
|
271219
|
+
|
|
271220
|
+
/**
|
|
271221
|
+
* This is a kludge to put the array attributes into
|
|
271222
|
+
* calcdata the way Scatter.plot does, so that legends and
|
|
271223
|
+
* popovers know what to do with them.
|
|
271224
|
+
*/
|
|
271225
|
+
module.exports = function calc(gd, trace) {
|
|
271226
|
+
var cd = [{x: false, y: false, trace: trace, t: {}}];
|
|
271227
|
+
|
|
271228
|
+
arraysToCalcdata(cd, trace);
|
|
271229
|
+
calcColorscale(gd, trace);
|
|
271230
|
+
|
|
271231
|
+
return cd;
|
|
271232
|
+
};
|
|
271233
|
+
|
|
271234
|
+
|
|
271235
|
+
/***/ }),
|
|
271236
|
+
|
|
271237
|
+
/***/ 77681:
|
|
271238
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271239
|
+
|
|
271240
|
+
|
|
271241
|
+
|
|
271242
|
+
var Registry = __webpack_require__(13936);
|
|
271243
|
+
|
|
271244
|
+
function calculateAxisErrors(data, params, scaleFactor, axis) {
|
|
271245
|
+
if(!params || !params.visible) return null;
|
|
271246
|
+
|
|
271247
|
+
var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
|
|
271248
|
+
var result = new Array(data.length);
|
|
271249
|
+
|
|
271250
|
+
for(var i = 0; i < data.length; i++) {
|
|
271251
|
+
var errors = computeError(+data[i], i);
|
|
271252
|
+
|
|
271253
|
+
if(axis.type === 'log') {
|
|
271254
|
+
var point = axis.c2l(data[i]);
|
|
271255
|
+
var min = data[i] - errors[0];
|
|
271256
|
+
var max = data[i] + errors[1];
|
|
271257
|
+
|
|
271258
|
+
result[i] = [
|
|
271259
|
+
(axis.c2l(min, true) - point) * scaleFactor,
|
|
271260
|
+
(axis.c2l(max, true) - point) * scaleFactor
|
|
271261
|
+
];
|
|
271262
|
+
|
|
271263
|
+
// Keep track of the lower error bound which isn't negative!
|
|
271264
|
+
if(min > 0) {
|
|
271265
|
+
var lower = axis.c2l(min);
|
|
271266
|
+
if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
|
|
271267
|
+
axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
|
|
271268
|
+
}
|
|
271269
|
+
} else {
|
|
271270
|
+
result[i] = [
|
|
271271
|
+
-errors[0] * scaleFactor,
|
|
271272
|
+
errors[1] * scaleFactor
|
|
271273
|
+
];
|
|
271274
|
+
}
|
|
271275
|
+
}
|
|
271276
|
+
|
|
271277
|
+
return result;
|
|
271278
|
+
}
|
|
271279
|
+
|
|
271280
|
+
function dataLength(array) {
|
|
271281
|
+
for(var i = 0; i < array.length; i++) {
|
|
271282
|
+
if(array[i]) return array[i].length;
|
|
271283
|
+
}
|
|
271284
|
+
return 0;
|
|
271285
|
+
}
|
|
271286
|
+
|
|
271287
|
+
function calculateErrors(data, scaleFactor, sceneLayout) {
|
|
271288
|
+
var errors = [
|
|
271289
|
+
calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
|
|
271290
|
+
calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
|
|
271291
|
+
calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
|
|
271292
|
+
];
|
|
271293
|
+
|
|
271294
|
+
var n = dataLength(errors);
|
|
271295
|
+
if(n === 0) return null;
|
|
271296
|
+
|
|
271297
|
+
var errorBounds = new Array(n);
|
|
271298
|
+
|
|
271299
|
+
for(var i = 0; i < n; i++) {
|
|
271300
|
+
var bound = [[0, 0, 0], [0, 0, 0]];
|
|
271301
|
+
|
|
271302
|
+
for(var j = 0; j < 3; j++) {
|
|
271303
|
+
if(errors[j]) {
|
|
271304
|
+
for(var k = 0; k < 2; k++) {
|
|
271305
|
+
bound[k][j] = errors[j][i][k];
|
|
271306
|
+
}
|
|
271307
|
+
}
|
|
271308
|
+
}
|
|
271309
|
+
|
|
271310
|
+
errorBounds[i] = bound;
|
|
271311
|
+
}
|
|
271312
|
+
|
|
271313
|
+
return errorBounds;
|
|
271314
|
+
}
|
|
271315
|
+
|
|
271316
|
+
module.exports = calculateErrors;
|
|
271317
|
+
|
|
271318
|
+
|
|
271319
|
+
/***/ }),
|
|
271320
|
+
|
|
271321
|
+
/***/ 93219:
|
|
271322
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271323
|
+
|
|
271324
|
+
|
|
271325
|
+
|
|
271326
|
+
var createLinePlot = (__webpack_require__(46000).gl_line3d);
|
|
271327
|
+
var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
|
|
271328
|
+
var createErrorBars = (__webpack_require__(46000).gl_error3d);
|
|
271329
|
+
var createMesh = (__webpack_require__(46000).gl_mesh3d);
|
|
271330
|
+
var triangulate = (__webpack_require__(46000).delaunay_triangulate);
|
|
271331
|
+
|
|
271332
|
+
var Lib = __webpack_require__(30991);
|
|
271333
|
+
var str2RgbaArray = __webpack_require__(44960);
|
|
271334
|
+
var formatColor = (__webpack_require__(592).formatColor);
|
|
271335
|
+
var makeBubbleSizeFn = __webpack_require__(42581);
|
|
271336
|
+
var DASH_PATTERNS = __webpack_require__(68828);
|
|
271337
|
+
var MARKER_SYMBOLS = __webpack_require__(98993);
|
|
271338
|
+
|
|
271339
|
+
var Axes = __webpack_require__(15076);
|
|
271340
|
+
var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
|
|
271341
|
+
|
|
271342
|
+
var calculateError = __webpack_require__(77681);
|
|
271343
|
+
|
|
271344
|
+
function LineWithMarkers(scene, uid) {
|
|
271345
|
+
this.scene = scene;
|
|
271346
|
+
this.uid = uid;
|
|
271347
|
+
this.linePlot = null;
|
|
271348
|
+
this.scatterPlot = null;
|
|
271349
|
+
this.errorBars = null;
|
|
271350
|
+
this.textMarkers = null;
|
|
271351
|
+
this.delaunayMesh = null;
|
|
271352
|
+
this.color = null;
|
|
271353
|
+
this.mode = '';
|
|
271354
|
+
this.dataPoints = [];
|
|
271355
|
+
this.axesBounds = [
|
|
271356
|
+
[-Infinity, -Infinity, -Infinity],
|
|
271357
|
+
[Infinity, Infinity, Infinity]
|
|
271358
|
+
];
|
|
271359
|
+
this.textLabels = null;
|
|
271360
|
+
this.data = null;
|
|
271361
|
+
}
|
|
271362
|
+
|
|
271363
|
+
var proto = LineWithMarkers.prototype;
|
|
271364
|
+
|
|
271365
|
+
proto.handlePick = function(selection) {
|
|
271366
|
+
if(selection.object &&
|
|
271367
|
+
(selection.object === this.linePlot ||
|
|
271368
|
+
selection.object === this.delaunayMesh ||
|
|
271369
|
+
selection.object === this.textMarkers ||
|
|
271370
|
+
selection.object === this.scatterPlot)
|
|
271371
|
+
) {
|
|
271372
|
+
var ind = selection.index = selection.data.index;
|
|
271373
|
+
|
|
271374
|
+
if(selection.object.highlight) {
|
|
271375
|
+
selection.object.highlight(null);
|
|
271376
|
+
}
|
|
271377
|
+
if(this.scatterPlot) {
|
|
271378
|
+
selection.object = this.scatterPlot;
|
|
271379
|
+
this.scatterPlot.highlight(selection.data);
|
|
271380
|
+
}
|
|
271381
|
+
|
|
271382
|
+
selection.textLabel = '';
|
|
271383
|
+
if(this.textLabels) {
|
|
271384
|
+
if(Lib.isArrayOrTypedArray(this.textLabels)) {
|
|
271385
|
+
if(this.textLabels[ind] || this.textLabels[ind] === 0) {
|
|
271386
|
+
selection.textLabel = this.textLabels[ind];
|
|
271387
|
+
}
|
|
271388
|
+
} else {
|
|
271389
|
+
selection.textLabel = this.textLabels;
|
|
271390
|
+
}
|
|
271391
|
+
}
|
|
271392
|
+
|
|
271393
|
+
selection.traceCoordinate = [
|
|
271394
|
+
this.data.x[ind],
|
|
271395
|
+
this.data.y[ind],
|
|
271396
|
+
this.data.z[ind]
|
|
271397
|
+
];
|
|
271398
|
+
|
|
271399
|
+
return true;
|
|
271400
|
+
}
|
|
271401
|
+
};
|
|
271402
|
+
|
|
271403
|
+
function constructDelaunay(points, color, axis) {
|
|
271404
|
+
var u = (axis + 1) % 3;
|
|
271405
|
+
var v = (axis + 2) % 3;
|
|
271406
|
+
var filteredPoints = [];
|
|
271407
|
+
var filteredIds = [];
|
|
271408
|
+
var i;
|
|
271409
|
+
|
|
271410
|
+
for(i = 0; i < points.length; ++i) {
|
|
271411
|
+
var p = points[i];
|
|
271412
|
+
if(isNaN(p[u]) || !isFinite(p[u]) ||
|
|
271413
|
+
isNaN(p[v]) || !isFinite(p[v])) {
|
|
271414
|
+
continue;
|
|
271415
|
+
}
|
|
271416
|
+
filteredPoints.push([p[u], p[v]]);
|
|
271417
|
+
filteredIds.push(i);
|
|
271418
|
+
}
|
|
271419
|
+
var cells = triangulate(filteredPoints);
|
|
271420
|
+
for(i = 0; i < cells.length; ++i) {
|
|
271421
|
+
var c = cells[i];
|
|
271422
|
+
for(var j = 0; j < c.length; ++j) {
|
|
271423
|
+
c[j] = filteredIds[c[j]];
|
|
271424
|
+
}
|
|
271425
|
+
}
|
|
271426
|
+
return {
|
|
271427
|
+
positions: points,
|
|
271428
|
+
cells: cells,
|
|
271429
|
+
meshColor: color
|
|
271430
|
+
};
|
|
271431
|
+
}
|
|
271432
|
+
|
|
271433
|
+
function calculateErrorParams(errors) {
|
|
271434
|
+
var capSize = [0.0, 0.0, 0.0];
|
|
271435
|
+
var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
|
|
271436
|
+
var lineWidth = [1.0, 1.0, 1.0];
|
|
271437
|
+
|
|
271438
|
+
for(var i = 0; i < 3; i++) {
|
|
271439
|
+
var e = errors[i];
|
|
271440
|
+
|
|
271441
|
+
if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
|
|
271442
|
+
if(!e || !e.visible) continue;
|
|
271443
|
+
|
|
271444
|
+
capSize[i] = e.width / 2; // ballpark rescaling
|
|
271445
|
+
color[i] = str2RgbaArray(e.color);
|
|
271446
|
+
lineWidth[i] = e.thickness;
|
|
271447
|
+
}
|
|
271448
|
+
|
|
271449
|
+
return {capSize: capSize, color: color, lineWidth: lineWidth};
|
|
271450
|
+
}
|
|
271451
|
+
|
|
271452
|
+
function parseAlignmentX(a) {
|
|
271453
|
+
if(a === null || a === undefined) return 0;
|
|
271454
|
+
|
|
271455
|
+
return (a.indexOf('left') > -1) ? -1 :
|
|
271456
|
+
(a.indexOf('right') > -1) ? 1 : 0;
|
|
271457
|
+
}
|
|
271458
|
+
|
|
271459
|
+
function parseAlignmentY(a) {
|
|
271460
|
+
if(a === null || a === undefined) return 0;
|
|
271461
|
+
|
|
271462
|
+
return (a.indexOf('top') > -1) ? -1 :
|
|
271463
|
+
(a.indexOf('bottom') > -1) ? 1 : 0;
|
|
271464
|
+
}
|
|
271465
|
+
|
|
271466
|
+
function calculateTextOffset(tp) {
|
|
271467
|
+
// Read out text properties
|
|
271468
|
+
|
|
271469
|
+
var defaultAlignmentX = 0;
|
|
271470
|
+
var defaultAlignmentY = 0;
|
|
271471
|
+
|
|
271472
|
+
var textOffset = [
|
|
271473
|
+
defaultAlignmentX,
|
|
271474
|
+
defaultAlignmentY
|
|
271475
|
+
];
|
|
271476
|
+
|
|
271477
|
+
if(Array.isArray(tp)) {
|
|
271478
|
+
for(var i = 0; i < tp.length; i++) {
|
|
271479
|
+
textOffset[i] = [
|
|
271480
|
+
defaultAlignmentX,
|
|
271481
|
+
defaultAlignmentY
|
|
271482
|
+
];
|
|
271483
|
+
if(tp[i]) {
|
|
271484
|
+
textOffset[i][0] = parseAlignmentX(tp[i]);
|
|
271485
|
+
textOffset[i][1] = parseAlignmentY(tp[i]);
|
|
271486
|
+
}
|
|
271487
|
+
}
|
|
271488
|
+
} else {
|
|
271489
|
+
textOffset[0] = parseAlignmentX(tp);
|
|
271490
|
+
textOffset[1] = parseAlignmentY(tp);
|
|
271491
|
+
}
|
|
271492
|
+
|
|
271493
|
+
return textOffset;
|
|
271494
|
+
}
|
|
271495
|
+
|
|
271496
|
+
|
|
271497
|
+
function calculateSize(sizeIn, sizeFn) {
|
|
271498
|
+
// rough parity with Plotly 2D markers
|
|
271499
|
+
return sizeFn(sizeIn * 4);
|
|
271500
|
+
}
|
|
271501
|
+
|
|
271502
|
+
function calculateSymbol(symbolIn) {
|
|
271503
|
+
return MARKER_SYMBOLS[symbolIn];
|
|
271504
|
+
}
|
|
271505
|
+
|
|
271506
|
+
function formatParam(paramIn, len, calculate, dflt, extraFn) {
|
|
271507
|
+
var paramOut = null;
|
|
271508
|
+
|
|
271509
|
+
if(Lib.isArrayOrTypedArray(paramIn)) {
|
|
271510
|
+
paramOut = [];
|
|
271511
|
+
|
|
271512
|
+
for(var i = 0; i < len; i++) {
|
|
271513
|
+
if(paramIn[i] === undefined) paramOut[i] = dflt;
|
|
271514
|
+
else paramOut[i] = calculate(paramIn[i], extraFn);
|
|
271515
|
+
}
|
|
271516
|
+
} else paramOut = calculate(paramIn, Lib.identity);
|
|
271517
|
+
|
|
271518
|
+
return paramOut;
|
|
271519
|
+
}
|
|
271520
|
+
|
|
271521
|
+
|
|
271522
|
+
function convertPlotlyOptions(scene, data) {
|
|
271523
|
+
var points = [];
|
|
271524
|
+
var sceneLayout = scene.fullSceneLayout;
|
|
271525
|
+
var scaleFactor = scene.dataScale;
|
|
271526
|
+
var xaxis = sceneLayout.xaxis;
|
|
271527
|
+
var yaxis = sceneLayout.yaxis;
|
|
271528
|
+
var zaxis = sceneLayout.zaxis;
|
|
271529
|
+
var marker = data.marker;
|
|
271530
|
+
var line = data.line;
|
|
271531
|
+
var x = data.x || [];
|
|
271532
|
+
var y = data.y || [];
|
|
271533
|
+
var z = data.z || [];
|
|
271534
|
+
var len = x.length;
|
|
271535
|
+
var xcalendar = data.xcalendar;
|
|
271536
|
+
var ycalendar = data.ycalendar;
|
|
271537
|
+
var zcalendar = data.zcalendar;
|
|
271538
|
+
var xc, yc, zc;
|
|
271539
|
+
var params, i;
|
|
271540
|
+
var text;
|
|
271541
|
+
|
|
271542
|
+
// Convert points
|
|
271543
|
+
for(i = 0; i < len; i++) {
|
|
271544
|
+
// sanitize numbers and apply transforms based on axes.type
|
|
271545
|
+
xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
|
|
271546
|
+
yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
|
|
271547
|
+
zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
|
|
271548
|
+
|
|
271549
|
+
points[i] = [xc, yc, zc];
|
|
271550
|
+
}
|
|
271551
|
+
|
|
271552
|
+
// convert text
|
|
271553
|
+
if(Array.isArray(data.text)) {
|
|
271554
|
+
text = data.text;
|
|
271555
|
+
} else if(Lib.isTypedArray(data.text)) {
|
|
271556
|
+
text = Array.from(data.text);
|
|
271557
|
+
} else if(data.text !== undefined) {
|
|
271558
|
+
text = new Array(len);
|
|
271559
|
+
for(i = 0; i < len; i++) text[i] = data.text;
|
|
271560
|
+
}
|
|
271561
|
+
|
|
271562
|
+
function formatter(axName, val) {
|
|
271563
|
+
var ax = sceneLayout[axName];
|
|
271564
|
+
return Axes.tickText(ax, ax.d2l(val), true).text;
|
|
271565
|
+
}
|
|
271566
|
+
|
|
271567
|
+
// check texttemplate
|
|
271568
|
+
var texttemplate = data.texttemplate;
|
|
271569
|
+
if(texttemplate) {
|
|
271570
|
+
var fullLayout = scene.fullLayout;
|
|
271571
|
+
var d3locale = fullLayout._d3locale;
|
|
271572
|
+
var isArray = Array.isArray(texttemplate);
|
|
271573
|
+
var N = isArray ? Math.min(texttemplate.length, len) : len;
|
|
271574
|
+
var txt = isArray ?
|
|
271575
|
+
function(i) { return texttemplate[i]; } :
|
|
271576
|
+
function() { return texttemplate; };
|
|
271577
|
+
|
|
271578
|
+
text = new Array(N);
|
|
271579
|
+
|
|
271580
|
+
for(i = 0; i < N; i++) {
|
|
271581
|
+
var d = {x: x[i], y: y[i], z: z[i]};
|
|
271582
|
+
var labels = {
|
|
271583
|
+
xLabel: formatter('xaxis', x[i]),
|
|
271584
|
+
yLabel: formatter('yaxis', y[i]),
|
|
271585
|
+
zLabel: formatter('zaxis', z[i])
|
|
271586
|
+
};
|
|
271587
|
+
var pointValues = {};
|
|
271588
|
+
appendArrayPointValue(pointValues, data, i);
|
|
271589
|
+
var meta = data._meta || {};
|
|
271590
|
+
text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
|
|
271591
|
+
}
|
|
271592
|
+
}
|
|
271593
|
+
|
|
271594
|
+
// Build object parameters
|
|
271595
|
+
params = {
|
|
271596
|
+
position: points,
|
|
271597
|
+
mode: data.mode,
|
|
271598
|
+
text: text
|
|
271599
|
+
};
|
|
271600
|
+
|
|
271601
|
+
if('line' in data) {
|
|
271602
|
+
params.lineColor = formatColor(line, 1, len);
|
|
271603
|
+
params.lineWidth = line.width;
|
|
271604
|
+
params.lineDashes = line.dash;
|
|
271605
|
+
}
|
|
271606
|
+
|
|
271607
|
+
if('marker' in data) {
|
|
271608
|
+
var sizeFn = makeBubbleSizeFn(data);
|
|
271609
|
+
|
|
271610
|
+
params.scatterColor = formatColor(marker, 1, len);
|
|
271611
|
+
params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
|
|
271612
|
+
params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
|
|
271613
|
+
params.scatterLineWidth = marker.line.width; // arrayOk === false
|
|
271614
|
+
params.scatterLineColor = formatColor(marker.line, 1, len);
|
|
271615
|
+
params.scatterAngle = 0;
|
|
271616
|
+
}
|
|
271617
|
+
|
|
271618
|
+
if('textposition' in data) {
|
|
271619
|
+
params.textOffset = calculateTextOffset(data.textposition);
|
|
271620
|
+
params.textColor = formatColor(data.textfont, 1, len);
|
|
271621
|
+
params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
|
|
271622
|
+
params.textFontFamily = data.textfont.family;
|
|
271623
|
+
params.textFontWeight = data.textfont.weight;
|
|
271624
|
+
params.textFontStyle = data.textfont.style;
|
|
271625
|
+
params.textFontVariant = data.textfont.variant;
|
|
271626
|
+
params.textAngle = 0;
|
|
271627
|
+
}
|
|
271628
|
+
|
|
271629
|
+
var dims = ['x', 'y', 'z'];
|
|
271630
|
+
params.project = [false, false, false];
|
|
271631
|
+
params.projectScale = [1, 1, 1];
|
|
271632
|
+
params.projectOpacity = [1, 1, 1];
|
|
271633
|
+
for(i = 0; i < 3; ++i) {
|
|
271634
|
+
var projection = data.projection[dims[i]];
|
|
271635
|
+
if((params.project[i] = projection.show)) {
|
|
271636
|
+
params.projectOpacity[i] = projection.opacity;
|
|
271637
|
+
params.projectScale[i] = projection.scale;
|
|
271638
|
+
}
|
|
271639
|
+
}
|
|
271640
|
+
|
|
271641
|
+
params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
|
|
271642
|
+
|
|
271643
|
+
var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
|
|
271644
|
+
params.errorColor = errorParams.color;
|
|
271645
|
+
params.errorLineWidth = errorParams.lineWidth;
|
|
271646
|
+
params.errorCapSize = errorParams.capSize;
|
|
271647
|
+
|
|
271648
|
+
params.delaunayAxis = data.surfaceaxis;
|
|
271649
|
+
params.delaunayColor = str2RgbaArray(data.surfacecolor);
|
|
271650
|
+
|
|
271651
|
+
return params;
|
|
271652
|
+
}
|
|
271653
|
+
|
|
271654
|
+
function _arrayToColor(color) {
|
|
271655
|
+
if(Lib.isArrayOrTypedArray(color)) {
|
|
271656
|
+
var c = color[0];
|
|
271657
|
+
|
|
271658
|
+
if(Lib.isArrayOrTypedArray(c)) color = c;
|
|
271659
|
+
|
|
271660
|
+
return 'rgb(' + color.slice(0, 3).map(function(x) {
|
|
271661
|
+
return Math.round(x * 255);
|
|
271662
|
+
}) + ')';
|
|
271663
|
+
}
|
|
271664
|
+
|
|
271665
|
+
return null;
|
|
271666
|
+
}
|
|
271667
|
+
|
|
271668
|
+
function arrayToColor(colors) {
|
|
271669
|
+
if(!Lib.isArrayOrTypedArray(colors)) {
|
|
271670
|
+
return null;
|
|
271671
|
+
}
|
|
271672
|
+
|
|
271673
|
+
if((colors.length === 4) && (typeof colors[0] === 'number')) {
|
|
271674
|
+
return _arrayToColor(colors);
|
|
271675
|
+
}
|
|
271676
|
+
|
|
271677
|
+
return colors.map(_arrayToColor);
|
|
271678
|
+
}
|
|
271679
|
+
|
|
271680
|
+
proto.update = function(data) {
|
|
271681
|
+
var gl = this.scene.glplot.gl;
|
|
271682
|
+
var lineOptions;
|
|
271683
|
+
var scatterOptions;
|
|
271684
|
+
var errorOptions;
|
|
271685
|
+
var textOptions;
|
|
271686
|
+
var dashPattern = DASH_PATTERNS.solid;
|
|
271687
|
+
|
|
271688
|
+
// Save data
|
|
271689
|
+
this.data = data;
|
|
271690
|
+
|
|
271691
|
+
// Run data conversion
|
|
271692
|
+
var options = convertPlotlyOptions(this.scene, data);
|
|
271693
|
+
|
|
271694
|
+
if('mode' in options) {
|
|
271695
|
+
this.mode = options.mode;
|
|
271696
|
+
}
|
|
271697
|
+
if('lineDashes' in options) {
|
|
271698
|
+
if(options.lineDashes in DASH_PATTERNS) {
|
|
271699
|
+
dashPattern = DASH_PATTERNS[options.lineDashes];
|
|
271700
|
+
}
|
|
271701
|
+
}
|
|
271702
|
+
|
|
271703
|
+
this.color = arrayToColor(options.scatterColor) ||
|
|
271704
|
+
arrayToColor(options.lineColor);
|
|
271705
|
+
|
|
271706
|
+
// Save data points
|
|
271707
|
+
this.dataPoints = options.position;
|
|
271708
|
+
|
|
271709
|
+
lineOptions = {
|
|
271710
|
+
gl: this.scene.glplot.gl,
|
|
271711
|
+
position: options.position,
|
|
271712
|
+
color: options.lineColor,
|
|
271713
|
+
lineWidth: options.lineWidth || 1,
|
|
271714
|
+
dashes: dashPattern[0],
|
|
271715
|
+
dashScale: dashPattern[1],
|
|
271716
|
+
opacity: data.opacity,
|
|
271717
|
+
connectGaps: data.connectgaps
|
|
271718
|
+
};
|
|
271719
|
+
|
|
271720
|
+
if(this.mode.indexOf('lines') !== -1) {
|
|
271721
|
+
if(this.linePlot) this.linePlot.update(lineOptions);
|
|
271722
|
+
else {
|
|
271723
|
+
this.linePlot = createLinePlot(lineOptions);
|
|
271724
|
+
this.linePlot._trace = this;
|
|
271725
|
+
this.scene.glplot.add(this.linePlot);
|
|
271726
|
+
}
|
|
271727
|
+
} else if(this.linePlot) {
|
|
271728
|
+
this.scene.glplot.remove(this.linePlot);
|
|
271729
|
+
this.linePlot.dispose();
|
|
271730
|
+
this.linePlot = null;
|
|
271731
|
+
}
|
|
271732
|
+
|
|
271733
|
+
// N.B. marker.opacity must be a scalar for performance
|
|
271734
|
+
var scatterOpacity = data.opacity;
|
|
271735
|
+
if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
|
|
271736
|
+
|
|
271737
|
+
scatterOptions = {
|
|
271738
|
+
gl: this.scene.glplot.gl,
|
|
271739
|
+
position: options.position,
|
|
271740
|
+
color: options.scatterColor,
|
|
271741
|
+
size: options.scatterSize,
|
|
271742
|
+
glyph: options.scatterMarker,
|
|
271743
|
+
opacity: scatterOpacity,
|
|
271744
|
+
orthographic: true,
|
|
271745
|
+
lineWidth: options.scatterLineWidth,
|
|
271746
|
+
lineColor: options.scatterLineColor,
|
|
271747
|
+
project: options.project,
|
|
271748
|
+
projectScale: options.projectScale,
|
|
271749
|
+
projectOpacity: options.projectOpacity
|
|
271750
|
+
};
|
|
271751
|
+
|
|
271752
|
+
if(this.mode.indexOf('markers') !== -1) {
|
|
271753
|
+
if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
|
|
271754
|
+
else {
|
|
271755
|
+
this.scatterPlot = createScatterPlot(scatterOptions);
|
|
271756
|
+
this.scatterPlot._trace = this;
|
|
271757
|
+
this.scatterPlot.highlightScale = 1;
|
|
271758
|
+
this.scene.glplot.add(this.scatterPlot);
|
|
271759
|
+
}
|
|
271760
|
+
} else if(this.scatterPlot) {
|
|
271761
|
+
this.scene.glplot.remove(this.scatterPlot);
|
|
271762
|
+
this.scatterPlot.dispose();
|
|
271763
|
+
this.scatterPlot = null;
|
|
271764
|
+
}
|
|
271765
|
+
|
|
271766
|
+
textOptions = {
|
|
271767
|
+
gl: this.scene.glplot.gl,
|
|
271768
|
+
position: options.position,
|
|
271769
|
+
glyph: options.text,
|
|
271770
|
+
color: options.textColor,
|
|
271771
|
+
size: options.textSize,
|
|
271772
|
+
angle: options.textAngle,
|
|
271773
|
+
alignment: options.textOffset,
|
|
271774
|
+
font: options.textFontFamily,
|
|
271775
|
+
fontWeight: options.textFontWeight,
|
|
271776
|
+
fontStyle: options.textFontStyle,
|
|
271777
|
+
fontVariant: options.textFontVariant,
|
|
271778
|
+
orthographic: true,
|
|
271779
|
+
lineWidth: 0,
|
|
271780
|
+
project: false,
|
|
271781
|
+
opacity: data.opacity
|
|
271782
|
+
};
|
|
271783
|
+
|
|
271784
|
+
this.textLabels = data.hovertext || data.text;
|
|
271785
|
+
|
|
271786
|
+
if(this.mode.indexOf('text') !== -1) {
|
|
271787
|
+
if(this.textMarkers) this.textMarkers.update(textOptions);
|
|
271788
|
+
else {
|
|
271789
|
+
this.textMarkers = createScatterPlot(textOptions);
|
|
271790
|
+
this.textMarkers._trace = this;
|
|
271791
|
+
this.textMarkers.highlightScale = 1;
|
|
271792
|
+
this.scene.glplot.add(this.textMarkers);
|
|
271793
|
+
}
|
|
271794
|
+
} else if(this.textMarkers) {
|
|
271795
|
+
this.scene.glplot.remove(this.textMarkers);
|
|
271796
|
+
this.textMarkers.dispose();
|
|
271797
|
+
this.textMarkers = null;
|
|
271798
|
+
}
|
|
271799
|
+
|
|
271800
|
+
errorOptions = {
|
|
271801
|
+
gl: this.scene.glplot.gl,
|
|
271802
|
+
position: options.position,
|
|
271803
|
+
color: options.errorColor,
|
|
271804
|
+
error: options.errorBounds,
|
|
271805
|
+
lineWidth: options.errorLineWidth,
|
|
271806
|
+
capSize: options.errorCapSize,
|
|
271807
|
+
opacity: data.opacity
|
|
271808
|
+
};
|
|
271809
|
+
if(this.errorBars) {
|
|
271810
|
+
if(options.errorBounds) {
|
|
271811
|
+
this.errorBars.update(errorOptions);
|
|
271812
|
+
} else {
|
|
271813
|
+
this.scene.glplot.remove(this.errorBars);
|
|
271814
|
+
this.errorBars.dispose();
|
|
271815
|
+
this.errorBars = null;
|
|
271816
|
+
}
|
|
271817
|
+
} else if(options.errorBounds) {
|
|
271818
|
+
this.errorBars = createErrorBars(errorOptions);
|
|
271819
|
+
this.errorBars._trace = this;
|
|
271820
|
+
this.scene.glplot.add(this.errorBars);
|
|
271821
|
+
}
|
|
271822
|
+
|
|
271823
|
+
if(options.delaunayAxis >= 0) {
|
|
271824
|
+
var delaunayOptions = constructDelaunay(
|
|
271825
|
+
options.position,
|
|
271826
|
+
options.delaunayColor,
|
|
271827
|
+
options.delaunayAxis
|
|
271828
|
+
);
|
|
271829
|
+
delaunayOptions.opacity = data.opacity;
|
|
271830
|
+
|
|
271831
|
+
if(this.delaunayMesh) {
|
|
271832
|
+
this.delaunayMesh.update(delaunayOptions);
|
|
271833
|
+
} else {
|
|
271834
|
+
delaunayOptions.gl = gl;
|
|
271835
|
+
this.delaunayMesh = createMesh(delaunayOptions);
|
|
271836
|
+
this.delaunayMesh._trace = this;
|
|
271837
|
+
this.scene.glplot.add(this.delaunayMesh);
|
|
271838
|
+
}
|
|
271839
|
+
} else if(this.delaunayMesh) {
|
|
271840
|
+
this.scene.glplot.remove(this.delaunayMesh);
|
|
271841
|
+
this.delaunayMesh.dispose();
|
|
271842
|
+
this.delaunayMesh = null;
|
|
271843
|
+
}
|
|
271844
|
+
};
|
|
271845
|
+
|
|
271846
|
+
proto.dispose = function() {
|
|
271847
|
+
if(this.linePlot) {
|
|
271848
|
+
this.scene.glplot.remove(this.linePlot);
|
|
271849
|
+
this.linePlot.dispose();
|
|
271850
|
+
}
|
|
271851
|
+
if(this.scatterPlot) {
|
|
271852
|
+
this.scene.glplot.remove(this.scatterPlot);
|
|
271853
|
+
this.scatterPlot.dispose();
|
|
271854
|
+
}
|
|
271855
|
+
if(this.errorBars) {
|
|
271856
|
+
this.scene.glplot.remove(this.errorBars);
|
|
271857
|
+
this.errorBars.dispose();
|
|
271858
|
+
}
|
|
271859
|
+
if(this.textMarkers) {
|
|
271860
|
+
this.scene.glplot.remove(this.textMarkers);
|
|
271861
|
+
this.textMarkers.dispose();
|
|
271862
|
+
}
|
|
271863
|
+
if(this.delaunayMesh) {
|
|
271864
|
+
this.scene.glplot.remove(this.delaunayMesh);
|
|
271865
|
+
this.delaunayMesh.dispose();
|
|
271866
|
+
}
|
|
271867
|
+
};
|
|
271868
|
+
|
|
271869
|
+
function createLineWithMarkers(scene, data) {
|
|
271870
|
+
var plot = new LineWithMarkers(scene, data.uid);
|
|
271871
|
+
plot.update(data);
|
|
271872
|
+
return plot;
|
|
271873
|
+
}
|
|
271874
|
+
|
|
271875
|
+
module.exports = createLineWithMarkers;
|
|
271876
|
+
|
|
271877
|
+
|
|
271878
|
+
/***/ }),
|
|
271879
|
+
|
|
271880
|
+
/***/ 13744:
|
|
271881
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271882
|
+
|
|
271883
|
+
|
|
271884
|
+
|
|
271885
|
+
var Registry = __webpack_require__(13936);
|
|
271886
|
+
var Lib = __webpack_require__(30991);
|
|
271887
|
+
|
|
271888
|
+
var subTypes = __webpack_require__(33068);
|
|
271889
|
+
var handleMarkerDefaults = __webpack_require__(15294);
|
|
271890
|
+
var handleLineDefaults = __webpack_require__(82094);
|
|
271891
|
+
var handleTextDefaults = __webpack_require__(94729);
|
|
271892
|
+
|
|
271893
|
+
var attributes = __webpack_require__(1015);
|
|
271894
|
+
|
|
271895
|
+
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
|
|
271896
|
+
function coerce(attr, dflt) {
|
|
271897
|
+
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
|
|
271898
|
+
}
|
|
271899
|
+
|
|
271900
|
+
var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
|
|
271901
|
+
if(!len) {
|
|
271902
|
+
traceOut.visible = false;
|
|
271903
|
+
return;
|
|
271904
|
+
}
|
|
271905
|
+
|
|
271906
|
+
coerce('text');
|
|
271907
|
+
coerce('hovertext');
|
|
271908
|
+
coerce('hovertemplate');
|
|
271909
|
+
coerce('xhoverformat');
|
|
271910
|
+
coerce('yhoverformat');
|
|
271911
|
+
coerce('zhoverformat');
|
|
271912
|
+
|
|
271913
|
+
coerce('mode');
|
|
271914
|
+
|
|
271915
|
+
if(subTypes.hasMarkers(traceOut)) {
|
|
271916
|
+
handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
|
|
271917
|
+
}
|
|
271918
|
+
|
|
271919
|
+
if(subTypes.hasLines(traceOut)) {
|
|
271920
|
+
coerce('connectgaps');
|
|
271921
|
+
handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
|
|
271922
|
+
}
|
|
271923
|
+
|
|
271924
|
+
if(subTypes.hasText(traceOut)) {
|
|
271925
|
+
coerce('texttemplate');
|
|
271926
|
+
handleTextDefaults(traceIn, traceOut, layout, coerce, {
|
|
271927
|
+
noSelect: true,
|
|
271928
|
+
noFontShadow: true,
|
|
271929
|
+
noFontLineposition: true,
|
|
271930
|
+
noFontTextcase: true,
|
|
271931
|
+
});
|
|
271932
|
+
}
|
|
271933
|
+
|
|
271934
|
+
var lineColor = (traceOut.line || {}).color;
|
|
271935
|
+
var markerColor = (traceOut.marker || {}).color;
|
|
271936
|
+
if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
|
|
271937
|
+
|
|
271938
|
+
var dims = ['x', 'y', 'z'];
|
|
271939
|
+
for(var i = 0; i < 3; ++i) {
|
|
271940
|
+
var projection = 'projection.' + dims[i];
|
|
271941
|
+
if(coerce(projection + '.show')) {
|
|
271942
|
+
coerce(projection + '.opacity');
|
|
271943
|
+
coerce(projection + '.scale');
|
|
271944
|
+
}
|
|
271945
|
+
}
|
|
271946
|
+
|
|
271947
|
+
var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
|
|
271948
|
+
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
|
|
271949
|
+
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
|
|
271950
|
+
errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
|
|
271951
|
+
};
|
|
271952
|
+
|
|
271953
|
+
function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
|
|
271954
|
+
var len = 0;
|
|
271955
|
+
var x = coerce('x');
|
|
271956
|
+
var y = coerce('y');
|
|
271957
|
+
var z = coerce('z');
|
|
271958
|
+
|
|
271959
|
+
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
|
|
271960
|
+
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
|
|
271961
|
+
|
|
271962
|
+
if(x && y && z) {
|
|
271963
|
+
// TODO: what happens if one is missing?
|
|
271964
|
+
len = Math.min(x.length, y.length, z.length);
|
|
271965
|
+
traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
|
|
271966
|
+
}
|
|
271967
|
+
|
|
271968
|
+
return len;
|
|
271969
|
+
}
|
|
271970
|
+
|
|
271971
|
+
|
|
271972
|
+
/***/ }),
|
|
271973
|
+
|
|
271974
|
+
/***/ 68860:
|
|
271975
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271976
|
+
|
|
271977
|
+
|
|
271978
|
+
|
|
271979
|
+
module.exports = {
|
|
271980
|
+
plot: __webpack_require__(93219),
|
|
271981
|
+
attributes: __webpack_require__(1015),
|
|
271982
|
+
markerSymbols: __webpack_require__(98993),
|
|
271983
|
+
supplyDefaults: __webpack_require__(13744),
|
|
271984
|
+
colorbar: [
|
|
271985
|
+
{
|
|
271986
|
+
container: 'marker',
|
|
271987
|
+
min: 'cmin',
|
|
271988
|
+
max: 'cmax'
|
|
271989
|
+
}, {
|
|
271990
|
+
container: 'line',
|
|
271991
|
+
min: 'cmin',
|
|
271992
|
+
max: 'cmax'
|
|
271993
|
+
}
|
|
271994
|
+
],
|
|
271995
|
+
calc: __webpack_require__(30935),
|
|
271996
|
+
|
|
271997
|
+
moduleType: 'trace',
|
|
271998
|
+
name: 'scatter3d',
|
|
271999
|
+
basePlotModule: __webpack_require__(68137),
|
|
272000
|
+
categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
|
|
272001
|
+
meta: {
|
|
272002
|
+
hrName: 'scatter_3d',
|
|
272003
|
+
description: [
|
|
272004
|
+
'The data visualized as scatter point or lines in 3D dimension',
|
|
272005
|
+
'is set in `x`, `y`, `z`.',
|
|
272006
|
+
'Text (appearing either on the chart or on hover only) is via `text`.',
|
|
272007
|
+
'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
|
|
272008
|
+
'Projections are achieved via `projection`.',
|
|
272009
|
+
'Surface fills are achieved via `surfaceaxis`.'
|
|
272010
|
+
].join(' ')
|
|
272011
|
+
}
|
|
272012
|
+
};
|
|
272013
|
+
|
|
272014
|
+
|
|
272018
272015
|
/***/ }),
|
|
272019
272016
|
|
|
272020
272017
|
/***/ 44771:
|
|
@@ -369334,7 +369331,7 @@ function HtmlRunner() {
|
|
|
369334
369331
|
const iframeClasses = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
|
|
369335
369332
|
[styles_module_scss_1.default.codeHasBeenRun]: codeHasBeenRun,
|
|
369336
369333
|
});
|
|
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: "\
|
|
369334
|
+
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 }) }) }))] }));
|
|
369338
369335
|
}
|
|
369339
369336
|
exports["default"] = HtmlRunner;
|
|
369340
369337
|
|
|
@@ -369716,234 +369713,234 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
369716
369713
|
exports.consoleOverrideScript = exports.disableLocalStorageScript = void 0;
|
|
369717
369714
|
// insert script to disable access to specific localStorage keys
|
|
369718
369715
|
// localstorage.getItem() is a potential security risk when executing untrusted code
|
|
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>
|
|
369716
|
+
exports.disableLocalStorageScript = `
|
|
369717
|
+
<script>
|
|
369718
|
+
(function() {
|
|
369719
|
+
const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
|
|
369720
|
+
const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
|
|
369721
|
+
const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
|
|
369722
|
+
const originalClear = window.localStorage.clear.bind(window.localStorage);
|
|
369723
|
+
|
|
369724
|
+
const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
|
|
369725
|
+
|
|
369726
|
+
Object.defineProperty(window, 'localStorage', {
|
|
369727
|
+
value: {
|
|
369728
|
+
getItem: function(key) {
|
|
369729
|
+
if (isDisallowedKey(key)) {
|
|
369730
|
+
console.log(\`localStorage.getItem for "\${key}" is disabled\`);
|
|
369731
|
+
return null;
|
|
369732
|
+
}
|
|
369733
|
+
return originalGetItem(key);
|
|
369734
|
+
},
|
|
369735
|
+
setItem: function(key, value) {
|
|
369736
|
+
if (isDisallowedKey(key)) {
|
|
369737
|
+
console.log(\`localStorage.setItem for "\${key}" is disabled\`);
|
|
369738
|
+
return;
|
|
369739
|
+
}
|
|
369740
|
+
return originalSetItem(key, value);
|
|
369741
|
+
},
|
|
369742
|
+
removeItem: function(key) {
|
|
369743
|
+
if (isDisallowedKey(key)) {
|
|
369744
|
+
console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
|
|
369745
|
+
return;
|
|
369746
|
+
}
|
|
369747
|
+
return originalRemoveItem(key);
|
|
369748
|
+
},
|
|
369749
|
+
clear: function() {
|
|
369750
|
+
console.log('localStorage.clear is disabled');
|
|
369751
|
+
return;
|
|
369752
|
+
}
|
|
369753
|
+
},
|
|
369754
|
+
writable: false,
|
|
369755
|
+
configurable: false
|
|
369756
|
+
});
|
|
369757
|
+
})();
|
|
369758
|
+
</script>
|
|
369762
369759
|
`;
|
|
369763
369760
|
const MAX_DEPTH = 5; // Maximum depth for object serialization to prevent infinite recursion
|
|
369764
369761
|
// Override console methods to send logs to parent window and serialize complex objects
|
|
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>
|
|
369762
|
+
exports.consoleOverrideScript = `
|
|
369763
|
+
<script>
|
|
369764
|
+
(function() {
|
|
369765
|
+
const SerializedType = {
|
|
369766
|
+
Null: "null",
|
|
369767
|
+
Undefined: "undefined",
|
|
369768
|
+
Boolean: "boolean",
|
|
369769
|
+
Number: "number",
|
|
369770
|
+
String: "string",
|
|
369771
|
+
Array: "array",
|
|
369772
|
+
Object: "object",
|
|
369773
|
+
};
|
|
369774
|
+
|
|
369775
|
+
const original = {};
|
|
369776
|
+
const methods = ["log", "error", "warn", "info", "debug", "assert"];
|
|
369777
|
+
|
|
369778
|
+
function getTimestamp() {
|
|
369779
|
+
const now = new Date();
|
|
369780
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
369781
|
+
|
|
369782
|
+
return (
|
|
369783
|
+
now.getFullYear() + '-' +
|
|
369784
|
+
pad(now.getMonth() + 1) + '-' +
|
|
369785
|
+
pad(now.getDate()) + ' ' +
|
|
369786
|
+
pad(now.getHours()) + ':' +
|
|
369787
|
+
pad(now.getMinutes()) + ':' +
|
|
369788
|
+
pad(now.getSeconds()) + '.' +
|
|
369789
|
+
pad(Math.floor(now.getMilliseconds() / 10))
|
|
369790
|
+
);
|
|
369791
|
+
}
|
|
369792
|
+
|
|
369793
|
+
function serialize(arg, depth = 0, maxDepth = ${MAX_DEPTH}, visited = new WeakSet()) {
|
|
369794
|
+
if (depth > maxDepth) return { "type": SerializedType.String, "value": "[Max depth reached]" };
|
|
369795
|
+
|
|
369796
|
+
if (arg && typeof arg === "object") {
|
|
369797
|
+
if (visited.has(arg)) {
|
|
369798
|
+
return { "type": SerializedType.String, "value": "[Circular reference]" };
|
|
369799
|
+
}
|
|
369800
|
+
visited.add(arg);
|
|
369801
|
+
}
|
|
369802
|
+
|
|
369803
|
+
const type = typeof arg;
|
|
369804
|
+
if (arg === null) return { "type": SerializedType.Null, "value": "null" };
|
|
369805
|
+
if (arg === undefined) return { "type": SerializedType.Undefined, "value": "undefined" };
|
|
369806
|
+
if (type === "boolean") return { "type": SerializedType.Boolean, "value": String(arg) };
|
|
369807
|
+
if (type === "number") return { "type": SerializedType.Number, "value": String(arg) };
|
|
369808
|
+
if (type === "string") return { "type": SerializedType.String, "value": arg };
|
|
369809
|
+
|
|
369810
|
+
if (Array.isArray(arg)) {
|
|
369811
|
+
return {
|
|
369812
|
+
"type": SerializedType.Array,
|
|
369813
|
+
"value": arg.map(item => serialize(item, depth + 1, maxDepth))
|
|
369814
|
+
};
|
|
369815
|
+
}
|
|
369816
|
+
|
|
369817
|
+
if (type === "object" && arg !== null) {
|
|
369818
|
+
const props = {};
|
|
369819
|
+
try {
|
|
369820
|
+
for (let key in arg) {
|
|
369821
|
+
if (arg.hasOwnProperty(key)) {
|
|
369822
|
+
props[key] = serialize(arg[key], depth + 1, maxDepth, visited);
|
|
369823
|
+
}
|
|
369824
|
+
}
|
|
369825
|
+
} catch (error) {
|
|
369826
|
+
console.error("Error serializing object property:", error);
|
|
369827
|
+
}
|
|
369828
|
+
return { "type": SerializedType.Object, "value": props };
|
|
369829
|
+
}
|
|
369830
|
+
|
|
369831
|
+
return { "type": SerializedType.String, "value": String(arg) };
|
|
369832
|
+
}
|
|
369833
|
+
|
|
369834
|
+
methods.forEach(m => {
|
|
369835
|
+
original[m] = console[m] || function(){};
|
|
369836
|
+
|
|
369837
|
+
console[m] = function(...args) {
|
|
369838
|
+
const timestamp = getTimestamp();
|
|
369839
|
+
|
|
369840
|
+
let level = m;
|
|
369841
|
+
let serializedArgs = args.map(arg => serialize(arg));
|
|
369842
|
+
|
|
369843
|
+
if (m === "assert") {
|
|
369844
|
+
const condition = Boolean(args[0]);
|
|
369845
|
+
const messageArgs = args.slice(1);
|
|
369846
|
+
|
|
369847
|
+
serializedArgs =
|
|
369848
|
+
messageArgs.length > 0
|
|
369849
|
+
? messageArgs.map(arg => serialize(arg))
|
|
369850
|
+
: [
|
|
369851
|
+
{
|
|
369852
|
+
"type": "string",
|
|
369853
|
+
"value": condition ? "Assertion passed" : "Assertion failed",
|
|
369854
|
+
},
|
|
369855
|
+
];
|
|
369856
|
+
|
|
369857
|
+
level = condition ? "log" : "error";
|
|
369858
|
+
}
|
|
369859
|
+
|
|
369860
|
+
window.parent.postMessage({
|
|
369861
|
+
"type": "console",
|
|
369862
|
+
"method": level,
|
|
369863
|
+
"data": serializedArgs,
|
|
369864
|
+
"timestamp": timestamp
|
|
369865
|
+
}, "*");
|
|
369866
|
+
|
|
369867
|
+
original[m](...args);
|
|
369868
|
+
};
|
|
369869
|
+
});
|
|
369870
|
+
|
|
369871
|
+
window.addEventListener("error", function(event) {
|
|
369872
|
+
const timestamp = getTimestamp();
|
|
369873
|
+
const error = event.error;
|
|
369874
|
+
|
|
369875
|
+
let message;
|
|
369876
|
+
if (error && error.name && error.message) {
|
|
369877
|
+
message = error.name + ": " + error.message;
|
|
369878
|
+
} else if (event.message) {
|
|
369879
|
+
message = event.message;
|
|
369880
|
+
} else {
|
|
369881
|
+
message = "Unknown JavaScript error";
|
|
369882
|
+
}
|
|
369883
|
+
|
|
369884
|
+
let displayFilename = event.filename;
|
|
369885
|
+
|
|
369886
|
+
if (
|
|
369887
|
+
typeof displayFilename === "string" &&
|
|
369888
|
+
displayFilename.startsWith("blob:")
|
|
369889
|
+
) {
|
|
369890
|
+
const sourceMap = window.__blobSourceMap__ || {};
|
|
369891
|
+
const mappedFilename = sourceMap[displayFilename];
|
|
369892
|
+
|
|
369893
|
+
if (mappedFilename) {
|
|
369894
|
+
displayFilename = mappedFilename;
|
|
369895
|
+
} else {
|
|
369896
|
+
const meta = document.querySelector("meta[filename]");
|
|
369897
|
+
displayFilename =
|
|
369898
|
+
(meta && meta.getAttribute("filename")) || "preview";
|
|
369899
|
+
}
|
|
369900
|
+
}
|
|
369901
|
+
|
|
369902
|
+
const location =
|
|
369903
|
+
displayFilename || event.lineno || event.colno
|
|
369904
|
+
? " at " +
|
|
369905
|
+
[displayFilename, event.lineno, event.colno]
|
|
369906
|
+
.filter(Boolean)
|
|
369907
|
+
.join(":")
|
|
369908
|
+
: "";
|
|
369909
|
+
|
|
369910
|
+
window.parent.postMessage({
|
|
369911
|
+
"type": "console",
|
|
369912
|
+
"method": "error",
|
|
369913
|
+
"data": [
|
|
369914
|
+
{ "type": "string", "value": message + location }
|
|
369915
|
+
],
|
|
369916
|
+
"timestamp": timestamp
|
|
369917
|
+
}, "*");
|
|
369918
|
+
});
|
|
369919
|
+
|
|
369920
|
+
window.addEventListener("unhandledrejection", function(event) {
|
|
369921
|
+
const timestamp = getTimestamp();
|
|
369922
|
+
const reason = event.reason;
|
|
369923
|
+
|
|
369924
|
+
let message;
|
|
369925
|
+
if (reason && reason.name && reason.message) {
|
|
369926
|
+
message = reason.name + ": " + reason.message;
|
|
369927
|
+
} else if (typeof reason === "string") {
|
|
369928
|
+
message = "UnhandledPromiseRejection: " + reason;
|
|
369929
|
+
} else {
|
|
369930
|
+
message = "UnhandledPromiseRejection: " + String(reason);
|
|
369931
|
+
}
|
|
369932
|
+
|
|
369933
|
+
window.parent.postMessage({
|
|
369934
|
+
"type": "console",
|
|
369935
|
+
"method": "error",
|
|
369936
|
+
"data": [
|
|
369937
|
+
{ "type": "string", "value": message }
|
|
369938
|
+
],
|
|
369939
|
+
"timestamp": timestamp
|
|
369940
|
+
}, "*");
|
|
369941
|
+
});
|
|
369942
|
+
})();
|
|
369943
|
+
</script>
|
|
369947
369944
|
`;
|
|
369948
369945
|
|
|
369949
369946
|
|
|
@@ -371765,17 +371762,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
371765
371762
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
371766
371763
|
const ContextMenu_1 = __importDefault(__webpack_require__(39179));
|
|
371767
371764
|
const AuthContext_1 = __webpack_require__(55471);
|
|
371768
|
-
const BeforeUnloadContext_1 = __webpack_require__(2373);
|
|
371769
371765
|
const UserMenu = (props) => {
|
|
371770
371766
|
const { anchorRef, opened, onClose } = props;
|
|
371771
371767
|
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
|
-
};
|
|
371779
371768
|
return ((0, jsx_runtime_1.jsx)(ContextMenu_1.default, { align: "start", direction: "top", menuWidth: 142, menuOptions: [
|
|
371780
371769
|
{
|
|
371781
371770
|
text: "View Profile",
|
|
@@ -371783,7 +371772,7 @@ const UserMenu = (props) => {
|
|
|
371783
371772
|
},
|
|
371784
371773
|
{
|
|
371785
371774
|
text: "Logout",
|
|
371786
|
-
action:
|
|
371775
|
+
action: onLogout,
|
|
371787
371776
|
},
|
|
371788
371777
|
], opened: opened, anchorRef: anchorRef, onClose: onClose, gap: 4 }));
|
|
371789
371778
|
};
|
|
@@ -372150,6 +372139,7 @@ const types_1 = __webpack_require__(92932);
|
|
|
372150
372139
|
const stores_1 = __webpack_require__(32132);
|
|
372151
372140
|
const useHover_1 = __webpack_require__(78556);
|
|
372152
372141
|
const styles_module_scss_1 = __importDefault(__webpack_require__(99855));
|
|
372142
|
+
const SvgIcon_1 = __webpack_require__(82917);
|
|
372153
372143
|
const ShareButton = (props) => {
|
|
372154
372144
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
372155
372145
|
const shareLinks = (0, stores_1.useAppSelector)((state) => state.editor.shareLinks);
|
|
@@ -372166,7 +372156,7 @@ const ShareButton = (props) => {
|
|
|
372166
372156
|
}, [dispatch, shareLinks]);
|
|
372167
372157
|
const canShare = Boolean(shareLinks);
|
|
372168
372158
|
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
372169
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.shareButtonWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "To share your project, please save it first.", visible: hovered && !canShare, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: !canShare, variant: "tertiary", ButtonIcon: share_svg_1.default, onClickHandler: onClickShare, ...props })] }));
|
|
372159
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.shareButtonWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "To share your project, please save it first.", visible: hovered && !canShare, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: !canShare, variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: share_svg_1.default, size: 24 }), onClickHandler: onClickShare, ...props })] }));
|
|
372170
372160
|
};
|
|
372171
372161
|
exports["default"] = ShareButton;
|
|
372172
372162
|
|
|
@@ -372478,7 +372468,6 @@ const ToastMessages_1 = __webpack_require__(6459);
|
|
|
372478
372468
|
const Modals_1 = __webpack_require__(18284);
|
|
372479
372469
|
const Loading_1 = __importDefault(__webpack_require__(34466));
|
|
372480
372470
|
const stores_1 = __webpack_require__(32132);
|
|
372481
|
-
const BeforeUnloadContext_1 = __webpack_require__(2373);
|
|
372482
372471
|
const SaveBeforeLeave_1 = __webpack_require__(47318);
|
|
372483
372472
|
const selectors_1 = __webpack_require__(43551);
|
|
372484
372473
|
const WebComponentLoader = (props) => {
|
|
@@ -372579,10 +372568,10 @@ const WebComponentLoader = (props) => {
|
|
|
372579
372568
|
(0, react_1.useEffect)(() => {
|
|
372580
372569
|
// Create a script element to save the existing Prism object if there is one
|
|
372581
372570
|
const script = document.createElement("script");
|
|
372582
|
-
script.textContent = `
|
|
372583
|
-
if (window.Prism) {
|
|
372584
|
-
window.syntaxHighlight = window.Prism;
|
|
372585
|
-
}
|
|
372571
|
+
script.textContent = `
|
|
372572
|
+
if (window.Prism) {
|
|
372573
|
+
window.syntaxHighlight = window.Prism;
|
|
372574
|
+
}
|
|
372586
372575
|
`;
|
|
372587
372576
|
// Append the script to the document body
|
|
372588
372577
|
document.body.appendChild(script);
|
|
@@ -372593,7 +372582,6 @@ const WebComponentLoader = (props) => {
|
|
|
372593
372582
|
}, []);
|
|
372594
372583
|
const modal = (modalWindowShowing && Modals_1.ModalTypeToComponentMap[modalWindowShowing]) ?? null;
|
|
372595
372584
|
const isReadOnly = (0, stores_1.useAppSelector)((state) => state.editor.readOnly);
|
|
372596
|
-
const beforeUnloadRef = (0, react_1.useRef)(null);
|
|
372597
372585
|
const shouldBlockNavigation = (0, stores_1.useAppSelector)(selectors_1.selectProjectDirtyState);
|
|
372598
372586
|
// effect for browser actions (refresh, tab close etc)
|
|
372599
372587
|
(0, react_1.useEffect)(() => {
|
|
@@ -372605,17 +372593,15 @@ const WebComponentLoader = (props) => {
|
|
|
372605
372593
|
// for browsers to show the confirmation dialog
|
|
372606
372594
|
e.returnValue = "";
|
|
372607
372595
|
};
|
|
372608
|
-
beforeUnloadRef.current = handleBeforeUnload;
|
|
372609
372596
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
372610
372597
|
return () => {
|
|
372611
372598
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
372612
|
-
beforeUnloadRef.current = null;
|
|
372613
372599
|
};
|
|
372614
|
-
}, [isPreviewMode, isReadOnly
|
|
372615
|
-
const renderSuccessState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.
|
|
372616
|
-
|
|
372617
|
-
|
|
372618
|
-
|
|
372600
|
+
}, [shouldBlockNavigation, isPreviewMode, isReadOnly]);
|
|
372601
|
+
const renderSuccessState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(settings_1.SettingsContext.Provider, { value: {
|
|
372602
|
+
theme: themeDefault,
|
|
372603
|
+
fontSize: "small",
|
|
372604
|
+
}, children: [(0, jsx_runtime_1.jsx)(ToastMessages_1.ToastMessagesProvider, {}), (0, jsx_runtime_1.jsxs)("div", { id: "textjam-root", className: `editor-shell --${themeDefault}`, children: [(0, jsx_runtime_1.jsx)(WebComponentProject_1.default, { nameEditable: projectNameEditable, sidebarOptions: sidebarOptions, packageApiUrl: packageApiUrl }), errorModalShowing && (0, jsx_runtime_1.jsx)(ErrorModal_1.default, {}), modal, shouldBlockNavigation && (0, jsx_runtime_1.jsx)(SaveBeforeLeave_1.SaveBeforeLeaveModal, {})] })] }) }));
|
|
372619
372605
|
const renderFailedState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("p", { children: t("webComponent.failed") }) }));
|
|
372620
372606
|
const renderLoadingState = () => (0, jsx_runtime_1.jsx)(Loading_1.default, {});
|
|
372621
372607
|
if (loading === types_1.LoadingState.SUCCESS) {
|
|
@@ -372656,20 +372642,6 @@ const useAuthActions = () => {
|
|
|
372656
372642
|
exports.useAuthActions = useAuthActions;
|
|
372657
372643
|
|
|
372658
372644
|
|
|
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
|
-
|
|
372673
372645
|
/***/ }),
|
|
372674
372646
|
|
|
372675
372647
|
/***/ 59578:
|
|
@@ -373735,15 +373707,21 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
|
|
|
373735
373707
|
components: cleanedComponents,
|
|
373736
373708
|
identifier: projectData.identifier,
|
|
373737
373709
|
};
|
|
373710
|
+
const newLastSavedSnapshot = (0, buildProjectSnapshot_1.buildProjectSnapshot)(cleanedProject);
|
|
373738
373711
|
const updatedProjectSnapshot = {
|
|
373739
373712
|
components: cleanedComponents,
|
|
373740
373713
|
hasStructureChanges: false,
|
|
373741
|
-
lastSavedSnapshot:
|
|
373714
|
+
lastSavedSnapshot: newLastSavedSnapshot,
|
|
373742
373715
|
identifier: projectData.identifier,
|
|
373743
373716
|
};
|
|
373744
373717
|
dispatch((0, EditorSlice_1.updateProjectSnapshot)(updatedProjectSnapshot));
|
|
373718
|
+
upsertCacheValue(cleanedProject.identifier, {
|
|
373719
|
+
...cleanedProject,
|
|
373720
|
+
lastSavedSnapshot: newLastSavedSnapshot,
|
|
373721
|
+
});
|
|
373745
373722
|
}, [
|
|
373746
373723
|
deleteValueFromCache,
|
|
373724
|
+
upsertCacheValue,
|
|
373747
373725
|
dispatch,
|
|
373748
373726
|
project,
|
|
373749
373727
|
projectData?.identifier,
|
|
@@ -374919,6 +374897,7 @@ exports.IndexedDb = {
|
|
|
374919
374897
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
374920
374898
|
exports.LeaveGuardController = void 0;
|
|
374921
374899
|
const LeaveFlowSlice_1 = __webpack_require__(52990);
|
|
374900
|
+
const selectors_1 = __webpack_require__(43551);
|
|
374922
374901
|
class LeaveGuardController {
|
|
374923
374902
|
store;
|
|
374924
374903
|
pendingPromise = null;
|
|
@@ -374928,12 +374907,11 @@ class LeaveGuardController {
|
|
|
374928
374907
|
this.store = store;
|
|
374929
374908
|
}
|
|
374930
374909
|
canLeave = () => {
|
|
374931
|
-
|
|
374932
|
-
|
|
374933
|
-
|
|
374934
|
-
|
|
374935
|
-
|
|
374936
|
-
// }
|
|
374910
|
+
const state = this.store.getState();
|
|
374911
|
+
const isDirty = (0, selectors_1.selectProjectDirtyState)(state);
|
|
374912
|
+
if (!isDirty) {
|
|
374913
|
+
return Promise.resolve(true);
|
|
374914
|
+
}
|
|
374937
374915
|
if (this.pendingPromise) {
|
|
374938
374916
|
return this.pendingPromise;
|
|
374939
374917
|
}
|