gwchq-textjam 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -59993,7 +59993,7 @@ var OutputViewToggle = () => {
59993
59993
  // EXTERNAL MODULE: ./src/components/RunButton/RunnerControls.jsx + 4 modules
59994
59994
  var RunnerControls = __webpack_require__(15590);
59995
59995
  ;// ./src/assets/editor/pyodide/shims/pygal.js?url
59996
- const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalc0b4f32d2d2cc5a0c638.js";
59996
+ const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalef3b78a56cb1d66beb61.js";
59997
59997
  ;// ./src/assets/editor/pyodide/packages/turtle-0.0.1-py3-none-any.whl?url
59998
59998
  const turtle_0_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "assets/turtle-0.0.1-py3-none-any0c3147a3e0c3188b2544.whl";
59999
59999
  ;// ./src/assets/editor/pyodide/packages/p5-0.0.1-py3-none-any.whl?url
@@ -60008,7 +60008,7 @@ const py_enigma_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "a
60008
60008
 
60009
60009
 
60010
60010
  ;// ./src/PyodideWorker.js?url
60011
- const PyodideWorkerurl_namespaceObject = __webpack_require__.p + "assets/PyodideWorker543e2f3f6cecfe86e905.js";
60011
+ const PyodideWorkerurl_namespaceObject = __webpack_require__.p + "assets/PyodideWorker04ce34b6863d1f341e6a.js";
60012
60012
  ;// ./src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx
60013
60013
 
60014
60014
  /* eslint-disable react-hooks/exhaustive-deps */
@@ -70155,115 +70155,6 @@ function escapeName(str, charsToEscape) {
70155
70155
 
70156
70156
 
70157
70157
 
70158
- /***/ }),
70159
-
70160
- /***/ 16450:
70161
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
70162
-
70163
-
70164
-
70165
- var isValue = __webpack_require__(48175)
70166
- , ensureValue = __webpack_require__(34809)
70167
- , ensurePlainFunction = __webpack_require__(90251)
70168
- , copy = __webpack_require__(30203)
70169
- , normalizeOptions = __webpack_require__(90148)
70170
- , map = __webpack_require__(30498);
70171
-
70172
- var bind = Function.prototype.bind
70173
- , defineProperty = Object.defineProperty
70174
- , hasOwnProperty = Object.prototype.hasOwnProperty
70175
- , define;
70176
-
70177
- define = function (name, desc, options) {
70178
- var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
70179
- dgs = copy(desc);
70180
- delete dgs.writable;
70181
- delete dgs.value;
70182
- dgs.get = function () {
70183
- if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
70184
- desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
70185
- defineProperty(this, name, desc);
70186
- return this[name];
70187
- };
70188
- return dgs;
70189
- };
70190
-
70191
- module.exports = function (props/*, options*/) {
70192
- var options = normalizeOptions(arguments[1]);
70193
- if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
70194
- return map(props, function (desc, name) { return define(name, desc, options); });
70195
- };
70196
-
70197
-
70198
- /***/ }),
70199
-
70200
- /***/ 58263:
70201
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
70202
-
70203
-
70204
-
70205
- var isValue = __webpack_require__(48175)
70206
- , isPlainFunction = __webpack_require__(6873)
70207
- , assign = __webpack_require__(16596)
70208
- , normalizeOpts = __webpack_require__(90148)
70209
- , contains = __webpack_require__(70214);
70210
-
70211
- var d = (module.exports = function (dscr, value/*, options*/) {
70212
- var c, e, w, options, desc;
70213
- if (arguments.length < 2 || typeof dscr !== "string") {
70214
- options = value;
70215
- value = dscr;
70216
- dscr = null;
70217
- } else {
70218
- options = arguments[2];
70219
- }
70220
- if (isValue(dscr)) {
70221
- c = contains.call(dscr, "c");
70222
- e = contains.call(dscr, "e");
70223
- w = contains.call(dscr, "w");
70224
- } else {
70225
- c = w = true;
70226
- e = false;
70227
- }
70228
-
70229
- desc = { value: value, configurable: c, enumerable: e, writable: w };
70230
- return !options ? desc : assign(normalizeOpts(options), desc);
70231
- });
70232
-
70233
- d.gs = function (dscr, get, set/*, options*/) {
70234
- var c, e, options, desc;
70235
- if (typeof dscr !== "string") {
70236
- options = set;
70237
- set = get;
70238
- get = dscr;
70239
- dscr = null;
70240
- } else {
70241
- options = arguments[3];
70242
- }
70243
- if (!isValue(get)) {
70244
- get = undefined;
70245
- } else if (!isPlainFunction(get)) {
70246
- options = get;
70247
- get = set = undefined;
70248
- } else if (!isValue(set)) {
70249
- set = undefined;
70250
- } else if (!isPlainFunction(set)) {
70251
- options = set;
70252
- set = undefined;
70253
- }
70254
- if (isValue(dscr)) {
70255
- c = contains.call(dscr, "c");
70256
- e = contains.call(dscr, "e");
70257
- } else {
70258
- c = true;
70259
- e = false;
70260
- }
70261
-
70262
- desc = { get: get, set: set, configurable: c, enumerable: e };
70263
- return !options ? desc : assign(normalizeOpts(options), desc);
70264
- };
70265
-
70266
-
70267
70158
  /***/ }),
70268
70159
 
70269
70160
  /***/ 83999:
@@ -85092,6 +84983,115 @@ year.every = function(k) {
85092
84983
  var years = year.range;
85093
84984
 
85094
84985
 
84986
+ /***/ }),
84987
+
84988
+ /***/ 16450:
84989
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
84990
+
84991
+
84992
+
84993
+ var isValue = __webpack_require__(48175)
84994
+ , ensureValue = __webpack_require__(34809)
84995
+ , ensurePlainFunction = __webpack_require__(90251)
84996
+ , copy = __webpack_require__(30203)
84997
+ , normalizeOptions = __webpack_require__(90148)
84998
+ , map = __webpack_require__(30498);
84999
+
85000
+ var bind = Function.prototype.bind
85001
+ , defineProperty = Object.defineProperty
85002
+ , hasOwnProperty = Object.prototype.hasOwnProperty
85003
+ , define;
85004
+
85005
+ define = function (name, desc, options) {
85006
+ var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
85007
+ dgs = copy(desc);
85008
+ delete dgs.writable;
85009
+ delete dgs.value;
85010
+ dgs.get = function () {
85011
+ if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
85012
+ desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
85013
+ defineProperty(this, name, desc);
85014
+ return this[name];
85015
+ };
85016
+ return dgs;
85017
+ };
85018
+
85019
+ module.exports = function (props/*, options*/) {
85020
+ var options = normalizeOptions(arguments[1]);
85021
+ if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
85022
+ return map(props, function (desc, name) { return define(name, desc, options); });
85023
+ };
85024
+
85025
+
85026
+ /***/ }),
85027
+
85028
+ /***/ 58263:
85029
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
85030
+
85031
+
85032
+
85033
+ var isValue = __webpack_require__(48175)
85034
+ , isPlainFunction = __webpack_require__(6873)
85035
+ , assign = __webpack_require__(16596)
85036
+ , normalizeOpts = __webpack_require__(90148)
85037
+ , contains = __webpack_require__(70214);
85038
+
85039
+ var d = (module.exports = function (dscr, value/*, options*/) {
85040
+ var c, e, w, options, desc;
85041
+ if (arguments.length < 2 || typeof dscr !== "string") {
85042
+ options = value;
85043
+ value = dscr;
85044
+ dscr = null;
85045
+ } else {
85046
+ options = arguments[2];
85047
+ }
85048
+ if (isValue(dscr)) {
85049
+ c = contains.call(dscr, "c");
85050
+ e = contains.call(dscr, "e");
85051
+ w = contains.call(dscr, "w");
85052
+ } else {
85053
+ c = w = true;
85054
+ e = false;
85055
+ }
85056
+
85057
+ desc = { value: value, configurable: c, enumerable: e, writable: w };
85058
+ return !options ? desc : assign(normalizeOpts(options), desc);
85059
+ });
85060
+
85061
+ d.gs = function (dscr, get, set/*, options*/) {
85062
+ var c, e, options, desc;
85063
+ if (typeof dscr !== "string") {
85064
+ options = set;
85065
+ set = get;
85066
+ get = dscr;
85067
+ dscr = null;
85068
+ } else {
85069
+ options = arguments[3];
85070
+ }
85071
+ if (!isValue(get)) {
85072
+ get = undefined;
85073
+ } else if (!isPlainFunction(get)) {
85074
+ options = get;
85075
+ get = set = undefined;
85076
+ } else if (!isValue(set)) {
85077
+ set = undefined;
85078
+ } else if (!isPlainFunction(set)) {
85079
+ options = set;
85080
+ set = undefined;
85081
+ }
85082
+ if (isValue(dscr)) {
85083
+ c = contains.call(dscr, "c");
85084
+ e = contains.call(dscr, "e");
85085
+ } else {
85086
+ c = true;
85087
+ e = false;
85088
+ }
85089
+
85090
+ desc = { get: get, set: set, configurable: c, enumerable: e };
85091
+ return !options ? desc : assign(normalizeOpts(options), desc);
85092
+ };
85093
+
85094
+
85095
85095
  /***/ }),
85096
85096
 
85097
85097
  /***/ 30041:
@@ -101542,6 +101542,324 @@ function hsl2rgb(hsl) {
101542
101542
  }
101543
101543
 
101544
101544
 
101545
+ /***/ }),
101546
+
101547
+ /***/ 9793:
101548
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
101549
+
101550
+
101551
+
101552
+ var annAttrs = __webpack_require__(84676);
101553
+ var overrideAll = (__webpack_require__(70756).overrideAll);
101554
+ var templatedArray = (__webpack_require__(79338).templatedArray);
101555
+
101556
+ module.exports = overrideAll(templatedArray('annotation', {
101557
+ visible: annAttrs.visible,
101558
+ x: {
101559
+ valType: 'any',
101560
+ description: [
101561
+ 'Sets the annotation\'s x position.'
101562
+ ].join(' ')
101563
+ },
101564
+ y: {
101565
+ valType: 'any',
101566
+ description: [
101567
+ 'Sets the annotation\'s y position.'
101568
+ ].join(' ')
101569
+ },
101570
+ z: {
101571
+ valType: 'any',
101572
+ description: [
101573
+ 'Sets the annotation\'s z position.'
101574
+ ].join(' ')
101575
+ },
101576
+ ax: {
101577
+ valType: 'number',
101578
+ description: [
101579
+ 'Sets the x component of the arrow tail about the arrow head (in pixels).'
101580
+ ].join(' ')
101581
+ },
101582
+ ay: {
101583
+ valType: 'number',
101584
+ description: [
101585
+ 'Sets the y component of the arrow tail about the arrow head (in pixels).'
101586
+ ].join(' ')
101587
+ },
101588
+
101589
+ xanchor: annAttrs.xanchor,
101590
+ xshift: annAttrs.xshift,
101591
+ yanchor: annAttrs.yanchor,
101592
+ yshift: annAttrs.yshift,
101593
+
101594
+ text: annAttrs.text,
101595
+ textangle: annAttrs.textangle,
101596
+ font: annAttrs.font,
101597
+ width: annAttrs.width,
101598
+ height: annAttrs.height,
101599
+ opacity: annAttrs.opacity,
101600
+ align: annAttrs.align,
101601
+ valign: annAttrs.valign,
101602
+ bgcolor: annAttrs.bgcolor,
101603
+ bordercolor: annAttrs.bordercolor,
101604
+ borderpad: annAttrs.borderpad,
101605
+ borderwidth: annAttrs.borderwidth,
101606
+ showarrow: annAttrs.showarrow,
101607
+ arrowcolor: annAttrs.arrowcolor,
101608
+ arrowhead: annAttrs.arrowhead,
101609
+ startarrowhead: annAttrs.startarrowhead,
101610
+ arrowside: annAttrs.arrowside,
101611
+ arrowsize: annAttrs.arrowsize,
101612
+ startarrowsize: annAttrs.startarrowsize,
101613
+ arrowwidth: annAttrs.arrowwidth,
101614
+ standoff: annAttrs.standoff,
101615
+ startstandoff: annAttrs.startstandoff,
101616
+ hovertext: annAttrs.hovertext,
101617
+ hoverlabel: annAttrs.hoverlabel,
101618
+ captureevents: annAttrs.captureevents,
101619
+
101620
+ // maybes later?
101621
+ // clicktoshow: annAttrs.clicktoshow,
101622
+ // xclick: annAttrs.xclick,
101623
+ // yclick: annAttrs.yclick,
101624
+
101625
+ // not needed!
101626
+ // axref: 'pixel'
101627
+ // ayref: 'pixel'
101628
+ // xref: 'x'
101629
+ // yref: 'y
101630
+ // zref: 'z'
101631
+ }), 'calc', 'from-root');
101632
+
101633
+
101634
+ /***/ }),
101635
+
101636
+ /***/ 58121:
101637
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
101638
+
101639
+
101640
+
101641
+ var Lib = __webpack_require__(30991);
101642
+ var Axes = __webpack_require__(15076);
101643
+
101644
+ module.exports = function convert(scene) {
101645
+ var fullSceneLayout = scene.fullSceneLayout;
101646
+ var anns = fullSceneLayout.annotations;
101647
+
101648
+ for(var i = 0; i < anns.length; i++) {
101649
+ mockAnnAxes(anns[i], scene);
101650
+ }
101651
+
101652
+ scene.fullLayout._infolayer
101653
+ .selectAll('.annotation-' + scene.id)
101654
+ .remove();
101655
+ };
101656
+
101657
+ function mockAnnAxes(ann, scene) {
101658
+ var fullSceneLayout = scene.fullSceneLayout;
101659
+ var domain = fullSceneLayout.domain;
101660
+ var size = scene.fullLayout._size;
101661
+
101662
+ var base = {
101663
+ // this gets fill in on render
101664
+ pdata: null,
101665
+
101666
+ // to get setConvert to not execute cleanly
101667
+ type: 'linear',
101668
+
101669
+ // don't try to update them on `editable: true`
101670
+ autorange: false,
101671
+
101672
+ // set infinite range so that annotation draw routine
101673
+ // does not try to remove 'outside-range' annotations,
101674
+ // this case is handled in the render loop
101675
+ range: [-Infinity, Infinity]
101676
+ };
101677
+
101678
+ ann._xa = {};
101679
+ Lib.extendFlat(ann._xa, base);
101680
+ Axes.setConvert(ann._xa);
101681
+ ann._xa._offset = size.l + domain.x[0] * size.w;
101682
+ ann._xa.l2p = function() {
101683
+ return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
101684
+ };
101685
+
101686
+ ann._ya = {};
101687
+ Lib.extendFlat(ann._ya, base);
101688
+ Axes.setConvert(ann._ya);
101689
+ ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
101690
+ ann._ya.l2p = function() {
101691
+ return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
101692
+ };
101693
+ }
101694
+
101695
+
101696
+ /***/ }),
101697
+
101698
+ /***/ 41926:
101699
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
101700
+
101701
+
101702
+
101703
+ var Lib = __webpack_require__(30991);
101704
+ var Axes = __webpack_require__(15076);
101705
+ var handleArrayContainerDefaults = __webpack_require__(21238);
101706
+ var handleAnnotationCommonDefaults = __webpack_require__(84081);
101707
+ var attributes = __webpack_require__(9793);
101708
+
101709
+ module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
101710
+ handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
101711
+ name: 'annotations',
101712
+ handleItemDefaults: handleAnnotationDefaults,
101713
+ fullLayout: opts.fullLayout
101714
+ });
101715
+ };
101716
+
101717
+ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
101718
+ function coerce(attr, dflt) {
101719
+ return Lib.coerce(annIn, annOut, attributes, attr, dflt);
101720
+ }
101721
+
101722
+ function coercePosition(axLetter) {
101723
+ var axName = axLetter + 'axis';
101724
+
101725
+ // mock in such way that getFromId grabs correct 3D axis
101726
+ var gdMock = { _fullLayout: {} };
101727
+ gdMock._fullLayout[axName] = sceneLayout[axName];
101728
+
101729
+ return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
101730
+ }
101731
+
101732
+
101733
+ var visible = coerce('visible');
101734
+ if(!visible) return;
101735
+
101736
+ handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
101737
+
101738
+ coercePosition('x');
101739
+ coercePosition('y');
101740
+ coercePosition('z');
101741
+
101742
+ // if you have one coordinate you should all three
101743
+ Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
101744
+
101745
+ // hard-set here for completeness
101746
+ annOut.xref = 'x';
101747
+ annOut.yref = 'y';
101748
+ annOut.zref = 'z';
101749
+
101750
+ coerce('xanchor');
101751
+ coerce('yanchor');
101752
+ coerce('xshift');
101753
+ coerce('yshift');
101754
+
101755
+ if(annOut.showarrow) {
101756
+ annOut.axref = 'pixel';
101757
+ annOut.ayref = 'pixel';
101758
+
101759
+ // TODO maybe default values should be bigger than the 2D case?
101760
+ coerce('ax', -10);
101761
+ coerce('ay', -30);
101762
+
101763
+ // if you have one part of arrow length you should have both
101764
+ Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
101765
+ }
101766
+ }
101767
+
101768
+
101769
+ /***/ }),
101770
+
101771
+ /***/ 13802:
101772
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
101773
+
101774
+
101775
+
101776
+ var drawRaw = (__webpack_require__(47995).drawRaw);
101777
+ var project = __webpack_require__(51344);
101778
+ var axLetters = ['x', 'y', 'z'];
101779
+
101780
+ module.exports = function draw(scene) {
101781
+ var fullSceneLayout = scene.fullSceneLayout;
101782
+ var dataScale = scene.dataScale;
101783
+ var anns = fullSceneLayout.annotations;
101784
+
101785
+ for(var i = 0; i < anns.length; i++) {
101786
+ var ann = anns[i];
101787
+ var annotationIsOffscreen = false;
101788
+
101789
+ for(var j = 0; j < 3; j++) {
101790
+ var axLetter = axLetters[j];
101791
+ var pos = ann[axLetter];
101792
+ var ax = fullSceneLayout[axLetter + 'axis'];
101793
+ var posFraction = ax.r2fraction(pos);
101794
+
101795
+ if(posFraction < 0 || posFraction > 1) {
101796
+ annotationIsOffscreen = true;
101797
+ break;
101798
+ }
101799
+ }
101800
+
101801
+ if(annotationIsOffscreen) {
101802
+ scene.fullLayout._infolayer
101803
+ .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
101804
+ .remove();
101805
+ } else {
101806
+ ann._pdata = project(scene.glplot.cameraParams, [
101807
+ fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
101808
+ fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
101809
+ fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
101810
+ ]);
101811
+
101812
+ drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
101813
+ }
101814
+ }
101815
+ };
101816
+
101817
+
101818
+ /***/ }),
101819
+
101820
+ /***/ 86578:
101821
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
101822
+
101823
+
101824
+
101825
+ var Registry = __webpack_require__(13936);
101826
+ var Lib = __webpack_require__(30991);
101827
+
101828
+ module.exports = {
101829
+ moduleType: 'component',
101830
+ name: 'annotations3d',
101831
+
101832
+ schema: {
101833
+ subplots: {
101834
+ scene: {annotations: __webpack_require__(9793)}
101835
+ }
101836
+ },
101837
+
101838
+ layoutAttributes: __webpack_require__(9793),
101839
+ handleDefaults: __webpack_require__(41926),
101840
+ includeBasePlot: includeGL3D,
101841
+
101842
+ convert: __webpack_require__(58121),
101843
+ draw: __webpack_require__(13802)
101844
+ };
101845
+
101846
+ function includeGL3D(layoutIn, layoutOut) {
101847
+ var GL3D = Registry.subplotsRegistry.gl3d;
101848
+ if(!GL3D) return;
101849
+
101850
+ var attrRegex = GL3D.attrRegex;
101851
+
101852
+ var keys = Object.keys(layoutIn);
101853
+ for(var i = 0; i < keys.length; i++) {
101854
+ var k = keys[i];
101855
+ if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
101856
+ Lib.pushUnique(layoutOut._basePlotModules, GL3D);
101857
+ Lib.pushUnique(layoutOut._subplots.gl3d, k);
101858
+ }
101859
+ }
101860
+ }
101861
+
101862
+
101545
101863
  /***/ }),
101546
101864
 
101547
101865
  /***/ 2595:
@@ -103515,324 +103833,6 @@ module.exports = {
103515
103833
  };
103516
103834
 
103517
103835
 
103518
- /***/ }),
103519
-
103520
- /***/ 9793:
103521
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
103522
-
103523
-
103524
-
103525
- var annAttrs = __webpack_require__(84676);
103526
- var overrideAll = (__webpack_require__(70756).overrideAll);
103527
- var templatedArray = (__webpack_require__(79338).templatedArray);
103528
-
103529
- module.exports = overrideAll(templatedArray('annotation', {
103530
- visible: annAttrs.visible,
103531
- x: {
103532
- valType: 'any',
103533
- description: [
103534
- 'Sets the annotation\'s x position.'
103535
- ].join(' ')
103536
- },
103537
- y: {
103538
- valType: 'any',
103539
- description: [
103540
- 'Sets the annotation\'s y position.'
103541
- ].join(' ')
103542
- },
103543
- z: {
103544
- valType: 'any',
103545
- description: [
103546
- 'Sets the annotation\'s z position.'
103547
- ].join(' ')
103548
- },
103549
- ax: {
103550
- valType: 'number',
103551
- description: [
103552
- 'Sets the x component of the arrow tail about the arrow head (in pixels).'
103553
- ].join(' ')
103554
- },
103555
- ay: {
103556
- valType: 'number',
103557
- description: [
103558
- 'Sets the y component of the arrow tail about the arrow head (in pixels).'
103559
- ].join(' ')
103560
- },
103561
-
103562
- xanchor: annAttrs.xanchor,
103563
- xshift: annAttrs.xshift,
103564
- yanchor: annAttrs.yanchor,
103565
- yshift: annAttrs.yshift,
103566
-
103567
- text: annAttrs.text,
103568
- textangle: annAttrs.textangle,
103569
- font: annAttrs.font,
103570
- width: annAttrs.width,
103571
- height: annAttrs.height,
103572
- opacity: annAttrs.opacity,
103573
- align: annAttrs.align,
103574
- valign: annAttrs.valign,
103575
- bgcolor: annAttrs.bgcolor,
103576
- bordercolor: annAttrs.bordercolor,
103577
- borderpad: annAttrs.borderpad,
103578
- borderwidth: annAttrs.borderwidth,
103579
- showarrow: annAttrs.showarrow,
103580
- arrowcolor: annAttrs.arrowcolor,
103581
- arrowhead: annAttrs.arrowhead,
103582
- startarrowhead: annAttrs.startarrowhead,
103583
- arrowside: annAttrs.arrowside,
103584
- arrowsize: annAttrs.arrowsize,
103585
- startarrowsize: annAttrs.startarrowsize,
103586
- arrowwidth: annAttrs.arrowwidth,
103587
- standoff: annAttrs.standoff,
103588
- startstandoff: annAttrs.startstandoff,
103589
- hovertext: annAttrs.hovertext,
103590
- hoverlabel: annAttrs.hoverlabel,
103591
- captureevents: annAttrs.captureevents,
103592
-
103593
- // maybes later?
103594
- // clicktoshow: annAttrs.clicktoshow,
103595
- // xclick: annAttrs.xclick,
103596
- // yclick: annAttrs.yclick,
103597
-
103598
- // not needed!
103599
- // axref: 'pixel'
103600
- // ayref: 'pixel'
103601
- // xref: 'x'
103602
- // yref: 'y
103603
- // zref: 'z'
103604
- }), 'calc', 'from-root');
103605
-
103606
-
103607
- /***/ }),
103608
-
103609
- /***/ 58121:
103610
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
103611
-
103612
-
103613
-
103614
- var Lib = __webpack_require__(30991);
103615
- var Axes = __webpack_require__(15076);
103616
-
103617
- module.exports = function convert(scene) {
103618
- var fullSceneLayout = scene.fullSceneLayout;
103619
- var anns = fullSceneLayout.annotations;
103620
-
103621
- for(var i = 0; i < anns.length; i++) {
103622
- mockAnnAxes(anns[i], scene);
103623
- }
103624
-
103625
- scene.fullLayout._infolayer
103626
- .selectAll('.annotation-' + scene.id)
103627
- .remove();
103628
- };
103629
-
103630
- function mockAnnAxes(ann, scene) {
103631
- var fullSceneLayout = scene.fullSceneLayout;
103632
- var domain = fullSceneLayout.domain;
103633
- var size = scene.fullLayout._size;
103634
-
103635
- var base = {
103636
- // this gets fill in on render
103637
- pdata: null,
103638
-
103639
- // to get setConvert to not execute cleanly
103640
- type: 'linear',
103641
-
103642
- // don't try to update them on `editable: true`
103643
- autorange: false,
103644
-
103645
- // set infinite range so that annotation draw routine
103646
- // does not try to remove 'outside-range' annotations,
103647
- // this case is handled in the render loop
103648
- range: [-Infinity, Infinity]
103649
- };
103650
-
103651
- ann._xa = {};
103652
- Lib.extendFlat(ann._xa, base);
103653
- Axes.setConvert(ann._xa);
103654
- ann._xa._offset = size.l + domain.x[0] * size.w;
103655
- ann._xa.l2p = function() {
103656
- return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
103657
- };
103658
-
103659
- ann._ya = {};
103660
- Lib.extendFlat(ann._ya, base);
103661
- Axes.setConvert(ann._ya);
103662
- ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
103663
- ann._ya.l2p = function() {
103664
- return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
103665
- };
103666
- }
103667
-
103668
-
103669
- /***/ }),
103670
-
103671
- /***/ 41926:
103672
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
103673
-
103674
-
103675
-
103676
- var Lib = __webpack_require__(30991);
103677
- var Axes = __webpack_require__(15076);
103678
- var handleArrayContainerDefaults = __webpack_require__(21238);
103679
- var handleAnnotationCommonDefaults = __webpack_require__(84081);
103680
- var attributes = __webpack_require__(9793);
103681
-
103682
- module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
103683
- handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
103684
- name: 'annotations',
103685
- handleItemDefaults: handleAnnotationDefaults,
103686
- fullLayout: opts.fullLayout
103687
- });
103688
- };
103689
-
103690
- function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
103691
- function coerce(attr, dflt) {
103692
- return Lib.coerce(annIn, annOut, attributes, attr, dflt);
103693
- }
103694
-
103695
- function coercePosition(axLetter) {
103696
- var axName = axLetter + 'axis';
103697
-
103698
- // mock in such way that getFromId grabs correct 3D axis
103699
- var gdMock = { _fullLayout: {} };
103700
- gdMock._fullLayout[axName] = sceneLayout[axName];
103701
-
103702
- return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
103703
- }
103704
-
103705
-
103706
- var visible = coerce('visible');
103707
- if(!visible) return;
103708
-
103709
- handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
103710
-
103711
- coercePosition('x');
103712
- coercePosition('y');
103713
- coercePosition('z');
103714
-
103715
- // if you have one coordinate you should all three
103716
- Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
103717
-
103718
- // hard-set here for completeness
103719
- annOut.xref = 'x';
103720
- annOut.yref = 'y';
103721
- annOut.zref = 'z';
103722
-
103723
- coerce('xanchor');
103724
- coerce('yanchor');
103725
- coerce('xshift');
103726
- coerce('yshift');
103727
-
103728
- if(annOut.showarrow) {
103729
- annOut.axref = 'pixel';
103730
- annOut.ayref = 'pixel';
103731
-
103732
- // TODO maybe default values should be bigger than the 2D case?
103733
- coerce('ax', -10);
103734
- coerce('ay', -30);
103735
-
103736
- // if you have one part of arrow length you should have both
103737
- Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
103738
- }
103739
- }
103740
-
103741
-
103742
- /***/ }),
103743
-
103744
- /***/ 13802:
103745
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
103746
-
103747
-
103748
-
103749
- var drawRaw = (__webpack_require__(47995).drawRaw);
103750
- var project = __webpack_require__(51344);
103751
- var axLetters = ['x', 'y', 'z'];
103752
-
103753
- module.exports = function draw(scene) {
103754
- var fullSceneLayout = scene.fullSceneLayout;
103755
- var dataScale = scene.dataScale;
103756
- var anns = fullSceneLayout.annotations;
103757
-
103758
- for(var i = 0; i < anns.length; i++) {
103759
- var ann = anns[i];
103760
- var annotationIsOffscreen = false;
103761
-
103762
- for(var j = 0; j < 3; j++) {
103763
- var axLetter = axLetters[j];
103764
- var pos = ann[axLetter];
103765
- var ax = fullSceneLayout[axLetter + 'axis'];
103766
- var posFraction = ax.r2fraction(pos);
103767
-
103768
- if(posFraction < 0 || posFraction > 1) {
103769
- annotationIsOffscreen = true;
103770
- break;
103771
- }
103772
- }
103773
-
103774
- if(annotationIsOffscreen) {
103775
- scene.fullLayout._infolayer
103776
- .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
103777
- .remove();
103778
- } else {
103779
- ann._pdata = project(scene.glplot.cameraParams, [
103780
- fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
103781
- fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
103782
- fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
103783
- ]);
103784
-
103785
- drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
103786
- }
103787
- }
103788
- };
103789
-
103790
-
103791
- /***/ }),
103792
-
103793
- /***/ 86578:
103794
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
103795
-
103796
-
103797
-
103798
- var Registry = __webpack_require__(13936);
103799
- var Lib = __webpack_require__(30991);
103800
-
103801
- module.exports = {
103802
- moduleType: 'component',
103803
- name: 'annotations3d',
103804
-
103805
- schema: {
103806
- subplots: {
103807
- scene: {annotations: __webpack_require__(9793)}
103808
- }
103809
- },
103810
-
103811
- layoutAttributes: __webpack_require__(9793),
103812
- handleDefaults: __webpack_require__(41926),
103813
- includeBasePlot: includeGL3D,
103814
-
103815
- convert: __webpack_require__(58121),
103816
- draw: __webpack_require__(13802)
103817
- };
103818
-
103819
- function includeGL3D(layoutIn, layoutOut) {
103820
- var GL3D = Registry.subplotsRegistry.gl3d;
103821
- if(!GL3D) return;
103822
-
103823
- var attrRegex = GL3D.attrRegex;
103824
-
103825
- var keys = Object.keys(layoutIn);
103826
- for(var i = 0; i < keys.length; i++) {
103827
- var k = keys[i];
103828
- if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
103829
- Lib.pushUnique(layoutOut._basePlotModules, GL3D);
103830
- Lib.pushUnique(layoutOut._subplots.gl3d, k);
103831
- }
103832
- }
103833
- }
103834
-
103835
-
103836
103836
  /***/ }),
103837
103837
 
103838
103838
  /***/ 27639:
@@ -202065,6 +202065,595 @@ function isValidZ(z) {
202065
202065
  }
202066
202066
 
202067
202067
 
202068
+ /***/ }),
202069
+
202070
+ /***/ 42124:
202071
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202072
+
202073
+
202074
+
202075
+ var histogramAttrs = __webpack_require__(71250);
202076
+ var makeBinAttrs = __webpack_require__(9284);
202077
+ var heatmapAttrs = __webpack_require__(68300);
202078
+ var baseAttrs = __webpack_require__(35667);
202079
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
202080
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
202081
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
202082
+ var colorScaleAttrs = __webpack_require__(17957);
202083
+
202084
+ var extendFlat = (__webpack_require__(91307).extendFlat);
202085
+
202086
+ module.exports = extendFlat(
202087
+ {
202088
+ x: histogramAttrs.x,
202089
+ y: histogramAttrs.y,
202090
+
202091
+ z: {
202092
+ valType: 'data_array',
202093
+ editType: 'calc',
202094
+ description: 'Sets the aggregation data.'
202095
+ },
202096
+ marker: {
202097
+ color: {
202098
+ valType: 'data_array',
202099
+ editType: 'calc',
202100
+ description: 'Sets the aggregation data.'
202101
+ },
202102
+ editType: 'calc'
202103
+ },
202104
+
202105
+ histnorm: histogramAttrs.histnorm,
202106
+ histfunc: histogramAttrs.histfunc,
202107
+ nbinsx: histogramAttrs.nbinsx,
202108
+ xbins: makeBinAttrs('x'),
202109
+ nbinsy: histogramAttrs.nbinsy,
202110
+ ybins: makeBinAttrs('y'),
202111
+ autobinx: histogramAttrs.autobinx,
202112
+ autobiny: histogramAttrs.autobiny,
202113
+
202114
+ bingroup: extendFlat({}, histogramAttrs.bingroup, {
202115
+ description: [
202116
+ 'Set the `xbingroup` and `ybingroup` default prefix',
202117
+ 'For example, setting a `bingroup` of *1* on two histogram2d traces',
202118
+ 'will make them their x-bins and y-bins match separately.'
202119
+ ].join(' ')
202120
+ }),
202121
+ xbingroup: extendFlat({}, histogramAttrs.bingroup, {
202122
+ description: [
202123
+ 'Set a group of histogram traces which will have compatible x-bin settings.',
202124
+ 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
202125
+ '(on axes of the same axis type) can have compatible x-bin settings.',
202126
+ 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
202127
+ ].join(' ')
202128
+ }),
202129
+ ybingroup: extendFlat({}, histogramAttrs.bingroup, {
202130
+ description: [
202131
+ 'Set a group of histogram traces which will have compatible y-bin settings.',
202132
+ 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
202133
+ '(on axes of the same axis type) can have compatible y-bin settings.',
202134
+ 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
202135
+ ].join(' ')
202136
+ }),
202137
+
202138
+ xgap: heatmapAttrs.xgap,
202139
+ ygap: heatmapAttrs.ygap,
202140
+ zsmooth: heatmapAttrs.zsmooth,
202141
+ xhoverformat: axisHoverFormat('x'),
202142
+ yhoverformat: axisHoverFormat('y'),
202143
+ zhoverformat: axisHoverFormat('z', 1),
202144
+ hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
202145
+ texttemplate: texttemplateAttrs({
202146
+ arrayOk: false,
202147
+ editType: 'plot'
202148
+ }, {
202149
+ keys: 'z'
202150
+ }),
202151
+ textfont: heatmapAttrs.textfont,
202152
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
202153
+ },
202154
+ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
202155
+ );
202156
+
202157
+
202158
+ /***/ }),
202159
+
202160
+ /***/ 32492:
202161
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202162
+
202163
+
202164
+
202165
+ var Lib = __webpack_require__(30991);
202166
+ var Axes = __webpack_require__(15076);
202167
+
202168
+ var binFunctions = __webpack_require__(47260);
202169
+ var normFunctions = __webpack_require__(855);
202170
+ var doAvg = __webpack_require__(26756);
202171
+ var getBinSpanLabelRound = __webpack_require__(41574);
202172
+ var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
202173
+
202174
+ module.exports = function calc(gd, trace) {
202175
+ var xa = Axes.getFromId(gd, trace.xaxis);
202176
+ var ya = Axes.getFromId(gd, trace.yaxis);
202177
+
202178
+ var xcalendar = trace.xcalendar;
202179
+ var ycalendar = trace.ycalendar;
202180
+ var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
202181
+ var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
202182
+ var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
202183
+ var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
202184
+
202185
+ var i, j, n, m;
202186
+
202187
+ // calculate the bins
202188
+ var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
202189
+ var xBinSpec = xBinsAndPos[0];
202190
+ var xPos0 = xBinsAndPos[1];
202191
+ var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
202192
+ var yBinSpec = yBinsAndPos[0];
202193
+ var yPos0 = yBinsAndPos[1];
202194
+
202195
+ var serieslen = trace._length;
202196
+ if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
202197
+ if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
202198
+
202199
+ // make the empty bin array & scale the map
202200
+ var z = [];
202201
+ var onecol = [];
202202
+ var zerocol = [];
202203
+ var nonuniformBinsX = typeof xBinSpec.size === 'string';
202204
+ var nonuniformBinsY = typeof yBinSpec.size === 'string';
202205
+ var xEdges = [];
202206
+ var yEdges = [];
202207
+ var xbins = nonuniformBinsX ? xEdges : xBinSpec;
202208
+ var ybins = nonuniformBinsY ? yEdges : yBinSpec;
202209
+ var total = 0;
202210
+ var counts = [];
202211
+ var inputPoints = [];
202212
+ var norm = trace.histnorm;
202213
+ var func = trace.histfunc;
202214
+ var densitynorm = norm.indexOf('density') !== -1;
202215
+ var extremefunc = func === 'max' || func === 'min';
202216
+ var sizeinit = extremefunc ? null : 0;
202217
+ var binfunc = binFunctions.count;
202218
+ var normfunc = normFunctions[norm];
202219
+ var doavg = false;
202220
+ var xinc = [];
202221
+ var yinc = [];
202222
+
202223
+ // set a binning function other than count?
202224
+ // for binning functions: check first for 'z',
202225
+ // then 'mc' in case we had a colored scatter plot
202226
+ // and want to transfer these colors to the 2D histo
202227
+ // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
202228
+ var rawCounterData = ('z' in trace) ?
202229
+ trace.z :
202230
+ (('marker' in trace && Array.isArray(trace.marker.color)) ?
202231
+ trace.marker.color : '');
202232
+ if(rawCounterData && func !== 'count') {
202233
+ doavg = func === 'avg';
202234
+ binfunc = binFunctions[func];
202235
+ }
202236
+
202237
+ // decrease end a little in case of rounding errors
202238
+ var xBinSize = xBinSpec.size;
202239
+ var xBinStart = xr2c(xBinSpec.start);
202240
+ var xBinEnd = xr2c(xBinSpec.end) +
202241
+ (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
202242
+
202243
+ for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
202244
+ onecol.push(sizeinit);
202245
+ xEdges.push(i);
202246
+ if(doavg) zerocol.push(0);
202247
+ }
202248
+ xEdges.push(i);
202249
+
202250
+ var nx = onecol.length;
202251
+ var dx = (i - xBinStart) / nx;
202252
+ var x0 = xc2r(xBinStart + dx / 2);
202253
+
202254
+ var yBinSize = yBinSpec.size;
202255
+ var yBinStart = yr2c(yBinSpec.start);
202256
+ var yBinEnd = yr2c(yBinSpec.end) +
202257
+ (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
202258
+
202259
+ for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
202260
+ z.push(onecol.slice());
202261
+ yEdges.push(i);
202262
+ var ipCol = new Array(nx);
202263
+ for(j = 0; j < nx; j++) ipCol[j] = [];
202264
+ inputPoints.push(ipCol);
202265
+ if(doavg) counts.push(zerocol.slice());
202266
+ }
202267
+ yEdges.push(i);
202268
+
202269
+ var ny = z.length;
202270
+ var dy = (i - yBinStart) / ny;
202271
+ var y0 = yc2r(yBinStart + dy / 2);
202272
+
202273
+ if(densitynorm) {
202274
+ xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
202275
+ yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
202276
+ }
202277
+
202278
+ // for date axes we need bin bounds to be calcdata. For nonuniform bins
202279
+ // we already have this, but uniform with start/end/size they're still strings.
202280
+ if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
202281
+ if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
202282
+
202283
+ // put data into bins
202284
+ var uniqueValsPerX = true;
202285
+ var uniqueValsPerY = true;
202286
+ var xVals = new Array(nx);
202287
+ var yVals = new Array(ny);
202288
+ var xGapLow = Infinity;
202289
+ var xGapHigh = Infinity;
202290
+ var yGapLow = Infinity;
202291
+ var yGapHigh = Infinity;
202292
+ for(i = 0; i < serieslen; i++) {
202293
+ var xi = xPos0[i];
202294
+ var yi = yPos0[i];
202295
+ n = Lib.findBin(xi, xbins);
202296
+ m = Lib.findBin(yi, ybins);
202297
+ if(n >= 0 && n < nx && m >= 0 && m < ny) {
202298
+ total += binfunc(n, i, z[m], rawCounterData, counts[m]);
202299
+ inputPoints[m][n].push(i);
202300
+
202301
+ if(uniqueValsPerX) {
202302
+ if(xVals[n] === undefined) xVals[n] = xi;
202303
+ else if(xVals[n] !== xi) uniqueValsPerX = false;
202304
+ }
202305
+ if(uniqueValsPerY) {
202306
+ if(yVals[m] === undefined) yVals[m] = yi;
202307
+ else if(yVals[m] !== yi) uniqueValsPerY = false;
202308
+ }
202309
+
202310
+ xGapLow = Math.min(xGapLow, xi - xEdges[n]);
202311
+ xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
202312
+ yGapLow = Math.min(yGapLow, yi - yEdges[m]);
202313
+ yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
202314
+ }
202315
+ }
202316
+ // normalize, if needed
202317
+ if(doavg) {
202318
+ for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
202319
+ }
202320
+ if(normfunc) {
202321
+ for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
202322
+ }
202323
+
202324
+ return {
202325
+ x: xPos0,
202326
+ xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
202327
+ x0: x0,
202328
+ dx: dx,
202329
+ y: yPos0,
202330
+ yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
202331
+ y0: y0,
202332
+ dy: dy,
202333
+ z: z,
202334
+ pts: inputPoints
202335
+ };
202336
+ };
202337
+
202338
+ function makeIncrements(len, bins, dv, nonuniform) {
202339
+ var out = new Array(len);
202340
+ var i;
202341
+ if(nonuniform) {
202342
+ for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
202343
+ } else {
202344
+ var inc = 1 / dv;
202345
+ for(i = 0; i < len; i++) out[i] = inc;
202346
+ }
202347
+ return out;
202348
+ }
202349
+
202350
+ function binsToCalc(r2c, bins) {
202351
+ return {
202352
+ start: r2c(bins.start),
202353
+ end: r2c(bins.end),
202354
+ size: bins.size
202355
+ };
202356
+ }
202357
+
202358
+ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
202359
+ var i;
202360
+ var len = edges.length - 1;
202361
+ var out = new Array(len);
202362
+ var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
202363
+
202364
+ for(i = 0; i < len; i++) {
202365
+ var v = (uniqueVals || [])[i];
202366
+ out[i] = v === undefined ?
202367
+ [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
202368
+ [v, v];
202369
+ }
202370
+ return out;
202371
+ }
202372
+
202373
+
202374
+ /***/ }),
202375
+
202376
+ /***/ 15611:
202377
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202378
+
202379
+
202380
+
202381
+ var Lib = __webpack_require__(30991);
202382
+
202383
+ var handleSampleDefaults = __webpack_require__(6236);
202384
+ var handleStyleDefaults = __webpack_require__(25157);
202385
+ var colorscaleDefaults = __webpack_require__(13682);
202386
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
202387
+ var attributes = __webpack_require__(42124);
202388
+
202389
+
202390
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
202391
+ function coerce(attr, dflt) {
202392
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
202393
+ }
202394
+
202395
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
202396
+ if(traceOut.visible === false) return;
202397
+
202398
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
202399
+ colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
202400
+ coerce('hovertemplate');
202401
+
202402
+ handleHeatmapLabelDefaults(coerce, layout);
202403
+
202404
+ coerce('xhoverformat');
202405
+ coerce('yhoverformat');
202406
+ };
202407
+
202408
+
202409
+ /***/ }),
202410
+
202411
+ /***/ 94587:
202412
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202413
+
202414
+
202415
+
202416
+ var heatmapHover = __webpack_require__(85243);
202417
+ var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
202418
+
202419
+ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
202420
+ var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
202421
+
202422
+ if(!pts) return;
202423
+
202424
+ pointData = pts[0];
202425
+ var indices = pointData.index;
202426
+ var ny = indices[0];
202427
+ var nx = indices[1];
202428
+ var cd0 = pointData.cd[0];
202429
+ var trace = cd0.trace;
202430
+ var xRange = cd0.xRanges[nx];
202431
+ var yRange = cd0.yRanges[ny];
202432
+
202433
+ pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
202434
+ pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
202435
+
202436
+ return pts;
202437
+ };
202438
+
202439
+
202440
+ /***/ }),
202441
+
202442
+ /***/ 3617:
202443
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202444
+
202445
+
202446
+
202447
+ module.exports = {
202448
+ attributes: __webpack_require__(42124),
202449
+ supplyDefaults: __webpack_require__(15611),
202450
+ crossTraceDefaults: __webpack_require__(34294),
202451
+ calc: __webpack_require__(91980),
202452
+ plot: __webpack_require__(29406),
202453
+ layerName: 'heatmaplayer',
202454
+ colorbar: __webpack_require__(90165),
202455
+ style: __webpack_require__(58756),
202456
+ hoverPoints: __webpack_require__(94587),
202457
+ eventData: __webpack_require__(63870),
202458
+
202459
+ moduleType: 'trace',
202460
+ name: 'histogram2d',
202461
+ basePlotModule: __webpack_require__(47885),
202462
+ categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
202463
+ meta: {
202464
+ hrName: 'histogram_2d',
202465
+ description: [
202466
+ 'The sample data from which statistics are computed is set in `x`',
202467
+ 'and `y` (where `x` and `y` represent marginal distributions,',
202468
+ 'binning is set in `xbins` and `ybins` in this case)',
202469
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
202470
+ 'binning is set by `x` and `y` in this case).',
202471
+ 'The resulting distribution is visualized as a heatmap.'
202472
+ ].join(' ')
202473
+ }
202474
+ };
202475
+
202476
+
202477
+ /***/ }),
202478
+
202479
+ /***/ 6236:
202480
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202481
+
202482
+
202483
+
202484
+ var Registry = __webpack_require__(13936);
202485
+ var Lib = __webpack_require__(30991);
202486
+
202487
+ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
202488
+ var x = coerce('x');
202489
+ var y = coerce('y');
202490
+ var xlen = Lib.minRowLength(x);
202491
+ var ylen = Lib.minRowLength(y);
202492
+
202493
+ // we could try to accept x0 and dx, etc...
202494
+ // but that's a pretty weird use case.
202495
+ // for now require both x and y explicitly specified.
202496
+ if(!xlen || !ylen) {
202497
+ traceOut.visible = false;
202498
+ return;
202499
+ }
202500
+
202501
+ traceOut._length = Math.min(xlen, ylen);
202502
+
202503
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
202504
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
202505
+
202506
+ // if marker.color is an array, we can use it in aggregation instead of z
202507
+ var hasAggregationData = coerce('z') || coerce('marker.color');
202508
+
202509
+ if(hasAggregationData) coerce('histfunc');
202510
+ coerce('histnorm');
202511
+
202512
+ // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
202513
+ // autobin(x|y) are only included here to appease Plotly.validate
202514
+ coerce('autobinx');
202515
+ coerce('autobiny');
202516
+ };
202517
+
202518
+
202519
+ /***/ }),
202520
+
202521
+ /***/ 34872:
202522
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202523
+
202524
+
202525
+
202526
+ var histogram2dAttrs = __webpack_require__(42124);
202527
+ var contourAttrs = __webpack_require__(70318);
202528
+ var colorScaleAttrs = __webpack_require__(17957);
202529
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
202530
+
202531
+ var extendFlat = (__webpack_require__(91307).extendFlat);
202532
+
202533
+ module.exports = extendFlat({
202534
+ x: histogram2dAttrs.x,
202535
+ y: histogram2dAttrs.y,
202536
+ z: histogram2dAttrs.z,
202537
+ marker: histogram2dAttrs.marker,
202538
+
202539
+ histnorm: histogram2dAttrs.histnorm,
202540
+ histfunc: histogram2dAttrs.histfunc,
202541
+ nbinsx: histogram2dAttrs.nbinsx,
202542
+ xbins: histogram2dAttrs.xbins,
202543
+ nbinsy: histogram2dAttrs.nbinsy,
202544
+ ybins: histogram2dAttrs.ybins,
202545
+ autobinx: histogram2dAttrs.autobinx,
202546
+ autobiny: histogram2dAttrs.autobiny,
202547
+
202548
+ bingroup: histogram2dAttrs.bingroup,
202549
+ xbingroup: histogram2dAttrs.xbingroup,
202550
+ ybingroup: histogram2dAttrs.ybingroup,
202551
+
202552
+ autocontour: contourAttrs.autocontour,
202553
+ ncontours: contourAttrs.ncontours,
202554
+ contours: contourAttrs.contours,
202555
+ line: {
202556
+ color: contourAttrs.line.color,
202557
+ width: extendFlat({}, contourAttrs.line.width, {
202558
+ dflt: 0.5,
202559
+ description: 'Sets the contour line width in (in px)'
202560
+ }),
202561
+ dash: contourAttrs.line.dash,
202562
+ smoothing: contourAttrs.line.smoothing,
202563
+ editType: 'plot'
202564
+ },
202565
+ xhoverformat: axisHoverFormat('x'),
202566
+ yhoverformat: axisHoverFormat('y'),
202567
+ zhoverformat: axisHoverFormat('z', 1),
202568
+ hovertemplate: histogram2dAttrs.hovertemplate,
202569
+ texttemplate: contourAttrs.texttemplate,
202570
+ textfont: contourAttrs.textfont
202571
+ },
202572
+ colorScaleAttrs('', {
202573
+ cLetter: 'z',
202574
+ editTypeOverride: 'calc'
202575
+ })
202576
+ );
202577
+
202578
+
202579
+ /***/ }),
202580
+
202581
+ /***/ 14319:
202582
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202583
+
202584
+
202585
+
202586
+ var Lib = __webpack_require__(30991);
202587
+
202588
+ var handleSampleDefaults = __webpack_require__(6236);
202589
+ var handleContoursDefaults = __webpack_require__(657);
202590
+ var handleStyleDefaults = __webpack_require__(74619);
202591
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
202592
+ var attributes = __webpack_require__(34872);
202593
+
202594
+
202595
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
202596
+ function coerce(attr, dflt) {
202597
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
202598
+ }
202599
+
202600
+ function coerce2(attr) {
202601
+ return Lib.coerce2(traceIn, traceOut, attributes, attr);
202602
+ }
202603
+
202604
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
202605
+ if(traceOut.visible === false) return;
202606
+
202607
+ handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
202608
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
202609
+ coerce('xhoverformat');
202610
+ coerce('yhoverformat');
202611
+ coerce('hovertemplate');
202612
+ if(
202613
+ traceOut.contours &&
202614
+ traceOut.contours.coloring === 'heatmap'
202615
+ ) {
202616
+ handleHeatmapLabelDefaults(coerce, layout);
202617
+ }
202618
+ };
202619
+
202620
+
202621
+ /***/ }),
202622
+
202623
+ /***/ 60613:
202624
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
202625
+
202626
+
202627
+
202628
+ module.exports = {
202629
+ attributes: __webpack_require__(34872),
202630
+ supplyDefaults: __webpack_require__(14319),
202631
+ crossTraceDefaults: __webpack_require__(34294),
202632
+ calc: __webpack_require__(3274),
202633
+ plot: (__webpack_require__(32664).plot),
202634
+ layerName: 'contourlayer',
202635
+ style: __webpack_require__(72690),
202636
+ colorbar: __webpack_require__(70307),
202637
+ hoverPoints: __webpack_require__(52353),
202638
+
202639
+ moduleType: 'trace',
202640
+ name: 'histogram2dcontour',
202641
+ basePlotModule: __webpack_require__(47885),
202642
+ categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
202643
+ meta: {
202644
+ hrName: 'histogram_2d_contour',
202645
+ description: [
202646
+ 'The sample data from which statistics are computed is set in `x`',
202647
+ 'and `y` (where `x` and `y` represent marginal distributions,',
202648
+ 'binning is set in `xbins` and `ybins` in this case)',
202649
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
202650
+ 'binning is set by `x` and `y` in this case).',
202651
+ 'The resulting distribution is visualized as a contour plot.'
202652
+ ].join(' ')
202653
+ }
202654
+ };
202655
+
202656
+
202068
202657
  /***/ }),
202069
202658
 
202070
202659
  /***/ 71250:
@@ -203773,595 +204362,6 @@ module.exports = {
203773
204362
  };
203774
204363
 
203775
204364
 
203776
- /***/ }),
203777
-
203778
- /***/ 42124:
203779
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
203780
-
203781
-
203782
-
203783
- var histogramAttrs = __webpack_require__(71250);
203784
- var makeBinAttrs = __webpack_require__(9284);
203785
- var heatmapAttrs = __webpack_require__(68300);
203786
- var baseAttrs = __webpack_require__(35667);
203787
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
203788
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
203789
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
203790
- var colorScaleAttrs = __webpack_require__(17957);
203791
-
203792
- var extendFlat = (__webpack_require__(91307).extendFlat);
203793
-
203794
- module.exports = extendFlat(
203795
- {
203796
- x: histogramAttrs.x,
203797
- y: histogramAttrs.y,
203798
-
203799
- z: {
203800
- valType: 'data_array',
203801
- editType: 'calc',
203802
- description: 'Sets the aggregation data.'
203803
- },
203804
- marker: {
203805
- color: {
203806
- valType: 'data_array',
203807
- editType: 'calc',
203808
- description: 'Sets the aggregation data.'
203809
- },
203810
- editType: 'calc'
203811
- },
203812
-
203813
- histnorm: histogramAttrs.histnorm,
203814
- histfunc: histogramAttrs.histfunc,
203815
- nbinsx: histogramAttrs.nbinsx,
203816
- xbins: makeBinAttrs('x'),
203817
- nbinsy: histogramAttrs.nbinsy,
203818
- ybins: makeBinAttrs('y'),
203819
- autobinx: histogramAttrs.autobinx,
203820
- autobiny: histogramAttrs.autobiny,
203821
-
203822
- bingroup: extendFlat({}, histogramAttrs.bingroup, {
203823
- description: [
203824
- 'Set the `xbingroup` and `ybingroup` default prefix',
203825
- 'For example, setting a `bingroup` of *1* on two histogram2d traces',
203826
- 'will make them their x-bins and y-bins match separately.'
203827
- ].join(' ')
203828
- }),
203829
- xbingroup: extendFlat({}, histogramAttrs.bingroup, {
203830
- description: [
203831
- 'Set a group of histogram traces which will have compatible x-bin settings.',
203832
- 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
203833
- '(on axes of the same axis type) can have compatible x-bin settings.',
203834
- 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
203835
- ].join(' ')
203836
- }),
203837
- ybingroup: extendFlat({}, histogramAttrs.bingroup, {
203838
- description: [
203839
- 'Set a group of histogram traces which will have compatible y-bin settings.',
203840
- 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
203841
- '(on axes of the same axis type) can have compatible y-bin settings.',
203842
- 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
203843
- ].join(' ')
203844
- }),
203845
-
203846
- xgap: heatmapAttrs.xgap,
203847
- ygap: heatmapAttrs.ygap,
203848
- zsmooth: heatmapAttrs.zsmooth,
203849
- xhoverformat: axisHoverFormat('x'),
203850
- yhoverformat: axisHoverFormat('y'),
203851
- zhoverformat: axisHoverFormat('z', 1),
203852
- hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
203853
- texttemplate: texttemplateAttrs({
203854
- arrayOk: false,
203855
- editType: 'plot'
203856
- }, {
203857
- keys: 'z'
203858
- }),
203859
- textfont: heatmapAttrs.textfont,
203860
- showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
203861
- },
203862
- colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
203863
- );
203864
-
203865
-
203866
- /***/ }),
203867
-
203868
- /***/ 32492:
203869
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
203870
-
203871
-
203872
-
203873
- var Lib = __webpack_require__(30991);
203874
- var Axes = __webpack_require__(15076);
203875
-
203876
- var binFunctions = __webpack_require__(47260);
203877
- var normFunctions = __webpack_require__(855);
203878
- var doAvg = __webpack_require__(26756);
203879
- var getBinSpanLabelRound = __webpack_require__(41574);
203880
- var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
203881
-
203882
- module.exports = function calc(gd, trace) {
203883
- var xa = Axes.getFromId(gd, trace.xaxis);
203884
- var ya = Axes.getFromId(gd, trace.yaxis);
203885
-
203886
- var xcalendar = trace.xcalendar;
203887
- var ycalendar = trace.ycalendar;
203888
- var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
203889
- var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
203890
- var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
203891
- var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
203892
-
203893
- var i, j, n, m;
203894
-
203895
- // calculate the bins
203896
- var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
203897
- var xBinSpec = xBinsAndPos[0];
203898
- var xPos0 = xBinsAndPos[1];
203899
- var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
203900
- var yBinSpec = yBinsAndPos[0];
203901
- var yPos0 = yBinsAndPos[1];
203902
-
203903
- var serieslen = trace._length;
203904
- if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
203905
- if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
203906
-
203907
- // make the empty bin array & scale the map
203908
- var z = [];
203909
- var onecol = [];
203910
- var zerocol = [];
203911
- var nonuniformBinsX = typeof xBinSpec.size === 'string';
203912
- var nonuniformBinsY = typeof yBinSpec.size === 'string';
203913
- var xEdges = [];
203914
- var yEdges = [];
203915
- var xbins = nonuniformBinsX ? xEdges : xBinSpec;
203916
- var ybins = nonuniformBinsY ? yEdges : yBinSpec;
203917
- var total = 0;
203918
- var counts = [];
203919
- var inputPoints = [];
203920
- var norm = trace.histnorm;
203921
- var func = trace.histfunc;
203922
- var densitynorm = norm.indexOf('density') !== -1;
203923
- var extremefunc = func === 'max' || func === 'min';
203924
- var sizeinit = extremefunc ? null : 0;
203925
- var binfunc = binFunctions.count;
203926
- var normfunc = normFunctions[norm];
203927
- var doavg = false;
203928
- var xinc = [];
203929
- var yinc = [];
203930
-
203931
- // set a binning function other than count?
203932
- // for binning functions: check first for 'z',
203933
- // then 'mc' in case we had a colored scatter plot
203934
- // and want to transfer these colors to the 2D histo
203935
- // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
203936
- var rawCounterData = ('z' in trace) ?
203937
- trace.z :
203938
- (('marker' in trace && Array.isArray(trace.marker.color)) ?
203939
- trace.marker.color : '');
203940
- if(rawCounterData && func !== 'count') {
203941
- doavg = func === 'avg';
203942
- binfunc = binFunctions[func];
203943
- }
203944
-
203945
- // decrease end a little in case of rounding errors
203946
- var xBinSize = xBinSpec.size;
203947
- var xBinStart = xr2c(xBinSpec.start);
203948
- var xBinEnd = xr2c(xBinSpec.end) +
203949
- (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
203950
-
203951
- for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
203952
- onecol.push(sizeinit);
203953
- xEdges.push(i);
203954
- if(doavg) zerocol.push(0);
203955
- }
203956
- xEdges.push(i);
203957
-
203958
- var nx = onecol.length;
203959
- var dx = (i - xBinStart) / nx;
203960
- var x0 = xc2r(xBinStart + dx / 2);
203961
-
203962
- var yBinSize = yBinSpec.size;
203963
- var yBinStart = yr2c(yBinSpec.start);
203964
- var yBinEnd = yr2c(yBinSpec.end) +
203965
- (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
203966
-
203967
- for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
203968
- z.push(onecol.slice());
203969
- yEdges.push(i);
203970
- var ipCol = new Array(nx);
203971
- for(j = 0; j < nx; j++) ipCol[j] = [];
203972
- inputPoints.push(ipCol);
203973
- if(doavg) counts.push(zerocol.slice());
203974
- }
203975
- yEdges.push(i);
203976
-
203977
- var ny = z.length;
203978
- var dy = (i - yBinStart) / ny;
203979
- var y0 = yc2r(yBinStart + dy / 2);
203980
-
203981
- if(densitynorm) {
203982
- xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
203983
- yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
203984
- }
203985
-
203986
- // for date axes we need bin bounds to be calcdata. For nonuniform bins
203987
- // we already have this, but uniform with start/end/size they're still strings.
203988
- if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
203989
- if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
203990
-
203991
- // put data into bins
203992
- var uniqueValsPerX = true;
203993
- var uniqueValsPerY = true;
203994
- var xVals = new Array(nx);
203995
- var yVals = new Array(ny);
203996
- var xGapLow = Infinity;
203997
- var xGapHigh = Infinity;
203998
- var yGapLow = Infinity;
203999
- var yGapHigh = Infinity;
204000
- for(i = 0; i < serieslen; i++) {
204001
- var xi = xPos0[i];
204002
- var yi = yPos0[i];
204003
- n = Lib.findBin(xi, xbins);
204004
- m = Lib.findBin(yi, ybins);
204005
- if(n >= 0 && n < nx && m >= 0 && m < ny) {
204006
- total += binfunc(n, i, z[m], rawCounterData, counts[m]);
204007
- inputPoints[m][n].push(i);
204008
-
204009
- if(uniqueValsPerX) {
204010
- if(xVals[n] === undefined) xVals[n] = xi;
204011
- else if(xVals[n] !== xi) uniqueValsPerX = false;
204012
- }
204013
- if(uniqueValsPerY) {
204014
- if(yVals[m] === undefined) yVals[m] = yi;
204015
- else if(yVals[m] !== yi) uniqueValsPerY = false;
204016
- }
204017
-
204018
- xGapLow = Math.min(xGapLow, xi - xEdges[n]);
204019
- xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
204020
- yGapLow = Math.min(yGapLow, yi - yEdges[m]);
204021
- yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
204022
- }
204023
- }
204024
- // normalize, if needed
204025
- if(doavg) {
204026
- for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
204027
- }
204028
- if(normfunc) {
204029
- for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
204030
- }
204031
-
204032
- return {
204033
- x: xPos0,
204034
- xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
204035
- x0: x0,
204036
- dx: dx,
204037
- y: yPos0,
204038
- yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
204039
- y0: y0,
204040
- dy: dy,
204041
- z: z,
204042
- pts: inputPoints
204043
- };
204044
- };
204045
-
204046
- function makeIncrements(len, bins, dv, nonuniform) {
204047
- var out = new Array(len);
204048
- var i;
204049
- if(nonuniform) {
204050
- for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
204051
- } else {
204052
- var inc = 1 / dv;
204053
- for(i = 0; i < len; i++) out[i] = inc;
204054
- }
204055
- return out;
204056
- }
204057
-
204058
- function binsToCalc(r2c, bins) {
204059
- return {
204060
- start: r2c(bins.start),
204061
- end: r2c(bins.end),
204062
- size: bins.size
204063
- };
204064
- }
204065
-
204066
- function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
204067
- var i;
204068
- var len = edges.length - 1;
204069
- var out = new Array(len);
204070
- var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
204071
-
204072
- for(i = 0; i < len; i++) {
204073
- var v = (uniqueVals || [])[i];
204074
- out[i] = v === undefined ?
204075
- [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
204076
- [v, v];
204077
- }
204078
- return out;
204079
- }
204080
-
204081
-
204082
- /***/ }),
204083
-
204084
- /***/ 15611:
204085
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204086
-
204087
-
204088
-
204089
- var Lib = __webpack_require__(30991);
204090
-
204091
- var handleSampleDefaults = __webpack_require__(6236);
204092
- var handleStyleDefaults = __webpack_require__(25157);
204093
- var colorscaleDefaults = __webpack_require__(13682);
204094
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
204095
- var attributes = __webpack_require__(42124);
204096
-
204097
-
204098
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
204099
- function coerce(attr, dflt) {
204100
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
204101
- }
204102
-
204103
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
204104
- if(traceOut.visible === false) return;
204105
-
204106
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
204107
- colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
204108
- coerce('hovertemplate');
204109
-
204110
- handleHeatmapLabelDefaults(coerce, layout);
204111
-
204112
- coerce('xhoverformat');
204113
- coerce('yhoverformat');
204114
- };
204115
-
204116
-
204117
- /***/ }),
204118
-
204119
- /***/ 94587:
204120
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204121
-
204122
-
204123
-
204124
- var heatmapHover = __webpack_require__(85243);
204125
- var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
204126
-
204127
- module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
204128
- var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
204129
-
204130
- if(!pts) return;
204131
-
204132
- pointData = pts[0];
204133
- var indices = pointData.index;
204134
- var ny = indices[0];
204135
- var nx = indices[1];
204136
- var cd0 = pointData.cd[0];
204137
- var trace = cd0.trace;
204138
- var xRange = cd0.xRanges[nx];
204139
- var yRange = cd0.yRanges[ny];
204140
-
204141
- pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
204142
- pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
204143
-
204144
- return pts;
204145
- };
204146
-
204147
-
204148
- /***/ }),
204149
-
204150
- /***/ 3617:
204151
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204152
-
204153
-
204154
-
204155
- module.exports = {
204156
- attributes: __webpack_require__(42124),
204157
- supplyDefaults: __webpack_require__(15611),
204158
- crossTraceDefaults: __webpack_require__(34294),
204159
- calc: __webpack_require__(91980),
204160
- plot: __webpack_require__(29406),
204161
- layerName: 'heatmaplayer',
204162
- colorbar: __webpack_require__(90165),
204163
- style: __webpack_require__(58756),
204164
- hoverPoints: __webpack_require__(94587),
204165
- eventData: __webpack_require__(63870),
204166
-
204167
- moduleType: 'trace',
204168
- name: 'histogram2d',
204169
- basePlotModule: __webpack_require__(47885),
204170
- categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
204171
- meta: {
204172
- hrName: 'histogram_2d',
204173
- description: [
204174
- 'The sample data from which statistics are computed is set in `x`',
204175
- 'and `y` (where `x` and `y` represent marginal distributions,',
204176
- 'binning is set in `xbins` and `ybins` in this case)',
204177
- 'or `z` (where `z` represent the 2D distribution and binning set,',
204178
- 'binning is set by `x` and `y` in this case).',
204179
- 'The resulting distribution is visualized as a heatmap.'
204180
- ].join(' ')
204181
- }
204182
- };
204183
-
204184
-
204185
- /***/ }),
204186
-
204187
- /***/ 6236:
204188
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204189
-
204190
-
204191
-
204192
- var Registry = __webpack_require__(13936);
204193
- var Lib = __webpack_require__(30991);
204194
-
204195
- module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
204196
- var x = coerce('x');
204197
- var y = coerce('y');
204198
- var xlen = Lib.minRowLength(x);
204199
- var ylen = Lib.minRowLength(y);
204200
-
204201
- // we could try to accept x0 and dx, etc...
204202
- // but that's a pretty weird use case.
204203
- // for now require both x and y explicitly specified.
204204
- if(!xlen || !ylen) {
204205
- traceOut.visible = false;
204206
- return;
204207
- }
204208
-
204209
- traceOut._length = Math.min(xlen, ylen);
204210
-
204211
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
204212
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
204213
-
204214
- // if marker.color is an array, we can use it in aggregation instead of z
204215
- var hasAggregationData = coerce('z') || coerce('marker.color');
204216
-
204217
- if(hasAggregationData) coerce('histfunc');
204218
- coerce('histnorm');
204219
-
204220
- // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
204221
- // autobin(x|y) are only included here to appease Plotly.validate
204222
- coerce('autobinx');
204223
- coerce('autobiny');
204224
- };
204225
-
204226
-
204227
- /***/ }),
204228
-
204229
- /***/ 34872:
204230
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204231
-
204232
-
204233
-
204234
- var histogram2dAttrs = __webpack_require__(42124);
204235
- var contourAttrs = __webpack_require__(70318);
204236
- var colorScaleAttrs = __webpack_require__(17957);
204237
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
204238
-
204239
- var extendFlat = (__webpack_require__(91307).extendFlat);
204240
-
204241
- module.exports = extendFlat({
204242
- x: histogram2dAttrs.x,
204243
- y: histogram2dAttrs.y,
204244
- z: histogram2dAttrs.z,
204245
- marker: histogram2dAttrs.marker,
204246
-
204247
- histnorm: histogram2dAttrs.histnorm,
204248
- histfunc: histogram2dAttrs.histfunc,
204249
- nbinsx: histogram2dAttrs.nbinsx,
204250
- xbins: histogram2dAttrs.xbins,
204251
- nbinsy: histogram2dAttrs.nbinsy,
204252
- ybins: histogram2dAttrs.ybins,
204253
- autobinx: histogram2dAttrs.autobinx,
204254
- autobiny: histogram2dAttrs.autobiny,
204255
-
204256
- bingroup: histogram2dAttrs.bingroup,
204257
- xbingroup: histogram2dAttrs.xbingroup,
204258
- ybingroup: histogram2dAttrs.ybingroup,
204259
-
204260
- autocontour: contourAttrs.autocontour,
204261
- ncontours: contourAttrs.ncontours,
204262
- contours: contourAttrs.contours,
204263
- line: {
204264
- color: contourAttrs.line.color,
204265
- width: extendFlat({}, contourAttrs.line.width, {
204266
- dflt: 0.5,
204267
- description: 'Sets the contour line width in (in px)'
204268
- }),
204269
- dash: contourAttrs.line.dash,
204270
- smoothing: contourAttrs.line.smoothing,
204271
- editType: 'plot'
204272
- },
204273
- xhoverformat: axisHoverFormat('x'),
204274
- yhoverformat: axisHoverFormat('y'),
204275
- zhoverformat: axisHoverFormat('z', 1),
204276
- hovertemplate: histogram2dAttrs.hovertemplate,
204277
- texttemplate: contourAttrs.texttemplate,
204278
- textfont: contourAttrs.textfont
204279
- },
204280
- colorScaleAttrs('', {
204281
- cLetter: 'z',
204282
- editTypeOverride: 'calc'
204283
- })
204284
- );
204285
-
204286
-
204287
- /***/ }),
204288
-
204289
- /***/ 14319:
204290
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204291
-
204292
-
204293
-
204294
- var Lib = __webpack_require__(30991);
204295
-
204296
- var handleSampleDefaults = __webpack_require__(6236);
204297
- var handleContoursDefaults = __webpack_require__(657);
204298
- var handleStyleDefaults = __webpack_require__(74619);
204299
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
204300
- var attributes = __webpack_require__(34872);
204301
-
204302
-
204303
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
204304
- function coerce(attr, dflt) {
204305
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
204306
- }
204307
-
204308
- function coerce2(attr) {
204309
- return Lib.coerce2(traceIn, traceOut, attributes, attr);
204310
- }
204311
-
204312
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
204313
- if(traceOut.visible === false) return;
204314
-
204315
- handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
204316
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
204317
- coerce('xhoverformat');
204318
- coerce('yhoverformat');
204319
- coerce('hovertemplate');
204320
- if(
204321
- traceOut.contours &&
204322
- traceOut.contours.coloring === 'heatmap'
204323
- ) {
204324
- handleHeatmapLabelDefaults(coerce, layout);
204325
- }
204326
- };
204327
-
204328
-
204329
- /***/ }),
204330
-
204331
- /***/ 60613:
204332
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
204333
-
204334
-
204335
-
204336
- module.exports = {
204337
- attributes: __webpack_require__(34872),
204338
- supplyDefaults: __webpack_require__(14319),
204339
- crossTraceDefaults: __webpack_require__(34294),
204340
- calc: __webpack_require__(3274),
204341
- plot: (__webpack_require__(32664).plot),
204342
- layerName: 'contourlayer',
204343
- style: __webpack_require__(72690),
204344
- colorbar: __webpack_require__(70307),
204345
- hoverPoints: __webpack_require__(52353),
204346
-
204347
- moduleType: 'trace',
204348
- name: 'histogram2dcontour',
204349
- basePlotModule: __webpack_require__(47885),
204350
- categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
204351
- meta: {
204352
- hrName: 'histogram_2d_contour',
204353
- description: [
204354
- 'The sample data from which statistics are computed is set in `x`',
204355
- 'and `y` (where `x` and `y` represent marginal distributions,',
204356
- 'binning is set in `xbins` and `ybins` in this case)',
204357
- 'or `z` (where `z` represent the 2D distribution and binning set,',
204358
- 'binning is set by `x` and `y` in this case).',
204359
- 'The resulting distribution is visualized as a contour plot.'
204360
- ].join(' ')
204361
- }
204362
- };
204363
-
204364
-
204365
204365
  /***/ }),
204366
204366
 
204367
204367
  /***/ 48223:
@@ -220551,6 +220551,993 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
220551
220551
  };
220552
220552
 
220553
220553
 
220554
+ /***/ }),
220555
+
220556
+ /***/ 1015:
220557
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
220558
+
220559
+
220560
+
220561
+ var scatterAttrs = __webpack_require__(86854);
220562
+ var fontAttrs = __webpack_require__(70827);
220563
+ var colorAttributes = __webpack_require__(17957);
220564
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
220565
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
220566
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
220567
+ var baseAttrs = __webpack_require__(35667);
220568
+ var DASHES = __webpack_require__(68828);
220569
+
220570
+ var MARKER_SYMBOLS = __webpack_require__(98993);
220571
+ var extendFlat = (__webpack_require__(91307).extendFlat);
220572
+ var overrideAll = (__webpack_require__(70756).overrideAll);
220573
+ var sortObjectKeys = __webpack_require__(99124);
220574
+
220575
+ var scatterLineAttrs = scatterAttrs.line;
220576
+ var scatterMarkerAttrs = scatterAttrs.marker;
220577
+ var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
220578
+
220579
+ var lineAttrs = extendFlat({
220580
+ width: scatterLineAttrs.width,
220581
+ dash: {
220582
+ valType: 'enumerated',
220583
+ values: sortObjectKeys(DASHES),
220584
+ dflt: 'solid',
220585
+ description: 'Sets the dash style of the lines.'
220586
+ }
220587
+ }, colorAttributes('line'));
220588
+
220589
+ function makeProjectionAttr(axLetter) {
220590
+ return {
220591
+ show: {
220592
+ valType: 'boolean',
220593
+ dflt: false,
220594
+ description: [
220595
+ 'Sets whether or not projections are shown along the',
220596
+ axLetter, 'axis.'
220597
+ ].join(' ')
220598
+ },
220599
+ opacity: {
220600
+ valType: 'number',
220601
+ min: 0,
220602
+ max: 1,
220603
+ dflt: 1,
220604
+ description: 'Sets the projection color.'
220605
+ },
220606
+ scale: {
220607
+ valType: 'number',
220608
+ min: 0,
220609
+ max: 10,
220610
+ dflt: 2 / 3,
220611
+ description: [
220612
+ 'Sets the scale factor determining the size of the',
220613
+ 'projection marker points.'
220614
+ ].join(' ')
220615
+ }
220616
+ };
220617
+ }
220618
+
220619
+ var attrs = module.exports = overrideAll({
220620
+ x: scatterAttrs.x,
220621
+ y: scatterAttrs.y,
220622
+ z: {
220623
+ valType: 'data_array',
220624
+ description: 'Sets the z coordinates.'
220625
+ },
220626
+
220627
+ text: extendFlat({}, scatterAttrs.text, {
220628
+ description: [
220629
+ 'Sets text elements associated with each (x,y,z) triplet.',
220630
+ 'If a single string, the same string appears over',
220631
+ 'all the data points.',
220632
+ 'If an array of string, the items are mapped in order to the',
220633
+ 'this trace\'s (x,y,z) coordinates.',
220634
+ 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
220635
+ 'these elements will be seen in the hover labels.'
220636
+ ].join(' ')
220637
+ }),
220638
+ texttemplate: texttemplateAttrs({}, {
220639
+
220640
+ }),
220641
+ hovertext: extendFlat({}, scatterAttrs.hovertext, {
220642
+ description: [
220643
+ 'Sets text elements associated with each (x,y,z) triplet.',
220644
+ 'If a single string, the same string appears over',
220645
+ 'all the data points.',
220646
+ 'If an array of string, the items are mapped in order to the',
220647
+ 'this trace\'s (x,y,z) coordinates.',
220648
+ 'To be seen, trace `hoverinfo` must contain a *text* flag.'
220649
+ ].join(' ')
220650
+ }),
220651
+ hovertemplate: hovertemplateAttrs(),
220652
+
220653
+ xhoverformat: axisHoverFormat('x'),
220654
+ yhoverformat: axisHoverFormat('y'),
220655
+ zhoverformat: axisHoverFormat('z'),
220656
+
220657
+ mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
220658
+ {dflt: 'lines+markers'}),
220659
+ surfaceaxis: {
220660
+ valType: 'enumerated',
220661
+ values: [-1, 0, 1, 2],
220662
+ dflt: -1,
220663
+ description: [
220664
+ 'If *-1*, the scatter points are not fill with a surface',
220665
+ 'If *0*, *1*, *2*, the scatter points are filled with',
220666
+ 'a Delaunay surface about the x, y, z respectively.'
220667
+ ].join(' ')
220668
+ },
220669
+ surfacecolor: {
220670
+ valType: 'color',
220671
+ description: 'Sets the surface fill color.'
220672
+ },
220673
+ projection: {
220674
+ x: makeProjectionAttr('x'),
220675
+ y: makeProjectionAttr('y'),
220676
+ z: makeProjectionAttr('z')
220677
+ },
220678
+
220679
+ connectgaps: scatterAttrs.connectgaps,
220680
+ line: lineAttrs,
220681
+
220682
+ marker: extendFlat({ // Parity with scatter.js?
220683
+ symbol: {
220684
+ valType: 'enumerated',
220685
+ values: sortObjectKeys(MARKER_SYMBOLS),
220686
+ dflt: 'circle',
220687
+ arrayOk: true,
220688
+ description: 'Sets the marker symbol type.'
220689
+ },
220690
+ size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
220691
+ sizeref: scatterMarkerAttrs.sizeref,
220692
+ sizemin: scatterMarkerAttrs.sizemin,
220693
+ sizemode: scatterMarkerAttrs.sizemode,
220694
+ opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
220695
+ arrayOk: false,
220696
+ description: [
220697
+ 'Sets the marker opacity.',
220698
+ 'Note that the marker opacity for scatter3d traces',
220699
+ 'must be a scalar value for performance reasons.',
220700
+ 'To set a blending opacity value',
220701
+ '(i.e. which is not transparent), set *marker.color*',
220702
+ 'to an rgba color and use its alpha channel.'
220703
+ ].join(' ')
220704
+ }),
220705
+ colorbar: scatterMarkerAttrs.colorbar,
220706
+
220707
+ line: extendFlat({
220708
+ width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
220709
+ },
220710
+ colorAttributes('marker.line')
220711
+ )
220712
+ },
220713
+ colorAttributes('marker')
220714
+ ),
220715
+
220716
+ textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
220717
+ textfont: fontAttrs({
220718
+ noFontShadow: true,
220719
+ noFontLineposition: true,
220720
+ noFontTextcase: true,
220721
+ editType: 'calc',
220722
+ colorEditType: 'style',
220723
+ arrayOk: true,
220724
+ variantValues: ['normal', 'small-caps'],
220725
+ description: 'Sets the text font.'
220726
+ }),
220727
+
220728
+ opacity: baseAttrs.opacity,
220729
+
220730
+ hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
220731
+ }, 'calc', 'nested');
220732
+
220733
+ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
220734
+
220735
+
220736
+ /***/ }),
220737
+
220738
+ /***/ 30935:
220739
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
220740
+
220741
+
220742
+
220743
+ var arraysToCalcdata = __webpack_require__(47213);
220744
+ var calcColorscale = __webpack_require__(59498);
220745
+
220746
+ /**
220747
+ * This is a kludge to put the array attributes into
220748
+ * calcdata the way Scatter.plot does, so that legends and
220749
+ * popovers know what to do with them.
220750
+ */
220751
+ module.exports = function calc(gd, trace) {
220752
+ var cd = [{x: false, y: false, trace: trace, t: {}}];
220753
+
220754
+ arraysToCalcdata(cd, trace);
220755
+ calcColorscale(gd, trace);
220756
+
220757
+ return cd;
220758
+ };
220759
+
220760
+
220761
+ /***/ }),
220762
+
220763
+ /***/ 77681:
220764
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
220765
+
220766
+
220767
+
220768
+ var Registry = __webpack_require__(13936);
220769
+
220770
+ function calculateAxisErrors(data, params, scaleFactor, axis) {
220771
+ if(!params || !params.visible) return null;
220772
+
220773
+ var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
220774
+ var result = new Array(data.length);
220775
+
220776
+ for(var i = 0; i < data.length; i++) {
220777
+ var errors = computeError(+data[i], i);
220778
+
220779
+ if(axis.type === 'log') {
220780
+ var point = axis.c2l(data[i]);
220781
+ var min = data[i] - errors[0];
220782
+ var max = data[i] + errors[1];
220783
+
220784
+ result[i] = [
220785
+ (axis.c2l(min, true) - point) * scaleFactor,
220786
+ (axis.c2l(max, true) - point) * scaleFactor
220787
+ ];
220788
+
220789
+ // Keep track of the lower error bound which isn't negative!
220790
+ if(min > 0) {
220791
+ var lower = axis.c2l(min);
220792
+ if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
220793
+ axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
220794
+ }
220795
+ } else {
220796
+ result[i] = [
220797
+ -errors[0] * scaleFactor,
220798
+ errors[1] * scaleFactor
220799
+ ];
220800
+ }
220801
+ }
220802
+
220803
+ return result;
220804
+ }
220805
+
220806
+ function dataLength(array) {
220807
+ for(var i = 0; i < array.length; i++) {
220808
+ if(array[i]) return array[i].length;
220809
+ }
220810
+ return 0;
220811
+ }
220812
+
220813
+ function calculateErrors(data, scaleFactor, sceneLayout) {
220814
+ var errors = [
220815
+ calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
220816
+ calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
220817
+ calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
220818
+ ];
220819
+
220820
+ var n = dataLength(errors);
220821
+ if(n === 0) return null;
220822
+
220823
+ var errorBounds = new Array(n);
220824
+
220825
+ for(var i = 0; i < n; i++) {
220826
+ var bound = [[0, 0, 0], [0, 0, 0]];
220827
+
220828
+ for(var j = 0; j < 3; j++) {
220829
+ if(errors[j]) {
220830
+ for(var k = 0; k < 2; k++) {
220831
+ bound[k][j] = errors[j][i][k];
220832
+ }
220833
+ }
220834
+ }
220835
+
220836
+ errorBounds[i] = bound;
220837
+ }
220838
+
220839
+ return errorBounds;
220840
+ }
220841
+
220842
+ module.exports = calculateErrors;
220843
+
220844
+
220845
+ /***/ }),
220846
+
220847
+ /***/ 93219:
220848
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
220849
+
220850
+
220851
+
220852
+ var createLinePlot = (__webpack_require__(46000).gl_line3d);
220853
+ var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
220854
+ var createErrorBars = (__webpack_require__(46000).gl_error3d);
220855
+ var createMesh = (__webpack_require__(46000).gl_mesh3d);
220856
+ var triangulate = (__webpack_require__(46000).delaunay_triangulate);
220857
+
220858
+ var Lib = __webpack_require__(30991);
220859
+ var str2RgbaArray = __webpack_require__(44960);
220860
+ var formatColor = (__webpack_require__(592).formatColor);
220861
+ var makeBubbleSizeFn = __webpack_require__(42581);
220862
+ var DASH_PATTERNS = __webpack_require__(68828);
220863
+ var MARKER_SYMBOLS = __webpack_require__(98993);
220864
+
220865
+ var Axes = __webpack_require__(15076);
220866
+ var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
220867
+
220868
+ var calculateError = __webpack_require__(77681);
220869
+
220870
+ function LineWithMarkers(scene, uid) {
220871
+ this.scene = scene;
220872
+ this.uid = uid;
220873
+ this.linePlot = null;
220874
+ this.scatterPlot = null;
220875
+ this.errorBars = null;
220876
+ this.textMarkers = null;
220877
+ this.delaunayMesh = null;
220878
+ this.color = null;
220879
+ this.mode = '';
220880
+ this.dataPoints = [];
220881
+ this.axesBounds = [
220882
+ [-Infinity, -Infinity, -Infinity],
220883
+ [Infinity, Infinity, Infinity]
220884
+ ];
220885
+ this.textLabels = null;
220886
+ this.data = null;
220887
+ }
220888
+
220889
+ var proto = LineWithMarkers.prototype;
220890
+
220891
+ proto.handlePick = function(selection) {
220892
+ if(selection.object &&
220893
+ (selection.object === this.linePlot ||
220894
+ selection.object === this.delaunayMesh ||
220895
+ selection.object === this.textMarkers ||
220896
+ selection.object === this.scatterPlot)
220897
+ ) {
220898
+ var ind = selection.index = selection.data.index;
220899
+
220900
+ if(selection.object.highlight) {
220901
+ selection.object.highlight(null);
220902
+ }
220903
+ if(this.scatterPlot) {
220904
+ selection.object = this.scatterPlot;
220905
+ this.scatterPlot.highlight(selection.data);
220906
+ }
220907
+
220908
+ selection.textLabel = '';
220909
+ if(this.textLabels) {
220910
+ if(Lib.isArrayOrTypedArray(this.textLabels)) {
220911
+ if(this.textLabels[ind] || this.textLabels[ind] === 0) {
220912
+ selection.textLabel = this.textLabels[ind];
220913
+ }
220914
+ } else {
220915
+ selection.textLabel = this.textLabels;
220916
+ }
220917
+ }
220918
+
220919
+ selection.traceCoordinate = [
220920
+ this.data.x[ind],
220921
+ this.data.y[ind],
220922
+ this.data.z[ind]
220923
+ ];
220924
+
220925
+ return true;
220926
+ }
220927
+ };
220928
+
220929
+ function constructDelaunay(points, color, axis) {
220930
+ var u = (axis + 1) % 3;
220931
+ var v = (axis + 2) % 3;
220932
+ var filteredPoints = [];
220933
+ var filteredIds = [];
220934
+ var i;
220935
+
220936
+ for(i = 0; i < points.length; ++i) {
220937
+ var p = points[i];
220938
+ if(isNaN(p[u]) || !isFinite(p[u]) ||
220939
+ isNaN(p[v]) || !isFinite(p[v])) {
220940
+ continue;
220941
+ }
220942
+ filteredPoints.push([p[u], p[v]]);
220943
+ filteredIds.push(i);
220944
+ }
220945
+ var cells = triangulate(filteredPoints);
220946
+ for(i = 0; i < cells.length; ++i) {
220947
+ var c = cells[i];
220948
+ for(var j = 0; j < c.length; ++j) {
220949
+ c[j] = filteredIds[c[j]];
220950
+ }
220951
+ }
220952
+ return {
220953
+ positions: points,
220954
+ cells: cells,
220955
+ meshColor: color
220956
+ };
220957
+ }
220958
+
220959
+ function calculateErrorParams(errors) {
220960
+ var capSize = [0.0, 0.0, 0.0];
220961
+ var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
220962
+ var lineWidth = [1.0, 1.0, 1.0];
220963
+
220964
+ for(var i = 0; i < 3; i++) {
220965
+ var e = errors[i];
220966
+
220967
+ if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
220968
+ if(!e || !e.visible) continue;
220969
+
220970
+ capSize[i] = e.width / 2; // ballpark rescaling
220971
+ color[i] = str2RgbaArray(e.color);
220972
+ lineWidth[i] = e.thickness;
220973
+ }
220974
+
220975
+ return {capSize: capSize, color: color, lineWidth: lineWidth};
220976
+ }
220977
+
220978
+ function parseAlignmentX(a) {
220979
+ if(a === null || a === undefined) return 0;
220980
+
220981
+ return (a.indexOf('left') > -1) ? -1 :
220982
+ (a.indexOf('right') > -1) ? 1 : 0;
220983
+ }
220984
+
220985
+ function parseAlignmentY(a) {
220986
+ if(a === null || a === undefined) return 0;
220987
+
220988
+ return (a.indexOf('top') > -1) ? -1 :
220989
+ (a.indexOf('bottom') > -1) ? 1 : 0;
220990
+ }
220991
+
220992
+ function calculateTextOffset(tp) {
220993
+ // Read out text properties
220994
+
220995
+ var defaultAlignmentX = 0;
220996
+ var defaultAlignmentY = 0;
220997
+
220998
+ var textOffset = [
220999
+ defaultAlignmentX,
221000
+ defaultAlignmentY
221001
+ ];
221002
+
221003
+ if(Array.isArray(tp)) {
221004
+ for(var i = 0; i < tp.length; i++) {
221005
+ textOffset[i] = [
221006
+ defaultAlignmentX,
221007
+ defaultAlignmentY
221008
+ ];
221009
+ if(tp[i]) {
221010
+ textOffset[i][0] = parseAlignmentX(tp[i]);
221011
+ textOffset[i][1] = parseAlignmentY(tp[i]);
221012
+ }
221013
+ }
221014
+ } else {
221015
+ textOffset[0] = parseAlignmentX(tp);
221016
+ textOffset[1] = parseAlignmentY(tp);
221017
+ }
221018
+
221019
+ return textOffset;
221020
+ }
221021
+
221022
+
221023
+ function calculateSize(sizeIn, sizeFn) {
221024
+ // rough parity with Plotly 2D markers
221025
+ return sizeFn(sizeIn * 4);
221026
+ }
221027
+
221028
+ function calculateSymbol(symbolIn) {
221029
+ return MARKER_SYMBOLS[symbolIn];
221030
+ }
221031
+
221032
+ function formatParam(paramIn, len, calculate, dflt, extraFn) {
221033
+ var paramOut = null;
221034
+
221035
+ if(Lib.isArrayOrTypedArray(paramIn)) {
221036
+ paramOut = [];
221037
+
221038
+ for(var i = 0; i < len; i++) {
221039
+ if(paramIn[i] === undefined) paramOut[i] = dflt;
221040
+ else paramOut[i] = calculate(paramIn[i], extraFn);
221041
+ }
221042
+ } else paramOut = calculate(paramIn, Lib.identity);
221043
+
221044
+ return paramOut;
221045
+ }
221046
+
221047
+
221048
+ function convertPlotlyOptions(scene, data) {
221049
+ var points = [];
221050
+ var sceneLayout = scene.fullSceneLayout;
221051
+ var scaleFactor = scene.dataScale;
221052
+ var xaxis = sceneLayout.xaxis;
221053
+ var yaxis = sceneLayout.yaxis;
221054
+ var zaxis = sceneLayout.zaxis;
221055
+ var marker = data.marker;
221056
+ var line = data.line;
221057
+ var x = data.x || [];
221058
+ var y = data.y || [];
221059
+ var z = data.z || [];
221060
+ var len = x.length;
221061
+ var xcalendar = data.xcalendar;
221062
+ var ycalendar = data.ycalendar;
221063
+ var zcalendar = data.zcalendar;
221064
+ var xc, yc, zc;
221065
+ var params, i;
221066
+ var text;
221067
+
221068
+ // Convert points
221069
+ for(i = 0; i < len; i++) {
221070
+ // sanitize numbers and apply transforms based on axes.type
221071
+ xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
221072
+ yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
221073
+ zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
221074
+
221075
+ points[i] = [xc, yc, zc];
221076
+ }
221077
+
221078
+ // convert text
221079
+ if(Array.isArray(data.text)) {
221080
+ text = data.text;
221081
+ } else if(Lib.isTypedArray(data.text)) {
221082
+ text = Array.from(data.text);
221083
+ } else if(data.text !== undefined) {
221084
+ text = new Array(len);
221085
+ for(i = 0; i < len; i++) text[i] = data.text;
221086
+ }
221087
+
221088
+ function formatter(axName, val) {
221089
+ var ax = sceneLayout[axName];
221090
+ return Axes.tickText(ax, ax.d2l(val), true).text;
221091
+ }
221092
+
221093
+ // check texttemplate
221094
+ var texttemplate = data.texttemplate;
221095
+ if(texttemplate) {
221096
+ var fullLayout = scene.fullLayout;
221097
+ var d3locale = fullLayout._d3locale;
221098
+ var isArray = Array.isArray(texttemplate);
221099
+ var N = isArray ? Math.min(texttemplate.length, len) : len;
221100
+ var txt = isArray ?
221101
+ function(i) { return texttemplate[i]; } :
221102
+ function() { return texttemplate; };
221103
+
221104
+ text = new Array(N);
221105
+
221106
+ for(i = 0; i < N; i++) {
221107
+ var d = {x: x[i], y: y[i], z: z[i]};
221108
+ var labels = {
221109
+ xLabel: formatter('xaxis', x[i]),
221110
+ yLabel: formatter('yaxis', y[i]),
221111
+ zLabel: formatter('zaxis', z[i])
221112
+ };
221113
+ var pointValues = {};
221114
+ appendArrayPointValue(pointValues, data, i);
221115
+ var meta = data._meta || {};
221116
+ text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
221117
+ }
221118
+ }
221119
+
221120
+ // Build object parameters
221121
+ params = {
221122
+ position: points,
221123
+ mode: data.mode,
221124
+ text: text
221125
+ };
221126
+
221127
+ if('line' in data) {
221128
+ params.lineColor = formatColor(line, 1, len);
221129
+ params.lineWidth = line.width;
221130
+ params.lineDashes = line.dash;
221131
+ }
221132
+
221133
+ if('marker' in data) {
221134
+ var sizeFn = makeBubbleSizeFn(data);
221135
+
221136
+ params.scatterColor = formatColor(marker, 1, len);
221137
+ params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
221138
+ params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
221139
+ params.scatterLineWidth = marker.line.width; // arrayOk === false
221140
+ params.scatterLineColor = formatColor(marker.line, 1, len);
221141
+ params.scatterAngle = 0;
221142
+ }
221143
+
221144
+ if('textposition' in data) {
221145
+ params.textOffset = calculateTextOffset(data.textposition);
221146
+ params.textColor = formatColor(data.textfont, 1, len);
221147
+ params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
221148
+ params.textFontFamily = data.textfont.family;
221149
+ params.textFontWeight = data.textfont.weight;
221150
+ params.textFontStyle = data.textfont.style;
221151
+ params.textFontVariant = data.textfont.variant;
221152
+ params.textAngle = 0;
221153
+ }
221154
+
221155
+ var dims = ['x', 'y', 'z'];
221156
+ params.project = [false, false, false];
221157
+ params.projectScale = [1, 1, 1];
221158
+ params.projectOpacity = [1, 1, 1];
221159
+ for(i = 0; i < 3; ++i) {
221160
+ var projection = data.projection[dims[i]];
221161
+ if((params.project[i] = projection.show)) {
221162
+ params.projectOpacity[i] = projection.opacity;
221163
+ params.projectScale[i] = projection.scale;
221164
+ }
221165
+ }
221166
+
221167
+ params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
221168
+
221169
+ var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
221170
+ params.errorColor = errorParams.color;
221171
+ params.errorLineWidth = errorParams.lineWidth;
221172
+ params.errorCapSize = errorParams.capSize;
221173
+
221174
+ params.delaunayAxis = data.surfaceaxis;
221175
+ params.delaunayColor = str2RgbaArray(data.surfacecolor);
221176
+
221177
+ return params;
221178
+ }
221179
+
221180
+ function _arrayToColor(color) {
221181
+ if(Lib.isArrayOrTypedArray(color)) {
221182
+ var c = color[0];
221183
+
221184
+ if(Lib.isArrayOrTypedArray(c)) color = c;
221185
+
221186
+ return 'rgb(' + color.slice(0, 3).map(function(x) {
221187
+ return Math.round(x * 255);
221188
+ }) + ')';
221189
+ }
221190
+
221191
+ return null;
221192
+ }
221193
+
221194
+ function arrayToColor(colors) {
221195
+ if(!Lib.isArrayOrTypedArray(colors)) {
221196
+ return null;
221197
+ }
221198
+
221199
+ if((colors.length === 4) && (typeof colors[0] === 'number')) {
221200
+ return _arrayToColor(colors);
221201
+ }
221202
+
221203
+ return colors.map(_arrayToColor);
221204
+ }
221205
+
221206
+ proto.update = function(data) {
221207
+ var gl = this.scene.glplot.gl;
221208
+ var lineOptions;
221209
+ var scatterOptions;
221210
+ var errorOptions;
221211
+ var textOptions;
221212
+ var dashPattern = DASH_PATTERNS.solid;
221213
+
221214
+ // Save data
221215
+ this.data = data;
221216
+
221217
+ // Run data conversion
221218
+ var options = convertPlotlyOptions(this.scene, data);
221219
+
221220
+ if('mode' in options) {
221221
+ this.mode = options.mode;
221222
+ }
221223
+ if('lineDashes' in options) {
221224
+ if(options.lineDashes in DASH_PATTERNS) {
221225
+ dashPattern = DASH_PATTERNS[options.lineDashes];
221226
+ }
221227
+ }
221228
+
221229
+ this.color = arrayToColor(options.scatterColor) ||
221230
+ arrayToColor(options.lineColor);
221231
+
221232
+ // Save data points
221233
+ this.dataPoints = options.position;
221234
+
221235
+ lineOptions = {
221236
+ gl: this.scene.glplot.gl,
221237
+ position: options.position,
221238
+ color: options.lineColor,
221239
+ lineWidth: options.lineWidth || 1,
221240
+ dashes: dashPattern[0],
221241
+ dashScale: dashPattern[1],
221242
+ opacity: data.opacity,
221243
+ connectGaps: data.connectgaps
221244
+ };
221245
+
221246
+ if(this.mode.indexOf('lines') !== -1) {
221247
+ if(this.linePlot) this.linePlot.update(lineOptions);
221248
+ else {
221249
+ this.linePlot = createLinePlot(lineOptions);
221250
+ this.linePlot._trace = this;
221251
+ this.scene.glplot.add(this.linePlot);
221252
+ }
221253
+ } else if(this.linePlot) {
221254
+ this.scene.glplot.remove(this.linePlot);
221255
+ this.linePlot.dispose();
221256
+ this.linePlot = null;
221257
+ }
221258
+
221259
+ // N.B. marker.opacity must be a scalar for performance
221260
+ var scatterOpacity = data.opacity;
221261
+ if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
221262
+
221263
+ scatterOptions = {
221264
+ gl: this.scene.glplot.gl,
221265
+ position: options.position,
221266
+ color: options.scatterColor,
221267
+ size: options.scatterSize,
221268
+ glyph: options.scatterMarker,
221269
+ opacity: scatterOpacity,
221270
+ orthographic: true,
221271
+ lineWidth: options.scatterLineWidth,
221272
+ lineColor: options.scatterLineColor,
221273
+ project: options.project,
221274
+ projectScale: options.projectScale,
221275
+ projectOpacity: options.projectOpacity
221276
+ };
221277
+
221278
+ if(this.mode.indexOf('markers') !== -1) {
221279
+ if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
221280
+ else {
221281
+ this.scatterPlot = createScatterPlot(scatterOptions);
221282
+ this.scatterPlot._trace = this;
221283
+ this.scatterPlot.highlightScale = 1;
221284
+ this.scene.glplot.add(this.scatterPlot);
221285
+ }
221286
+ } else if(this.scatterPlot) {
221287
+ this.scene.glplot.remove(this.scatterPlot);
221288
+ this.scatterPlot.dispose();
221289
+ this.scatterPlot = null;
221290
+ }
221291
+
221292
+ textOptions = {
221293
+ gl: this.scene.glplot.gl,
221294
+ position: options.position,
221295
+ glyph: options.text,
221296
+ color: options.textColor,
221297
+ size: options.textSize,
221298
+ angle: options.textAngle,
221299
+ alignment: options.textOffset,
221300
+ font: options.textFontFamily,
221301
+ fontWeight: options.textFontWeight,
221302
+ fontStyle: options.textFontStyle,
221303
+ fontVariant: options.textFontVariant,
221304
+ orthographic: true,
221305
+ lineWidth: 0,
221306
+ project: false,
221307
+ opacity: data.opacity
221308
+ };
221309
+
221310
+ this.textLabels = data.hovertext || data.text;
221311
+
221312
+ if(this.mode.indexOf('text') !== -1) {
221313
+ if(this.textMarkers) this.textMarkers.update(textOptions);
221314
+ else {
221315
+ this.textMarkers = createScatterPlot(textOptions);
221316
+ this.textMarkers._trace = this;
221317
+ this.textMarkers.highlightScale = 1;
221318
+ this.scene.glplot.add(this.textMarkers);
221319
+ }
221320
+ } else if(this.textMarkers) {
221321
+ this.scene.glplot.remove(this.textMarkers);
221322
+ this.textMarkers.dispose();
221323
+ this.textMarkers = null;
221324
+ }
221325
+
221326
+ errorOptions = {
221327
+ gl: this.scene.glplot.gl,
221328
+ position: options.position,
221329
+ color: options.errorColor,
221330
+ error: options.errorBounds,
221331
+ lineWidth: options.errorLineWidth,
221332
+ capSize: options.errorCapSize,
221333
+ opacity: data.opacity
221334
+ };
221335
+ if(this.errorBars) {
221336
+ if(options.errorBounds) {
221337
+ this.errorBars.update(errorOptions);
221338
+ } else {
221339
+ this.scene.glplot.remove(this.errorBars);
221340
+ this.errorBars.dispose();
221341
+ this.errorBars = null;
221342
+ }
221343
+ } else if(options.errorBounds) {
221344
+ this.errorBars = createErrorBars(errorOptions);
221345
+ this.errorBars._trace = this;
221346
+ this.scene.glplot.add(this.errorBars);
221347
+ }
221348
+
221349
+ if(options.delaunayAxis >= 0) {
221350
+ var delaunayOptions = constructDelaunay(
221351
+ options.position,
221352
+ options.delaunayColor,
221353
+ options.delaunayAxis
221354
+ );
221355
+ delaunayOptions.opacity = data.opacity;
221356
+
221357
+ if(this.delaunayMesh) {
221358
+ this.delaunayMesh.update(delaunayOptions);
221359
+ } else {
221360
+ delaunayOptions.gl = gl;
221361
+ this.delaunayMesh = createMesh(delaunayOptions);
221362
+ this.delaunayMesh._trace = this;
221363
+ this.scene.glplot.add(this.delaunayMesh);
221364
+ }
221365
+ } else if(this.delaunayMesh) {
221366
+ this.scene.glplot.remove(this.delaunayMesh);
221367
+ this.delaunayMesh.dispose();
221368
+ this.delaunayMesh = null;
221369
+ }
221370
+ };
221371
+
221372
+ proto.dispose = function() {
221373
+ if(this.linePlot) {
221374
+ this.scene.glplot.remove(this.linePlot);
221375
+ this.linePlot.dispose();
221376
+ }
221377
+ if(this.scatterPlot) {
221378
+ this.scene.glplot.remove(this.scatterPlot);
221379
+ this.scatterPlot.dispose();
221380
+ }
221381
+ if(this.errorBars) {
221382
+ this.scene.glplot.remove(this.errorBars);
221383
+ this.errorBars.dispose();
221384
+ }
221385
+ if(this.textMarkers) {
221386
+ this.scene.glplot.remove(this.textMarkers);
221387
+ this.textMarkers.dispose();
221388
+ }
221389
+ if(this.delaunayMesh) {
221390
+ this.scene.glplot.remove(this.delaunayMesh);
221391
+ this.delaunayMesh.dispose();
221392
+ }
221393
+ };
221394
+
221395
+ function createLineWithMarkers(scene, data) {
221396
+ var plot = new LineWithMarkers(scene, data.uid);
221397
+ plot.update(data);
221398
+ return plot;
221399
+ }
221400
+
221401
+ module.exports = createLineWithMarkers;
221402
+
221403
+
221404
+ /***/ }),
221405
+
221406
+ /***/ 13744:
221407
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
221408
+
221409
+
221410
+
221411
+ var Registry = __webpack_require__(13936);
221412
+ var Lib = __webpack_require__(30991);
221413
+
221414
+ var subTypes = __webpack_require__(33068);
221415
+ var handleMarkerDefaults = __webpack_require__(15294);
221416
+ var handleLineDefaults = __webpack_require__(82094);
221417
+ var handleTextDefaults = __webpack_require__(94729);
221418
+
221419
+ var attributes = __webpack_require__(1015);
221420
+
221421
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
221422
+ function coerce(attr, dflt) {
221423
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
221424
+ }
221425
+
221426
+ var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
221427
+ if(!len) {
221428
+ traceOut.visible = false;
221429
+ return;
221430
+ }
221431
+
221432
+ coerce('text');
221433
+ coerce('hovertext');
221434
+ coerce('hovertemplate');
221435
+ coerce('xhoverformat');
221436
+ coerce('yhoverformat');
221437
+ coerce('zhoverformat');
221438
+
221439
+ coerce('mode');
221440
+
221441
+ if(subTypes.hasMarkers(traceOut)) {
221442
+ handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
221443
+ }
221444
+
221445
+ if(subTypes.hasLines(traceOut)) {
221446
+ coerce('connectgaps');
221447
+ handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
221448
+ }
221449
+
221450
+ if(subTypes.hasText(traceOut)) {
221451
+ coerce('texttemplate');
221452
+ handleTextDefaults(traceIn, traceOut, layout, coerce, {
221453
+ noSelect: true,
221454
+ noFontShadow: true,
221455
+ noFontLineposition: true,
221456
+ noFontTextcase: true,
221457
+ });
221458
+ }
221459
+
221460
+ var lineColor = (traceOut.line || {}).color;
221461
+ var markerColor = (traceOut.marker || {}).color;
221462
+ if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
221463
+
221464
+ var dims = ['x', 'y', 'z'];
221465
+ for(var i = 0; i < 3; ++i) {
221466
+ var projection = 'projection.' + dims[i];
221467
+ if(coerce(projection + '.show')) {
221468
+ coerce(projection + '.opacity');
221469
+ coerce(projection + '.scale');
221470
+ }
221471
+ }
221472
+
221473
+ var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
221474
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
221475
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
221476
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
221477
+ };
221478
+
221479
+ function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
221480
+ var len = 0;
221481
+ var x = coerce('x');
221482
+ var y = coerce('y');
221483
+ var z = coerce('z');
221484
+
221485
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
221486
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
221487
+
221488
+ if(x && y && z) {
221489
+ // TODO: what happens if one is missing?
221490
+ len = Math.min(x.length, y.length, z.length);
221491
+ traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
221492
+ }
221493
+
221494
+ return len;
221495
+ }
221496
+
221497
+
221498
+ /***/ }),
221499
+
221500
+ /***/ 68860:
221501
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
221502
+
221503
+
221504
+
221505
+ module.exports = {
221506
+ plot: __webpack_require__(93219),
221507
+ attributes: __webpack_require__(1015),
221508
+ markerSymbols: __webpack_require__(98993),
221509
+ supplyDefaults: __webpack_require__(13744),
221510
+ colorbar: [
221511
+ {
221512
+ container: 'marker',
221513
+ min: 'cmin',
221514
+ max: 'cmax'
221515
+ }, {
221516
+ container: 'line',
221517
+ min: 'cmin',
221518
+ max: 'cmax'
221519
+ }
221520
+ ],
221521
+ calc: __webpack_require__(30935),
221522
+
221523
+ moduleType: 'trace',
221524
+ name: 'scatter3d',
221525
+ basePlotModule: __webpack_require__(68137),
221526
+ categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
221527
+ meta: {
221528
+ hrName: 'scatter_3d',
221529
+ description: [
221530
+ 'The data visualized as scatter point or lines in 3D dimension',
221531
+ 'is set in `x`, `y`, `z`.',
221532
+ 'Text (appearing either on the chart or on hover only) is via `text`.',
221533
+ 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
221534
+ 'Projections are achieved via `projection`.',
221535
+ 'Surface fills are achieved via `surfaceaxis`.'
221536
+ ].join(' ')
221537
+ }
221538
+ };
221539
+
221540
+
220554
221541
  /***/ }),
220555
221542
 
220556
221543
  /***/ 47213:
@@ -224481,993 +225468,6 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
224481
225468
  };
224482
225469
 
224483
225470
 
224484
- /***/ }),
224485
-
224486
- /***/ 1015:
224487
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
224488
-
224489
-
224490
-
224491
- var scatterAttrs = __webpack_require__(86854);
224492
- var fontAttrs = __webpack_require__(70827);
224493
- var colorAttributes = __webpack_require__(17957);
224494
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
224495
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
224496
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
224497
- var baseAttrs = __webpack_require__(35667);
224498
- var DASHES = __webpack_require__(68828);
224499
-
224500
- var MARKER_SYMBOLS = __webpack_require__(98993);
224501
- var extendFlat = (__webpack_require__(91307).extendFlat);
224502
- var overrideAll = (__webpack_require__(70756).overrideAll);
224503
- var sortObjectKeys = __webpack_require__(99124);
224504
-
224505
- var scatterLineAttrs = scatterAttrs.line;
224506
- var scatterMarkerAttrs = scatterAttrs.marker;
224507
- var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
224508
-
224509
- var lineAttrs = extendFlat({
224510
- width: scatterLineAttrs.width,
224511
- dash: {
224512
- valType: 'enumerated',
224513
- values: sortObjectKeys(DASHES),
224514
- dflt: 'solid',
224515
- description: 'Sets the dash style of the lines.'
224516
- }
224517
- }, colorAttributes('line'));
224518
-
224519
- function makeProjectionAttr(axLetter) {
224520
- return {
224521
- show: {
224522
- valType: 'boolean',
224523
- dflt: false,
224524
- description: [
224525
- 'Sets whether or not projections are shown along the',
224526
- axLetter, 'axis.'
224527
- ].join(' ')
224528
- },
224529
- opacity: {
224530
- valType: 'number',
224531
- min: 0,
224532
- max: 1,
224533
- dflt: 1,
224534
- description: 'Sets the projection color.'
224535
- },
224536
- scale: {
224537
- valType: 'number',
224538
- min: 0,
224539
- max: 10,
224540
- dflt: 2 / 3,
224541
- description: [
224542
- 'Sets the scale factor determining the size of the',
224543
- 'projection marker points.'
224544
- ].join(' ')
224545
- }
224546
- };
224547
- }
224548
-
224549
- var attrs = module.exports = overrideAll({
224550
- x: scatterAttrs.x,
224551
- y: scatterAttrs.y,
224552
- z: {
224553
- valType: 'data_array',
224554
- description: 'Sets the z coordinates.'
224555
- },
224556
-
224557
- text: extendFlat({}, scatterAttrs.text, {
224558
- description: [
224559
- 'Sets text elements associated with each (x,y,z) triplet.',
224560
- 'If a single string, the same string appears over',
224561
- 'all the data points.',
224562
- 'If an array of string, the items are mapped in order to the',
224563
- 'this trace\'s (x,y,z) coordinates.',
224564
- 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
224565
- 'these elements will be seen in the hover labels.'
224566
- ].join(' ')
224567
- }),
224568
- texttemplate: texttemplateAttrs({}, {
224569
-
224570
- }),
224571
- hovertext: extendFlat({}, scatterAttrs.hovertext, {
224572
- description: [
224573
- 'Sets text elements associated with each (x,y,z) triplet.',
224574
- 'If a single string, the same string appears over',
224575
- 'all the data points.',
224576
- 'If an array of string, the items are mapped in order to the',
224577
- 'this trace\'s (x,y,z) coordinates.',
224578
- 'To be seen, trace `hoverinfo` must contain a *text* flag.'
224579
- ].join(' ')
224580
- }),
224581
- hovertemplate: hovertemplateAttrs(),
224582
-
224583
- xhoverformat: axisHoverFormat('x'),
224584
- yhoverformat: axisHoverFormat('y'),
224585
- zhoverformat: axisHoverFormat('z'),
224586
-
224587
- mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
224588
- {dflt: 'lines+markers'}),
224589
- surfaceaxis: {
224590
- valType: 'enumerated',
224591
- values: [-1, 0, 1, 2],
224592
- dflt: -1,
224593
- description: [
224594
- 'If *-1*, the scatter points are not fill with a surface',
224595
- 'If *0*, *1*, *2*, the scatter points are filled with',
224596
- 'a Delaunay surface about the x, y, z respectively.'
224597
- ].join(' ')
224598
- },
224599
- surfacecolor: {
224600
- valType: 'color',
224601
- description: 'Sets the surface fill color.'
224602
- },
224603
- projection: {
224604
- x: makeProjectionAttr('x'),
224605
- y: makeProjectionAttr('y'),
224606
- z: makeProjectionAttr('z')
224607
- },
224608
-
224609
- connectgaps: scatterAttrs.connectgaps,
224610
- line: lineAttrs,
224611
-
224612
- marker: extendFlat({ // Parity with scatter.js?
224613
- symbol: {
224614
- valType: 'enumerated',
224615
- values: sortObjectKeys(MARKER_SYMBOLS),
224616
- dflt: 'circle',
224617
- arrayOk: true,
224618
- description: 'Sets the marker symbol type.'
224619
- },
224620
- size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
224621
- sizeref: scatterMarkerAttrs.sizeref,
224622
- sizemin: scatterMarkerAttrs.sizemin,
224623
- sizemode: scatterMarkerAttrs.sizemode,
224624
- opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
224625
- arrayOk: false,
224626
- description: [
224627
- 'Sets the marker opacity.',
224628
- 'Note that the marker opacity for scatter3d traces',
224629
- 'must be a scalar value for performance reasons.',
224630
- 'To set a blending opacity value',
224631
- '(i.e. which is not transparent), set *marker.color*',
224632
- 'to an rgba color and use its alpha channel.'
224633
- ].join(' ')
224634
- }),
224635
- colorbar: scatterMarkerAttrs.colorbar,
224636
-
224637
- line: extendFlat({
224638
- width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
224639
- },
224640
- colorAttributes('marker.line')
224641
- )
224642
- },
224643
- colorAttributes('marker')
224644
- ),
224645
-
224646
- textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
224647
- textfont: fontAttrs({
224648
- noFontShadow: true,
224649
- noFontLineposition: true,
224650
- noFontTextcase: true,
224651
- editType: 'calc',
224652
- colorEditType: 'style',
224653
- arrayOk: true,
224654
- variantValues: ['normal', 'small-caps'],
224655
- description: 'Sets the text font.'
224656
- }),
224657
-
224658
- opacity: baseAttrs.opacity,
224659
-
224660
- hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
224661
- }, 'calc', 'nested');
224662
-
224663
- attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
224664
-
224665
-
224666
- /***/ }),
224667
-
224668
- /***/ 30935:
224669
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
224670
-
224671
-
224672
-
224673
- var arraysToCalcdata = __webpack_require__(47213);
224674
- var calcColorscale = __webpack_require__(59498);
224675
-
224676
- /**
224677
- * This is a kludge to put the array attributes into
224678
- * calcdata the way Scatter.plot does, so that legends and
224679
- * popovers know what to do with them.
224680
- */
224681
- module.exports = function calc(gd, trace) {
224682
- var cd = [{x: false, y: false, trace: trace, t: {}}];
224683
-
224684
- arraysToCalcdata(cd, trace);
224685
- calcColorscale(gd, trace);
224686
-
224687
- return cd;
224688
- };
224689
-
224690
-
224691
- /***/ }),
224692
-
224693
- /***/ 77681:
224694
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
224695
-
224696
-
224697
-
224698
- var Registry = __webpack_require__(13936);
224699
-
224700
- function calculateAxisErrors(data, params, scaleFactor, axis) {
224701
- if(!params || !params.visible) return null;
224702
-
224703
- var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
224704
- var result = new Array(data.length);
224705
-
224706
- for(var i = 0; i < data.length; i++) {
224707
- var errors = computeError(+data[i], i);
224708
-
224709
- if(axis.type === 'log') {
224710
- var point = axis.c2l(data[i]);
224711
- var min = data[i] - errors[0];
224712
- var max = data[i] + errors[1];
224713
-
224714
- result[i] = [
224715
- (axis.c2l(min, true) - point) * scaleFactor,
224716
- (axis.c2l(max, true) - point) * scaleFactor
224717
- ];
224718
-
224719
- // Keep track of the lower error bound which isn't negative!
224720
- if(min > 0) {
224721
- var lower = axis.c2l(min);
224722
- if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
224723
- axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
224724
- }
224725
- } else {
224726
- result[i] = [
224727
- -errors[0] * scaleFactor,
224728
- errors[1] * scaleFactor
224729
- ];
224730
- }
224731
- }
224732
-
224733
- return result;
224734
- }
224735
-
224736
- function dataLength(array) {
224737
- for(var i = 0; i < array.length; i++) {
224738
- if(array[i]) return array[i].length;
224739
- }
224740
- return 0;
224741
- }
224742
-
224743
- function calculateErrors(data, scaleFactor, sceneLayout) {
224744
- var errors = [
224745
- calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
224746
- calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
224747
- calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
224748
- ];
224749
-
224750
- var n = dataLength(errors);
224751
- if(n === 0) return null;
224752
-
224753
- var errorBounds = new Array(n);
224754
-
224755
- for(var i = 0; i < n; i++) {
224756
- var bound = [[0, 0, 0], [0, 0, 0]];
224757
-
224758
- for(var j = 0; j < 3; j++) {
224759
- if(errors[j]) {
224760
- for(var k = 0; k < 2; k++) {
224761
- bound[k][j] = errors[j][i][k];
224762
- }
224763
- }
224764
- }
224765
-
224766
- errorBounds[i] = bound;
224767
- }
224768
-
224769
- return errorBounds;
224770
- }
224771
-
224772
- module.exports = calculateErrors;
224773
-
224774
-
224775
- /***/ }),
224776
-
224777
- /***/ 93219:
224778
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
224779
-
224780
-
224781
-
224782
- var createLinePlot = (__webpack_require__(46000).gl_line3d);
224783
- var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
224784
- var createErrorBars = (__webpack_require__(46000).gl_error3d);
224785
- var createMesh = (__webpack_require__(46000).gl_mesh3d);
224786
- var triangulate = (__webpack_require__(46000).delaunay_triangulate);
224787
-
224788
- var Lib = __webpack_require__(30991);
224789
- var str2RgbaArray = __webpack_require__(44960);
224790
- var formatColor = (__webpack_require__(592).formatColor);
224791
- var makeBubbleSizeFn = __webpack_require__(42581);
224792
- var DASH_PATTERNS = __webpack_require__(68828);
224793
- var MARKER_SYMBOLS = __webpack_require__(98993);
224794
-
224795
- var Axes = __webpack_require__(15076);
224796
- var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
224797
-
224798
- var calculateError = __webpack_require__(77681);
224799
-
224800
- function LineWithMarkers(scene, uid) {
224801
- this.scene = scene;
224802
- this.uid = uid;
224803
- this.linePlot = null;
224804
- this.scatterPlot = null;
224805
- this.errorBars = null;
224806
- this.textMarkers = null;
224807
- this.delaunayMesh = null;
224808
- this.color = null;
224809
- this.mode = '';
224810
- this.dataPoints = [];
224811
- this.axesBounds = [
224812
- [-Infinity, -Infinity, -Infinity],
224813
- [Infinity, Infinity, Infinity]
224814
- ];
224815
- this.textLabels = null;
224816
- this.data = null;
224817
- }
224818
-
224819
- var proto = LineWithMarkers.prototype;
224820
-
224821
- proto.handlePick = function(selection) {
224822
- if(selection.object &&
224823
- (selection.object === this.linePlot ||
224824
- selection.object === this.delaunayMesh ||
224825
- selection.object === this.textMarkers ||
224826
- selection.object === this.scatterPlot)
224827
- ) {
224828
- var ind = selection.index = selection.data.index;
224829
-
224830
- if(selection.object.highlight) {
224831
- selection.object.highlight(null);
224832
- }
224833
- if(this.scatterPlot) {
224834
- selection.object = this.scatterPlot;
224835
- this.scatterPlot.highlight(selection.data);
224836
- }
224837
-
224838
- selection.textLabel = '';
224839
- if(this.textLabels) {
224840
- if(Lib.isArrayOrTypedArray(this.textLabels)) {
224841
- if(this.textLabels[ind] || this.textLabels[ind] === 0) {
224842
- selection.textLabel = this.textLabels[ind];
224843
- }
224844
- } else {
224845
- selection.textLabel = this.textLabels;
224846
- }
224847
- }
224848
-
224849
- selection.traceCoordinate = [
224850
- this.data.x[ind],
224851
- this.data.y[ind],
224852
- this.data.z[ind]
224853
- ];
224854
-
224855
- return true;
224856
- }
224857
- };
224858
-
224859
- function constructDelaunay(points, color, axis) {
224860
- var u = (axis + 1) % 3;
224861
- var v = (axis + 2) % 3;
224862
- var filteredPoints = [];
224863
- var filteredIds = [];
224864
- var i;
224865
-
224866
- for(i = 0; i < points.length; ++i) {
224867
- var p = points[i];
224868
- if(isNaN(p[u]) || !isFinite(p[u]) ||
224869
- isNaN(p[v]) || !isFinite(p[v])) {
224870
- continue;
224871
- }
224872
- filteredPoints.push([p[u], p[v]]);
224873
- filteredIds.push(i);
224874
- }
224875
- var cells = triangulate(filteredPoints);
224876
- for(i = 0; i < cells.length; ++i) {
224877
- var c = cells[i];
224878
- for(var j = 0; j < c.length; ++j) {
224879
- c[j] = filteredIds[c[j]];
224880
- }
224881
- }
224882
- return {
224883
- positions: points,
224884
- cells: cells,
224885
- meshColor: color
224886
- };
224887
- }
224888
-
224889
- function calculateErrorParams(errors) {
224890
- var capSize = [0.0, 0.0, 0.0];
224891
- var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
224892
- var lineWidth = [1.0, 1.0, 1.0];
224893
-
224894
- for(var i = 0; i < 3; i++) {
224895
- var e = errors[i];
224896
-
224897
- if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
224898
- if(!e || !e.visible) continue;
224899
-
224900
- capSize[i] = e.width / 2; // ballpark rescaling
224901
- color[i] = str2RgbaArray(e.color);
224902
- lineWidth[i] = e.thickness;
224903
- }
224904
-
224905
- return {capSize: capSize, color: color, lineWidth: lineWidth};
224906
- }
224907
-
224908
- function parseAlignmentX(a) {
224909
- if(a === null || a === undefined) return 0;
224910
-
224911
- return (a.indexOf('left') > -1) ? -1 :
224912
- (a.indexOf('right') > -1) ? 1 : 0;
224913
- }
224914
-
224915
- function parseAlignmentY(a) {
224916
- if(a === null || a === undefined) return 0;
224917
-
224918
- return (a.indexOf('top') > -1) ? -1 :
224919
- (a.indexOf('bottom') > -1) ? 1 : 0;
224920
- }
224921
-
224922
- function calculateTextOffset(tp) {
224923
- // Read out text properties
224924
-
224925
- var defaultAlignmentX = 0;
224926
- var defaultAlignmentY = 0;
224927
-
224928
- var textOffset = [
224929
- defaultAlignmentX,
224930
- defaultAlignmentY
224931
- ];
224932
-
224933
- if(Array.isArray(tp)) {
224934
- for(var i = 0; i < tp.length; i++) {
224935
- textOffset[i] = [
224936
- defaultAlignmentX,
224937
- defaultAlignmentY
224938
- ];
224939
- if(tp[i]) {
224940
- textOffset[i][0] = parseAlignmentX(tp[i]);
224941
- textOffset[i][1] = parseAlignmentY(tp[i]);
224942
- }
224943
- }
224944
- } else {
224945
- textOffset[0] = parseAlignmentX(tp);
224946
- textOffset[1] = parseAlignmentY(tp);
224947
- }
224948
-
224949
- return textOffset;
224950
- }
224951
-
224952
-
224953
- function calculateSize(sizeIn, sizeFn) {
224954
- // rough parity with Plotly 2D markers
224955
- return sizeFn(sizeIn * 4);
224956
- }
224957
-
224958
- function calculateSymbol(symbolIn) {
224959
- return MARKER_SYMBOLS[symbolIn];
224960
- }
224961
-
224962
- function formatParam(paramIn, len, calculate, dflt, extraFn) {
224963
- var paramOut = null;
224964
-
224965
- if(Lib.isArrayOrTypedArray(paramIn)) {
224966
- paramOut = [];
224967
-
224968
- for(var i = 0; i < len; i++) {
224969
- if(paramIn[i] === undefined) paramOut[i] = dflt;
224970
- else paramOut[i] = calculate(paramIn[i], extraFn);
224971
- }
224972
- } else paramOut = calculate(paramIn, Lib.identity);
224973
-
224974
- return paramOut;
224975
- }
224976
-
224977
-
224978
- function convertPlotlyOptions(scene, data) {
224979
- var points = [];
224980
- var sceneLayout = scene.fullSceneLayout;
224981
- var scaleFactor = scene.dataScale;
224982
- var xaxis = sceneLayout.xaxis;
224983
- var yaxis = sceneLayout.yaxis;
224984
- var zaxis = sceneLayout.zaxis;
224985
- var marker = data.marker;
224986
- var line = data.line;
224987
- var x = data.x || [];
224988
- var y = data.y || [];
224989
- var z = data.z || [];
224990
- var len = x.length;
224991
- var xcalendar = data.xcalendar;
224992
- var ycalendar = data.ycalendar;
224993
- var zcalendar = data.zcalendar;
224994
- var xc, yc, zc;
224995
- var params, i;
224996
- var text;
224997
-
224998
- // Convert points
224999
- for(i = 0; i < len; i++) {
225000
- // sanitize numbers and apply transforms based on axes.type
225001
- xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
225002
- yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
225003
- zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
225004
-
225005
- points[i] = [xc, yc, zc];
225006
- }
225007
-
225008
- // convert text
225009
- if(Array.isArray(data.text)) {
225010
- text = data.text;
225011
- } else if(Lib.isTypedArray(data.text)) {
225012
- text = Array.from(data.text);
225013
- } else if(data.text !== undefined) {
225014
- text = new Array(len);
225015
- for(i = 0; i < len; i++) text[i] = data.text;
225016
- }
225017
-
225018
- function formatter(axName, val) {
225019
- var ax = sceneLayout[axName];
225020
- return Axes.tickText(ax, ax.d2l(val), true).text;
225021
- }
225022
-
225023
- // check texttemplate
225024
- var texttemplate = data.texttemplate;
225025
- if(texttemplate) {
225026
- var fullLayout = scene.fullLayout;
225027
- var d3locale = fullLayout._d3locale;
225028
- var isArray = Array.isArray(texttemplate);
225029
- var N = isArray ? Math.min(texttemplate.length, len) : len;
225030
- var txt = isArray ?
225031
- function(i) { return texttemplate[i]; } :
225032
- function() { return texttemplate; };
225033
-
225034
- text = new Array(N);
225035
-
225036
- for(i = 0; i < N; i++) {
225037
- var d = {x: x[i], y: y[i], z: z[i]};
225038
- var labels = {
225039
- xLabel: formatter('xaxis', x[i]),
225040
- yLabel: formatter('yaxis', y[i]),
225041
- zLabel: formatter('zaxis', z[i])
225042
- };
225043
- var pointValues = {};
225044
- appendArrayPointValue(pointValues, data, i);
225045
- var meta = data._meta || {};
225046
- text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
225047
- }
225048
- }
225049
-
225050
- // Build object parameters
225051
- params = {
225052
- position: points,
225053
- mode: data.mode,
225054
- text: text
225055
- };
225056
-
225057
- if('line' in data) {
225058
- params.lineColor = formatColor(line, 1, len);
225059
- params.lineWidth = line.width;
225060
- params.lineDashes = line.dash;
225061
- }
225062
-
225063
- if('marker' in data) {
225064
- var sizeFn = makeBubbleSizeFn(data);
225065
-
225066
- params.scatterColor = formatColor(marker, 1, len);
225067
- params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
225068
- params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
225069
- params.scatterLineWidth = marker.line.width; // arrayOk === false
225070
- params.scatterLineColor = formatColor(marker.line, 1, len);
225071
- params.scatterAngle = 0;
225072
- }
225073
-
225074
- if('textposition' in data) {
225075
- params.textOffset = calculateTextOffset(data.textposition);
225076
- params.textColor = formatColor(data.textfont, 1, len);
225077
- params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
225078
- params.textFontFamily = data.textfont.family;
225079
- params.textFontWeight = data.textfont.weight;
225080
- params.textFontStyle = data.textfont.style;
225081
- params.textFontVariant = data.textfont.variant;
225082
- params.textAngle = 0;
225083
- }
225084
-
225085
- var dims = ['x', 'y', 'z'];
225086
- params.project = [false, false, false];
225087
- params.projectScale = [1, 1, 1];
225088
- params.projectOpacity = [1, 1, 1];
225089
- for(i = 0; i < 3; ++i) {
225090
- var projection = data.projection[dims[i]];
225091
- if((params.project[i] = projection.show)) {
225092
- params.projectOpacity[i] = projection.opacity;
225093
- params.projectScale[i] = projection.scale;
225094
- }
225095
- }
225096
-
225097
- params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
225098
-
225099
- var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
225100
- params.errorColor = errorParams.color;
225101
- params.errorLineWidth = errorParams.lineWidth;
225102
- params.errorCapSize = errorParams.capSize;
225103
-
225104
- params.delaunayAxis = data.surfaceaxis;
225105
- params.delaunayColor = str2RgbaArray(data.surfacecolor);
225106
-
225107
- return params;
225108
- }
225109
-
225110
- function _arrayToColor(color) {
225111
- if(Lib.isArrayOrTypedArray(color)) {
225112
- var c = color[0];
225113
-
225114
- if(Lib.isArrayOrTypedArray(c)) color = c;
225115
-
225116
- return 'rgb(' + color.slice(0, 3).map(function(x) {
225117
- return Math.round(x * 255);
225118
- }) + ')';
225119
- }
225120
-
225121
- return null;
225122
- }
225123
-
225124
- function arrayToColor(colors) {
225125
- if(!Lib.isArrayOrTypedArray(colors)) {
225126
- return null;
225127
- }
225128
-
225129
- if((colors.length === 4) && (typeof colors[0] === 'number')) {
225130
- return _arrayToColor(colors);
225131
- }
225132
-
225133
- return colors.map(_arrayToColor);
225134
- }
225135
-
225136
- proto.update = function(data) {
225137
- var gl = this.scene.glplot.gl;
225138
- var lineOptions;
225139
- var scatterOptions;
225140
- var errorOptions;
225141
- var textOptions;
225142
- var dashPattern = DASH_PATTERNS.solid;
225143
-
225144
- // Save data
225145
- this.data = data;
225146
-
225147
- // Run data conversion
225148
- var options = convertPlotlyOptions(this.scene, data);
225149
-
225150
- if('mode' in options) {
225151
- this.mode = options.mode;
225152
- }
225153
- if('lineDashes' in options) {
225154
- if(options.lineDashes in DASH_PATTERNS) {
225155
- dashPattern = DASH_PATTERNS[options.lineDashes];
225156
- }
225157
- }
225158
-
225159
- this.color = arrayToColor(options.scatterColor) ||
225160
- arrayToColor(options.lineColor);
225161
-
225162
- // Save data points
225163
- this.dataPoints = options.position;
225164
-
225165
- lineOptions = {
225166
- gl: this.scene.glplot.gl,
225167
- position: options.position,
225168
- color: options.lineColor,
225169
- lineWidth: options.lineWidth || 1,
225170
- dashes: dashPattern[0],
225171
- dashScale: dashPattern[1],
225172
- opacity: data.opacity,
225173
- connectGaps: data.connectgaps
225174
- };
225175
-
225176
- if(this.mode.indexOf('lines') !== -1) {
225177
- if(this.linePlot) this.linePlot.update(lineOptions);
225178
- else {
225179
- this.linePlot = createLinePlot(lineOptions);
225180
- this.linePlot._trace = this;
225181
- this.scene.glplot.add(this.linePlot);
225182
- }
225183
- } else if(this.linePlot) {
225184
- this.scene.glplot.remove(this.linePlot);
225185
- this.linePlot.dispose();
225186
- this.linePlot = null;
225187
- }
225188
-
225189
- // N.B. marker.opacity must be a scalar for performance
225190
- var scatterOpacity = data.opacity;
225191
- if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
225192
-
225193
- scatterOptions = {
225194
- gl: this.scene.glplot.gl,
225195
- position: options.position,
225196
- color: options.scatterColor,
225197
- size: options.scatterSize,
225198
- glyph: options.scatterMarker,
225199
- opacity: scatterOpacity,
225200
- orthographic: true,
225201
- lineWidth: options.scatterLineWidth,
225202
- lineColor: options.scatterLineColor,
225203
- project: options.project,
225204
- projectScale: options.projectScale,
225205
- projectOpacity: options.projectOpacity
225206
- };
225207
-
225208
- if(this.mode.indexOf('markers') !== -1) {
225209
- if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
225210
- else {
225211
- this.scatterPlot = createScatterPlot(scatterOptions);
225212
- this.scatterPlot._trace = this;
225213
- this.scatterPlot.highlightScale = 1;
225214
- this.scene.glplot.add(this.scatterPlot);
225215
- }
225216
- } else if(this.scatterPlot) {
225217
- this.scene.glplot.remove(this.scatterPlot);
225218
- this.scatterPlot.dispose();
225219
- this.scatterPlot = null;
225220
- }
225221
-
225222
- textOptions = {
225223
- gl: this.scene.glplot.gl,
225224
- position: options.position,
225225
- glyph: options.text,
225226
- color: options.textColor,
225227
- size: options.textSize,
225228
- angle: options.textAngle,
225229
- alignment: options.textOffset,
225230
- font: options.textFontFamily,
225231
- fontWeight: options.textFontWeight,
225232
- fontStyle: options.textFontStyle,
225233
- fontVariant: options.textFontVariant,
225234
- orthographic: true,
225235
- lineWidth: 0,
225236
- project: false,
225237
- opacity: data.opacity
225238
- };
225239
-
225240
- this.textLabels = data.hovertext || data.text;
225241
-
225242
- if(this.mode.indexOf('text') !== -1) {
225243
- if(this.textMarkers) this.textMarkers.update(textOptions);
225244
- else {
225245
- this.textMarkers = createScatterPlot(textOptions);
225246
- this.textMarkers._trace = this;
225247
- this.textMarkers.highlightScale = 1;
225248
- this.scene.glplot.add(this.textMarkers);
225249
- }
225250
- } else if(this.textMarkers) {
225251
- this.scene.glplot.remove(this.textMarkers);
225252
- this.textMarkers.dispose();
225253
- this.textMarkers = null;
225254
- }
225255
-
225256
- errorOptions = {
225257
- gl: this.scene.glplot.gl,
225258
- position: options.position,
225259
- color: options.errorColor,
225260
- error: options.errorBounds,
225261
- lineWidth: options.errorLineWidth,
225262
- capSize: options.errorCapSize,
225263
- opacity: data.opacity
225264
- };
225265
- if(this.errorBars) {
225266
- if(options.errorBounds) {
225267
- this.errorBars.update(errorOptions);
225268
- } else {
225269
- this.scene.glplot.remove(this.errorBars);
225270
- this.errorBars.dispose();
225271
- this.errorBars = null;
225272
- }
225273
- } else if(options.errorBounds) {
225274
- this.errorBars = createErrorBars(errorOptions);
225275
- this.errorBars._trace = this;
225276
- this.scene.glplot.add(this.errorBars);
225277
- }
225278
-
225279
- if(options.delaunayAxis >= 0) {
225280
- var delaunayOptions = constructDelaunay(
225281
- options.position,
225282
- options.delaunayColor,
225283
- options.delaunayAxis
225284
- );
225285
- delaunayOptions.opacity = data.opacity;
225286
-
225287
- if(this.delaunayMesh) {
225288
- this.delaunayMesh.update(delaunayOptions);
225289
- } else {
225290
- delaunayOptions.gl = gl;
225291
- this.delaunayMesh = createMesh(delaunayOptions);
225292
- this.delaunayMesh._trace = this;
225293
- this.scene.glplot.add(this.delaunayMesh);
225294
- }
225295
- } else if(this.delaunayMesh) {
225296
- this.scene.glplot.remove(this.delaunayMesh);
225297
- this.delaunayMesh.dispose();
225298
- this.delaunayMesh = null;
225299
- }
225300
- };
225301
-
225302
- proto.dispose = function() {
225303
- if(this.linePlot) {
225304
- this.scene.glplot.remove(this.linePlot);
225305
- this.linePlot.dispose();
225306
- }
225307
- if(this.scatterPlot) {
225308
- this.scene.glplot.remove(this.scatterPlot);
225309
- this.scatterPlot.dispose();
225310
- }
225311
- if(this.errorBars) {
225312
- this.scene.glplot.remove(this.errorBars);
225313
- this.errorBars.dispose();
225314
- }
225315
- if(this.textMarkers) {
225316
- this.scene.glplot.remove(this.textMarkers);
225317
- this.textMarkers.dispose();
225318
- }
225319
- if(this.delaunayMesh) {
225320
- this.scene.glplot.remove(this.delaunayMesh);
225321
- this.delaunayMesh.dispose();
225322
- }
225323
- };
225324
-
225325
- function createLineWithMarkers(scene, data) {
225326
- var plot = new LineWithMarkers(scene, data.uid);
225327
- plot.update(data);
225328
- return plot;
225329
- }
225330
-
225331
- module.exports = createLineWithMarkers;
225332
-
225333
-
225334
- /***/ }),
225335
-
225336
- /***/ 13744:
225337
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
225338
-
225339
-
225340
-
225341
- var Registry = __webpack_require__(13936);
225342
- var Lib = __webpack_require__(30991);
225343
-
225344
- var subTypes = __webpack_require__(33068);
225345
- var handleMarkerDefaults = __webpack_require__(15294);
225346
- var handleLineDefaults = __webpack_require__(82094);
225347
- var handleTextDefaults = __webpack_require__(94729);
225348
-
225349
- var attributes = __webpack_require__(1015);
225350
-
225351
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
225352
- function coerce(attr, dflt) {
225353
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
225354
- }
225355
-
225356
- var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
225357
- if(!len) {
225358
- traceOut.visible = false;
225359
- return;
225360
- }
225361
-
225362
- coerce('text');
225363
- coerce('hovertext');
225364
- coerce('hovertemplate');
225365
- coerce('xhoverformat');
225366
- coerce('yhoverformat');
225367
- coerce('zhoverformat');
225368
-
225369
- coerce('mode');
225370
-
225371
- if(subTypes.hasMarkers(traceOut)) {
225372
- handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
225373
- }
225374
-
225375
- if(subTypes.hasLines(traceOut)) {
225376
- coerce('connectgaps');
225377
- handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
225378
- }
225379
-
225380
- if(subTypes.hasText(traceOut)) {
225381
- coerce('texttemplate');
225382
- handleTextDefaults(traceIn, traceOut, layout, coerce, {
225383
- noSelect: true,
225384
- noFontShadow: true,
225385
- noFontLineposition: true,
225386
- noFontTextcase: true,
225387
- });
225388
- }
225389
-
225390
- var lineColor = (traceOut.line || {}).color;
225391
- var markerColor = (traceOut.marker || {}).color;
225392
- if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
225393
-
225394
- var dims = ['x', 'y', 'z'];
225395
- for(var i = 0; i < 3; ++i) {
225396
- var projection = 'projection.' + dims[i];
225397
- if(coerce(projection + '.show')) {
225398
- coerce(projection + '.opacity');
225399
- coerce(projection + '.scale');
225400
- }
225401
- }
225402
-
225403
- var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
225404
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
225405
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
225406
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
225407
- };
225408
-
225409
- function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
225410
- var len = 0;
225411
- var x = coerce('x');
225412
- var y = coerce('y');
225413
- var z = coerce('z');
225414
-
225415
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
225416
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
225417
-
225418
- if(x && y && z) {
225419
- // TODO: what happens if one is missing?
225420
- len = Math.min(x.length, y.length, z.length);
225421
- traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
225422
- }
225423
-
225424
- return len;
225425
- }
225426
-
225427
-
225428
- /***/ }),
225429
-
225430
- /***/ 68860:
225431
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
225432
-
225433
-
225434
-
225435
- module.exports = {
225436
- plot: __webpack_require__(93219),
225437
- attributes: __webpack_require__(1015),
225438
- markerSymbols: __webpack_require__(98993),
225439
- supplyDefaults: __webpack_require__(13744),
225440
- colorbar: [
225441
- {
225442
- container: 'marker',
225443
- min: 'cmin',
225444
- max: 'cmax'
225445
- }, {
225446
- container: 'line',
225447
- min: 'cmin',
225448
- max: 'cmax'
225449
- }
225450
- ],
225451
- calc: __webpack_require__(30935),
225452
-
225453
- moduleType: 'trace',
225454
- name: 'scatter3d',
225455
- basePlotModule: __webpack_require__(68137),
225456
- categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
225457
- meta: {
225458
- hrName: 'scatter_3d',
225459
- description: [
225460
- 'The data visualized as scatter point or lines in 3D dimension',
225461
- 'is set in `x`, `y`, `z`.',
225462
- 'Text (appearing either on the chart or on hover only) is via `text`.',
225463
- 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
225464
- 'Projections are achieved via `projection`.',
225465
- 'Surface fills are achieved via `surfaceaxis`.'
225466
- ].join(' ')
225467
- }
225468
- };
225469
-
225470
-
225471
225471
  /***/ }),
225472
225472
 
225473
225473
  /***/ 44771:
@@ -320691,49 +320691,49 @@ function HtmlRunner() {
320691
320691
  const body = indexPage.querySelector("body") || indexPage;
320692
320692
  // insert script to disable access to specific localStorage keys
320693
320693
  // localstorage.getItem() is a potential security risk when executing untrusted code
320694
- const disableLocalStorageScript = `
320695
- <script>
320696
- (function() {
320697
- const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
320698
- const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
320699
- const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
320700
- const originalClear = window.localStorage.clear.bind(window.localStorage);
320701
-
320702
- const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
320703
-
320704
- Object.defineProperty(window, 'localStorage', {
320705
- value: {
320706
- getItem: function(key) {
320707
- if (isDisallowedKey(key)) {
320708
- console.log(\`localStorage.getItem for "\${key}" is disabled\`);
320709
- return null;
320710
- }
320711
- return originalGetItem(key);
320712
- },
320713
- setItem: function(key, value) {
320714
- if (isDisallowedKey(key)) {
320715
- console.log(\`localStorage.setItem for "\${key}" is disabled\`);
320716
- return;
320717
- }
320718
- return originalSetItem(key, value);
320719
- },
320720
- removeItem: function(key) {
320721
- if (isDisallowedKey(key)) {
320722
- console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
320723
- return;
320724
- }
320725
- return originalRemoveItem(key);
320726
- },
320727
- clear: function() {
320728
- console.log('localStorage.clear is disabled');
320729
- return;
320730
- }
320731
- },
320732
- writable: false,
320733
- configurable: false
320734
- });
320735
- })();
320736
- </script>
320694
+ const disableLocalStorageScript = `
320695
+ <script>
320696
+ (function() {
320697
+ const originalGetItem = window.localStorage.getItem.bind(window.localStorage);
320698
+ const originalSetItem = window.localStorage.setItem.bind(window.localStorage);
320699
+ const originalRemoveItem = window.localStorage.removeItem.bind(window.localStorage);
320700
+ const originalClear = window.localStorage.clear.bind(window.localStorage);
320701
+
320702
+ const isDisallowedKey = (key) => key === 'authKey' || key.startsWith('oidc.');
320703
+
320704
+ Object.defineProperty(window, 'localStorage', {
320705
+ value: {
320706
+ getItem: function(key) {
320707
+ if (isDisallowedKey(key)) {
320708
+ console.log(\`localStorage.getItem for "\${key}" is disabled\`);
320709
+ return null;
320710
+ }
320711
+ return originalGetItem(key);
320712
+ },
320713
+ setItem: function(key, value) {
320714
+ if (isDisallowedKey(key)) {
320715
+ console.log(\`localStorage.setItem for "\${key}" is disabled\`);
320716
+ return;
320717
+ }
320718
+ return originalSetItem(key, value);
320719
+ },
320720
+ removeItem: function(key) {
320721
+ if (isDisallowedKey(key)) {
320722
+ console.log(\`localStorage.removeItem for "\${key}" is disabled\`);
320723
+ return;
320724
+ }
320725
+ return originalRemoveItem(key);
320726
+ },
320727
+ clear: function() {
320728
+ console.log('localStorage.clear is disabled');
320729
+ return;
320730
+ }
320731
+ },
320732
+ writable: false,
320733
+ configurable: false
320734
+ });
320735
+ })();
320736
+ </script>
320737
320737
  `;
320738
320738
  body.insertAdjacentHTML("afterbegin", disableLocalStorageScript);
320739
320739
  replaceHrefNodes(indexPage, projectCode);
@@ -320801,18 +320801,15 @@ const plus_circle_svg_1 = __importDefault(__webpack_require__(45494));
320801
320801
  const minus_circle_svg_1 = __importDefault(__webpack_require__(71720));
320802
320802
  const add_folder_svg_1 = __importDefault(__webpack_require__(3503));
320803
320803
  const add_file_svg_1 = __importDefault(__webpack_require__(41625));
320804
- const upload_file_svg_1 = __importDefault(__webpack_require__(98201));
320804
+ const ImportButton_1 = __webpack_require__(67532);
320805
320805
  const classnames_1 = __importDefault(__webpack_require__(46942));
320806
320806
  const styles_module_scss_1 = __importDefault(__webpack_require__(79473));
320807
- const SvgIcon_1 = __webpack_require__(82917);
320808
320807
  const react_1 = __webpack_require__(51649);
320809
320808
  const FileTreeContext_1 = __webpack_require__(5323);
320810
320809
  const ProjectTypes_1 = __webpack_require__(27130);
320811
320810
  const FileTreeActions = ({ hasExpandedNodes, }) => {
320812
- const { expandAll, collapseAll, createComponent } = (0, react_1.useContext)(FileTreeContext_1.TreeContext);
320813
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fileTreeActions, children: [hasExpandedNodes ? ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Collapse all folders", onClick: collapseAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(minus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Expand all folders", onClick: expandAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(plus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) })), (0, jsx_runtime_1.jsx)("p", { className: styles_module_scss_1.default.label, children: "Project files" }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add folder", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.DIR), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_folder_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add file", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.FILE), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_file_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Upload file", onClick: () => {
320814
- console.log("Upload file clicked");
320815
- }, className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: upload_file_svg_1.default, size: 16, "aria-hidden": "true", focusable: "false" }) })] }));
320811
+ const { expandAll, collapseAll, createComponent, importFiles } = (0, react_1.useContext)(FileTreeContext_1.TreeContext);
320812
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fileTreeActions, children: [hasExpandedNodes ? ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Collapse all folders", onClick: collapseAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(minus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Expand all folders", onClick: expandAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(plus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) })), (0, jsx_runtime_1.jsx)("p", { className: styles_module_scss_1.default.label, children: "Project files" }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add folder", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.DIR), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_folder_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add file", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.FILE), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_file_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles })] }));
320816
320813
  };
320817
320814
  exports.FileTreeActions = FileTreeActions;
320818
320815
 
@@ -320912,6 +320909,37 @@ const FileTreeItem = ({ item, guides, activeLevel, }) => {
320912
320909
  exports.FileTreeItem = FileTreeItem;
320913
320910
 
320914
320911
 
320912
+ /***/ }),
320913
+
320914
+ /***/ 67532:
320915
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
320916
+
320917
+
320918
+ var __importDefault = (this && this.__importDefault) || function (mod) {
320919
+ return (mod && mod.__esModule) ? mod : { "default": mod };
320920
+ };
320921
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
320922
+ exports.ImportButton = void 0;
320923
+ const jsx_runtime_1 = __webpack_require__(74848);
320924
+ const react_1 = __webpack_require__(51649);
320925
+ const classnames_1 = __importDefault(__webpack_require__(46942));
320926
+ const upload_file_svg_1 = __importDefault(__webpack_require__(98201));
320927
+ const SvgIcon_1 = __webpack_require__(82917);
320928
+ const styles_module_scss_1 = __importDefault(__webpack_require__(79473));
320929
+ const ImportButton = ({ importFiles, }) => {
320930
+ const inputRef = (0, react_1.useRef)(null);
320931
+ const onChange = (e) => {
320932
+ const files = e.target.files;
320933
+ if (!files || files.length === 0)
320934
+ return;
320935
+ importFiles(Array.from(files));
320936
+ e.currentTarget.value = "";
320937
+ };
320938
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "file", hidden: true, multiple: true, onChange: onChange }), (0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Upload file", onClick: () => inputRef.current?.click(), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: upload_file_svg_1.default, size: 18, "aria-hidden": "true", focusable: "false" }) })] }));
320939
+ };
320940
+ exports.ImportButton = ImportButton;
320941
+
320942
+
320915
320943
  /***/ }),
320916
320944
 
320917
320945
  /***/ 5323:
@@ -320931,7 +320959,7 @@ exports.TreeContext = (0, react_1.createContext)({});
320931
320959
 
320932
320960
 
320933
320961
  Object.defineProperty(exports, "__esModule", ({ value: true }));
320934
- exports.parseFileName = void 0;
320962
+ exports.getUniqueNameFromItem = exports.parseFileName = void 0;
320935
320963
  const parseFileName = (fileName) => {
320936
320964
  // Find the last dot in the filename, ignoring a leading dot (for hidden files)
320937
320965
  const lastDotIndex = fileName.lastIndexOf(".");
@@ -320947,6 +320975,18 @@ const parseFileName = (fileName) => {
320947
320975
  }
320948
320976
  };
320949
320977
  exports.parseFileName = parseFileName;
320978
+ const getUniqueNameFromItem = (folderItem, baseName, extension = "") => {
320979
+ const existingNames = folderItem.getChildren()?.map(child => child.getItemName()) ?? [];
320980
+ const fullName = (name) => `${name}${extension ? "." + extension : ""}`;
320981
+ let name = baseName;
320982
+ let counter = 1;
320983
+ while (existingNames.includes(fullName(name))) {
320984
+ name = `${baseName} (${counter})`;
320985
+ counter++;
320986
+ }
320987
+ return name;
320988
+ };
320989
+ exports.getUniqueNameFromItem = getUniqueNameFromItem;
320950
320990
 
320951
320991
 
320952
320992
  /***/ }),
@@ -321190,6 +321230,7 @@ const useFileTreeActions = () => {
321190
321230
  ...selectedFolderData,
321191
321231
  children: [...(selectedFolderData.children ?? []), newComponent.id],
321192
321232
  }));
321233
+ tree.rebuildTree();
321193
321234
  // Start renaming the new node after it is added to the tree
321194
321235
  setTimeout(() => {
321195
321236
  tree.getItemInstance(newComponent.id)?.startRenaming();
@@ -321203,11 +321244,46 @@ const useFileTreeActions = () => {
321203
321244
  tree.rebuildTree();
321204
321245
  }
321205
321246
  }, [dispatch, tree]);
321247
+ const importFiles = (0, react_1.useCallback)(async (files) => {
321248
+ let nearestFolder = tree.getFocusedItem();
321249
+ while (!nearestFolder.isFolder()) {
321250
+ const parent = nearestFolder.getParent();
321251
+ if (!parent)
321252
+ return;
321253
+ nearestFolder = parent;
321254
+ }
321255
+ nearestFolder.expand();
321256
+ const folderData = nearestFolder.getItemData();
321257
+ const newIds = [];
321258
+ const filesToCreate = await Promise.all(files.map(async (file) => {
321259
+ const { name, extension } = (0, helpers_1.parseFileName)(file.name);
321260
+ const uniqueName = (0, helpers_1.getUniqueNameFromItem)(nearestFolder, name, extension);
321261
+ const content = await file.text();
321262
+ const id = crypto.randomUUID();
321263
+ newIds.push(id);
321264
+ return {
321265
+ id,
321266
+ name: uniqueName,
321267
+ extension,
321268
+ content,
321269
+ type: ProjectTypes_1.ProjectComponentType.FILE,
321270
+ };
321271
+ }));
321272
+ for (const file of filesToCreate) {
321273
+ dispatch((0, EditorSlice_1.addProjectComponent)(file));
321274
+ }
321275
+ dispatch((0, EditorSlice_1.updateProjectComponent)({
321276
+ ...folderData,
321277
+ children: [...(folderData.children ?? []), ...newIds],
321278
+ }));
321279
+ tree.rebuildTree();
321280
+ }, [dispatch, tree, projectFiles]);
321206
321281
  return {
321207
321282
  createComponent,
321208
321283
  cancelRenaming,
321209
321284
  tree,
321210
321285
  completeRenaming: tree.completeRenaming,
321286
+ importFiles,
321211
321287
  ...restTreeProps,
321212
321288
  };
321213
321289
  };
@@ -321238,7 +321314,7 @@ const FileTree = () => {
321238
321314
  const projectFiles = (0, stores_1.useAppSelector)((state) => state.editor.project.components);
321239
321315
  const focussedFileIndex = (0, stores_1.useAppSelector)((state) => state.editor.focussedFileIndices)[0];
321240
321316
  const openFiles = (0, stores_1.useAppSelector)((state) => state.editor.openFiles)[0];
321241
- const { createComponent, cancelRenaming, focusedItem, setFocusedItem, tree, completeRenaming, } = (0, useFileTreeActions_1.useFileTreeActions)();
321317
+ const { createComponent, cancelRenaming, focusedItem, setFocusedItem, tree, completeRenaming, importFiles, } = (0, useFileTreeActions_1.useFileTreeActions)();
321242
321318
  const treeItems = tree
321243
321319
  .getItems()
321244
321320
  .filter((item) => projectFiles.some((f) => f.id === item.getId()));
@@ -321266,7 +321342,8 @@ const FileTree = () => {
321266
321342
  completeRenaming,
321267
321343
  collapseAll: tree.collapseAll,
321268
321344
  expandAll: tree.expandAll,
321269
- }), [createComponent, cancelRenaming, completeRenaming, tree]);
321345
+ importFiles,
321346
+ }), [createComponent, cancelRenaming, completeRenaming, tree, importFiles]);
321270
321347
  return ((0, jsx_runtime_1.jsxs)(FileTreeContext_1.TreeContext.Provider, { value: treeCtx, children: [(0, jsx_runtime_1.jsx)(FileTreeActions_1.FileTreeActions, { hasExpandedNodes: Boolean(tree.getState().expandedItems.length) }), (0, jsx_runtime_1.jsxs)("div", { ...tree.getContainerProps(), className: styles_module_scss_1.default.tree, children: [treeItems.map((item, i) => ((0, jsx_runtime_1.jsx)(FileTreeItem_1.FileTreeItem, { item: item, guides: guidesByIndex[i], activeLevel: activeLevel }, item.getId()))), (0, jsx_runtime_1.jsx)("div", { style: tree.getDragLineStyle(), className: styles_module_scss_1.default.dragline })] })] }));
321271
321348
  };
321272
321349
  exports.FileTree = FileTree;