plotly.js 3.0.0-rc.1 → 3.0.0

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * plotly.js v3.0.0-rc.1
3
- * Copyright 2012-2024, Plotly, Inc.
2
+ * plotly.js v3.0.0
3
+ * Copyright 2012-2025, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -59,7 +59,7 @@ var Plotly = (() => {
59
59
  var require_version = __commonJS({
60
60
  "src/version.js"(exports) {
61
61
  "use strict";
62
- exports.version = "3.0.0-rc.1";
62
+ exports.version = "3.0.0";
63
63
  }
64
64
  });
65
65
 
@@ -13365,11 +13365,14 @@ var Plotly = (() => {
13365
13365
  var style = document.getElementById(id);
13366
13366
  if (style) removeElement(style);
13367
13367
  }
13368
- function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle) {
13368
+ function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle, element) {
13369
13369
  var activeStyleParts = activeStyle.split(":");
13370
13370
  var inactiveStyleParts = inactiveStyle.split(":");
13371
13371
  var eventAddedAttrName = "data-btn-style-event-added";
13372
- document.querySelectorAll(selector).forEach(function(el) {
13372
+ if (!element) {
13373
+ element = document;
13374
+ }
13375
+ element.querySelectorAll(selector).forEach(function(el) {
13373
13376
  if (!el.getAttribute(eventAddedAttrName)) {
13374
13377
  el.addEventListener("mouseenter", function() {
13375
13378
  var childEl = this.querySelector(childSelector);
@@ -14825,10 +14828,10 @@ var Plotly = (() => {
14825
14828
  }
14826
14829
  });
14827
14830
 
14828
- // stylePlugin:/home/solarch/plotly/webgl/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css
14831
+ // stylePlugin:/Users/alex/plotly/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css
14829
14832
  var maplibre_gl_exports = {};
14830
14833
  var init_maplibre_gl2 = __esm({
14831
- "stylePlugin:/home/solarch/plotly/webgl/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"() {
14834
+ "stylePlugin:/Users/alex/plotly/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"() {
14832
14835
  init_maplibre_gl();
14833
14836
  }
14834
14837
  });
@@ -24578,8 +24581,10 @@ var Plotly = (() => {
24578
24581
  pointData.distance = 0;
24579
24582
  } else pointData.index = false;
24580
24583
  } else {
24581
- for (var i = 0; i < cd.length; i++) {
24582
- var newDistance = distfn(cd[i]);
24584
+ var newDistance = Infinity;
24585
+ var len = cd.length;
24586
+ for (var i = 0; i < len; i++) {
24587
+ newDistance = distfn(cd[i]);
24583
24588
  if (newDistance <= pointData.distance) {
24584
24589
  pointData.index = i;
24585
24590
  pointData.distance = newDistance;
@@ -39176,7 +39181,6 @@ var Plotly = (() => {
39176
39181
  document.querySelectorAll(groupSelector).forEach(function(group) {
39177
39182
  group.style.backgroundColor = style.bgcolor;
39178
39183
  });
39179
- Lib.setStyleOnHover("#" + modeBarId + " .modebar-btn", ".active", ".icon path", "fill: " + style.activecolor, "fill: " + style.color);
39180
39184
  var needsNewButtons = !this.hasButtons(buttons);
39181
39185
  var needsNewLogo = this.hasLogo !== context.displaylogo;
39182
39186
  var needsNewLocale = this.locale !== context.locale;
@@ -39198,6 +39202,7 @@ var Plotly = (() => {
39198
39202
  }
39199
39203
  }
39200
39204
  this.updateActiveButton();
39205
+ Lib.setStyleOnHover("#" + modeBarId + " .modebar-btn", ".active", ".icon path", "fill: " + style.activecolor, "fill: " + style.color, this.element);
39201
39206
  };
39202
39207
  proto.updateButtons = function(buttons) {
39203
39208
  var _this = this;
@@ -48970,7 +48975,10 @@ var Plotly = (() => {
48970
48975
  fullLayout._calcInverseTransform = calcInverseTransform;
48971
48976
  fullLayout._calcInverseTransform(gd);
48972
48977
  fullLayout._container = gd3.selectAll(".plot-container").data([0]);
48973
- fullLayout._container.enter().insert("div", ":first-child").classed("plot-container", true).classed("plotly", true);
48978
+ fullLayout._container.enter().insert("div", ":first-child").classed("plot-container", true).classed("plotly", true).style({
48979
+ width: "100%",
48980
+ height: "100%"
48981
+ });
48974
48982
  fullLayout._paperdiv = fullLayout._container.selectAll(".svg-container").data([0]);
48975
48983
  fullLayout._paperdiv.enter().append("div").classed("user-select-none", true).classed("svg-container", true).style("position", "relative");
48976
48984
  fullLayout._glcontainer = fullLayout._paperdiv.selectAll(".gl-container").data([{}]);
@@ -244212,14 +244220,48 @@ uniform ${i3} ${a3} u_${s3};
244212
244220
  var pathString = "";
244213
244221
  var offset = link.width / 2;
244214
244222
  var coords = link.circularPathData;
244223
+ var isSourceBeforeTarget = coords.sourceX + coords.verticalBuffer < coords.targetX;
244224
+ var isPathOverlapped = coords.rightFullExtent - coords.rightLargeArcRadius - arrowLen <= coords.leftFullExtent - offset;
244225
+ var diff = Math.abs(coords.rightFullExtent - coords.leftFullExtent - offset) < offset;
244215
244226
  if (link.circularLinkType === "top") {
244216
244227
  pathString = // start at the left of the target node
244217
- "M " + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + " L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + "L" + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + "L" + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent + "L" + (coords.leftFullExtent + offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.sourceY + offset) + "L" + coords.sourceX + " " + (coords.sourceY + offset) + // Walking back
244218
- "L" + coords.sourceX + " " + (coords.sourceY - offset) + "L" + coords.leftInnerExtent + " " + (coords.sourceY - offset) + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 0 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + "L" + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + "L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent + "L" + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + "L" + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + (arrowLen > 0 ? "L" + coords.targetX + " " + coords.targetY : "") + "Z";
244228
+ "M " + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + "A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + "L " + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244229
+ if (isSourceBeforeTarget && isPathOverlapped) {
244230
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius + offset)) + " L " + (coords.rightFullExtent + offset - (coords.rightLargeArcRadius - offset) - arrowLen) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius + offset)) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalRightInnerExtent;
244231
+ } else if (isSourceBeforeTarget) {
244232
+ pathString += " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 0 " + (coords.rightFullExtent - offset - arrowLen - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius - offset)) + " L " + (coords.leftFullExtent + offset + (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius - offset)) + " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
244233
+ } else {
244234
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + " L " + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
244235
+ }
244236
+ pathString += " L " + (coords.leftFullExtent + offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.sourceY + offset) + " L " + coords.sourceX + " " + (coords.sourceY + offset) + // Walking back
244237
+ " L " + coords.sourceX + " " + (coords.sourceY - offset) + " L " + coords.leftInnerExtent + " " + (coords.sourceY - offset) + " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 0 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + " L " + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent;
244238
+ if (isSourceBeforeTarget && isPathOverlapped) {
244239
+ pathString += " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent - offset) + " " + (coords.verticalFullExtent + offset) + "L" + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244240
+ } else if (isSourceBeforeTarget) {
244241
+ pathString += " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + (coords.verticalFullExtent - offset) + " L " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244242
+ } else {
244243
+ pathString += " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244244
+ }
244245
+ pathString += " L " + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + " L " + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + (arrowLen > 0 ? " L " + coords.targetX + " " + coords.targetY : "") + "Z";
244219
244246
  } else {
244220
- pathString = // start at the left of the target node
244221
- "M " + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + " L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + "L" + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + "L" + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent + "L" + (coords.leftFullExtent + offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.sourceY - offset) + "L" + coords.sourceX + " " + (coords.sourceY - offset) + // Walking back
244222
- "L" + coords.sourceX + " " + (coords.sourceY + offset) + "L" + coords.leftInnerExtent + " " + (coords.sourceY + offset) + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + "L" + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + "L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent + "L" + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + "L" + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + (arrowLen > 0 ? "L" + coords.targetX + " " + coords.targetY : "") + "Z";
244247
+ pathString = "M " + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + " L " + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244248
+ if (isSourceBeforeTarget && isPathOverlapped) {
244249
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightInnerExtent - offset - arrowLen) + " " + (coords.verticalFullExtent + offset) + " L " + (coords.rightFullExtent + offset - arrowLen - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
244250
+ } else if (isSourceBeforeTarget) {
244251
+ pathString += " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent - arrowLen - offset - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " L " + (coords.leftFullExtent + offset + (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
244252
+ } else {
244253
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + " L " + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
244254
+ }
244255
+ pathString += " L " + (coords.leftFullExtent + offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.sourceY - offset) + " L " + coords.sourceX + " " + (coords.sourceY - offset) + // Walking back
244256
+ " L " + coords.sourceX + " " + (coords.sourceY + offset) + " L " + coords.leftInnerExtent + " " + (coords.sourceY + offset) + " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + " L " + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent;
244257
+ if (isSourceBeforeTarget && isPathOverlapped) {
244258
+ pathString += " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent - offset - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " L " + (coords.rightFullExtent + offset - arrowLen + (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244259
+ } else if (isSourceBeforeTarget) {
244260
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + (coords.verticalFullExtent + offset) + " L " + (coords.rightFullExtent - arrowLen - offset) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244261
+ } else {
244262
+ pathString += " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
244263
+ }
244264
+ pathString += " L " + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + " L " + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + (arrowLen > 0 ? " L " + coords.targetX + " " + coords.targetY : "") + "Z";
244223
244265
  }
244224
244266
  return pathString;
244225
244267
  }
package/dist/plotly.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * plotly.js v3.0.0-rc.1
3
- * Copyright 2012-2024, Plotly, Inc.
2
+ * plotly.js v3.0.0
3
+ * Copyright 2012-2025, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
6
6
  */
@@ -59,7 +59,7 @@ var Plotly = (() => {
59
59
  var require_version = __commonJS({
60
60
  "src/version.js"(exports) {
61
61
  "use strict";
62
- exports.version = "3.0.0-rc.1";
62
+ exports.version = "3.0.0";
63
63
  }
64
64
  });
65
65
 
@@ -12789,11 +12789,14 @@ var Plotly = (() => {
12789
12789
  var style = document.getElementById(id);
12790
12790
  if (style) removeElement(style);
12791
12791
  }
12792
- function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle) {
12792
+ function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle, element) {
12793
12793
  var activeStyleParts = activeStyle.split(":");
12794
12794
  var inactiveStyleParts = inactiveStyle.split(":");
12795
12795
  var eventAddedAttrName = "data-btn-style-event-added";
12796
- document.querySelectorAll(selector).forEach(function(el) {
12796
+ if (!element) {
12797
+ element = document;
12798
+ }
12799
+ element.querySelectorAll(selector).forEach(function(el) {
12797
12800
  if (!el.getAttribute(eventAddedAttrName)) {
12798
12801
  el.addEventListener("mouseenter", function() {
12799
12802
  var childEl = this.querySelector(childSelector);
@@ -13755,10 +13758,10 @@ var Plotly = (() => {
13755
13758
  }
13756
13759
  });
13757
13760
 
13758
- // stylePlugin:/home/solarch/plotly/webgl/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css
13761
+ // stylePlugin:/Users/alex/plotly/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css
13759
13762
  var maplibre_gl_exports = {};
13760
13763
  var init_maplibre_gl2 = __esm({
13761
- "stylePlugin:/home/solarch/plotly/webgl/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"() {
13764
+ "stylePlugin:/Users/alex/plotly/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"() {
13762
13765
  init_maplibre_gl();
13763
13766
  }
13764
13767
  });
@@ -22721,8 +22724,10 @@ var Plotly = (() => {
22721
22724
  pointData.distance = 0;
22722
22725
  } else pointData.index = false;
22723
22726
  } else {
22724
- for (var i = 0; i < cd.length; i++) {
22725
- var newDistance = distfn(cd[i]);
22727
+ var newDistance = Infinity;
22728
+ var len = cd.length;
22729
+ for (var i = 0; i < len; i++) {
22730
+ newDistance = distfn(cd[i]);
22726
22731
  if (newDistance <= pointData.distance) {
22727
22732
  pointData.index = i;
22728
22733
  pointData.distance = newDistance;
@@ -37173,7 +37178,6 @@ var Plotly = (() => {
37173
37178
  document.querySelectorAll(groupSelector).forEach(function(group) {
37174
37179
  group.style.backgroundColor = style.bgcolor;
37175
37180
  });
37176
- Lib.setStyleOnHover("#" + modeBarId + " .modebar-btn", ".active", ".icon path", "fill: " + style.activecolor, "fill: " + style.color);
37177
37181
  var needsNewButtons = !this.hasButtons(buttons);
37178
37182
  var needsNewLogo = this.hasLogo !== context.displaylogo;
37179
37183
  var needsNewLocale = this.locale !== context.locale;
@@ -37195,6 +37199,7 @@ var Plotly = (() => {
37195
37199
  }
37196
37200
  }
37197
37201
  this.updateActiveButton();
37202
+ Lib.setStyleOnHover("#" + modeBarId + " .modebar-btn", ".active", ".icon path", "fill: " + style.activecolor, "fill: " + style.color, this.element);
37198
37203
  };
37199
37204
  proto.updateButtons = function(buttons) {
37200
37205
  var _this = this;
@@ -46411,7 +46416,10 @@ var Plotly = (() => {
46411
46416
  fullLayout._calcInverseTransform = calcInverseTransform;
46412
46417
  fullLayout._calcInverseTransform(gd);
46413
46418
  fullLayout._container = gd3.selectAll(".plot-container").data([0]);
46414
- fullLayout._container.enter().insert("div", ":first-child").classed("plot-container", true).classed("plotly", true);
46419
+ fullLayout._container.enter().insert("div", ":first-child").classed("plot-container", true).classed("plotly", true).style({
46420
+ width: "100%",
46421
+ height: "100%"
46422
+ });
46415
46423
  fullLayout._paperdiv = fullLayout._container.selectAll(".svg-container").data([0]);
46416
46424
  fullLayout._paperdiv.enter().append("div").classed("user-select-none", true).classed("svg-container", true).style("position", "relative");
46417
46425
  fullLayout._glcontainer = fullLayout._paperdiv.selectAll(".gl-container").data([{}]);
@@ -238310,14 +238318,48 @@ uniform ${i3} ${a3} u_${s3};
238310
238318
  var pathString = "";
238311
238319
  var offset = link.width / 2;
238312
238320
  var coords = link.circularPathData;
238321
+ var isSourceBeforeTarget = coords.sourceX + coords.verticalBuffer < coords.targetX;
238322
+ var isPathOverlapped = coords.rightFullExtent - coords.rightLargeArcRadius - arrowLen <= coords.leftFullExtent - offset;
238323
+ var diff = Math.abs(coords.rightFullExtent - coords.leftFullExtent - offset) < offset;
238313
238324
  if (link.circularLinkType === "top") {
238314
238325
  pathString = // start at the left of the target node
238315
- "M " + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + " L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + "L" + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + "L" + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent + "L" + (coords.leftFullExtent + offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.sourceY + offset) + "L" + coords.sourceX + " " + (coords.sourceY + offset) + // Walking back
238316
- "L" + coords.sourceX + " " + (coords.sourceY - offset) + "L" + coords.leftInnerExtent + " " + (coords.sourceY - offset) + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 0 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + "L" + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + "L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent + "L" + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + "L" + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + (arrowLen > 0 ? "L" + coords.targetX + " " + coords.targetY : "") + "Z";
238326
+ "M " + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + "A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + "L " + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238327
+ if (isSourceBeforeTarget && isPathOverlapped) {
238328
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius + offset)) + " L " + (coords.rightFullExtent + offset - (coords.rightLargeArcRadius - offset) - arrowLen) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius + offset)) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalRightInnerExtent;
238329
+ } else if (isSourceBeforeTarget) {
238330
+ pathString += " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 0 " + (coords.rightFullExtent - offset - arrowLen - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius - offset)) + " L " + (coords.leftFullExtent + offset + (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalRightInnerExtent - (coords.rightLargeArcRadius - offset)) + " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
238331
+ } else {
238332
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + " L " + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
238333
+ }
238334
+ pathString += " L " + (coords.leftFullExtent + offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.sourceY + offset) + " L " + coords.sourceX + " " + (coords.sourceY + offset) + // Walking back
238335
+ " L " + coords.sourceX + " " + (coords.sourceY - offset) + " L " + coords.leftInnerExtent + " " + (coords.sourceY - offset) + " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 0 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY - coords.leftSmallArcRadius) + " L " + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent;
238336
+ if (isSourceBeforeTarget && isPathOverlapped) {
238337
+ pathString += " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent - offset) + " " + (coords.verticalFullExtent + offset) + "L" + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238338
+ } else if (isSourceBeforeTarget) {
238339
+ pathString += " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + (coords.verticalFullExtent - offset) + " L " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238340
+ } else {
238341
+ pathString += " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238342
+ }
238343
+ pathString += " L " + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY - coords.rightSmallArcRadius) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + " L " + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + (arrowLen > 0 ? " L " + coords.targetX + " " + coords.targetY : "") + "Z";
238317
238344
  } else {
238318
- pathString = // start at the left of the target node
238319
- "M " + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + " L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + "L" + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent + "A" + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + "L" + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent + "L" + (coords.leftFullExtent + offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + "A" + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.sourceY - offset) + "L" + coords.sourceX + " " + (coords.sourceY - offset) + // Walking back
238320
- "L" + coords.sourceX + " " + (coords.sourceY + offset) + "L" + coords.leftInnerExtent + " " + (coords.sourceY + offset) + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + "L" + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent + "A" + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + "L" + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent + "L" + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + "A" + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + "L" + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + (arrowLen > 0 ? "L" + coords.targetX + " " + coords.targetY : "") + "Z";
238345
+ pathString = "M " + (coords.targetX - arrowLen) + " " + (coords.targetY - offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY - offset) + " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightSmallArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent - offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + " L " + (coords.rightFullExtent - offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238346
+ if (isSourceBeforeTarget && isPathOverlapped) {
238347
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightInnerExtent - offset - arrowLen) + " " + (coords.verticalFullExtent + offset) + " L " + (coords.rightFullExtent + offset - arrowLen - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
238348
+ } else if (isSourceBeforeTarget) {
238349
+ pathString += " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent - arrowLen - offset - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " L " + (coords.leftFullExtent + offset + (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
238350
+ } else {
238351
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent + offset) + " L " + coords.leftInnerExtent + " " + (coords.verticalFullExtent + offset) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + coords.verticalLeftInnerExtent;
238352
+ }
238353
+ pathString += " L " + (coords.leftFullExtent + offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + " A " + (coords.leftLargeArcRadius + offset) + " " + (coords.leftSmallArcRadius + offset) + " 0 0 0 " + coords.leftInnerExtent + " " + (coords.sourceY - offset) + " L " + coords.sourceX + " " + (coords.sourceY - offset) + // Walking back
238354
+ " L " + coords.sourceX + " " + (coords.sourceY + offset) + " L " + coords.leftInnerExtent + " " + (coords.sourceY + offset) + " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent - offset) + " " + (coords.sourceY + coords.leftSmallArcRadius) + " L " + (coords.leftFullExtent - offset) + " " + coords.verticalLeftInnerExtent;
238355
+ if (isSourceBeforeTarget && isPathOverlapped) {
238356
+ pathString += " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.leftFullExtent - offset - (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " L " + (coords.rightFullExtent + offset - arrowLen + (coords.rightLargeArcRadius - offset)) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238357
+ } else if (isSourceBeforeTarget) {
238358
+ pathString += " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.leftFullExtent + offset) + " " + (coords.verticalFullExtent + offset) + " L " + (coords.rightFullExtent - arrowLen - offset) + " " + (coords.verticalFullExtent + offset) + " A " + (coords.rightLargeArcRadius + offset) + " " + (coords.rightLargeArcRadius + offset) + " 0 0 0 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238359
+ } else {
238360
+ pathString += " A " + (coords.leftLargeArcRadius - offset) + " " + (coords.leftLargeArcRadius - offset) + " 0 0 1 " + coords.leftInnerExtent + " " + (coords.verticalFullExtent - offset) + " L " + (coords.rightInnerExtent - arrowLen) + " " + (coords.verticalFullExtent - offset) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightLargeArcRadius - offset) + " 0 0 1 " + (coords.rightFullExtent + offset - arrowLen) + " " + coords.verticalRightInnerExtent;
238361
+ }
238362
+ pathString += " L " + (coords.rightFullExtent + offset - arrowLen) + " " + (coords.targetY + coords.rightSmallArcRadius) + " A " + (coords.rightLargeArcRadius - offset) + " " + (coords.rightSmallArcRadius - offset) + " 0 0 1 " + (coords.rightInnerExtent - arrowLen) + " " + (coords.targetY + offset) + " L " + (coords.targetX - arrowLen) + " " + (coords.targetY + offset) + (arrowLen > 0 ? " L " + coords.targetX + " " + coords.targetY : "") + "Z";
238321
238363
  }
238322
238364
  return pathString;
238323
238365
  }