gwchq-textjam 0.1.9 → 0.1.10

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
@@ -63641,115 +63641,6 @@ function escapeName(str, charsToEscape) {
63641
63641
 
63642
63642
 
63643
63643
 
63644
- /***/ }),
63645
-
63646
- /***/ 16450:
63647
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
63648
-
63649
-
63650
-
63651
- var isValue = __webpack_require__(48175)
63652
- , ensureValue = __webpack_require__(34809)
63653
- , ensurePlainFunction = __webpack_require__(90251)
63654
- , copy = __webpack_require__(30203)
63655
- , normalizeOptions = __webpack_require__(90148)
63656
- , map = __webpack_require__(30498);
63657
-
63658
- var bind = Function.prototype.bind
63659
- , defineProperty = Object.defineProperty
63660
- , hasOwnProperty = Object.prototype.hasOwnProperty
63661
- , define;
63662
-
63663
- define = function (name, desc, options) {
63664
- var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
63665
- dgs = copy(desc);
63666
- delete dgs.writable;
63667
- delete dgs.value;
63668
- dgs.get = function () {
63669
- if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
63670
- desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
63671
- defineProperty(this, name, desc);
63672
- return this[name];
63673
- };
63674
- return dgs;
63675
- };
63676
-
63677
- module.exports = function (props/*, options*/) {
63678
- var options = normalizeOptions(arguments[1]);
63679
- if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
63680
- return map(props, function (desc, name) { return define(name, desc, options); });
63681
- };
63682
-
63683
-
63684
- /***/ }),
63685
-
63686
- /***/ 58263:
63687
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
63688
-
63689
-
63690
-
63691
- var isValue = __webpack_require__(48175)
63692
- , isPlainFunction = __webpack_require__(6873)
63693
- , assign = __webpack_require__(16596)
63694
- , normalizeOpts = __webpack_require__(90148)
63695
- , contains = __webpack_require__(70214);
63696
-
63697
- var d = (module.exports = function (dscr, value/*, options*/) {
63698
- var c, e, w, options, desc;
63699
- if (arguments.length < 2 || typeof dscr !== "string") {
63700
- options = value;
63701
- value = dscr;
63702
- dscr = null;
63703
- } else {
63704
- options = arguments[2];
63705
- }
63706
- if (isValue(dscr)) {
63707
- c = contains.call(dscr, "c");
63708
- e = contains.call(dscr, "e");
63709
- w = contains.call(dscr, "w");
63710
- } else {
63711
- c = w = true;
63712
- e = false;
63713
- }
63714
-
63715
- desc = { value: value, configurable: c, enumerable: e, writable: w };
63716
- return !options ? desc : assign(normalizeOpts(options), desc);
63717
- });
63718
-
63719
- d.gs = function (dscr, get, set/*, options*/) {
63720
- var c, e, options, desc;
63721
- if (typeof dscr !== "string") {
63722
- options = set;
63723
- set = get;
63724
- get = dscr;
63725
- dscr = null;
63726
- } else {
63727
- options = arguments[3];
63728
- }
63729
- if (!isValue(get)) {
63730
- get = undefined;
63731
- } else if (!isPlainFunction(get)) {
63732
- options = get;
63733
- get = set = undefined;
63734
- } else if (!isValue(set)) {
63735
- set = undefined;
63736
- } else if (!isPlainFunction(set)) {
63737
- options = set;
63738
- set = undefined;
63739
- }
63740
- if (isValue(dscr)) {
63741
- c = contains.call(dscr, "c");
63742
- e = contains.call(dscr, "e");
63743
- } else {
63744
- c = true;
63745
- e = false;
63746
- }
63747
-
63748
- desc = { get: get, set: set, configurable: c, enumerable: e };
63749
- return !options ? desc : assign(normalizeOpts(options), desc);
63750
- };
63751
-
63752
-
63753
63644
  /***/ }),
63754
63645
 
63755
63646
  /***/ 83999:
@@ -78578,6 +78469,115 @@ year.every = function(k) {
78578
78469
  var years = year.range;
78579
78470
 
78580
78471
 
78472
+ /***/ }),
78473
+
78474
+ /***/ 16450:
78475
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
78476
+
78477
+
78478
+
78479
+ var isValue = __webpack_require__(48175)
78480
+ , ensureValue = __webpack_require__(34809)
78481
+ , ensurePlainFunction = __webpack_require__(90251)
78482
+ , copy = __webpack_require__(30203)
78483
+ , normalizeOptions = __webpack_require__(90148)
78484
+ , map = __webpack_require__(30498);
78485
+
78486
+ var bind = Function.prototype.bind
78487
+ , defineProperty = Object.defineProperty
78488
+ , hasOwnProperty = Object.prototype.hasOwnProperty
78489
+ , define;
78490
+
78491
+ define = function (name, desc, options) {
78492
+ var value = ensureValue(desc) && ensurePlainFunction(desc.value), dgs;
78493
+ dgs = copy(desc);
78494
+ delete dgs.writable;
78495
+ delete dgs.value;
78496
+ dgs.get = function () {
78497
+ if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
78498
+ desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
78499
+ defineProperty(this, name, desc);
78500
+ return this[name];
78501
+ };
78502
+ return dgs;
78503
+ };
78504
+
78505
+ module.exports = function (props/*, options*/) {
78506
+ var options = normalizeOptions(arguments[1]);
78507
+ if (isValue(options.resolveContext)) ensurePlainFunction(options.resolveContext);
78508
+ return map(props, function (desc, name) { return define(name, desc, options); });
78509
+ };
78510
+
78511
+
78512
+ /***/ }),
78513
+
78514
+ /***/ 58263:
78515
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
78516
+
78517
+
78518
+
78519
+ var isValue = __webpack_require__(48175)
78520
+ , isPlainFunction = __webpack_require__(6873)
78521
+ , assign = __webpack_require__(16596)
78522
+ , normalizeOpts = __webpack_require__(90148)
78523
+ , contains = __webpack_require__(70214);
78524
+
78525
+ var d = (module.exports = function (dscr, value/*, options*/) {
78526
+ var c, e, w, options, desc;
78527
+ if (arguments.length < 2 || typeof dscr !== "string") {
78528
+ options = value;
78529
+ value = dscr;
78530
+ dscr = null;
78531
+ } else {
78532
+ options = arguments[2];
78533
+ }
78534
+ if (isValue(dscr)) {
78535
+ c = contains.call(dscr, "c");
78536
+ e = contains.call(dscr, "e");
78537
+ w = contains.call(dscr, "w");
78538
+ } else {
78539
+ c = w = true;
78540
+ e = false;
78541
+ }
78542
+
78543
+ desc = { value: value, configurable: c, enumerable: e, writable: w };
78544
+ return !options ? desc : assign(normalizeOpts(options), desc);
78545
+ });
78546
+
78547
+ d.gs = function (dscr, get, set/*, options*/) {
78548
+ var c, e, options, desc;
78549
+ if (typeof dscr !== "string") {
78550
+ options = set;
78551
+ set = get;
78552
+ get = dscr;
78553
+ dscr = null;
78554
+ } else {
78555
+ options = arguments[3];
78556
+ }
78557
+ if (!isValue(get)) {
78558
+ get = undefined;
78559
+ } else if (!isPlainFunction(get)) {
78560
+ options = get;
78561
+ get = set = undefined;
78562
+ } else if (!isValue(set)) {
78563
+ set = undefined;
78564
+ } else if (!isPlainFunction(set)) {
78565
+ options = set;
78566
+ set = undefined;
78567
+ }
78568
+ if (isValue(dscr)) {
78569
+ c = contains.call(dscr, "c");
78570
+ e = contains.call(dscr, "e");
78571
+ } else {
78572
+ c = true;
78573
+ e = false;
78574
+ }
78575
+
78576
+ desc = { get: get, set: set, configurable: c, enumerable: e };
78577
+ return !options ? desc : assign(normalizeOpts(options), desc);
78578
+ };
78579
+
78580
+
78581
78581
  /***/ }),
78582
78582
 
78583
78583
  /***/ 30041:
@@ -94964,6 +94964,324 @@ function hsl2rgb(hsl) {
94964
94964
  }
94965
94965
 
94966
94966
 
94967
+ /***/ }),
94968
+
94969
+ /***/ 9793:
94970
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
94971
+
94972
+
94973
+
94974
+ var annAttrs = __webpack_require__(84676);
94975
+ var overrideAll = (__webpack_require__(70756).overrideAll);
94976
+ var templatedArray = (__webpack_require__(79338).templatedArray);
94977
+
94978
+ module.exports = overrideAll(templatedArray('annotation', {
94979
+ visible: annAttrs.visible,
94980
+ x: {
94981
+ valType: 'any',
94982
+ description: [
94983
+ 'Sets the annotation\'s x position.'
94984
+ ].join(' ')
94985
+ },
94986
+ y: {
94987
+ valType: 'any',
94988
+ description: [
94989
+ 'Sets the annotation\'s y position.'
94990
+ ].join(' ')
94991
+ },
94992
+ z: {
94993
+ valType: 'any',
94994
+ description: [
94995
+ 'Sets the annotation\'s z position.'
94996
+ ].join(' ')
94997
+ },
94998
+ ax: {
94999
+ valType: 'number',
95000
+ description: [
95001
+ 'Sets the x component of the arrow tail about the arrow head (in pixels).'
95002
+ ].join(' ')
95003
+ },
95004
+ ay: {
95005
+ valType: 'number',
95006
+ description: [
95007
+ 'Sets the y component of the arrow tail about the arrow head (in pixels).'
95008
+ ].join(' ')
95009
+ },
95010
+
95011
+ xanchor: annAttrs.xanchor,
95012
+ xshift: annAttrs.xshift,
95013
+ yanchor: annAttrs.yanchor,
95014
+ yshift: annAttrs.yshift,
95015
+
95016
+ text: annAttrs.text,
95017
+ textangle: annAttrs.textangle,
95018
+ font: annAttrs.font,
95019
+ width: annAttrs.width,
95020
+ height: annAttrs.height,
95021
+ opacity: annAttrs.opacity,
95022
+ align: annAttrs.align,
95023
+ valign: annAttrs.valign,
95024
+ bgcolor: annAttrs.bgcolor,
95025
+ bordercolor: annAttrs.bordercolor,
95026
+ borderpad: annAttrs.borderpad,
95027
+ borderwidth: annAttrs.borderwidth,
95028
+ showarrow: annAttrs.showarrow,
95029
+ arrowcolor: annAttrs.arrowcolor,
95030
+ arrowhead: annAttrs.arrowhead,
95031
+ startarrowhead: annAttrs.startarrowhead,
95032
+ arrowside: annAttrs.arrowside,
95033
+ arrowsize: annAttrs.arrowsize,
95034
+ startarrowsize: annAttrs.startarrowsize,
95035
+ arrowwidth: annAttrs.arrowwidth,
95036
+ standoff: annAttrs.standoff,
95037
+ startstandoff: annAttrs.startstandoff,
95038
+ hovertext: annAttrs.hovertext,
95039
+ hoverlabel: annAttrs.hoverlabel,
95040
+ captureevents: annAttrs.captureevents,
95041
+
95042
+ // maybes later?
95043
+ // clicktoshow: annAttrs.clicktoshow,
95044
+ // xclick: annAttrs.xclick,
95045
+ // yclick: annAttrs.yclick,
95046
+
95047
+ // not needed!
95048
+ // axref: 'pixel'
95049
+ // ayref: 'pixel'
95050
+ // xref: 'x'
95051
+ // yref: 'y
95052
+ // zref: 'z'
95053
+ }), 'calc', 'from-root');
95054
+
95055
+
95056
+ /***/ }),
95057
+
95058
+ /***/ 58121:
95059
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
95060
+
95061
+
95062
+
95063
+ var Lib = __webpack_require__(30991);
95064
+ var Axes = __webpack_require__(15076);
95065
+
95066
+ module.exports = function convert(scene) {
95067
+ var fullSceneLayout = scene.fullSceneLayout;
95068
+ var anns = fullSceneLayout.annotations;
95069
+
95070
+ for(var i = 0; i < anns.length; i++) {
95071
+ mockAnnAxes(anns[i], scene);
95072
+ }
95073
+
95074
+ scene.fullLayout._infolayer
95075
+ .selectAll('.annotation-' + scene.id)
95076
+ .remove();
95077
+ };
95078
+
95079
+ function mockAnnAxes(ann, scene) {
95080
+ var fullSceneLayout = scene.fullSceneLayout;
95081
+ var domain = fullSceneLayout.domain;
95082
+ var size = scene.fullLayout._size;
95083
+
95084
+ var base = {
95085
+ // this gets fill in on render
95086
+ pdata: null,
95087
+
95088
+ // to get setConvert to not execute cleanly
95089
+ type: 'linear',
95090
+
95091
+ // don't try to update them on `editable: true`
95092
+ autorange: false,
95093
+
95094
+ // set infinite range so that annotation draw routine
95095
+ // does not try to remove 'outside-range' annotations,
95096
+ // this case is handled in the render loop
95097
+ range: [-Infinity, Infinity]
95098
+ };
95099
+
95100
+ ann._xa = {};
95101
+ Lib.extendFlat(ann._xa, base);
95102
+ Axes.setConvert(ann._xa);
95103
+ ann._xa._offset = size.l + domain.x[0] * size.w;
95104
+ ann._xa.l2p = function() {
95105
+ return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
95106
+ };
95107
+
95108
+ ann._ya = {};
95109
+ Lib.extendFlat(ann._ya, base);
95110
+ Axes.setConvert(ann._ya);
95111
+ ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
95112
+ ann._ya.l2p = function() {
95113
+ return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
95114
+ };
95115
+ }
95116
+
95117
+
95118
+ /***/ }),
95119
+
95120
+ /***/ 41926:
95121
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
95122
+
95123
+
95124
+
95125
+ var Lib = __webpack_require__(30991);
95126
+ var Axes = __webpack_require__(15076);
95127
+ var handleArrayContainerDefaults = __webpack_require__(21238);
95128
+ var handleAnnotationCommonDefaults = __webpack_require__(84081);
95129
+ var attributes = __webpack_require__(9793);
95130
+
95131
+ module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
95132
+ handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
95133
+ name: 'annotations',
95134
+ handleItemDefaults: handleAnnotationDefaults,
95135
+ fullLayout: opts.fullLayout
95136
+ });
95137
+ };
95138
+
95139
+ function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
95140
+ function coerce(attr, dflt) {
95141
+ return Lib.coerce(annIn, annOut, attributes, attr, dflt);
95142
+ }
95143
+
95144
+ function coercePosition(axLetter) {
95145
+ var axName = axLetter + 'axis';
95146
+
95147
+ // mock in such way that getFromId grabs correct 3D axis
95148
+ var gdMock = { _fullLayout: {} };
95149
+ gdMock._fullLayout[axName] = sceneLayout[axName];
95150
+
95151
+ return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
95152
+ }
95153
+
95154
+
95155
+ var visible = coerce('visible');
95156
+ if(!visible) return;
95157
+
95158
+ handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
95159
+
95160
+ coercePosition('x');
95161
+ coercePosition('y');
95162
+ coercePosition('z');
95163
+
95164
+ // if you have one coordinate you should all three
95165
+ Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
95166
+
95167
+ // hard-set here for completeness
95168
+ annOut.xref = 'x';
95169
+ annOut.yref = 'y';
95170
+ annOut.zref = 'z';
95171
+
95172
+ coerce('xanchor');
95173
+ coerce('yanchor');
95174
+ coerce('xshift');
95175
+ coerce('yshift');
95176
+
95177
+ if(annOut.showarrow) {
95178
+ annOut.axref = 'pixel';
95179
+ annOut.ayref = 'pixel';
95180
+
95181
+ // TODO maybe default values should be bigger than the 2D case?
95182
+ coerce('ax', -10);
95183
+ coerce('ay', -30);
95184
+
95185
+ // if you have one part of arrow length you should have both
95186
+ Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
95187
+ }
95188
+ }
95189
+
95190
+
95191
+ /***/ }),
95192
+
95193
+ /***/ 13802:
95194
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
95195
+
95196
+
95197
+
95198
+ var drawRaw = (__webpack_require__(47995).drawRaw);
95199
+ var project = __webpack_require__(51344);
95200
+ var axLetters = ['x', 'y', 'z'];
95201
+
95202
+ module.exports = function draw(scene) {
95203
+ var fullSceneLayout = scene.fullSceneLayout;
95204
+ var dataScale = scene.dataScale;
95205
+ var anns = fullSceneLayout.annotations;
95206
+
95207
+ for(var i = 0; i < anns.length; i++) {
95208
+ var ann = anns[i];
95209
+ var annotationIsOffscreen = false;
95210
+
95211
+ for(var j = 0; j < 3; j++) {
95212
+ var axLetter = axLetters[j];
95213
+ var pos = ann[axLetter];
95214
+ var ax = fullSceneLayout[axLetter + 'axis'];
95215
+ var posFraction = ax.r2fraction(pos);
95216
+
95217
+ if(posFraction < 0 || posFraction > 1) {
95218
+ annotationIsOffscreen = true;
95219
+ break;
95220
+ }
95221
+ }
95222
+
95223
+ if(annotationIsOffscreen) {
95224
+ scene.fullLayout._infolayer
95225
+ .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
95226
+ .remove();
95227
+ } else {
95228
+ ann._pdata = project(scene.glplot.cameraParams, [
95229
+ fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
95230
+ fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
95231
+ fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
95232
+ ]);
95233
+
95234
+ drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
95235
+ }
95236
+ }
95237
+ };
95238
+
95239
+
95240
+ /***/ }),
95241
+
95242
+ /***/ 86578:
95243
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
95244
+
95245
+
95246
+
95247
+ var Registry = __webpack_require__(13936);
95248
+ var Lib = __webpack_require__(30991);
95249
+
95250
+ module.exports = {
95251
+ moduleType: 'component',
95252
+ name: 'annotations3d',
95253
+
95254
+ schema: {
95255
+ subplots: {
95256
+ scene: {annotations: __webpack_require__(9793)}
95257
+ }
95258
+ },
95259
+
95260
+ layoutAttributes: __webpack_require__(9793),
95261
+ handleDefaults: __webpack_require__(41926),
95262
+ includeBasePlot: includeGL3D,
95263
+
95264
+ convert: __webpack_require__(58121),
95265
+ draw: __webpack_require__(13802)
95266
+ };
95267
+
95268
+ function includeGL3D(layoutIn, layoutOut) {
95269
+ var GL3D = Registry.subplotsRegistry.gl3d;
95270
+ if(!GL3D) return;
95271
+
95272
+ var attrRegex = GL3D.attrRegex;
95273
+
95274
+ var keys = Object.keys(layoutIn);
95275
+ for(var i = 0; i < keys.length; i++) {
95276
+ var k = keys[i];
95277
+ if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
95278
+ Lib.pushUnique(layoutOut._basePlotModules, GL3D);
95279
+ Lib.pushUnique(layoutOut._subplots.gl3d, k);
95280
+ }
95281
+ }
95282
+ }
95283
+
95284
+
94967
95285
  /***/ }),
94968
95286
 
94969
95287
  /***/ 2595:
@@ -96937,324 +97255,6 @@ module.exports = {
96937
97255
  };
96938
97256
 
96939
97257
 
96940
- /***/ }),
96941
-
96942
- /***/ 9793:
96943
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
96944
-
96945
-
96946
-
96947
- var annAttrs = __webpack_require__(84676);
96948
- var overrideAll = (__webpack_require__(70756).overrideAll);
96949
- var templatedArray = (__webpack_require__(79338).templatedArray);
96950
-
96951
- module.exports = overrideAll(templatedArray('annotation', {
96952
- visible: annAttrs.visible,
96953
- x: {
96954
- valType: 'any',
96955
- description: [
96956
- 'Sets the annotation\'s x position.'
96957
- ].join(' ')
96958
- },
96959
- y: {
96960
- valType: 'any',
96961
- description: [
96962
- 'Sets the annotation\'s y position.'
96963
- ].join(' ')
96964
- },
96965
- z: {
96966
- valType: 'any',
96967
- description: [
96968
- 'Sets the annotation\'s z position.'
96969
- ].join(' ')
96970
- },
96971
- ax: {
96972
- valType: 'number',
96973
- description: [
96974
- 'Sets the x component of the arrow tail about the arrow head (in pixels).'
96975
- ].join(' ')
96976
- },
96977
- ay: {
96978
- valType: 'number',
96979
- description: [
96980
- 'Sets the y component of the arrow tail about the arrow head (in pixels).'
96981
- ].join(' ')
96982
- },
96983
-
96984
- xanchor: annAttrs.xanchor,
96985
- xshift: annAttrs.xshift,
96986
- yanchor: annAttrs.yanchor,
96987
- yshift: annAttrs.yshift,
96988
-
96989
- text: annAttrs.text,
96990
- textangle: annAttrs.textangle,
96991
- font: annAttrs.font,
96992
- width: annAttrs.width,
96993
- height: annAttrs.height,
96994
- opacity: annAttrs.opacity,
96995
- align: annAttrs.align,
96996
- valign: annAttrs.valign,
96997
- bgcolor: annAttrs.bgcolor,
96998
- bordercolor: annAttrs.bordercolor,
96999
- borderpad: annAttrs.borderpad,
97000
- borderwidth: annAttrs.borderwidth,
97001
- showarrow: annAttrs.showarrow,
97002
- arrowcolor: annAttrs.arrowcolor,
97003
- arrowhead: annAttrs.arrowhead,
97004
- startarrowhead: annAttrs.startarrowhead,
97005
- arrowside: annAttrs.arrowside,
97006
- arrowsize: annAttrs.arrowsize,
97007
- startarrowsize: annAttrs.startarrowsize,
97008
- arrowwidth: annAttrs.arrowwidth,
97009
- standoff: annAttrs.standoff,
97010
- startstandoff: annAttrs.startstandoff,
97011
- hovertext: annAttrs.hovertext,
97012
- hoverlabel: annAttrs.hoverlabel,
97013
- captureevents: annAttrs.captureevents,
97014
-
97015
- // maybes later?
97016
- // clicktoshow: annAttrs.clicktoshow,
97017
- // xclick: annAttrs.xclick,
97018
- // yclick: annAttrs.yclick,
97019
-
97020
- // not needed!
97021
- // axref: 'pixel'
97022
- // ayref: 'pixel'
97023
- // xref: 'x'
97024
- // yref: 'y
97025
- // zref: 'z'
97026
- }), 'calc', 'from-root');
97027
-
97028
-
97029
- /***/ }),
97030
-
97031
- /***/ 58121:
97032
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
97033
-
97034
-
97035
-
97036
- var Lib = __webpack_require__(30991);
97037
- var Axes = __webpack_require__(15076);
97038
-
97039
- module.exports = function convert(scene) {
97040
- var fullSceneLayout = scene.fullSceneLayout;
97041
- var anns = fullSceneLayout.annotations;
97042
-
97043
- for(var i = 0; i < anns.length; i++) {
97044
- mockAnnAxes(anns[i], scene);
97045
- }
97046
-
97047
- scene.fullLayout._infolayer
97048
- .selectAll('.annotation-' + scene.id)
97049
- .remove();
97050
- };
97051
-
97052
- function mockAnnAxes(ann, scene) {
97053
- var fullSceneLayout = scene.fullSceneLayout;
97054
- var domain = fullSceneLayout.domain;
97055
- var size = scene.fullLayout._size;
97056
-
97057
- var base = {
97058
- // this gets fill in on render
97059
- pdata: null,
97060
-
97061
- // to get setConvert to not execute cleanly
97062
- type: 'linear',
97063
-
97064
- // don't try to update them on `editable: true`
97065
- autorange: false,
97066
-
97067
- // set infinite range so that annotation draw routine
97068
- // does not try to remove 'outside-range' annotations,
97069
- // this case is handled in the render loop
97070
- range: [-Infinity, Infinity]
97071
- };
97072
-
97073
- ann._xa = {};
97074
- Lib.extendFlat(ann._xa, base);
97075
- Axes.setConvert(ann._xa);
97076
- ann._xa._offset = size.l + domain.x[0] * size.w;
97077
- ann._xa.l2p = function() {
97078
- return 0.5 * (1 + ann._pdata[0] / ann._pdata[3]) * size.w * (domain.x[1] - domain.x[0]);
97079
- };
97080
-
97081
- ann._ya = {};
97082
- Lib.extendFlat(ann._ya, base);
97083
- Axes.setConvert(ann._ya);
97084
- ann._ya._offset = size.t + (1 - domain.y[1]) * size.h;
97085
- ann._ya.l2p = function() {
97086
- return 0.5 * (1 - ann._pdata[1] / ann._pdata[3]) * size.h * (domain.y[1] - domain.y[0]);
97087
- };
97088
- }
97089
-
97090
-
97091
- /***/ }),
97092
-
97093
- /***/ 41926:
97094
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
97095
-
97096
-
97097
-
97098
- var Lib = __webpack_require__(30991);
97099
- var Axes = __webpack_require__(15076);
97100
- var handleArrayContainerDefaults = __webpack_require__(21238);
97101
- var handleAnnotationCommonDefaults = __webpack_require__(84081);
97102
- var attributes = __webpack_require__(9793);
97103
-
97104
- module.exports = function handleDefaults(sceneLayoutIn, sceneLayoutOut, opts) {
97105
- handleArrayContainerDefaults(sceneLayoutIn, sceneLayoutOut, {
97106
- name: 'annotations',
97107
- handleItemDefaults: handleAnnotationDefaults,
97108
- fullLayout: opts.fullLayout
97109
- });
97110
- };
97111
-
97112
- function handleAnnotationDefaults(annIn, annOut, sceneLayout, opts) {
97113
- function coerce(attr, dflt) {
97114
- return Lib.coerce(annIn, annOut, attributes, attr, dflt);
97115
- }
97116
-
97117
- function coercePosition(axLetter) {
97118
- var axName = axLetter + 'axis';
97119
-
97120
- // mock in such way that getFromId grabs correct 3D axis
97121
- var gdMock = { _fullLayout: {} };
97122
- gdMock._fullLayout[axName] = sceneLayout[axName];
97123
-
97124
- return Axes.coercePosition(annOut, gdMock, coerce, axLetter, axLetter, 0.5);
97125
- }
97126
-
97127
-
97128
- var visible = coerce('visible');
97129
- if(!visible) return;
97130
-
97131
- handleAnnotationCommonDefaults(annIn, annOut, opts.fullLayout, coerce);
97132
-
97133
- coercePosition('x');
97134
- coercePosition('y');
97135
- coercePosition('z');
97136
-
97137
- // if you have one coordinate you should all three
97138
- Lib.noneOrAll(annIn, annOut, ['x', 'y', 'z']);
97139
-
97140
- // hard-set here for completeness
97141
- annOut.xref = 'x';
97142
- annOut.yref = 'y';
97143
- annOut.zref = 'z';
97144
-
97145
- coerce('xanchor');
97146
- coerce('yanchor');
97147
- coerce('xshift');
97148
- coerce('yshift');
97149
-
97150
- if(annOut.showarrow) {
97151
- annOut.axref = 'pixel';
97152
- annOut.ayref = 'pixel';
97153
-
97154
- // TODO maybe default values should be bigger than the 2D case?
97155
- coerce('ax', -10);
97156
- coerce('ay', -30);
97157
-
97158
- // if you have one part of arrow length you should have both
97159
- Lib.noneOrAll(annIn, annOut, ['ax', 'ay']);
97160
- }
97161
- }
97162
-
97163
-
97164
- /***/ }),
97165
-
97166
- /***/ 13802:
97167
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
97168
-
97169
-
97170
-
97171
- var drawRaw = (__webpack_require__(47995).drawRaw);
97172
- var project = __webpack_require__(51344);
97173
- var axLetters = ['x', 'y', 'z'];
97174
-
97175
- module.exports = function draw(scene) {
97176
- var fullSceneLayout = scene.fullSceneLayout;
97177
- var dataScale = scene.dataScale;
97178
- var anns = fullSceneLayout.annotations;
97179
-
97180
- for(var i = 0; i < anns.length; i++) {
97181
- var ann = anns[i];
97182
- var annotationIsOffscreen = false;
97183
-
97184
- for(var j = 0; j < 3; j++) {
97185
- var axLetter = axLetters[j];
97186
- var pos = ann[axLetter];
97187
- var ax = fullSceneLayout[axLetter + 'axis'];
97188
- var posFraction = ax.r2fraction(pos);
97189
-
97190
- if(posFraction < 0 || posFraction > 1) {
97191
- annotationIsOffscreen = true;
97192
- break;
97193
- }
97194
- }
97195
-
97196
- if(annotationIsOffscreen) {
97197
- scene.fullLayout._infolayer
97198
- .select('.annotation-' + scene.id + '[data-index="' + i + '"]')
97199
- .remove();
97200
- } else {
97201
- ann._pdata = project(scene.glplot.cameraParams, [
97202
- fullSceneLayout.xaxis.r2l(ann.x) * dataScale[0],
97203
- fullSceneLayout.yaxis.r2l(ann.y) * dataScale[1],
97204
- fullSceneLayout.zaxis.r2l(ann.z) * dataScale[2]
97205
- ]);
97206
-
97207
- drawRaw(scene.graphDiv, ann, i, scene.id, ann._xa, ann._ya);
97208
- }
97209
- }
97210
- };
97211
-
97212
-
97213
- /***/ }),
97214
-
97215
- /***/ 86578:
97216
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
97217
-
97218
-
97219
-
97220
- var Registry = __webpack_require__(13936);
97221
- var Lib = __webpack_require__(30991);
97222
-
97223
- module.exports = {
97224
- moduleType: 'component',
97225
- name: 'annotations3d',
97226
-
97227
- schema: {
97228
- subplots: {
97229
- scene: {annotations: __webpack_require__(9793)}
97230
- }
97231
- },
97232
-
97233
- layoutAttributes: __webpack_require__(9793),
97234
- handleDefaults: __webpack_require__(41926),
97235
- includeBasePlot: includeGL3D,
97236
-
97237
- convert: __webpack_require__(58121),
97238
- draw: __webpack_require__(13802)
97239
- };
97240
-
97241
- function includeGL3D(layoutIn, layoutOut) {
97242
- var GL3D = Registry.subplotsRegistry.gl3d;
97243
- if(!GL3D) return;
97244
-
97245
- var attrRegex = GL3D.attrRegex;
97246
-
97247
- var keys = Object.keys(layoutIn);
97248
- for(var i = 0; i < keys.length; i++) {
97249
- var k = keys[i];
97250
- if(attrRegex.test(k) && (layoutIn[k].annotations || []).length) {
97251
- Lib.pushUnique(layoutOut._basePlotModules, GL3D);
97252
- Lib.pushUnique(layoutOut._subplots.gl3d, k);
97253
- }
97254
- }
97255
- }
97256
-
97257
-
97258
97258
  /***/ }),
97259
97259
 
97260
97260
  /***/ 27639:
@@ -195487,6 +195487,595 @@ function isValidZ(z) {
195487
195487
  }
195488
195488
 
195489
195489
 
195490
+ /***/ }),
195491
+
195492
+ /***/ 42124:
195493
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195494
+
195495
+
195496
+
195497
+ var histogramAttrs = __webpack_require__(71250);
195498
+ var makeBinAttrs = __webpack_require__(9284);
195499
+ var heatmapAttrs = __webpack_require__(68300);
195500
+ var baseAttrs = __webpack_require__(35667);
195501
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
195502
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
195503
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
195504
+ var colorScaleAttrs = __webpack_require__(17957);
195505
+
195506
+ var extendFlat = (__webpack_require__(91307).extendFlat);
195507
+
195508
+ module.exports = extendFlat(
195509
+ {
195510
+ x: histogramAttrs.x,
195511
+ y: histogramAttrs.y,
195512
+
195513
+ z: {
195514
+ valType: 'data_array',
195515
+ editType: 'calc',
195516
+ description: 'Sets the aggregation data.'
195517
+ },
195518
+ marker: {
195519
+ color: {
195520
+ valType: 'data_array',
195521
+ editType: 'calc',
195522
+ description: 'Sets the aggregation data.'
195523
+ },
195524
+ editType: 'calc'
195525
+ },
195526
+
195527
+ histnorm: histogramAttrs.histnorm,
195528
+ histfunc: histogramAttrs.histfunc,
195529
+ nbinsx: histogramAttrs.nbinsx,
195530
+ xbins: makeBinAttrs('x'),
195531
+ nbinsy: histogramAttrs.nbinsy,
195532
+ ybins: makeBinAttrs('y'),
195533
+ autobinx: histogramAttrs.autobinx,
195534
+ autobiny: histogramAttrs.autobiny,
195535
+
195536
+ bingroup: extendFlat({}, histogramAttrs.bingroup, {
195537
+ description: [
195538
+ 'Set the `xbingroup` and `ybingroup` default prefix',
195539
+ 'For example, setting a `bingroup` of *1* on two histogram2d traces',
195540
+ 'will make them their x-bins and y-bins match separately.'
195541
+ ].join(' ')
195542
+ }),
195543
+ xbingroup: extendFlat({}, histogramAttrs.bingroup, {
195544
+ description: [
195545
+ 'Set a group of histogram traces which will have compatible x-bin settings.',
195546
+ 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
195547
+ '(on axes of the same axis type) can have compatible x-bin settings.',
195548
+ 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
195549
+ ].join(' ')
195550
+ }),
195551
+ ybingroup: extendFlat({}, histogramAttrs.bingroup, {
195552
+ description: [
195553
+ 'Set a group of histogram traces which will have compatible y-bin settings.',
195554
+ 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
195555
+ '(on axes of the same axis type) can have compatible y-bin settings.',
195556
+ 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
195557
+ ].join(' ')
195558
+ }),
195559
+
195560
+ xgap: heatmapAttrs.xgap,
195561
+ ygap: heatmapAttrs.ygap,
195562
+ zsmooth: heatmapAttrs.zsmooth,
195563
+ xhoverformat: axisHoverFormat('x'),
195564
+ yhoverformat: axisHoverFormat('y'),
195565
+ zhoverformat: axisHoverFormat('z', 1),
195566
+ hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
195567
+ texttemplate: texttemplateAttrs({
195568
+ arrayOk: false,
195569
+ editType: 'plot'
195570
+ }, {
195571
+ keys: 'z'
195572
+ }),
195573
+ textfont: heatmapAttrs.textfont,
195574
+ showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
195575
+ },
195576
+ colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
195577
+ );
195578
+
195579
+
195580
+ /***/ }),
195581
+
195582
+ /***/ 32492:
195583
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195584
+
195585
+
195586
+
195587
+ var Lib = __webpack_require__(30991);
195588
+ var Axes = __webpack_require__(15076);
195589
+
195590
+ var binFunctions = __webpack_require__(47260);
195591
+ var normFunctions = __webpack_require__(855);
195592
+ var doAvg = __webpack_require__(26756);
195593
+ var getBinSpanLabelRound = __webpack_require__(41574);
195594
+ var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
195595
+
195596
+ module.exports = function calc(gd, trace) {
195597
+ var xa = Axes.getFromId(gd, trace.xaxis);
195598
+ var ya = Axes.getFromId(gd, trace.yaxis);
195599
+
195600
+ var xcalendar = trace.xcalendar;
195601
+ var ycalendar = trace.ycalendar;
195602
+ var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
195603
+ var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
195604
+ var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
195605
+ var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
195606
+
195607
+ var i, j, n, m;
195608
+
195609
+ // calculate the bins
195610
+ var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
195611
+ var xBinSpec = xBinsAndPos[0];
195612
+ var xPos0 = xBinsAndPos[1];
195613
+ var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
195614
+ var yBinSpec = yBinsAndPos[0];
195615
+ var yPos0 = yBinsAndPos[1];
195616
+
195617
+ var serieslen = trace._length;
195618
+ if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
195619
+ if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
195620
+
195621
+ // make the empty bin array & scale the map
195622
+ var z = [];
195623
+ var onecol = [];
195624
+ var zerocol = [];
195625
+ var nonuniformBinsX = typeof xBinSpec.size === 'string';
195626
+ var nonuniformBinsY = typeof yBinSpec.size === 'string';
195627
+ var xEdges = [];
195628
+ var yEdges = [];
195629
+ var xbins = nonuniformBinsX ? xEdges : xBinSpec;
195630
+ var ybins = nonuniformBinsY ? yEdges : yBinSpec;
195631
+ var total = 0;
195632
+ var counts = [];
195633
+ var inputPoints = [];
195634
+ var norm = trace.histnorm;
195635
+ var func = trace.histfunc;
195636
+ var densitynorm = norm.indexOf('density') !== -1;
195637
+ var extremefunc = func === 'max' || func === 'min';
195638
+ var sizeinit = extremefunc ? null : 0;
195639
+ var binfunc = binFunctions.count;
195640
+ var normfunc = normFunctions[norm];
195641
+ var doavg = false;
195642
+ var xinc = [];
195643
+ var yinc = [];
195644
+
195645
+ // set a binning function other than count?
195646
+ // for binning functions: check first for 'z',
195647
+ // then 'mc' in case we had a colored scatter plot
195648
+ // and want to transfer these colors to the 2D histo
195649
+ // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
195650
+ var rawCounterData = ('z' in trace) ?
195651
+ trace.z :
195652
+ (('marker' in trace && Array.isArray(trace.marker.color)) ?
195653
+ trace.marker.color : '');
195654
+ if(rawCounterData && func !== 'count') {
195655
+ doavg = func === 'avg';
195656
+ binfunc = binFunctions[func];
195657
+ }
195658
+
195659
+ // decrease end a little in case of rounding errors
195660
+ var xBinSize = xBinSpec.size;
195661
+ var xBinStart = xr2c(xBinSpec.start);
195662
+ var xBinEnd = xr2c(xBinSpec.end) +
195663
+ (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
195664
+
195665
+ for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
195666
+ onecol.push(sizeinit);
195667
+ xEdges.push(i);
195668
+ if(doavg) zerocol.push(0);
195669
+ }
195670
+ xEdges.push(i);
195671
+
195672
+ var nx = onecol.length;
195673
+ var dx = (i - xBinStart) / nx;
195674
+ var x0 = xc2r(xBinStart + dx / 2);
195675
+
195676
+ var yBinSize = yBinSpec.size;
195677
+ var yBinStart = yr2c(yBinSpec.start);
195678
+ var yBinEnd = yr2c(yBinSpec.end) +
195679
+ (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
195680
+
195681
+ for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
195682
+ z.push(onecol.slice());
195683
+ yEdges.push(i);
195684
+ var ipCol = new Array(nx);
195685
+ for(j = 0; j < nx; j++) ipCol[j] = [];
195686
+ inputPoints.push(ipCol);
195687
+ if(doavg) counts.push(zerocol.slice());
195688
+ }
195689
+ yEdges.push(i);
195690
+
195691
+ var ny = z.length;
195692
+ var dy = (i - yBinStart) / ny;
195693
+ var y0 = yc2r(yBinStart + dy / 2);
195694
+
195695
+ if(densitynorm) {
195696
+ xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
195697
+ yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
195698
+ }
195699
+
195700
+ // for date axes we need bin bounds to be calcdata. For nonuniform bins
195701
+ // we already have this, but uniform with start/end/size they're still strings.
195702
+ if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
195703
+ if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
195704
+
195705
+ // put data into bins
195706
+ var uniqueValsPerX = true;
195707
+ var uniqueValsPerY = true;
195708
+ var xVals = new Array(nx);
195709
+ var yVals = new Array(ny);
195710
+ var xGapLow = Infinity;
195711
+ var xGapHigh = Infinity;
195712
+ var yGapLow = Infinity;
195713
+ var yGapHigh = Infinity;
195714
+ for(i = 0; i < serieslen; i++) {
195715
+ var xi = xPos0[i];
195716
+ var yi = yPos0[i];
195717
+ n = Lib.findBin(xi, xbins);
195718
+ m = Lib.findBin(yi, ybins);
195719
+ if(n >= 0 && n < nx && m >= 0 && m < ny) {
195720
+ total += binfunc(n, i, z[m], rawCounterData, counts[m]);
195721
+ inputPoints[m][n].push(i);
195722
+
195723
+ if(uniqueValsPerX) {
195724
+ if(xVals[n] === undefined) xVals[n] = xi;
195725
+ else if(xVals[n] !== xi) uniqueValsPerX = false;
195726
+ }
195727
+ if(uniqueValsPerY) {
195728
+ if(yVals[m] === undefined) yVals[m] = yi;
195729
+ else if(yVals[m] !== yi) uniqueValsPerY = false;
195730
+ }
195731
+
195732
+ xGapLow = Math.min(xGapLow, xi - xEdges[n]);
195733
+ xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
195734
+ yGapLow = Math.min(yGapLow, yi - yEdges[m]);
195735
+ yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
195736
+ }
195737
+ }
195738
+ // normalize, if needed
195739
+ if(doavg) {
195740
+ for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
195741
+ }
195742
+ if(normfunc) {
195743
+ for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
195744
+ }
195745
+
195746
+ return {
195747
+ x: xPos0,
195748
+ xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
195749
+ x0: x0,
195750
+ dx: dx,
195751
+ y: yPos0,
195752
+ yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
195753
+ y0: y0,
195754
+ dy: dy,
195755
+ z: z,
195756
+ pts: inputPoints
195757
+ };
195758
+ };
195759
+
195760
+ function makeIncrements(len, bins, dv, nonuniform) {
195761
+ var out = new Array(len);
195762
+ var i;
195763
+ if(nonuniform) {
195764
+ for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
195765
+ } else {
195766
+ var inc = 1 / dv;
195767
+ for(i = 0; i < len; i++) out[i] = inc;
195768
+ }
195769
+ return out;
195770
+ }
195771
+
195772
+ function binsToCalc(r2c, bins) {
195773
+ return {
195774
+ start: r2c(bins.start),
195775
+ end: r2c(bins.end),
195776
+ size: bins.size
195777
+ };
195778
+ }
195779
+
195780
+ function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
195781
+ var i;
195782
+ var len = edges.length - 1;
195783
+ var out = new Array(len);
195784
+ var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
195785
+
195786
+ for(i = 0; i < len; i++) {
195787
+ var v = (uniqueVals || [])[i];
195788
+ out[i] = v === undefined ?
195789
+ [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
195790
+ [v, v];
195791
+ }
195792
+ return out;
195793
+ }
195794
+
195795
+
195796
+ /***/ }),
195797
+
195798
+ /***/ 15611:
195799
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195800
+
195801
+
195802
+
195803
+ var Lib = __webpack_require__(30991);
195804
+
195805
+ var handleSampleDefaults = __webpack_require__(6236);
195806
+ var handleStyleDefaults = __webpack_require__(25157);
195807
+ var colorscaleDefaults = __webpack_require__(13682);
195808
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
195809
+ var attributes = __webpack_require__(42124);
195810
+
195811
+
195812
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
195813
+ function coerce(attr, dflt) {
195814
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
195815
+ }
195816
+
195817
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
195818
+ if(traceOut.visible === false) return;
195819
+
195820
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
195821
+ colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
195822
+ coerce('hovertemplate');
195823
+
195824
+ handleHeatmapLabelDefaults(coerce, layout);
195825
+
195826
+ coerce('xhoverformat');
195827
+ coerce('yhoverformat');
195828
+ };
195829
+
195830
+
195831
+ /***/ }),
195832
+
195833
+ /***/ 94587:
195834
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195835
+
195836
+
195837
+
195838
+ var heatmapHover = __webpack_require__(85243);
195839
+ var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
195840
+
195841
+ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
195842
+ var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
195843
+
195844
+ if(!pts) return;
195845
+
195846
+ pointData = pts[0];
195847
+ var indices = pointData.index;
195848
+ var ny = indices[0];
195849
+ var nx = indices[1];
195850
+ var cd0 = pointData.cd[0];
195851
+ var trace = cd0.trace;
195852
+ var xRange = cd0.xRanges[nx];
195853
+ var yRange = cd0.yRanges[ny];
195854
+
195855
+ pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
195856
+ pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
195857
+
195858
+ return pts;
195859
+ };
195860
+
195861
+
195862
+ /***/ }),
195863
+
195864
+ /***/ 3617:
195865
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195866
+
195867
+
195868
+
195869
+ module.exports = {
195870
+ attributes: __webpack_require__(42124),
195871
+ supplyDefaults: __webpack_require__(15611),
195872
+ crossTraceDefaults: __webpack_require__(34294),
195873
+ calc: __webpack_require__(91980),
195874
+ plot: __webpack_require__(29406),
195875
+ layerName: 'heatmaplayer',
195876
+ colorbar: __webpack_require__(90165),
195877
+ style: __webpack_require__(58756),
195878
+ hoverPoints: __webpack_require__(94587),
195879
+ eventData: __webpack_require__(63870),
195880
+
195881
+ moduleType: 'trace',
195882
+ name: 'histogram2d',
195883
+ basePlotModule: __webpack_require__(47885),
195884
+ categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
195885
+ meta: {
195886
+ hrName: 'histogram_2d',
195887
+ description: [
195888
+ 'The sample data from which statistics are computed is set in `x`',
195889
+ 'and `y` (where `x` and `y` represent marginal distributions,',
195890
+ 'binning is set in `xbins` and `ybins` in this case)',
195891
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
195892
+ 'binning is set by `x` and `y` in this case).',
195893
+ 'The resulting distribution is visualized as a heatmap.'
195894
+ ].join(' ')
195895
+ }
195896
+ };
195897
+
195898
+
195899
+ /***/ }),
195900
+
195901
+ /***/ 6236:
195902
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195903
+
195904
+
195905
+
195906
+ var Registry = __webpack_require__(13936);
195907
+ var Lib = __webpack_require__(30991);
195908
+
195909
+ module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
195910
+ var x = coerce('x');
195911
+ var y = coerce('y');
195912
+ var xlen = Lib.minRowLength(x);
195913
+ var ylen = Lib.minRowLength(y);
195914
+
195915
+ // we could try to accept x0 and dx, etc...
195916
+ // but that's a pretty weird use case.
195917
+ // for now require both x and y explicitly specified.
195918
+ if(!xlen || !ylen) {
195919
+ traceOut.visible = false;
195920
+ return;
195921
+ }
195922
+
195923
+ traceOut._length = Math.min(xlen, ylen);
195924
+
195925
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
195926
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
195927
+
195928
+ // if marker.color is an array, we can use it in aggregation instead of z
195929
+ var hasAggregationData = coerce('z') || coerce('marker.color');
195930
+
195931
+ if(hasAggregationData) coerce('histfunc');
195932
+ coerce('histnorm');
195933
+
195934
+ // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
195935
+ // autobin(x|y) are only included here to appease Plotly.validate
195936
+ coerce('autobinx');
195937
+ coerce('autobiny');
195938
+ };
195939
+
195940
+
195941
+ /***/ }),
195942
+
195943
+ /***/ 34872:
195944
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
195945
+
195946
+
195947
+
195948
+ var histogram2dAttrs = __webpack_require__(42124);
195949
+ var contourAttrs = __webpack_require__(70318);
195950
+ var colorScaleAttrs = __webpack_require__(17957);
195951
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
195952
+
195953
+ var extendFlat = (__webpack_require__(91307).extendFlat);
195954
+
195955
+ module.exports = extendFlat({
195956
+ x: histogram2dAttrs.x,
195957
+ y: histogram2dAttrs.y,
195958
+ z: histogram2dAttrs.z,
195959
+ marker: histogram2dAttrs.marker,
195960
+
195961
+ histnorm: histogram2dAttrs.histnorm,
195962
+ histfunc: histogram2dAttrs.histfunc,
195963
+ nbinsx: histogram2dAttrs.nbinsx,
195964
+ xbins: histogram2dAttrs.xbins,
195965
+ nbinsy: histogram2dAttrs.nbinsy,
195966
+ ybins: histogram2dAttrs.ybins,
195967
+ autobinx: histogram2dAttrs.autobinx,
195968
+ autobiny: histogram2dAttrs.autobiny,
195969
+
195970
+ bingroup: histogram2dAttrs.bingroup,
195971
+ xbingroup: histogram2dAttrs.xbingroup,
195972
+ ybingroup: histogram2dAttrs.ybingroup,
195973
+
195974
+ autocontour: contourAttrs.autocontour,
195975
+ ncontours: contourAttrs.ncontours,
195976
+ contours: contourAttrs.contours,
195977
+ line: {
195978
+ color: contourAttrs.line.color,
195979
+ width: extendFlat({}, contourAttrs.line.width, {
195980
+ dflt: 0.5,
195981
+ description: 'Sets the contour line width in (in px)'
195982
+ }),
195983
+ dash: contourAttrs.line.dash,
195984
+ smoothing: contourAttrs.line.smoothing,
195985
+ editType: 'plot'
195986
+ },
195987
+ xhoverformat: axisHoverFormat('x'),
195988
+ yhoverformat: axisHoverFormat('y'),
195989
+ zhoverformat: axisHoverFormat('z', 1),
195990
+ hovertemplate: histogram2dAttrs.hovertemplate,
195991
+ texttemplate: contourAttrs.texttemplate,
195992
+ textfont: contourAttrs.textfont
195993
+ },
195994
+ colorScaleAttrs('', {
195995
+ cLetter: 'z',
195996
+ editTypeOverride: 'calc'
195997
+ })
195998
+ );
195999
+
196000
+
196001
+ /***/ }),
196002
+
196003
+ /***/ 14319:
196004
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
196005
+
196006
+
196007
+
196008
+ var Lib = __webpack_require__(30991);
196009
+
196010
+ var handleSampleDefaults = __webpack_require__(6236);
196011
+ var handleContoursDefaults = __webpack_require__(657);
196012
+ var handleStyleDefaults = __webpack_require__(74619);
196013
+ var handleHeatmapLabelDefaults = __webpack_require__(52340);
196014
+ var attributes = __webpack_require__(34872);
196015
+
196016
+
196017
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
196018
+ function coerce(attr, dflt) {
196019
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
196020
+ }
196021
+
196022
+ function coerce2(attr) {
196023
+ return Lib.coerce2(traceIn, traceOut, attributes, attr);
196024
+ }
196025
+
196026
+ handleSampleDefaults(traceIn, traceOut, coerce, layout);
196027
+ if(traceOut.visible === false) return;
196028
+
196029
+ handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
196030
+ handleStyleDefaults(traceIn, traceOut, coerce, layout);
196031
+ coerce('xhoverformat');
196032
+ coerce('yhoverformat');
196033
+ coerce('hovertemplate');
196034
+ if(
196035
+ traceOut.contours &&
196036
+ traceOut.contours.coloring === 'heatmap'
196037
+ ) {
196038
+ handleHeatmapLabelDefaults(coerce, layout);
196039
+ }
196040
+ };
196041
+
196042
+
196043
+ /***/ }),
196044
+
196045
+ /***/ 60613:
196046
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
196047
+
196048
+
196049
+
196050
+ module.exports = {
196051
+ attributes: __webpack_require__(34872),
196052
+ supplyDefaults: __webpack_require__(14319),
196053
+ crossTraceDefaults: __webpack_require__(34294),
196054
+ calc: __webpack_require__(3274),
196055
+ plot: (__webpack_require__(32664).plot),
196056
+ layerName: 'contourlayer',
196057
+ style: __webpack_require__(72690),
196058
+ colorbar: __webpack_require__(70307),
196059
+ hoverPoints: __webpack_require__(52353),
196060
+
196061
+ moduleType: 'trace',
196062
+ name: 'histogram2dcontour',
196063
+ basePlotModule: __webpack_require__(47885),
196064
+ categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
196065
+ meta: {
196066
+ hrName: 'histogram_2d_contour',
196067
+ description: [
196068
+ 'The sample data from which statistics are computed is set in `x`',
196069
+ 'and `y` (where `x` and `y` represent marginal distributions,',
196070
+ 'binning is set in `xbins` and `ybins` in this case)',
196071
+ 'or `z` (where `z` represent the 2D distribution and binning set,',
196072
+ 'binning is set by `x` and `y` in this case).',
196073
+ 'The resulting distribution is visualized as a contour plot.'
196074
+ ].join(' ')
196075
+ }
196076
+ };
196077
+
196078
+
195490
196079
  /***/ }),
195491
196080
 
195492
196081
  /***/ 71250:
@@ -197195,595 +197784,6 @@ module.exports = {
197195
197784
  };
197196
197785
 
197197
197786
 
197198
- /***/ }),
197199
-
197200
- /***/ 42124:
197201
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197202
-
197203
-
197204
-
197205
- var histogramAttrs = __webpack_require__(71250);
197206
- var makeBinAttrs = __webpack_require__(9284);
197207
- var heatmapAttrs = __webpack_require__(68300);
197208
- var baseAttrs = __webpack_require__(35667);
197209
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
197210
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
197211
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
197212
- var colorScaleAttrs = __webpack_require__(17957);
197213
-
197214
- var extendFlat = (__webpack_require__(91307).extendFlat);
197215
-
197216
- module.exports = extendFlat(
197217
- {
197218
- x: histogramAttrs.x,
197219
- y: histogramAttrs.y,
197220
-
197221
- z: {
197222
- valType: 'data_array',
197223
- editType: 'calc',
197224
- description: 'Sets the aggregation data.'
197225
- },
197226
- marker: {
197227
- color: {
197228
- valType: 'data_array',
197229
- editType: 'calc',
197230
- description: 'Sets the aggregation data.'
197231
- },
197232
- editType: 'calc'
197233
- },
197234
-
197235
- histnorm: histogramAttrs.histnorm,
197236
- histfunc: histogramAttrs.histfunc,
197237
- nbinsx: histogramAttrs.nbinsx,
197238
- xbins: makeBinAttrs('x'),
197239
- nbinsy: histogramAttrs.nbinsy,
197240
- ybins: makeBinAttrs('y'),
197241
- autobinx: histogramAttrs.autobinx,
197242
- autobiny: histogramAttrs.autobiny,
197243
-
197244
- bingroup: extendFlat({}, histogramAttrs.bingroup, {
197245
- description: [
197246
- 'Set the `xbingroup` and `ybingroup` default prefix',
197247
- 'For example, setting a `bingroup` of *1* on two histogram2d traces',
197248
- 'will make them their x-bins and y-bins match separately.'
197249
- ].join(' ')
197250
- }),
197251
- xbingroup: extendFlat({}, histogramAttrs.bingroup, {
197252
- description: [
197253
- 'Set a group of histogram traces which will have compatible x-bin settings.',
197254
- 'Using `xbingroup`, histogram2d and histogram2dcontour traces ',
197255
- '(on axes of the same axis type) can have compatible x-bin settings.',
197256
- 'Note that the same `xbingroup` value can be used to set (1D) histogram `bingroup`'
197257
- ].join(' ')
197258
- }),
197259
- ybingroup: extendFlat({}, histogramAttrs.bingroup, {
197260
- description: [
197261
- 'Set a group of histogram traces which will have compatible y-bin settings.',
197262
- 'Using `ybingroup`, histogram2d and histogram2dcontour traces ',
197263
- '(on axes of the same axis type) can have compatible y-bin settings.',
197264
- 'Note that the same `ybingroup` value can be used to set (1D) histogram `bingroup`'
197265
- ].join(' ')
197266
- }),
197267
-
197268
- xgap: heatmapAttrs.xgap,
197269
- ygap: heatmapAttrs.ygap,
197270
- zsmooth: heatmapAttrs.zsmooth,
197271
- xhoverformat: axisHoverFormat('x'),
197272
- yhoverformat: axisHoverFormat('y'),
197273
- zhoverformat: axisHoverFormat('z', 1),
197274
- hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),
197275
- texttemplate: texttemplateAttrs({
197276
- arrayOk: false,
197277
- editType: 'plot'
197278
- }, {
197279
- keys: 'z'
197280
- }),
197281
- textfont: heatmapAttrs.textfont,
197282
- showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})
197283
- },
197284
- colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})
197285
- );
197286
-
197287
-
197288
- /***/ }),
197289
-
197290
- /***/ 32492:
197291
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197292
-
197293
-
197294
-
197295
- var Lib = __webpack_require__(30991);
197296
- var Axes = __webpack_require__(15076);
197297
-
197298
- var binFunctions = __webpack_require__(47260);
197299
- var normFunctions = __webpack_require__(855);
197300
- var doAvg = __webpack_require__(26756);
197301
- var getBinSpanLabelRound = __webpack_require__(41574);
197302
- var calcAllAutoBins = (__webpack_require__(50414).calcAllAutoBins);
197303
-
197304
- module.exports = function calc(gd, trace) {
197305
- var xa = Axes.getFromId(gd, trace.xaxis);
197306
- var ya = Axes.getFromId(gd, trace.yaxis);
197307
-
197308
- var xcalendar = trace.xcalendar;
197309
- var ycalendar = trace.ycalendar;
197310
- var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };
197311
- var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };
197312
- var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };
197313
- var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };
197314
-
197315
- var i, j, n, m;
197316
-
197317
- // calculate the bins
197318
- var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');
197319
- var xBinSpec = xBinsAndPos[0];
197320
- var xPos0 = xBinsAndPos[1];
197321
- var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');
197322
- var yBinSpec = yBinsAndPos[0];
197323
- var yPos0 = yBinsAndPos[1];
197324
-
197325
- var serieslen = trace._length;
197326
- if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);
197327
- if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);
197328
-
197329
- // make the empty bin array & scale the map
197330
- var z = [];
197331
- var onecol = [];
197332
- var zerocol = [];
197333
- var nonuniformBinsX = typeof xBinSpec.size === 'string';
197334
- var nonuniformBinsY = typeof yBinSpec.size === 'string';
197335
- var xEdges = [];
197336
- var yEdges = [];
197337
- var xbins = nonuniformBinsX ? xEdges : xBinSpec;
197338
- var ybins = nonuniformBinsY ? yEdges : yBinSpec;
197339
- var total = 0;
197340
- var counts = [];
197341
- var inputPoints = [];
197342
- var norm = trace.histnorm;
197343
- var func = trace.histfunc;
197344
- var densitynorm = norm.indexOf('density') !== -1;
197345
- var extremefunc = func === 'max' || func === 'min';
197346
- var sizeinit = extremefunc ? null : 0;
197347
- var binfunc = binFunctions.count;
197348
- var normfunc = normFunctions[norm];
197349
- var doavg = false;
197350
- var xinc = [];
197351
- var yinc = [];
197352
-
197353
- // set a binning function other than count?
197354
- // for binning functions: check first for 'z',
197355
- // then 'mc' in case we had a colored scatter plot
197356
- // and want to transfer these colors to the 2D histo
197357
- // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?
197358
- var rawCounterData = ('z' in trace) ?
197359
- trace.z :
197360
- (('marker' in trace && Array.isArray(trace.marker.color)) ?
197361
- trace.marker.color : '');
197362
- if(rawCounterData && func !== 'count') {
197363
- doavg = func === 'avg';
197364
- binfunc = binFunctions[func];
197365
- }
197366
-
197367
- // decrease end a little in case of rounding errors
197368
- var xBinSize = xBinSpec.size;
197369
- var xBinStart = xr2c(xBinSpec.start);
197370
- var xBinEnd = xr2c(xBinSpec.end) +
197371
- (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;
197372
-
197373
- for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {
197374
- onecol.push(sizeinit);
197375
- xEdges.push(i);
197376
- if(doavg) zerocol.push(0);
197377
- }
197378
- xEdges.push(i);
197379
-
197380
- var nx = onecol.length;
197381
- var dx = (i - xBinStart) / nx;
197382
- var x0 = xc2r(xBinStart + dx / 2);
197383
-
197384
- var yBinSize = yBinSpec.size;
197385
- var yBinStart = yr2c(yBinSpec.start);
197386
- var yBinEnd = yr2c(yBinSpec.end) +
197387
- (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;
197388
-
197389
- for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {
197390
- z.push(onecol.slice());
197391
- yEdges.push(i);
197392
- var ipCol = new Array(nx);
197393
- for(j = 0; j < nx; j++) ipCol[j] = [];
197394
- inputPoints.push(ipCol);
197395
- if(doavg) counts.push(zerocol.slice());
197396
- }
197397
- yEdges.push(i);
197398
-
197399
- var ny = z.length;
197400
- var dy = (i - yBinStart) / ny;
197401
- var y0 = yc2r(yBinStart + dy / 2);
197402
-
197403
- if(densitynorm) {
197404
- xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);
197405
- yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);
197406
- }
197407
-
197408
- // for date axes we need bin bounds to be calcdata. For nonuniform bins
197409
- // we already have this, but uniform with start/end/size they're still strings.
197410
- if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);
197411
- if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);
197412
-
197413
- // put data into bins
197414
- var uniqueValsPerX = true;
197415
- var uniqueValsPerY = true;
197416
- var xVals = new Array(nx);
197417
- var yVals = new Array(ny);
197418
- var xGapLow = Infinity;
197419
- var xGapHigh = Infinity;
197420
- var yGapLow = Infinity;
197421
- var yGapHigh = Infinity;
197422
- for(i = 0; i < serieslen; i++) {
197423
- var xi = xPos0[i];
197424
- var yi = yPos0[i];
197425
- n = Lib.findBin(xi, xbins);
197426
- m = Lib.findBin(yi, ybins);
197427
- if(n >= 0 && n < nx && m >= 0 && m < ny) {
197428
- total += binfunc(n, i, z[m], rawCounterData, counts[m]);
197429
- inputPoints[m][n].push(i);
197430
-
197431
- if(uniqueValsPerX) {
197432
- if(xVals[n] === undefined) xVals[n] = xi;
197433
- else if(xVals[n] !== xi) uniqueValsPerX = false;
197434
- }
197435
- if(uniqueValsPerY) {
197436
- if(yVals[m] === undefined) yVals[m] = yi;
197437
- else if(yVals[m] !== yi) uniqueValsPerY = false;
197438
- }
197439
-
197440
- xGapLow = Math.min(xGapLow, xi - xEdges[n]);
197441
- xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);
197442
- yGapLow = Math.min(yGapLow, yi - yEdges[m]);
197443
- yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);
197444
- }
197445
- }
197446
- // normalize, if needed
197447
- if(doavg) {
197448
- for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);
197449
- }
197450
- if(normfunc) {
197451
- for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);
197452
- }
197453
-
197454
- return {
197455
- x: xPos0,
197456
- xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),
197457
- x0: x0,
197458
- dx: dx,
197459
- y: yPos0,
197460
- yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),
197461
- y0: y0,
197462
- dy: dy,
197463
- z: z,
197464
- pts: inputPoints
197465
- };
197466
- };
197467
-
197468
- function makeIncrements(len, bins, dv, nonuniform) {
197469
- var out = new Array(len);
197470
- var i;
197471
- if(nonuniform) {
197472
- for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);
197473
- } else {
197474
- var inc = 1 / dv;
197475
- for(i = 0; i < len; i++) out[i] = inc;
197476
- }
197477
- return out;
197478
- }
197479
-
197480
- function binsToCalc(r2c, bins) {
197481
- return {
197482
- start: r2c(bins.start),
197483
- end: r2c(bins.end),
197484
- size: bins.size
197485
- };
197486
- }
197487
-
197488
- function getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {
197489
- var i;
197490
- var len = edges.length - 1;
197491
- var out = new Array(len);
197492
- var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);
197493
-
197494
- for(i = 0; i < len; i++) {
197495
- var v = (uniqueVals || [])[i];
197496
- out[i] = v === undefined ?
197497
- [roundFn(edges[i]), roundFn(edges[i + 1], true)] :
197498
- [v, v];
197499
- }
197500
- return out;
197501
- }
197502
-
197503
-
197504
- /***/ }),
197505
-
197506
- /***/ 15611:
197507
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197508
-
197509
-
197510
-
197511
- var Lib = __webpack_require__(30991);
197512
-
197513
- var handleSampleDefaults = __webpack_require__(6236);
197514
- var handleStyleDefaults = __webpack_require__(25157);
197515
- var colorscaleDefaults = __webpack_require__(13682);
197516
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
197517
- var attributes = __webpack_require__(42124);
197518
-
197519
-
197520
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
197521
- function coerce(attr, dflt) {
197522
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
197523
- }
197524
-
197525
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
197526
- if(traceOut.visible === false) return;
197527
-
197528
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
197529
- colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
197530
- coerce('hovertemplate');
197531
-
197532
- handleHeatmapLabelDefaults(coerce, layout);
197533
-
197534
- coerce('xhoverformat');
197535
- coerce('yhoverformat');
197536
- };
197537
-
197538
-
197539
- /***/ }),
197540
-
197541
- /***/ 94587:
197542
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197543
-
197544
-
197545
-
197546
- var heatmapHover = __webpack_require__(85243);
197547
- var hoverLabelText = (__webpack_require__(15076).hoverLabelText);
197548
-
197549
- module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
197550
- var pts = heatmapHover(pointData, xval, yval, hovermode, opts);
197551
-
197552
- if(!pts) return;
197553
-
197554
- pointData = pts[0];
197555
- var indices = pointData.index;
197556
- var ny = indices[0];
197557
- var nx = indices[1];
197558
- var cd0 = pointData.cd[0];
197559
- var trace = cd0.trace;
197560
- var xRange = cd0.xRanges[nx];
197561
- var yRange = cd0.yRanges[ny];
197562
-
197563
- pointData.xLabel = hoverLabelText(pointData.xa, [xRange[0], xRange[1]], trace.xhoverformat);
197564
- pointData.yLabel = hoverLabelText(pointData.ya, [yRange[0], yRange[1]], trace.yhoverformat);
197565
-
197566
- return pts;
197567
- };
197568
-
197569
-
197570
- /***/ }),
197571
-
197572
- /***/ 3617:
197573
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197574
-
197575
-
197576
-
197577
- module.exports = {
197578
- attributes: __webpack_require__(42124),
197579
- supplyDefaults: __webpack_require__(15611),
197580
- crossTraceDefaults: __webpack_require__(34294),
197581
- calc: __webpack_require__(91980),
197582
- plot: __webpack_require__(29406),
197583
- layerName: 'heatmaplayer',
197584
- colorbar: __webpack_require__(90165),
197585
- style: __webpack_require__(58756),
197586
- hoverPoints: __webpack_require__(94587),
197587
- eventData: __webpack_require__(63870),
197588
-
197589
- moduleType: 'trace',
197590
- name: 'histogram2d',
197591
- basePlotModule: __webpack_require__(47885),
197592
- categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],
197593
- meta: {
197594
- hrName: 'histogram_2d',
197595
- description: [
197596
- 'The sample data from which statistics are computed is set in `x`',
197597
- 'and `y` (where `x` and `y` represent marginal distributions,',
197598
- 'binning is set in `xbins` and `ybins` in this case)',
197599
- 'or `z` (where `z` represent the 2D distribution and binning set,',
197600
- 'binning is set by `x` and `y` in this case).',
197601
- 'The resulting distribution is visualized as a heatmap.'
197602
- ].join(' ')
197603
- }
197604
- };
197605
-
197606
-
197607
- /***/ }),
197608
-
197609
- /***/ 6236:
197610
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197611
-
197612
-
197613
-
197614
- var Registry = __webpack_require__(13936);
197615
- var Lib = __webpack_require__(30991);
197616
-
197617
- module.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {
197618
- var x = coerce('x');
197619
- var y = coerce('y');
197620
- var xlen = Lib.minRowLength(x);
197621
- var ylen = Lib.minRowLength(y);
197622
-
197623
- // we could try to accept x0 and dx, etc...
197624
- // but that's a pretty weird use case.
197625
- // for now require both x and y explicitly specified.
197626
- if(!xlen || !ylen) {
197627
- traceOut.visible = false;
197628
- return;
197629
- }
197630
-
197631
- traceOut._length = Math.min(xlen, ylen);
197632
-
197633
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
197634
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
197635
-
197636
- // if marker.color is an array, we can use it in aggregation instead of z
197637
- var hasAggregationData = coerce('z') || coerce('marker.color');
197638
-
197639
- if(hasAggregationData) coerce('histfunc');
197640
- coerce('histnorm');
197641
-
197642
- // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults
197643
- // autobin(x|y) are only included here to appease Plotly.validate
197644
- coerce('autobinx');
197645
- coerce('autobiny');
197646
- };
197647
-
197648
-
197649
- /***/ }),
197650
-
197651
- /***/ 34872:
197652
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197653
-
197654
-
197655
-
197656
- var histogram2dAttrs = __webpack_require__(42124);
197657
- var contourAttrs = __webpack_require__(70318);
197658
- var colorScaleAttrs = __webpack_require__(17957);
197659
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
197660
-
197661
- var extendFlat = (__webpack_require__(91307).extendFlat);
197662
-
197663
- module.exports = extendFlat({
197664
- x: histogram2dAttrs.x,
197665
- y: histogram2dAttrs.y,
197666
- z: histogram2dAttrs.z,
197667
- marker: histogram2dAttrs.marker,
197668
-
197669
- histnorm: histogram2dAttrs.histnorm,
197670
- histfunc: histogram2dAttrs.histfunc,
197671
- nbinsx: histogram2dAttrs.nbinsx,
197672
- xbins: histogram2dAttrs.xbins,
197673
- nbinsy: histogram2dAttrs.nbinsy,
197674
- ybins: histogram2dAttrs.ybins,
197675
- autobinx: histogram2dAttrs.autobinx,
197676
- autobiny: histogram2dAttrs.autobiny,
197677
-
197678
- bingroup: histogram2dAttrs.bingroup,
197679
- xbingroup: histogram2dAttrs.xbingroup,
197680
- ybingroup: histogram2dAttrs.ybingroup,
197681
-
197682
- autocontour: contourAttrs.autocontour,
197683
- ncontours: contourAttrs.ncontours,
197684
- contours: contourAttrs.contours,
197685
- line: {
197686
- color: contourAttrs.line.color,
197687
- width: extendFlat({}, contourAttrs.line.width, {
197688
- dflt: 0.5,
197689
- description: 'Sets the contour line width in (in px)'
197690
- }),
197691
- dash: contourAttrs.line.dash,
197692
- smoothing: contourAttrs.line.smoothing,
197693
- editType: 'plot'
197694
- },
197695
- xhoverformat: axisHoverFormat('x'),
197696
- yhoverformat: axisHoverFormat('y'),
197697
- zhoverformat: axisHoverFormat('z', 1),
197698
- hovertemplate: histogram2dAttrs.hovertemplate,
197699
- texttemplate: contourAttrs.texttemplate,
197700
- textfont: contourAttrs.textfont
197701
- },
197702
- colorScaleAttrs('', {
197703
- cLetter: 'z',
197704
- editTypeOverride: 'calc'
197705
- })
197706
- );
197707
-
197708
-
197709
- /***/ }),
197710
-
197711
- /***/ 14319:
197712
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197713
-
197714
-
197715
-
197716
- var Lib = __webpack_require__(30991);
197717
-
197718
- var handleSampleDefaults = __webpack_require__(6236);
197719
- var handleContoursDefaults = __webpack_require__(657);
197720
- var handleStyleDefaults = __webpack_require__(74619);
197721
- var handleHeatmapLabelDefaults = __webpack_require__(52340);
197722
- var attributes = __webpack_require__(34872);
197723
-
197724
-
197725
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
197726
- function coerce(attr, dflt) {
197727
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
197728
- }
197729
-
197730
- function coerce2(attr) {
197731
- return Lib.coerce2(traceIn, traceOut, attributes, attr);
197732
- }
197733
-
197734
- handleSampleDefaults(traceIn, traceOut, coerce, layout);
197735
- if(traceOut.visible === false) return;
197736
-
197737
- handleContoursDefaults(traceIn, traceOut, coerce, coerce2);
197738
- handleStyleDefaults(traceIn, traceOut, coerce, layout);
197739
- coerce('xhoverformat');
197740
- coerce('yhoverformat');
197741
- coerce('hovertemplate');
197742
- if(
197743
- traceOut.contours &&
197744
- traceOut.contours.coloring === 'heatmap'
197745
- ) {
197746
- handleHeatmapLabelDefaults(coerce, layout);
197747
- }
197748
- };
197749
-
197750
-
197751
- /***/ }),
197752
-
197753
- /***/ 60613:
197754
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
197755
-
197756
-
197757
-
197758
- module.exports = {
197759
- attributes: __webpack_require__(34872),
197760
- supplyDefaults: __webpack_require__(14319),
197761
- crossTraceDefaults: __webpack_require__(34294),
197762
- calc: __webpack_require__(3274),
197763
- plot: (__webpack_require__(32664).plot),
197764
- layerName: 'contourlayer',
197765
- style: __webpack_require__(72690),
197766
- colorbar: __webpack_require__(70307),
197767
- hoverPoints: __webpack_require__(52353),
197768
-
197769
- moduleType: 'trace',
197770
- name: 'histogram2dcontour',
197771
- basePlotModule: __webpack_require__(47885),
197772
- categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],
197773
- meta: {
197774
- hrName: 'histogram_2d_contour',
197775
- description: [
197776
- 'The sample data from which statistics are computed is set in `x`',
197777
- 'and `y` (where `x` and `y` represent marginal distributions,',
197778
- 'binning is set in `xbins` and `ybins` in this case)',
197779
- 'or `z` (where `z` represent the 2D distribution and binning set,',
197780
- 'binning is set by `x` and `y` in this case).',
197781
- 'The resulting distribution is visualized as a contour plot.'
197782
- ].join(' ')
197783
- }
197784
- };
197785
-
197786
-
197787
197787
  /***/ }),
197788
197788
 
197789
197789
  /***/ 48223:
@@ -213973,6 +213973,993 @@ module.exports = function selectPoints(searchInfo, selectionTester) {
213973
213973
  };
213974
213974
 
213975
213975
 
213976
+ /***/ }),
213977
+
213978
+ /***/ 1015:
213979
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
213980
+
213981
+
213982
+
213983
+ var scatterAttrs = __webpack_require__(86854);
213984
+ var fontAttrs = __webpack_require__(70827);
213985
+ var colorAttributes = __webpack_require__(17957);
213986
+ var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
213987
+ var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
213988
+ var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
213989
+ var baseAttrs = __webpack_require__(35667);
213990
+ var DASHES = __webpack_require__(68828);
213991
+
213992
+ var MARKER_SYMBOLS = __webpack_require__(98993);
213993
+ var extendFlat = (__webpack_require__(91307).extendFlat);
213994
+ var overrideAll = (__webpack_require__(70756).overrideAll);
213995
+ var sortObjectKeys = __webpack_require__(99124);
213996
+
213997
+ var scatterLineAttrs = scatterAttrs.line;
213998
+ var scatterMarkerAttrs = scatterAttrs.marker;
213999
+ var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
214000
+
214001
+ var lineAttrs = extendFlat({
214002
+ width: scatterLineAttrs.width,
214003
+ dash: {
214004
+ valType: 'enumerated',
214005
+ values: sortObjectKeys(DASHES),
214006
+ dflt: 'solid',
214007
+ description: 'Sets the dash style of the lines.'
214008
+ }
214009
+ }, colorAttributes('line'));
214010
+
214011
+ function makeProjectionAttr(axLetter) {
214012
+ return {
214013
+ show: {
214014
+ valType: 'boolean',
214015
+ dflt: false,
214016
+ description: [
214017
+ 'Sets whether or not projections are shown along the',
214018
+ axLetter, 'axis.'
214019
+ ].join(' ')
214020
+ },
214021
+ opacity: {
214022
+ valType: 'number',
214023
+ min: 0,
214024
+ max: 1,
214025
+ dflt: 1,
214026
+ description: 'Sets the projection color.'
214027
+ },
214028
+ scale: {
214029
+ valType: 'number',
214030
+ min: 0,
214031
+ max: 10,
214032
+ dflt: 2 / 3,
214033
+ description: [
214034
+ 'Sets the scale factor determining the size of the',
214035
+ 'projection marker points.'
214036
+ ].join(' ')
214037
+ }
214038
+ };
214039
+ }
214040
+
214041
+ var attrs = module.exports = overrideAll({
214042
+ x: scatterAttrs.x,
214043
+ y: scatterAttrs.y,
214044
+ z: {
214045
+ valType: 'data_array',
214046
+ description: 'Sets the z coordinates.'
214047
+ },
214048
+
214049
+ text: extendFlat({}, scatterAttrs.text, {
214050
+ description: [
214051
+ 'Sets text elements associated with each (x,y,z) triplet.',
214052
+ 'If a single string, the same string appears over',
214053
+ 'all the data points.',
214054
+ 'If an array of string, the items are mapped in order to the',
214055
+ 'this trace\'s (x,y,z) coordinates.',
214056
+ 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
214057
+ 'these elements will be seen in the hover labels.'
214058
+ ].join(' ')
214059
+ }),
214060
+ texttemplate: texttemplateAttrs({}, {
214061
+
214062
+ }),
214063
+ hovertext: extendFlat({}, scatterAttrs.hovertext, {
214064
+ description: [
214065
+ 'Sets text elements associated with each (x,y,z) triplet.',
214066
+ 'If a single string, the same string appears over',
214067
+ 'all the data points.',
214068
+ 'If an array of string, the items are mapped in order to the',
214069
+ 'this trace\'s (x,y,z) coordinates.',
214070
+ 'To be seen, trace `hoverinfo` must contain a *text* flag.'
214071
+ ].join(' ')
214072
+ }),
214073
+ hovertemplate: hovertemplateAttrs(),
214074
+
214075
+ xhoverformat: axisHoverFormat('x'),
214076
+ yhoverformat: axisHoverFormat('y'),
214077
+ zhoverformat: axisHoverFormat('z'),
214078
+
214079
+ mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
214080
+ {dflt: 'lines+markers'}),
214081
+ surfaceaxis: {
214082
+ valType: 'enumerated',
214083
+ values: [-1, 0, 1, 2],
214084
+ dflt: -1,
214085
+ description: [
214086
+ 'If *-1*, the scatter points are not fill with a surface',
214087
+ 'If *0*, *1*, *2*, the scatter points are filled with',
214088
+ 'a Delaunay surface about the x, y, z respectively.'
214089
+ ].join(' ')
214090
+ },
214091
+ surfacecolor: {
214092
+ valType: 'color',
214093
+ description: 'Sets the surface fill color.'
214094
+ },
214095
+ projection: {
214096
+ x: makeProjectionAttr('x'),
214097
+ y: makeProjectionAttr('y'),
214098
+ z: makeProjectionAttr('z')
214099
+ },
214100
+
214101
+ connectgaps: scatterAttrs.connectgaps,
214102
+ line: lineAttrs,
214103
+
214104
+ marker: extendFlat({ // Parity with scatter.js?
214105
+ symbol: {
214106
+ valType: 'enumerated',
214107
+ values: sortObjectKeys(MARKER_SYMBOLS),
214108
+ dflt: 'circle',
214109
+ arrayOk: true,
214110
+ description: 'Sets the marker symbol type.'
214111
+ },
214112
+ size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
214113
+ sizeref: scatterMarkerAttrs.sizeref,
214114
+ sizemin: scatterMarkerAttrs.sizemin,
214115
+ sizemode: scatterMarkerAttrs.sizemode,
214116
+ opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
214117
+ arrayOk: false,
214118
+ description: [
214119
+ 'Sets the marker opacity.',
214120
+ 'Note that the marker opacity for scatter3d traces',
214121
+ 'must be a scalar value for performance reasons.',
214122
+ 'To set a blending opacity value',
214123
+ '(i.e. which is not transparent), set *marker.color*',
214124
+ 'to an rgba color and use its alpha channel.'
214125
+ ].join(' ')
214126
+ }),
214127
+ colorbar: scatterMarkerAttrs.colorbar,
214128
+
214129
+ line: extendFlat({
214130
+ width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
214131
+ },
214132
+ colorAttributes('marker.line')
214133
+ )
214134
+ },
214135
+ colorAttributes('marker')
214136
+ ),
214137
+
214138
+ textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
214139
+ textfont: fontAttrs({
214140
+ noFontShadow: true,
214141
+ noFontLineposition: true,
214142
+ noFontTextcase: true,
214143
+ editType: 'calc',
214144
+ colorEditType: 'style',
214145
+ arrayOk: true,
214146
+ variantValues: ['normal', 'small-caps'],
214147
+ description: 'Sets the text font.'
214148
+ }),
214149
+
214150
+ opacity: baseAttrs.opacity,
214151
+
214152
+ hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
214153
+ }, 'calc', 'nested');
214154
+
214155
+ attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
214156
+
214157
+
214158
+ /***/ }),
214159
+
214160
+ /***/ 30935:
214161
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
214162
+
214163
+
214164
+
214165
+ var arraysToCalcdata = __webpack_require__(47213);
214166
+ var calcColorscale = __webpack_require__(59498);
214167
+
214168
+ /**
214169
+ * This is a kludge to put the array attributes into
214170
+ * calcdata the way Scatter.plot does, so that legends and
214171
+ * popovers know what to do with them.
214172
+ */
214173
+ module.exports = function calc(gd, trace) {
214174
+ var cd = [{x: false, y: false, trace: trace, t: {}}];
214175
+
214176
+ arraysToCalcdata(cd, trace);
214177
+ calcColorscale(gd, trace);
214178
+
214179
+ return cd;
214180
+ };
214181
+
214182
+
214183
+ /***/ }),
214184
+
214185
+ /***/ 77681:
214186
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
214187
+
214188
+
214189
+
214190
+ var Registry = __webpack_require__(13936);
214191
+
214192
+ function calculateAxisErrors(data, params, scaleFactor, axis) {
214193
+ if(!params || !params.visible) return null;
214194
+
214195
+ var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
214196
+ var result = new Array(data.length);
214197
+
214198
+ for(var i = 0; i < data.length; i++) {
214199
+ var errors = computeError(+data[i], i);
214200
+
214201
+ if(axis.type === 'log') {
214202
+ var point = axis.c2l(data[i]);
214203
+ var min = data[i] - errors[0];
214204
+ var max = data[i] + errors[1];
214205
+
214206
+ result[i] = [
214207
+ (axis.c2l(min, true) - point) * scaleFactor,
214208
+ (axis.c2l(max, true) - point) * scaleFactor
214209
+ ];
214210
+
214211
+ // Keep track of the lower error bound which isn't negative!
214212
+ if(min > 0) {
214213
+ var lower = axis.c2l(min);
214214
+ if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
214215
+ axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
214216
+ }
214217
+ } else {
214218
+ result[i] = [
214219
+ -errors[0] * scaleFactor,
214220
+ errors[1] * scaleFactor
214221
+ ];
214222
+ }
214223
+ }
214224
+
214225
+ return result;
214226
+ }
214227
+
214228
+ function dataLength(array) {
214229
+ for(var i = 0; i < array.length; i++) {
214230
+ if(array[i]) return array[i].length;
214231
+ }
214232
+ return 0;
214233
+ }
214234
+
214235
+ function calculateErrors(data, scaleFactor, sceneLayout) {
214236
+ var errors = [
214237
+ calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
214238
+ calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
214239
+ calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
214240
+ ];
214241
+
214242
+ var n = dataLength(errors);
214243
+ if(n === 0) return null;
214244
+
214245
+ var errorBounds = new Array(n);
214246
+
214247
+ for(var i = 0; i < n; i++) {
214248
+ var bound = [[0, 0, 0], [0, 0, 0]];
214249
+
214250
+ for(var j = 0; j < 3; j++) {
214251
+ if(errors[j]) {
214252
+ for(var k = 0; k < 2; k++) {
214253
+ bound[k][j] = errors[j][i][k];
214254
+ }
214255
+ }
214256
+ }
214257
+
214258
+ errorBounds[i] = bound;
214259
+ }
214260
+
214261
+ return errorBounds;
214262
+ }
214263
+
214264
+ module.exports = calculateErrors;
214265
+
214266
+
214267
+ /***/ }),
214268
+
214269
+ /***/ 93219:
214270
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
214271
+
214272
+
214273
+
214274
+ var createLinePlot = (__webpack_require__(46000).gl_line3d);
214275
+ var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
214276
+ var createErrorBars = (__webpack_require__(46000).gl_error3d);
214277
+ var createMesh = (__webpack_require__(46000).gl_mesh3d);
214278
+ var triangulate = (__webpack_require__(46000).delaunay_triangulate);
214279
+
214280
+ var Lib = __webpack_require__(30991);
214281
+ var str2RgbaArray = __webpack_require__(44960);
214282
+ var formatColor = (__webpack_require__(592).formatColor);
214283
+ var makeBubbleSizeFn = __webpack_require__(42581);
214284
+ var DASH_PATTERNS = __webpack_require__(68828);
214285
+ var MARKER_SYMBOLS = __webpack_require__(98993);
214286
+
214287
+ var Axes = __webpack_require__(15076);
214288
+ var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
214289
+
214290
+ var calculateError = __webpack_require__(77681);
214291
+
214292
+ function LineWithMarkers(scene, uid) {
214293
+ this.scene = scene;
214294
+ this.uid = uid;
214295
+ this.linePlot = null;
214296
+ this.scatterPlot = null;
214297
+ this.errorBars = null;
214298
+ this.textMarkers = null;
214299
+ this.delaunayMesh = null;
214300
+ this.color = null;
214301
+ this.mode = '';
214302
+ this.dataPoints = [];
214303
+ this.axesBounds = [
214304
+ [-Infinity, -Infinity, -Infinity],
214305
+ [Infinity, Infinity, Infinity]
214306
+ ];
214307
+ this.textLabels = null;
214308
+ this.data = null;
214309
+ }
214310
+
214311
+ var proto = LineWithMarkers.prototype;
214312
+
214313
+ proto.handlePick = function(selection) {
214314
+ if(selection.object &&
214315
+ (selection.object === this.linePlot ||
214316
+ selection.object === this.delaunayMesh ||
214317
+ selection.object === this.textMarkers ||
214318
+ selection.object === this.scatterPlot)
214319
+ ) {
214320
+ var ind = selection.index = selection.data.index;
214321
+
214322
+ if(selection.object.highlight) {
214323
+ selection.object.highlight(null);
214324
+ }
214325
+ if(this.scatterPlot) {
214326
+ selection.object = this.scatterPlot;
214327
+ this.scatterPlot.highlight(selection.data);
214328
+ }
214329
+
214330
+ selection.textLabel = '';
214331
+ if(this.textLabels) {
214332
+ if(Lib.isArrayOrTypedArray(this.textLabels)) {
214333
+ if(this.textLabels[ind] || this.textLabels[ind] === 0) {
214334
+ selection.textLabel = this.textLabels[ind];
214335
+ }
214336
+ } else {
214337
+ selection.textLabel = this.textLabels;
214338
+ }
214339
+ }
214340
+
214341
+ selection.traceCoordinate = [
214342
+ this.data.x[ind],
214343
+ this.data.y[ind],
214344
+ this.data.z[ind]
214345
+ ];
214346
+
214347
+ return true;
214348
+ }
214349
+ };
214350
+
214351
+ function constructDelaunay(points, color, axis) {
214352
+ var u = (axis + 1) % 3;
214353
+ var v = (axis + 2) % 3;
214354
+ var filteredPoints = [];
214355
+ var filteredIds = [];
214356
+ var i;
214357
+
214358
+ for(i = 0; i < points.length; ++i) {
214359
+ var p = points[i];
214360
+ if(isNaN(p[u]) || !isFinite(p[u]) ||
214361
+ isNaN(p[v]) || !isFinite(p[v])) {
214362
+ continue;
214363
+ }
214364
+ filteredPoints.push([p[u], p[v]]);
214365
+ filteredIds.push(i);
214366
+ }
214367
+ var cells = triangulate(filteredPoints);
214368
+ for(i = 0; i < cells.length; ++i) {
214369
+ var c = cells[i];
214370
+ for(var j = 0; j < c.length; ++j) {
214371
+ c[j] = filteredIds[c[j]];
214372
+ }
214373
+ }
214374
+ return {
214375
+ positions: points,
214376
+ cells: cells,
214377
+ meshColor: color
214378
+ };
214379
+ }
214380
+
214381
+ function calculateErrorParams(errors) {
214382
+ var capSize = [0.0, 0.0, 0.0];
214383
+ var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
214384
+ var lineWidth = [1.0, 1.0, 1.0];
214385
+
214386
+ for(var i = 0; i < 3; i++) {
214387
+ var e = errors[i];
214388
+
214389
+ if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
214390
+ if(!e || !e.visible) continue;
214391
+
214392
+ capSize[i] = e.width / 2; // ballpark rescaling
214393
+ color[i] = str2RgbaArray(e.color);
214394
+ lineWidth[i] = e.thickness;
214395
+ }
214396
+
214397
+ return {capSize: capSize, color: color, lineWidth: lineWidth};
214398
+ }
214399
+
214400
+ function parseAlignmentX(a) {
214401
+ if(a === null || a === undefined) return 0;
214402
+
214403
+ return (a.indexOf('left') > -1) ? -1 :
214404
+ (a.indexOf('right') > -1) ? 1 : 0;
214405
+ }
214406
+
214407
+ function parseAlignmentY(a) {
214408
+ if(a === null || a === undefined) return 0;
214409
+
214410
+ return (a.indexOf('top') > -1) ? -1 :
214411
+ (a.indexOf('bottom') > -1) ? 1 : 0;
214412
+ }
214413
+
214414
+ function calculateTextOffset(tp) {
214415
+ // Read out text properties
214416
+
214417
+ var defaultAlignmentX = 0;
214418
+ var defaultAlignmentY = 0;
214419
+
214420
+ var textOffset = [
214421
+ defaultAlignmentX,
214422
+ defaultAlignmentY
214423
+ ];
214424
+
214425
+ if(Array.isArray(tp)) {
214426
+ for(var i = 0; i < tp.length; i++) {
214427
+ textOffset[i] = [
214428
+ defaultAlignmentX,
214429
+ defaultAlignmentY
214430
+ ];
214431
+ if(tp[i]) {
214432
+ textOffset[i][0] = parseAlignmentX(tp[i]);
214433
+ textOffset[i][1] = parseAlignmentY(tp[i]);
214434
+ }
214435
+ }
214436
+ } else {
214437
+ textOffset[0] = parseAlignmentX(tp);
214438
+ textOffset[1] = parseAlignmentY(tp);
214439
+ }
214440
+
214441
+ return textOffset;
214442
+ }
214443
+
214444
+
214445
+ function calculateSize(sizeIn, sizeFn) {
214446
+ // rough parity with Plotly 2D markers
214447
+ return sizeFn(sizeIn * 4);
214448
+ }
214449
+
214450
+ function calculateSymbol(symbolIn) {
214451
+ return MARKER_SYMBOLS[symbolIn];
214452
+ }
214453
+
214454
+ function formatParam(paramIn, len, calculate, dflt, extraFn) {
214455
+ var paramOut = null;
214456
+
214457
+ if(Lib.isArrayOrTypedArray(paramIn)) {
214458
+ paramOut = [];
214459
+
214460
+ for(var i = 0; i < len; i++) {
214461
+ if(paramIn[i] === undefined) paramOut[i] = dflt;
214462
+ else paramOut[i] = calculate(paramIn[i], extraFn);
214463
+ }
214464
+ } else paramOut = calculate(paramIn, Lib.identity);
214465
+
214466
+ return paramOut;
214467
+ }
214468
+
214469
+
214470
+ function convertPlotlyOptions(scene, data) {
214471
+ var points = [];
214472
+ var sceneLayout = scene.fullSceneLayout;
214473
+ var scaleFactor = scene.dataScale;
214474
+ var xaxis = sceneLayout.xaxis;
214475
+ var yaxis = sceneLayout.yaxis;
214476
+ var zaxis = sceneLayout.zaxis;
214477
+ var marker = data.marker;
214478
+ var line = data.line;
214479
+ var x = data.x || [];
214480
+ var y = data.y || [];
214481
+ var z = data.z || [];
214482
+ var len = x.length;
214483
+ var xcalendar = data.xcalendar;
214484
+ var ycalendar = data.ycalendar;
214485
+ var zcalendar = data.zcalendar;
214486
+ var xc, yc, zc;
214487
+ var params, i;
214488
+ var text;
214489
+
214490
+ // Convert points
214491
+ for(i = 0; i < len; i++) {
214492
+ // sanitize numbers and apply transforms based on axes.type
214493
+ xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
214494
+ yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
214495
+ zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
214496
+
214497
+ points[i] = [xc, yc, zc];
214498
+ }
214499
+
214500
+ // convert text
214501
+ if(Array.isArray(data.text)) {
214502
+ text = data.text;
214503
+ } else if(Lib.isTypedArray(data.text)) {
214504
+ text = Array.from(data.text);
214505
+ } else if(data.text !== undefined) {
214506
+ text = new Array(len);
214507
+ for(i = 0; i < len; i++) text[i] = data.text;
214508
+ }
214509
+
214510
+ function formatter(axName, val) {
214511
+ var ax = sceneLayout[axName];
214512
+ return Axes.tickText(ax, ax.d2l(val), true).text;
214513
+ }
214514
+
214515
+ // check texttemplate
214516
+ var texttemplate = data.texttemplate;
214517
+ if(texttemplate) {
214518
+ var fullLayout = scene.fullLayout;
214519
+ var d3locale = fullLayout._d3locale;
214520
+ var isArray = Array.isArray(texttemplate);
214521
+ var N = isArray ? Math.min(texttemplate.length, len) : len;
214522
+ var txt = isArray ?
214523
+ function(i) { return texttemplate[i]; } :
214524
+ function() { return texttemplate; };
214525
+
214526
+ text = new Array(N);
214527
+
214528
+ for(i = 0; i < N; i++) {
214529
+ var d = {x: x[i], y: y[i], z: z[i]};
214530
+ var labels = {
214531
+ xLabel: formatter('xaxis', x[i]),
214532
+ yLabel: formatter('yaxis', y[i]),
214533
+ zLabel: formatter('zaxis', z[i])
214534
+ };
214535
+ var pointValues = {};
214536
+ appendArrayPointValue(pointValues, data, i);
214537
+ var meta = data._meta || {};
214538
+ text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
214539
+ }
214540
+ }
214541
+
214542
+ // Build object parameters
214543
+ params = {
214544
+ position: points,
214545
+ mode: data.mode,
214546
+ text: text
214547
+ };
214548
+
214549
+ if('line' in data) {
214550
+ params.lineColor = formatColor(line, 1, len);
214551
+ params.lineWidth = line.width;
214552
+ params.lineDashes = line.dash;
214553
+ }
214554
+
214555
+ if('marker' in data) {
214556
+ var sizeFn = makeBubbleSizeFn(data);
214557
+
214558
+ params.scatterColor = formatColor(marker, 1, len);
214559
+ params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
214560
+ params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
214561
+ params.scatterLineWidth = marker.line.width; // arrayOk === false
214562
+ params.scatterLineColor = formatColor(marker.line, 1, len);
214563
+ params.scatterAngle = 0;
214564
+ }
214565
+
214566
+ if('textposition' in data) {
214567
+ params.textOffset = calculateTextOffset(data.textposition);
214568
+ params.textColor = formatColor(data.textfont, 1, len);
214569
+ params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
214570
+ params.textFontFamily = data.textfont.family;
214571
+ params.textFontWeight = data.textfont.weight;
214572
+ params.textFontStyle = data.textfont.style;
214573
+ params.textFontVariant = data.textfont.variant;
214574
+ params.textAngle = 0;
214575
+ }
214576
+
214577
+ var dims = ['x', 'y', 'z'];
214578
+ params.project = [false, false, false];
214579
+ params.projectScale = [1, 1, 1];
214580
+ params.projectOpacity = [1, 1, 1];
214581
+ for(i = 0; i < 3; ++i) {
214582
+ var projection = data.projection[dims[i]];
214583
+ if((params.project[i] = projection.show)) {
214584
+ params.projectOpacity[i] = projection.opacity;
214585
+ params.projectScale[i] = projection.scale;
214586
+ }
214587
+ }
214588
+
214589
+ params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
214590
+
214591
+ var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
214592
+ params.errorColor = errorParams.color;
214593
+ params.errorLineWidth = errorParams.lineWidth;
214594
+ params.errorCapSize = errorParams.capSize;
214595
+
214596
+ params.delaunayAxis = data.surfaceaxis;
214597
+ params.delaunayColor = str2RgbaArray(data.surfacecolor);
214598
+
214599
+ return params;
214600
+ }
214601
+
214602
+ function _arrayToColor(color) {
214603
+ if(Lib.isArrayOrTypedArray(color)) {
214604
+ var c = color[0];
214605
+
214606
+ if(Lib.isArrayOrTypedArray(c)) color = c;
214607
+
214608
+ return 'rgb(' + color.slice(0, 3).map(function(x) {
214609
+ return Math.round(x * 255);
214610
+ }) + ')';
214611
+ }
214612
+
214613
+ return null;
214614
+ }
214615
+
214616
+ function arrayToColor(colors) {
214617
+ if(!Lib.isArrayOrTypedArray(colors)) {
214618
+ return null;
214619
+ }
214620
+
214621
+ if((colors.length === 4) && (typeof colors[0] === 'number')) {
214622
+ return _arrayToColor(colors);
214623
+ }
214624
+
214625
+ return colors.map(_arrayToColor);
214626
+ }
214627
+
214628
+ proto.update = function(data) {
214629
+ var gl = this.scene.glplot.gl;
214630
+ var lineOptions;
214631
+ var scatterOptions;
214632
+ var errorOptions;
214633
+ var textOptions;
214634
+ var dashPattern = DASH_PATTERNS.solid;
214635
+
214636
+ // Save data
214637
+ this.data = data;
214638
+
214639
+ // Run data conversion
214640
+ var options = convertPlotlyOptions(this.scene, data);
214641
+
214642
+ if('mode' in options) {
214643
+ this.mode = options.mode;
214644
+ }
214645
+ if('lineDashes' in options) {
214646
+ if(options.lineDashes in DASH_PATTERNS) {
214647
+ dashPattern = DASH_PATTERNS[options.lineDashes];
214648
+ }
214649
+ }
214650
+
214651
+ this.color = arrayToColor(options.scatterColor) ||
214652
+ arrayToColor(options.lineColor);
214653
+
214654
+ // Save data points
214655
+ this.dataPoints = options.position;
214656
+
214657
+ lineOptions = {
214658
+ gl: this.scene.glplot.gl,
214659
+ position: options.position,
214660
+ color: options.lineColor,
214661
+ lineWidth: options.lineWidth || 1,
214662
+ dashes: dashPattern[0],
214663
+ dashScale: dashPattern[1],
214664
+ opacity: data.opacity,
214665
+ connectGaps: data.connectgaps
214666
+ };
214667
+
214668
+ if(this.mode.indexOf('lines') !== -1) {
214669
+ if(this.linePlot) this.linePlot.update(lineOptions);
214670
+ else {
214671
+ this.linePlot = createLinePlot(lineOptions);
214672
+ this.linePlot._trace = this;
214673
+ this.scene.glplot.add(this.linePlot);
214674
+ }
214675
+ } else if(this.linePlot) {
214676
+ this.scene.glplot.remove(this.linePlot);
214677
+ this.linePlot.dispose();
214678
+ this.linePlot = null;
214679
+ }
214680
+
214681
+ // N.B. marker.opacity must be a scalar for performance
214682
+ var scatterOpacity = data.opacity;
214683
+ if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
214684
+
214685
+ scatterOptions = {
214686
+ gl: this.scene.glplot.gl,
214687
+ position: options.position,
214688
+ color: options.scatterColor,
214689
+ size: options.scatterSize,
214690
+ glyph: options.scatterMarker,
214691
+ opacity: scatterOpacity,
214692
+ orthographic: true,
214693
+ lineWidth: options.scatterLineWidth,
214694
+ lineColor: options.scatterLineColor,
214695
+ project: options.project,
214696
+ projectScale: options.projectScale,
214697
+ projectOpacity: options.projectOpacity
214698
+ };
214699
+
214700
+ if(this.mode.indexOf('markers') !== -1) {
214701
+ if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
214702
+ else {
214703
+ this.scatterPlot = createScatterPlot(scatterOptions);
214704
+ this.scatterPlot._trace = this;
214705
+ this.scatterPlot.highlightScale = 1;
214706
+ this.scene.glplot.add(this.scatterPlot);
214707
+ }
214708
+ } else if(this.scatterPlot) {
214709
+ this.scene.glplot.remove(this.scatterPlot);
214710
+ this.scatterPlot.dispose();
214711
+ this.scatterPlot = null;
214712
+ }
214713
+
214714
+ textOptions = {
214715
+ gl: this.scene.glplot.gl,
214716
+ position: options.position,
214717
+ glyph: options.text,
214718
+ color: options.textColor,
214719
+ size: options.textSize,
214720
+ angle: options.textAngle,
214721
+ alignment: options.textOffset,
214722
+ font: options.textFontFamily,
214723
+ fontWeight: options.textFontWeight,
214724
+ fontStyle: options.textFontStyle,
214725
+ fontVariant: options.textFontVariant,
214726
+ orthographic: true,
214727
+ lineWidth: 0,
214728
+ project: false,
214729
+ opacity: data.opacity
214730
+ };
214731
+
214732
+ this.textLabels = data.hovertext || data.text;
214733
+
214734
+ if(this.mode.indexOf('text') !== -1) {
214735
+ if(this.textMarkers) this.textMarkers.update(textOptions);
214736
+ else {
214737
+ this.textMarkers = createScatterPlot(textOptions);
214738
+ this.textMarkers._trace = this;
214739
+ this.textMarkers.highlightScale = 1;
214740
+ this.scene.glplot.add(this.textMarkers);
214741
+ }
214742
+ } else if(this.textMarkers) {
214743
+ this.scene.glplot.remove(this.textMarkers);
214744
+ this.textMarkers.dispose();
214745
+ this.textMarkers = null;
214746
+ }
214747
+
214748
+ errorOptions = {
214749
+ gl: this.scene.glplot.gl,
214750
+ position: options.position,
214751
+ color: options.errorColor,
214752
+ error: options.errorBounds,
214753
+ lineWidth: options.errorLineWidth,
214754
+ capSize: options.errorCapSize,
214755
+ opacity: data.opacity
214756
+ };
214757
+ if(this.errorBars) {
214758
+ if(options.errorBounds) {
214759
+ this.errorBars.update(errorOptions);
214760
+ } else {
214761
+ this.scene.glplot.remove(this.errorBars);
214762
+ this.errorBars.dispose();
214763
+ this.errorBars = null;
214764
+ }
214765
+ } else if(options.errorBounds) {
214766
+ this.errorBars = createErrorBars(errorOptions);
214767
+ this.errorBars._trace = this;
214768
+ this.scene.glplot.add(this.errorBars);
214769
+ }
214770
+
214771
+ if(options.delaunayAxis >= 0) {
214772
+ var delaunayOptions = constructDelaunay(
214773
+ options.position,
214774
+ options.delaunayColor,
214775
+ options.delaunayAxis
214776
+ );
214777
+ delaunayOptions.opacity = data.opacity;
214778
+
214779
+ if(this.delaunayMesh) {
214780
+ this.delaunayMesh.update(delaunayOptions);
214781
+ } else {
214782
+ delaunayOptions.gl = gl;
214783
+ this.delaunayMesh = createMesh(delaunayOptions);
214784
+ this.delaunayMesh._trace = this;
214785
+ this.scene.glplot.add(this.delaunayMesh);
214786
+ }
214787
+ } else if(this.delaunayMesh) {
214788
+ this.scene.glplot.remove(this.delaunayMesh);
214789
+ this.delaunayMesh.dispose();
214790
+ this.delaunayMesh = null;
214791
+ }
214792
+ };
214793
+
214794
+ proto.dispose = function() {
214795
+ if(this.linePlot) {
214796
+ this.scene.glplot.remove(this.linePlot);
214797
+ this.linePlot.dispose();
214798
+ }
214799
+ if(this.scatterPlot) {
214800
+ this.scene.glplot.remove(this.scatterPlot);
214801
+ this.scatterPlot.dispose();
214802
+ }
214803
+ if(this.errorBars) {
214804
+ this.scene.glplot.remove(this.errorBars);
214805
+ this.errorBars.dispose();
214806
+ }
214807
+ if(this.textMarkers) {
214808
+ this.scene.glplot.remove(this.textMarkers);
214809
+ this.textMarkers.dispose();
214810
+ }
214811
+ if(this.delaunayMesh) {
214812
+ this.scene.glplot.remove(this.delaunayMesh);
214813
+ this.delaunayMesh.dispose();
214814
+ }
214815
+ };
214816
+
214817
+ function createLineWithMarkers(scene, data) {
214818
+ var plot = new LineWithMarkers(scene, data.uid);
214819
+ plot.update(data);
214820
+ return plot;
214821
+ }
214822
+
214823
+ module.exports = createLineWithMarkers;
214824
+
214825
+
214826
+ /***/ }),
214827
+
214828
+ /***/ 13744:
214829
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
214830
+
214831
+
214832
+
214833
+ var Registry = __webpack_require__(13936);
214834
+ var Lib = __webpack_require__(30991);
214835
+
214836
+ var subTypes = __webpack_require__(33068);
214837
+ var handleMarkerDefaults = __webpack_require__(15294);
214838
+ var handleLineDefaults = __webpack_require__(82094);
214839
+ var handleTextDefaults = __webpack_require__(94729);
214840
+
214841
+ var attributes = __webpack_require__(1015);
214842
+
214843
+ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
214844
+ function coerce(attr, dflt) {
214845
+ return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
214846
+ }
214847
+
214848
+ var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
214849
+ if(!len) {
214850
+ traceOut.visible = false;
214851
+ return;
214852
+ }
214853
+
214854
+ coerce('text');
214855
+ coerce('hovertext');
214856
+ coerce('hovertemplate');
214857
+ coerce('xhoverformat');
214858
+ coerce('yhoverformat');
214859
+ coerce('zhoverformat');
214860
+
214861
+ coerce('mode');
214862
+
214863
+ if(subTypes.hasMarkers(traceOut)) {
214864
+ handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
214865
+ }
214866
+
214867
+ if(subTypes.hasLines(traceOut)) {
214868
+ coerce('connectgaps');
214869
+ handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
214870
+ }
214871
+
214872
+ if(subTypes.hasText(traceOut)) {
214873
+ coerce('texttemplate');
214874
+ handleTextDefaults(traceIn, traceOut, layout, coerce, {
214875
+ noSelect: true,
214876
+ noFontShadow: true,
214877
+ noFontLineposition: true,
214878
+ noFontTextcase: true,
214879
+ });
214880
+ }
214881
+
214882
+ var lineColor = (traceOut.line || {}).color;
214883
+ var markerColor = (traceOut.marker || {}).color;
214884
+ if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
214885
+
214886
+ var dims = ['x', 'y', 'z'];
214887
+ for(var i = 0; i < 3; ++i) {
214888
+ var projection = 'projection.' + dims[i];
214889
+ if(coerce(projection + '.show')) {
214890
+ coerce(projection + '.opacity');
214891
+ coerce(projection + '.scale');
214892
+ }
214893
+ }
214894
+
214895
+ var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
214896
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
214897
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
214898
+ errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
214899
+ };
214900
+
214901
+ function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
214902
+ var len = 0;
214903
+ var x = coerce('x');
214904
+ var y = coerce('y');
214905
+ var z = coerce('z');
214906
+
214907
+ var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
214908
+ handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
214909
+
214910
+ if(x && y && z) {
214911
+ // TODO: what happens if one is missing?
214912
+ len = Math.min(x.length, y.length, z.length);
214913
+ traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
214914
+ }
214915
+
214916
+ return len;
214917
+ }
214918
+
214919
+
214920
+ /***/ }),
214921
+
214922
+ /***/ 68860:
214923
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
214924
+
214925
+
214926
+
214927
+ module.exports = {
214928
+ plot: __webpack_require__(93219),
214929
+ attributes: __webpack_require__(1015),
214930
+ markerSymbols: __webpack_require__(98993),
214931
+ supplyDefaults: __webpack_require__(13744),
214932
+ colorbar: [
214933
+ {
214934
+ container: 'marker',
214935
+ min: 'cmin',
214936
+ max: 'cmax'
214937
+ }, {
214938
+ container: 'line',
214939
+ min: 'cmin',
214940
+ max: 'cmax'
214941
+ }
214942
+ ],
214943
+ calc: __webpack_require__(30935),
214944
+
214945
+ moduleType: 'trace',
214946
+ name: 'scatter3d',
214947
+ basePlotModule: __webpack_require__(68137),
214948
+ categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
214949
+ meta: {
214950
+ hrName: 'scatter_3d',
214951
+ description: [
214952
+ 'The data visualized as scatter point or lines in 3D dimension',
214953
+ 'is set in `x`, `y`, `z`.',
214954
+ 'Text (appearing either on the chart or on hover only) is via `text`.',
214955
+ 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
214956
+ 'Projections are achieved via `projection`.',
214957
+ 'Surface fills are achieved via `surfaceaxis`.'
214958
+ ].join(' ')
214959
+ }
214960
+ };
214961
+
214962
+
213976
214963
  /***/ }),
213977
214964
 
213978
214965
  /***/ 47213:
@@ -217903,993 +218890,6 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
217903
218890
  };
217904
218891
 
217905
218892
 
217906
- /***/ }),
217907
-
217908
- /***/ 1015:
217909
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
217910
-
217911
-
217912
-
217913
- var scatterAttrs = __webpack_require__(86854);
217914
- var fontAttrs = __webpack_require__(70827);
217915
- var colorAttributes = __webpack_require__(17957);
217916
- var axisHoverFormat = (__webpack_require__(71018).axisHoverFormat);
217917
- var hovertemplateAttrs = (__webpack_require__(92710)/* .hovertemplateAttrs */ .rb);
217918
- var texttemplateAttrs = (__webpack_require__(92710)/* .texttemplateAttrs */ .ay);
217919
- var baseAttrs = __webpack_require__(35667);
217920
- var DASHES = __webpack_require__(68828);
217921
-
217922
- var MARKER_SYMBOLS = __webpack_require__(98993);
217923
- var extendFlat = (__webpack_require__(91307).extendFlat);
217924
- var overrideAll = (__webpack_require__(70756).overrideAll);
217925
- var sortObjectKeys = __webpack_require__(99124);
217926
-
217927
- var scatterLineAttrs = scatterAttrs.line;
217928
- var scatterMarkerAttrs = scatterAttrs.marker;
217929
- var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
217930
-
217931
- var lineAttrs = extendFlat({
217932
- width: scatterLineAttrs.width,
217933
- dash: {
217934
- valType: 'enumerated',
217935
- values: sortObjectKeys(DASHES),
217936
- dflt: 'solid',
217937
- description: 'Sets the dash style of the lines.'
217938
- }
217939
- }, colorAttributes('line'));
217940
-
217941
- function makeProjectionAttr(axLetter) {
217942
- return {
217943
- show: {
217944
- valType: 'boolean',
217945
- dflt: false,
217946
- description: [
217947
- 'Sets whether or not projections are shown along the',
217948
- axLetter, 'axis.'
217949
- ].join(' ')
217950
- },
217951
- opacity: {
217952
- valType: 'number',
217953
- min: 0,
217954
- max: 1,
217955
- dflt: 1,
217956
- description: 'Sets the projection color.'
217957
- },
217958
- scale: {
217959
- valType: 'number',
217960
- min: 0,
217961
- max: 10,
217962
- dflt: 2 / 3,
217963
- description: [
217964
- 'Sets the scale factor determining the size of the',
217965
- 'projection marker points.'
217966
- ].join(' ')
217967
- }
217968
- };
217969
- }
217970
-
217971
- var attrs = module.exports = overrideAll({
217972
- x: scatterAttrs.x,
217973
- y: scatterAttrs.y,
217974
- z: {
217975
- valType: 'data_array',
217976
- description: 'Sets the z coordinates.'
217977
- },
217978
-
217979
- text: extendFlat({}, scatterAttrs.text, {
217980
- description: [
217981
- 'Sets text elements associated with each (x,y,z) triplet.',
217982
- 'If a single string, the same string appears over',
217983
- 'all the data points.',
217984
- 'If an array of string, the items are mapped in order to the',
217985
- 'this trace\'s (x,y,z) coordinates.',
217986
- 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
217987
- 'these elements will be seen in the hover labels.'
217988
- ].join(' ')
217989
- }),
217990
- texttemplate: texttemplateAttrs({}, {
217991
-
217992
- }),
217993
- hovertext: extendFlat({}, scatterAttrs.hovertext, {
217994
- description: [
217995
- 'Sets text elements associated with each (x,y,z) triplet.',
217996
- 'If a single string, the same string appears over',
217997
- 'all the data points.',
217998
- 'If an array of string, the items are mapped in order to the',
217999
- 'this trace\'s (x,y,z) coordinates.',
218000
- 'To be seen, trace `hoverinfo` must contain a *text* flag.'
218001
- ].join(' ')
218002
- }),
218003
- hovertemplate: hovertemplateAttrs(),
218004
-
218005
- xhoverformat: axisHoverFormat('x'),
218006
- yhoverformat: axisHoverFormat('y'),
218007
- zhoverformat: axisHoverFormat('z'),
218008
-
218009
- mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?
218010
- {dflt: 'lines+markers'}),
218011
- surfaceaxis: {
218012
- valType: 'enumerated',
218013
- values: [-1, 0, 1, 2],
218014
- dflt: -1,
218015
- description: [
218016
- 'If *-1*, the scatter points are not fill with a surface',
218017
- 'If *0*, *1*, *2*, the scatter points are filled with',
218018
- 'a Delaunay surface about the x, y, z respectively.'
218019
- ].join(' ')
218020
- },
218021
- surfacecolor: {
218022
- valType: 'color',
218023
- description: 'Sets the surface fill color.'
218024
- },
218025
- projection: {
218026
- x: makeProjectionAttr('x'),
218027
- y: makeProjectionAttr('y'),
218028
- z: makeProjectionAttr('z')
218029
- },
218030
-
218031
- connectgaps: scatterAttrs.connectgaps,
218032
- line: lineAttrs,
218033
-
218034
- marker: extendFlat({ // Parity with scatter.js?
218035
- symbol: {
218036
- valType: 'enumerated',
218037
- values: sortObjectKeys(MARKER_SYMBOLS),
218038
- dflt: 'circle',
218039
- arrayOk: true,
218040
- description: 'Sets the marker symbol type.'
218041
- },
218042
- size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),
218043
- sizeref: scatterMarkerAttrs.sizeref,
218044
- sizemin: scatterMarkerAttrs.sizemin,
218045
- sizemode: scatterMarkerAttrs.sizemode,
218046
- opacity: extendFlat({}, scatterMarkerAttrs.opacity, {
218047
- arrayOk: false,
218048
- description: [
218049
- 'Sets the marker opacity.',
218050
- 'Note that the marker opacity for scatter3d traces',
218051
- 'must be a scalar value for performance reasons.',
218052
- 'To set a blending opacity value',
218053
- '(i.e. which is not transparent), set *marker.color*',
218054
- 'to an rgba color and use its alpha channel.'
218055
- ].join(' ')
218056
- }),
218057
- colorbar: scatterMarkerAttrs.colorbar,
218058
-
218059
- line: extendFlat({
218060
- width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})
218061
- },
218062
- colorAttributes('marker.line')
218063
- )
218064
- },
218065
- colorAttributes('marker')
218066
- ),
218067
-
218068
- textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),
218069
- textfont: fontAttrs({
218070
- noFontShadow: true,
218071
- noFontLineposition: true,
218072
- noFontTextcase: true,
218073
- editType: 'calc',
218074
- colorEditType: 'style',
218075
- arrayOk: true,
218076
- variantValues: ['normal', 'small-caps'],
218077
- description: 'Sets the text font.'
218078
- }),
218079
-
218080
- opacity: baseAttrs.opacity,
218081
-
218082
- hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
218083
- }, 'calc', 'nested');
218084
-
218085
- attrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';
218086
-
218087
-
218088
- /***/ }),
218089
-
218090
- /***/ 30935:
218091
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
218092
-
218093
-
218094
-
218095
- var arraysToCalcdata = __webpack_require__(47213);
218096
- var calcColorscale = __webpack_require__(59498);
218097
-
218098
- /**
218099
- * This is a kludge to put the array attributes into
218100
- * calcdata the way Scatter.plot does, so that legends and
218101
- * popovers know what to do with them.
218102
- */
218103
- module.exports = function calc(gd, trace) {
218104
- var cd = [{x: false, y: false, trace: trace, t: {}}];
218105
-
218106
- arraysToCalcdata(cd, trace);
218107
- calcColorscale(gd, trace);
218108
-
218109
- return cd;
218110
- };
218111
-
218112
-
218113
- /***/ }),
218114
-
218115
- /***/ 77681:
218116
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
218117
-
218118
-
218119
-
218120
- var Registry = __webpack_require__(13936);
218121
-
218122
- function calculateAxisErrors(data, params, scaleFactor, axis) {
218123
- if(!params || !params.visible) return null;
218124
-
218125
- var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);
218126
- var result = new Array(data.length);
218127
-
218128
- for(var i = 0; i < data.length; i++) {
218129
- var errors = computeError(+data[i], i);
218130
-
218131
- if(axis.type === 'log') {
218132
- var point = axis.c2l(data[i]);
218133
- var min = data[i] - errors[0];
218134
- var max = data[i] + errors[1];
218135
-
218136
- result[i] = [
218137
- (axis.c2l(min, true) - point) * scaleFactor,
218138
- (axis.c2l(max, true) - point) * scaleFactor
218139
- ];
218140
-
218141
- // Keep track of the lower error bound which isn't negative!
218142
- if(min > 0) {
218143
- var lower = axis.c2l(min);
218144
- if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;
218145
- axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);
218146
- }
218147
- } else {
218148
- result[i] = [
218149
- -errors[0] * scaleFactor,
218150
- errors[1] * scaleFactor
218151
- ];
218152
- }
218153
- }
218154
-
218155
- return result;
218156
- }
218157
-
218158
- function dataLength(array) {
218159
- for(var i = 0; i < array.length; i++) {
218160
- if(array[i]) return array[i].length;
218161
- }
218162
- return 0;
218163
- }
218164
-
218165
- function calculateErrors(data, scaleFactor, sceneLayout) {
218166
- var errors = [
218167
- calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),
218168
- calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),
218169
- calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)
218170
- ];
218171
-
218172
- var n = dataLength(errors);
218173
- if(n === 0) return null;
218174
-
218175
- var errorBounds = new Array(n);
218176
-
218177
- for(var i = 0; i < n; i++) {
218178
- var bound = [[0, 0, 0], [0, 0, 0]];
218179
-
218180
- for(var j = 0; j < 3; j++) {
218181
- if(errors[j]) {
218182
- for(var k = 0; k < 2; k++) {
218183
- bound[k][j] = errors[j][i][k];
218184
- }
218185
- }
218186
- }
218187
-
218188
- errorBounds[i] = bound;
218189
- }
218190
-
218191
- return errorBounds;
218192
- }
218193
-
218194
- module.exports = calculateErrors;
218195
-
218196
-
218197
- /***/ }),
218198
-
218199
- /***/ 93219:
218200
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
218201
-
218202
-
218203
-
218204
- var createLinePlot = (__webpack_require__(46000).gl_line3d);
218205
- var createScatterPlot = (__webpack_require__(46000).gl_scatter3d);
218206
- var createErrorBars = (__webpack_require__(46000).gl_error3d);
218207
- var createMesh = (__webpack_require__(46000).gl_mesh3d);
218208
- var triangulate = (__webpack_require__(46000).delaunay_triangulate);
218209
-
218210
- var Lib = __webpack_require__(30991);
218211
- var str2RgbaArray = __webpack_require__(44960);
218212
- var formatColor = (__webpack_require__(592).formatColor);
218213
- var makeBubbleSizeFn = __webpack_require__(42581);
218214
- var DASH_PATTERNS = __webpack_require__(68828);
218215
- var MARKER_SYMBOLS = __webpack_require__(98993);
218216
-
218217
- var Axes = __webpack_require__(15076);
218218
- var appendArrayPointValue = (__webpack_require__(2918).appendArrayPointValue);
218219
-
218220
- var calculateError = __webpack_require__(77681);
218221
-
218222
- function LineWithMarkers(scene, uid) {
218223
- this.scene = scene;
218224
- this.uid = uid;
218225
- this.linePlot = null;
218226
- this.scatterPlot = null;
218227
- this.errorBars = null;
218228
- this.textMarkers = null;
218229
- this.delaunayMesh = null;
218230
- this.color = null;
218231
- this.mode = '';
218232
- this.dataPoints = [];
218233
- this.axesBounds = [
218234
- [-Infinity, -Infinity, -Infinity],
218235
- [Infinity, Infinity, Infinity]
218236
- ];
218237
- this.textLabels = null;
218238
- this.data = null;
218239
- }
218240
-
218241
- var proto = LineWithMarkers.prototype;
218242
-
218243
- proto.handlePick = function(selection) {
218244
- if(selection.object &&
218245
- (selection.object === this.linePlot ||
218246
- selection.object === this.delaunayMesh ||
218247
- selection.object === this.textMarkers ||
218248
- selection.object === this.scatterPlot)
218249
- ) {
218250
- var ind = selection.index = selection.data.index;
218251
-
218252
- if(selection.object.highlight) {
218253
- selection.object.highlight(null);
218254
- }
218255
- if(this.scatterPlot) {
218256
- selection.object = this.scatterPlot;
218257
- this.scatterPlot.highlight(selection.data);
218258
- }
218259
-
218260
- selection.textLabel = '';
218261
- if(this.textLabels) {
218262
- if(Lib.isArrayOrTypedArray(this.textLabels)) {
218263
- if(this.textLabels[ind] || this.textLabels[ind] === 0) {
218264
- selection.textLabel = this.textLabels[ind];
218265
- }
218266
- } else {
218267
- selection.textLabel = this.textLabels;
218268
- }
218269
- }
218270
-
218271
- selection.traceCoordinate = [
218272
- this.data.x[ind],
218273
- this.data.y[ind],
218274
- this.data.z[ind]
218275
- ];
218276
-
218277
- return true;
218278
- }
218279
- };
218280
-
218281
- function constructDelaunay(points, color, axis) {
218282
- var u = (axis + 1) % 3;
218283
- var v = (axis + 2) % 3;
218284
- var filteredPoints = [];
218285
- var filteredIds = [];
218286
- var i;
218287
-
218288
- for(i = 0; i < points.length; ++i) {
218289
- var p = points[i];
218290
- if(isNaN(p[u]) || !isFinite(p[u]) ||
218291
- isNaN(p[v]) || !isFinite(p[v])) {
218292
- continue;
218293
- }
218294
- filteredPoints.push([p[u], p[v]]);
218295
- filteredIds.push(i);
218296
- }
218297
- var cells = triangulate(filteredPoints);
218298
- for(i = 0; i < cells.length; ++i) {
218299
- var c = cells[i];
218300
- for(var j = 0; j < c.length; ++j) {
218301
- c[j] = filteredIds[c[j]];
218302
- }
218303
- }
218304
- return {
218305
- positions: points,
218306
- cells: cells,
218307
- meshColor: color
218308
- };
218309
- }
218310
-
218311
- function calculateErrorParams(errors) {
218312
- var capSize = [0.0, 0.0, 0.0];
218313
- var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
218314
- var lineWidth = [1.0, 1.0, 1.0];
218315
-
218316
- for(var i = 0; i < 3; i++) {
218317
- var e = errors[i];
218318
-
218319
- if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
218320
- if(!e || !e.visible) continue;
218321
-
218322
- capSize[i] = e.width / 2; // ballpark rescaling
218323
- color[i] = str2RgbaArray(e.color);
218324
- lineWidth[i] = e.thickness;
218325
- }
218326
-
218327
- return {capSize: capSize, color: color, lineWidth: lineWidth};
218328
- }
218329
-
218330
- function parseAlignmentX(a) {
218331
- if(a === null || a === undefined) return 0;
218332
-
218333
- return (a.indexOf('left') > -1) ? -1 :
218334
- (a.indexOf('right') > -1) ? 1 : 0;
218335
- }
218336
-
218337
- function parseAlignmentY(a) {
218338
- if(a === null || a === undefined) return 0;
218339
-
218340
- return (a.indexOf('top') > -1) ? -1 :
218341
- (a.indexOf('bottom') > -1) ? 1 : 0;
218342
- }
218343
-
218344
- function calculateTextOffset(tp) {
218345
- // Read out text properties
218346
-
218347
- var defaultAlignmentX = 0;
218348
- var defaultAlignmentY = 0;
218349
-
218350
- var textOffset = [
218351
- defaultAlignmentX,
218352
- defaultAlignmentY
218353
- ];
218354
-
218355
- if(Array.isArray(tp)) {
218356
- for(var i = 0; i < tp.length; i++) {
218357
- textOffset[i] = [
218358
- defaultAlignmentX,
218359
- defaultAlignmentY
218360
- ];
218361
- if(tp[i]) {
218362
- textOffset[i][0] = parseAlignmentX(tp[i]);
218363
- textOffset[i][1] = parseAlignmentY(tp[i]);
218364
- }
218365
- }
218366
- } else {
218367
- textOffset[0] = parseAlignmentX(tp);
218368
- textOffset[1] = parseAlignmentY(tp);
218369
- }
218370
-
218371
- return textOffset;
218372
- }
218373
-
218374
-
218375
- function calculateSize(sizeIn, sizeFn) {
218376
- // rough parity with Plotly 2D markers
218377
- return sizeFn(sizeIn * 4);
218378
- }
218379
-
218380
- function calculateSymbol(symbolIn) {
218381
- return MARKER_SYMBOLS[symbolIn];
218382
- }
218383
-
218384
- function formatParam(paramIn, len, calculate, dflt, extraFn) {
218385
- var paramOut = null;
218386
-
218387
- if(Lib.isArrayOrTypedArray(paramIn)) {
218388
- paramOut = [];
218389
-
218390
- for(var i = 0; i < len; i++) {
218391
- if(paramIn[i] === undefined) paramOut[i] = dflt;
218392
- else paramOut[i] = calculate(paramIn[i], extraFn);
218393
- }
218394
- } else paramOut = calculate(paramIn, Lib.identity);
218395
-
218396
- return paramOut;
218397
- }
218398
-
218399
-
218400
- function convertPlotlyOptions(scene, data) {
218401
- var points = [];
218402
- var sceneLayout = scene.fullSceneLayout;
218403
- var scaleFactor = scene.dataScale;
218404
- var xaxis = sceneLayout.xaxis;
218405
- var yaxis = sceneLayout.yaxis;
218406
- var zaxis = sceneLayout.zaxis;
218407
- var marker = data.marker;
218408
- var line = data.line;
218409
- var x = data.x || [];
218410
- var y = data.y || [];
218411
- var z = data.z || [];
218412
- var len = x.length;
218413
- var xcalendar = data.xcalendar;
218414
- var ycalendar = data.ycalendar;
218415
- var zcalendar = data.zcalendar;
218416
- var xc, yc, zc;
218417
- var params, i;
218418
- var text;
218419
-
218420
- // Convert points
218421
- for(i = 0; i < len; i++) {
218422
- // sanitize numbers and apply transforms based on axes.type
218423
- xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];
218424
- yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];
218425
- zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];
218426
-
218427
- points[i] = [xc, yc, zc];
218428
- }
218429
-
218430
- // convert text
218431
- if(Array.isArray(data.text)) {
218432
- text = data.text;
218433
- } else if(Lib.isTypedArray(data.text)) {
218434
- text = Array.from(data.text);
218435
- } else if(data.text !== undefined) {
218436
- text = new Array(len);
218437
- for(i = 0; i < len; i++) text[i] = data.text;
218438
- }
218439
-
218440
- function formatter(axName, val) {
218441
- var ax = sceneLayout[axName];
218442
- return Axes.tickText(ax, ax.d2l(val), true).text;
218443
- }
218444
-
218445
- // check texttemplate
218446
- var texttemplate = data.texttemplate;
218447
- if(texttemplate) {
218448
- var fullLayout = scene.fullLayout;
218449
- var d3locale = fullLayout._d3locale;
218450
- var isArray = Array.isArray(texttemplate);
218451
- var N = isArray ? Math.min(texttemplate.length, len) : len;
218452
- var txt = isArray ?
218453
- function(i) { return texttemplate[i]; } :
218454
- function() { return texttemplate; };
218455
-
218456
- text = new Array(N);
218457
-
218458
- for(i = 0; i < N; i++) {
218459
- var d = {x: x[i], y: y[i], z: z[i]};
218460
- var labels = {
218461
- xLabel: formatter('xaxis', x[i]),
218462
- yLabel: formatter('yaxis', y[i]),
218463
- zLabel: formatter('zaxis', z[i])
218464
- };
218465
- var pointValues = {};
218466
- appendArrayPointValue(pointValues, data, i);
218467
- var meta = data._meta || {};
218468
- text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);
218469
- }
218470
- }
218471
-
218472
- // Build object parameters
218473
- params = {
218474
- position: points,
218475
- mode: data.mode,
218476
- text: text
218477
- };
218478
-
218479
- if('line' in data) {
218480
- params.lineColor = formatColor(line, 1, len);
218481
- params.lineWidth = line.width;
218482
- params.lineDashes = line.dash;
218483
- }
218484
-
218485
- if('marker' in data) {
218486
- var sizeFn = makeBubbleSizeFn(data);
218487
-
218488
- params.scatterColor = formatColor(marker, 1, len);
218489
- params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);
218490
- params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');
218491
- params.scatterLineWidth = marker.line.width; // arrayOk === false
218492
- params.scatterLineColor = formatColor(marker.line, 1, len);
218493
- params.scatterAngle = 0;
218494
- }
218495
-
218496
- if('textposition' in data) {
218497
- params.textOffset = calculateTextOffset(data.textposition);
218498
- params.textColor = formatColor(data.textfont, 1, len);
218499
- params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);
218500
- params.textFontFamily = data.textfont.family;
218501
- params.textFontWeight = data.textfont.weight;
218502
- params.textFontStyle = data.textfont.style;
218503
- params.textFontVariant = data.textfont.variant;
218504
- params.textAngle = 0;
218505
- }
218506
-
218507
- var dims = ['x', 'y', 'z'];
218508
- params.project = [false, false, false];
218509
- params.projectScale = [1, 1, 1];
218510
- params.projectOpacity = [1, 1, 1];
218511
- for(i = 0; i < 3; ++i) {
218512
- var projection = data.projection[dims[i]];
218513
- if((params.project[i] = projection.show)) {
218514
- params.projectOpacity[i] = projection.opacity;
218515
- params.projectScale[i] = projection.scale;
218516
- }
218517
- }
218518
-
218519
- params.errorBounds = calculateError(data, scaleFactor, sceneLayout);
218520
-
218521
- var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);
218522
- params.errorColor = errorParams.color;
218523
- params.errorLineWidth = errorParams.lineWidth;
218524
- params.errorCapSize = errorParams.capSize;
218525
-
218526
- params.delaunayAxis = data.surfaceaxis;
218527
- params.delaunayColor = str2RgbaArray(data.surfacecolor);
218528
-
218529
- return params;
218530
- }
218531
-
218532
- function _arrayToColor(color) {
218533
- if(Lib.isArrayOrTypedArray(color)) {
218534
- var c = color[0];
218535
-
218536
- if(Lib.isArrayOrTypedArray(c)) color = c;
218537
-
218538
- return 'rgb(' + color.slice(0, 3).map(function(x) {
218539
- return Math.round(x * 255);
218540
- }) + ')';
218541
- }
218542
-
218543
- return null;
218544
- }
218545
-
218546
- function arrayToColor(colors) {
218547
- if(!Lib.isArrayOrTypedArray(colors)) {
218548
- return null;
218549
- }
218550
-
218551
- if((colors.length === 4) && (typeof colors[0] === 'number')) {
218552
- return _arrayToColor(colors);
218553
- }
218554
-
218555
- return colors.map(_arrayToColor);
218556
- }
218557
-
218558
- proto.update = function(data) {
218559
- var gl = this.scene.glplot.gl;
218560
- var lineOptions;
218561
- var scatterOptions;
218562
- var errorOptions;
218563
- var textOptions;
218564
- var dashPattern = DASH_PATTERNS.solid;
218565
-
218566
- // Save data
218567
- this.data = data;
218568
-
218569
- // Run data conversion
218570
- var options = convertPlotlyOptions(this.scene, data);
218571
-
218572
- if('mode' in options) {
218573
- this.mode = options.mode;
218574
- }
218575
- if('lineDashes' in options) {
218576
- if(options.lineDashes in DASH_PATTERNS) {
218577
- dashPattern = DASH_PATTERNS[options.lineDashes];
218578
- }
218579
- }
218580
-
218581
- this.color = arrayToColor(options.scatterColor) ||
218582
- arrayToColor(options.lineColor);
218583
-
218584
- // Save data points
218585
- this.dataPoints = options.position;
218586
-
218587
- lineOptions = {
218588
- gl: this.scene.glplot.gl,
218589
- position: options.position,
218590
- color: options.lineColor,
218591
- lineWidth: options.lineWidth || 1,
218592
- dashes: dashPattern[0],
218593
- dashScale: dashPattern[1],
218594
- opacity: data.opacity,
218595
- connectGaps: data.connectgaps
218596
- };
218597
-
218598
- if(this.mode.indexOf('lines') !== -1) {
218599
- if(this.linePlot) this.linePlot.update(lineOptions);
218600
- else {
218601
- this.linePlot = createLinePlot(lineOptions);
218602
- this.linePlot._trace = this;
218603
- this.scene.glplot.add(this.linePlot);
218604
- }
218605
- } else if(this.linePlot) {
218606
- this.scene.glplot.remove(this.linePlot);
218607
- this.linePlot.dispose();
218608
- this.linePlot = null;
218609
- }
218610
-
218611
- // N.B. marker.opacity must be a scalar for performance
218612
- var scatterOpacity = data.opacity;
218613
- if(data.marker && data.marker.opacity !== undefined) scatterOpacity *= data.marker.opacity;
218614
-
218615
- scatterOptions = {
218616
- gl: this.scene.glplot.gl,
218617
- position: options.position,
218618
- color: options.scatterColor,
218619
- size: options.scatterSize,
218620
- glyph: options.scatterMarker,
218621
- opacity: scatterOpacity,
218622
- orthographic: true,
218623
- lineWidth: options.scatterLineWidth,
218624
- lineColor: options.scatterLineColor,
218625
- project: options.project,
218626
- projectScale: options.projectScale,
218627
- projectOpacity: options.projectOpacity
218628
- };
218629
-
218630
- if(this.mode.indexOf('markers') !== -1) {
218631
- if(this.scatterPlot) this.scatterPlot.update(scatterOptions);
218632
- else {
218633
- this.scatterPlot = createScatterPlot(scatterOptions);
218634
- this.scatterPlot._trace = this;
218635
- this.scatterPlot.highlightScale = 1;
218636
- this.scene.glplot.add(this.scatterPlot);
218637
- }
218638
- } else if(this.scatterPlot) {
218639
- this.scene.glplot.remove(this.scatterPlot);
218640
- this.scatterPlot.dispose();
218641
- this.scatterPlot = null;
218642
- }
218643
-
218644
- textOptions = {
218645
- gl: this.scene.glplot.gl,
218646
- position: options.position,
218647
- glyph: options.text,
218648
- color: options.textColor,
218649
- size: options.textSize,
218650
- angle: options.textAngle,
218651
- alignment: options.textOffset,
218652
- font: options.textFontFamily,
218653
- fontWeight: options.textFontWeight,
218654
- fontStyle: options.textFontStyle,
218655
- fontVariant: options.textFontVariant,
218656
- orthographic: true,
218657
- lineWidth: 0,
218658
- project: false,
218659
- opacity: data.opacity
218660
- };
218661
-
218662
- this.textLabels = data.hovertext || data.text;
218663
-
218664
- if(this.mode.indexOf('text') !== -1) {
218665
- if(this.textMarkers) this.textMarkers.update(textOptions);
218666
- else {
218667
- this.textMarkers = createScatterPlot(textOptions);
218668
- this.textMarkers._trace = this;
218669
- this.textMarkers.highlightScale = 1;
218670
- this.scene.glplot.add(this.textMarkers);
218671
- }
218672
- } else if(this.textMarkers) {
218673
- this.scene.glplot.remove(this.textMarkers);
218674
- this.textMarkers.dispose();
218675
- this.textMarkers = null;
218676
- }
218677
-
218678
- errorOptions = {
218679
- gl: this.scene.glplot.gl,
218680
- position: options.position,
218681
- color: options.errorColor,
218682
- error: options.errorBounds,
218683
- lineWidth: options.errorLineWidth,
218684
- capSize: options.errorCapSize,
218685
- opacity: data.opacity
218686
- };
218687
- if(this.errorBars) {
218688
- if(options.errorBounds) {
218689
- this.errorBars.update(errorOptions);
218690
- } else {
218691
- this.scene.glplot.remove(this.errorBars);
218692
- this.errorBars.dispose();
218693
- this.errorBars = null;
218694
- }
218695
- } else if(options.errorBounds) {
218696
- this.errorBars = createErrorBars(errorOptions);
218697
- this.errorBars._trace = this;
218698
- this.scene.glplot.add(this.errorBars);
218699
- }
218700
-
218701
- if(options.delaunayAxis >= 0) {
218702
- var delaunayOptions = constructDelaunay(
218703
- options.position,
218704
- options.delaunayColor,
218705
- options.delaunayAxis
218706
- );
218707
- delaunayOptions.opacity = data.opacity;
218708
-
218709
- if(this.delaunayMesh) {
218710
- this.delaunayMesh.update(delaunayOptions);
218711
- } else {
218712
- delaunayOptions.gl = gl;
218713
- this.delaunayMesh = createMesh(delaunayOptions);
218714
- this.delaunayMesh._trace = this;
218715
- this.scene.glplot.add(this.delaunayMesh);
218716
- }
218717
- } else if(this.delaunayMesh) {
218718
- this.scene.glplot.remove(this.delaunayMesh);
218719
- this.delaunayMesh.dispose();
218720
- this.delaunayMesh = null;
218721
- }
218722
- };
218723
-
218724
- proto.dispose = function() {
218725
- if(this.linePlot) {
218726
- this.scene.glplot.remove(this.linePlot);
218727
- this.linePlot.dispose();
218728
- }
218729
- if(this.scatterPlot) {
218730
- this.scene.glplot.remove(this.scatterPlot);
218731
- this.scatterPlot.dispose();
218732
- }
218733
- if(this.errorBars) {
218734
- this.scene.glplot.remove(this.errorBars);
218735
- this.errorBars.dispose();
218736
- }
218737
- if(this.textMarkers) {
218738
- this.scene.glplot.remove(this.textMarkers);
218739
- this.textMarkers.dispose();
218740
- }
218741
- if(this.delaunayMesh) {
218742
- this.scene.glplot.remove(this.delaunayMesh);
218743
- this.delaunayMesh.dispose();
218744
- }
218745
- };
218746
-
218747
- function createLineWithMarkers(scene, data) {
218748
- var plot = new LineWithMarkers(scene, data.uid);
218749
- plot.update(data);
218750
- return plot;
218751
- }
218752
-
218753
- module.exports = createLineWithMarkers;
218754
-
218755
-
218756
- /***/ }),
218757
-
218758
- /***/ 13744:
218759
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
218760
-
218761
-
218762
-
218763
- var Registry = __webpack_require__(13936);
218764
- var Lib = __webpack_require__(30991);
218765
-
218766
- var subTypes = __webpack_require__(33068);
218767
- var handleMarkerDefaults = __webpack_require__(15294);
218768
- var handleLineDefaults = __webpack_require__(82094);
218769
- var handleTextDefaults = __webpack_require__(94729);
218770
-
218771
- var attributes = __webpack_require__(1015);
218772
-
218773
- module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
218774
- function coerce(attr, dflt) {
218775
- return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
218776
- }
218777
-
218778
- var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);
218779
- if(!len) {
218780
- traceOut.visible = false;
218781
- return;
218782
- }
218783
-
218784
- coerce('text');
218785
- coerce('hovertext');
218786
- coerce('hovertemplate');
218787
- coerce('xhoverformat');
218788
- coerce('yhoverformat');
218789
- coerce('zhoverformat');
218790
-
218791
- coerce('mode');
218792
-
218793
- if(subTypes.hasMarkers(traceOut)) {
218794
- handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true, noAngle: true});
218795
- }
218796
-
218797
- if(subTypes.hasLines(traceOut)) {
218798
- coerce('connectgaps');
218799
- handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);
218800
- }
218801
-
218802
- if(subTypes.hasText(traceOut)) {
218803
- coerce('texttemplate');
218804
- handleTextDefaults(traceIn, traceOut, layout, coerce, {
218805
- noSelect: true,
218806
- noFontShadow: true,
218807
- noFontLineposition: true,
218808
- noFontTextcase: true,
218809
- });
218810
- }
218811
-
218812
- var lineColor = (traceOut.line || {}).color;
218813
- var markerColor = (traceOut.marker || {}).color;
218814
- if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);
218815
-
218816
- var dims = ['x', 'y', 'z'];
218817
- for(var i = 0; i < 3; ++i) {
218818
- var projection = 'projection.' + dims[i];
218819
- if(coerce(projection + '.show')) {
218820
- coerce(projection + '.opacity');
218821
- coerce(projection + '.scale');
218822
- }
218823
- }
218824
-
218825
- var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');
218826
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});
218827
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});
218828
- errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});
218829
- };
218830
-
218831
- function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
218832
- var len = 0;
218833
- var x = coerce('x');
218834
- var y = coerce('y');
218835
- var z = coerce('z');
218836
-
218837
- var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
218838
- handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
218839
-
218840
- if(x && y && z) {
218841
- // TODO: what happens if one is missing?
218842
- len = Math.min(x.length, y.length, z.length);
218843
- traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
218844
- }
218845
-
218846
- return len;
218847
- }
218848
-
218849
-
218850
- /***/ }),
218851
-
218852
- /***/ 68860:
218853
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
218854
-
218855
-
218856
-
218857
- module.exports = {
218858
- plot: __webpack_require__(93219),
218859
- attributes: __webpack_require__(1015),
218860
- markerSymbols: __webpack_require__(98993),
218861
- supplyDefaults: __webpack_require__(13744),
218862
- colorbar: [
218863
- {
218864
- container: 'marker',
218865
- min: 'cmin',
218866
- max: 'cmax'
218867
- }, {
218868
- container: 'line',
218869
- min: 'cmin',
218870
- max: 'cmax'
218871
- }
218872
- ],
218873
- calc: __webpack_require__(30935),
218874
-
218875
- moduleType: 'trace',
218876
- name: 'scatter3d',
218877
- basePlotModule: __webpack_require__(68137),
218878
- categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],
218879
- meta: {
218880
- hrName: 'scatter_3d',
218881
- description: [
218882
- 'The data visualized as scatter point or lines in 3D dimension',
218883
- 'is set in `x`, `y`, `z`.',
218884
- 'Text (appearing either on the chart or on hover only) is via `text`.',
218885
- 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
218886
- 'Projections are achieved via `projection`.',
218887
- 'Surface fills are achieved via `surfaceaxis`.'
218888
- ].join(' ')
218889
- }
218890
- };
218891
-
218892
-
218893
218893
  /***/ }),
218894
218894
 
218895
218895
  /***/ 44771:
@@ -331774,7 +331774,7 @@ var RunnerControls = _ref => {
331774
331774
  };
331775
331775
  /* harmony default export */ const RunButton_RunnerControls = (RunnerControls);
331776
331776
  ;// ./src/assets/editor/pyodide/shims/pygal.js?url
331777
- const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalc0b4f32d2d2cc5a0c638.js";
331777
+ const pygalurl_namespaceObject = __webpack_require__.p + "assets/pygalef3b78a56cb1d66beb61.js";
331778
331778
  ;// ./src/assets/editor/pyodide/packages/turtle-0.0.1-py3-none-any.whl?url
331779
331779
  const turtle_0_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "assets/turtle-0.0.1-py3-none-any0c3147a3e0c3188b2544.whl";
331780
331780
  ;// ./src/assets/editor/pyodide/packages/p5-0.0.1-py3-none-any.whl?url
@@ -331789,7 +331789,7 @@ const py_enigma_0_1_py3_none_anyurl_namespaceObject = __webpack_require__.p + "a
331789
331789
 
331790
331790
 
331791
331791
  ;// ./src/PyodideWorker.js?url
331792
- const PyodideWorkerurl_namespaceObject = __webpack_require__.p + "assets/PyodideWorker917534d142d1f853d376.js";
331792
+ const PyodideWorkerurl_namespaceObject = __webpack_require__.p + "assets/PyodideWorker04ce34b6863d1f341e6a.js";
331793
331793
  ;// ./src/components/Editor/Runners/PythonRunner/PyodideRunner/PyodideRunner.jsx
331794
331794
 
331795
331795
  /* eslint-disable react-hooks/exhaustive-deps */
@@ -331814,7 +331814,8 @@ var url = new URL(PyodideWorkerurl_namespaceObject, window.origin).href;
331814
331814
  var PyodideRunner = _ref => {
331815
331815
  var {
331816
331816
  active,
331817
- outputPanels = ["text", "visual"]
331817
+ outputPanels = ["text", "visual"],
331818
+ packageApiUrl
331818
331819
  } = _ref;
331819
331820
  var [pyodideWorker, setPyodideWorker] = (0,external_react_.useState)(null);
331820
331821
  (0,external_react_.useEffect)(() => {
@@ -331827,7 +331828,8 @@ var PyodideRunner = _ref => {
331827
331828
  if (!pyodideWorker) return;
331828
331829
  pyodideWorker.postMessage({
331829
331830
  method: "init",
331830
- assets: editor_namespaceObject
331831
+ assets: editor_namespaceObject,
331832
+ packageApiUrl
331831
331833
  });
331832
331834
  return () => {
331833
331835
  pyodideWorker.terminate();
@@ -332223,7 +332225,8 @@ var PyodideRunner = _ref => {
332223
332225
  var PYODIDE_RUNNER_NAME = "pyodide";
332224
332226
  var PythonRunner = _ref => {
332225
332227
  var {
332226
- outputPanels = ["text", "visual"]
332228
+ outputPanels = ["text", "visual"],
332229
+ packageApiUrl
332227
332230
  } = _ref;
332228
332231
  var dispatch = (0,external_react_redux_namespaceObject.useDispatch)();
332229
332232
  var activeRunner = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.activeRunner);
@@ -332234,7 +332237,8 @@ var PythonRunner = _ref => {
332234
332237
  }, [dispatch, activeRunner]);
332235
332238
  return /*#__PURE__*/(0,jsx_runtime.jsx)(PyodideRunner_PyodideRunner, {
332236
332239
  active: activeRunner === PYODIDE_RUNNER_NAME,
332237
- outputPanels: outputPanels
332240
+ outputPanels: outputPanels,
332241
+ packageApiUrl: packageApiUrl
332238
332242
  });
332239
332243
  };
332240
332244
  /* harmony default export */ const PythonRunner_PythonRunner = (PythonRunner);
@@ -332587,7 +332591,8 @@ function HtmlRunner() {
332587
332591
  var RunnerFactory = _ref => {
332588
332592
  var {
332589
332593
  projectType,
332590
- outputPanels = ["text", "visual"]
332594
+ outputPanels = ["text", "visual"],
332595
+ packageApiUrl
332591
332596
  } = _ref;
332592
332597
  var Runner = () => {
332593
332598
  if (projectType === PROJECT_TYPES.web) {
@@ -332598,7 +332603,8 @@ var RunnerFactory = _ref => {
332598
332603
  };
332599
332604
  var Selected = Runner();
332600
332605
  var props = projectType === PROJECT_TYPES.web ? {} : {
332601
- outputPanels
332606
+ outputPanels,
332607
+ packageApiUrl
332602
332608
  };
332603
332609
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Selected, _objectSpread2({}, props));
332604
332610
  };
@@ -332636,7 +332642,8 @@ var RunBar = _ref => {
332636
332642
 
332637
332643
  var Output = _ref => {
332638
332644
  var {
332639
- outputPanels = ["text", "visual"]
332645
+ outputPanels = ["text", "visual"],
332646
+ packageApiUrl
332640
332647
  } = _ref;
332641
332648
  var project = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.project);
332642
332649
  var isEmbedded = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.isEmbedded);
@@ -332648,7 +332655,8 @@ var Output = _ref => {
332648
332655
  "data-testid": "output",
332649
332656
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Runners_RunnerFactory, {
332650
332657
  projectType: project.project_type,
332651
- outputPanels: outputPanels
332658
+ outputPanels: outputPanels,
332659
+ packageApiUrl: packageApiUrl
332652
332660
  }), isEmbedded && !isBrowserPreview && /*#__PURE__*/(0,jsx_runtime.jsx)(RunButton_RunBar, {
332653
332661
  embedded: true
332654
332662
  })]
@@ -380437,7 +380445,8 @@ var projContainer = {
380437
380445
  var Project = props => {
380438
380446
  var {
380439
380447
  nameEditable = true,
380440
- sidebarOptions = []
380448
+ sidebarOptions = [],
380449
+ packageApiUrl
380441
380450
  } = props;
380442
380451
  var saving = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.saving);
380443
380452
  var autosave = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.lastSaveAutosave);
@@ -380485,7 +380494,9 @@ var Project = props => {
380485
380494
  minWidth: "25%",
380486
380495
  maxWidth: maxWidth,
380487
380496
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(EditorInput_EditorInput, {})
380488
- }), /*#__PURE__*/(0,jsx_runtime.jsx)(Output_Output, {})]
380497
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(Output_Output, {
380498
+ packageApiUrl: packageApiUrl
380499
+ })]
380489
380500
  })
380490
380501
  })]
380491
380502
  })]
@@ -380520,7 +380531,8 @@ var WebComponentProject = _ref => {
380520
380531
  sidebarOptions = [],
380521
380532
  outputOnly = false,
380522
380533
  outputPanels = ["text", "visual"],
380523
- outputSplitView = false
380534
+ outputSplitView = false,
380535
+ packageApiUrl
380524
380536
  } = _ref;
380525
380537
  var loading = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.loading);
380526
380538
  var project = (0,external_react_redux_namespaceObject.useSelector)(state => state.editor.project);
@@ -380565,12 +380577,14 @@ var WebComponentProject = _ref => {
380565
380577
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
380566
380578
  children: [!outputOnly && /*#__PURE__*/(0,jsx_runtime.jsx)(Project_Project, {
380567
380579
  nameEditable: nameEditable,
380568
- sidebarOptions: sidebarOptions
380580
+ sidebarOptions: sidebarOptions,
380581
+ packageApiUrl: packageApiUrl
380569
380582
  }), outputOnly && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
380570
380583
  className: "embedded-viewer",
380571
380584
  "data-testid": "output-only",
380572
380585
  children: loading === "success" && /*#__PURE__*/(0,jsx_runtime.jsx)(Output_Output, {
380573
- outputPanels: outputPanels
380586
+ outputPanels: outputPanels,
380587
+ packageApiUrl: packageApiUrl
380574
380588
  })
380575
380589
  })]
380576
380590
  });
@@ -381213,7 +381227,8 @@ var WebComponentLoader = props => {
381213
381227
  showSavePrompt = false,
381214
381228
  sidebarOptions = [],
381215
381229
  loadCache = true,
381216
- project: projectData
381230
+ project: projectData,
381231
+ packageApiUrl
381217
381232
  } = props;
381218
381233
  var dispatch = (0,external_react_redux_namespaceObject.useDispatch)();
381219
381234
  var {
@@ -381301,7 +381316,8 @@ var WebComponentLoader = props => {
381301
381316
  sidebarOptions: sidebarOptions,
381302
381317
  outputOnly: outputOnly,
381303
381318
  outputPanels: outputPanels,
381304
- outputSplitView: outputSplitView
381319
+ outputSplitView: outputSplitView,
381320
+ packageApiUrl: packageApiUrl
381305
381321
  }), errorModalShowing && /*#__PURE__*/(0,jsx_runtime.jsx)(Modals_ErrorModal, {}), newFileModalShowing && /*#__PURE__*/(0,jsx_runtime.jsx)(Modals_NewFileModal, {}), renameFileModalShowing && modals.renameFile && /*#__PURE__*/(0,jsx_runtime.jsx)(Modals_RenameFileModal, {})]
381306
381322
  })
381307
381323
  })
@@ -381376,7 +381392,8 @@ var TextJamEditor = function TextJamEditor() {
381376
381392
  // Default props that match the previous web-component defaults
381377
381393
  var defaultProps = {
381378
381394
  sidebarOptions: ["files", "activity", "playground", "home", "fonts", "theme", "user"],
381379
- code: ""
381395
+ code: "",
381396
+ packageApiUrl: "https://cdn.jsdelivr.net/pyodide/v0.26.2/full"
381380
381397
  };
381381
381398
  var mergedProps = _objectSpread2(_objectSpread2({}, defaultProps), componentProps);
381382
381399
  return /*#__PURE__*/(0,jsx_runtime.jsx)(external_react_["default"].StrictMode, {