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 (strict) v3.0.0-rc.1
3
- * Copyright 2012-2024, Plotly, Inc.
2
+ * plotly.js (strict) 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([{}]);
@@ -261182,14 +261190,48 @@ uniform ${i3} ${a3} u_${s3};
261182
261190
  var pathString = "";
261183
261191
  var offset = link.width / 2;
261184
261192
  var coords = link.circularPathData;
261193
+ var isSourceBeforeTarget = coords.sourceX + coords.verticalBuffer < coords.targetX;
261194
+ var isPathOverlapped = coords.rightFullExtent - coords.rightLargeArcRadius - arrowLen <= coords.leftFullExtent - offset;
261195
+ var diff = Math.abs(coords.rightFullExtent - coords.leftFullExtent - offset) < offset;
261185
261196
  if (link.circularLinkType === "top") {
261186
261197
  pathString = // start at the left of the target node
261187
- "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
261188
- "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";
261198
+ "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;
261199
+ if (isSourceBeforeTarget && isPathOverlapped) {
261200
+ 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;
261201
+ } else if (isSourceBeforeTarget) {
261202
+ 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;
261203
+ } else {
261204
+ 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;
261205
+ }
261206
+ 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
261207
+ " 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;
261208
+ if (isSourceBeforeTarget && isPathOverlapped) {
261209
+ 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;
261210
+ } else if (isSourceBeforeTarget) {
261211
+ 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;
261212
+ } else {
261213
+ 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;
261214
+ }
261215
+ 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";
261189
261216
  } else {
261190
- pathString = // start at the left of the target node
261191
- "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
261192
- "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";
261217
+ 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;
261218
+ if (isSourceBeforeTarget && isPathOverlapped) {
261219
+ 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;
261220
+ } else if (isSourceBeforeTarget) {
261221
+ 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;
261222
+ } else {
261223
+ 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;
261224
+ }
261225
+ 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
261226
+ " 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;
261227
+ if (isSourceBeforeTarget && isPathOverlapped) {
261228
+ 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;
261229
+ } else if (isSourceBeforeTarget) {
261230
+ 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;
261231
+ } else {
261232
+ 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;
261233
+ }
261234
+ 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";
261193
261235
  }
261194
261236
  return pathString;
261195
261237
  }