diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d4edceaa80..80c63d1d5a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,32 @@ To see all merged commits on the main branch that will be part of the next plotl where X.Y.Z is the semver of most recent plotly.js release. +## [4.2.0] -- 2026-10-29 + +### Added +- Add `layout.legend.itemheight` to set the height of the legend fill swatch, so more of a trace `fillpattern` is visible in the legend [[#7925](https://github.com/plotly/plotly.js/pull/7925)], with thanks to @MannXo for the contribution! +- Add spikelines to ternary plots [[#8041](https://github.com/plotly/plotly.js/pull/8041)], with thanks to @Lexachoc for the contribution! + - Add TypeScript declarations for lifecycle and WebGL context events [[#8145](https://github.com/plotly/plotly.js/pull/8145)] + +### Fixed +- Respect explicit `node.x`/`node.y` positions in Sankey traces that contain unlinked or grouped nodes [[#7826](https://github.com/plotly/plotly.js/pull/7826)], with thanks to @kyo5uke for the contribution! +- Fix incorrect positioning of tick labels when using `ticklabelindex` on period axes [[#7934](https://github.com/plotly/plotly.js/pull/7934)], with thanks to @my-tien for the contribution! +- Fix tick label format sometimes being incompatible with the labeled tick when using `ticklabelindex` [[#7935](https://github.com/plotly/plotly.js/pull/7935)], with thanks to @my-tien for the contribution! +- Fix unified hover swatch color and pattern for bar `marker.pattern` arrays [[#8039](https://github.com/plotly/plotly.js/pull/8039)], with thanks to @Dmao233 for the contribution! +- Keep cartesian traces aligned with their axes when an automargin title is combined with any component that expands the margins [[#8045](https://github.com/plotly/plotly.js/pull/8045)] +- Fix hover labels ignoring MathJax for text that is a single tex expression [[#8051](https://github.com/plotly/plotly.js/pull/8051)], with thanks to @SergeyAxiomatic +- Fix XSS via `javascript:` URLs in MathJax `\href` macros by sanitizing links in MathJax-rendered text [[#8051](https://github.com/plotly/plotly.js/pull/8051)], with thanks to @SergeyAxiomatic +- Fix issue causing `scattergl` plot to freeze up when hovering over points [[#8052](https://github.com/plotly/plotly.js/pull/8052)], with thanks to @emilykl for the contribution! + - Fix quiver arrow colors for a discrete `marker.color` array [[#8069](https://github.com/plotly/plotly.js/pull/8069)], with thanks to @Yahiro025 for the contribution! +- Fix numeric and numeric-string marker symbol variant detection in `scattergl` [[#8071](https://github.com/plotly/plotly.js/pull/8071)] + - Fix `hoverlabel.align` so that it aligns the item text in `x unified` and `y unified` hover labels [[#8104](https://github.com/plotly/plotly.js/pull/8104)], with thanks to @MannXo for the contribution! + - Convert modern CSS color formats to rgba for scattergl based traces [[#8119](https://github.com/plotly/plotly.js/pull/8119)] +- Update TypeScript types so that `Plotly.relayout`, `Plotly.restyle`, `Plotly.update`, and the `plotly_relayout` event accept attribute paths such as `'xaxis.autorange'` [[#8126](https://github.com/plotly/plotly.js/pull/8126)] + - Add the `LayoutUpdate` and `DataUpdate` types for these update objects + - Add the `(root, attribute, value)` call form to the types of `Plotly.relayout` and `Plotly.restyle` + - Fix funnel `percentTotal` text formatting to display formatted percentages instead of raw ratios [[#8139](https://github.com/plotly/plotly.js/pull/8139)], with thanks to @ORITOMI for the contribution! + + ## [4.1.2] -- 2026-10-05 ### Changed diff --git a/CITATION.cff b/CITATION.cff index 02f705dfcb8..f0878807500 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -9,7 +9,7 @@ authors: - family-names: "Samimi" given-names: "Mojtaba" title: "Open source Plotly charting library" -version: 4.1.2 +version: 4.2.0 doi: 10.5281/zenodo.13964707 -date-released: 2026-10-05 +date-released: 2026-10-29 url: "https://github.com/plotly/plotly.js" diff --git a/README.md b/README.md index 967962c4466..e79e8c9f4cd 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo ```html
- + @@ -79,7 +79,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo Alternatively, you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag. ```html ``` @@ -89,7 +89,7 @@ Fastly supports Plotly.js with free CDN service. Read more atp?1:v>=p?0:NaN}e.descending=function(v,p){return p =p.length)return C?C.call(v,F):k?F.sort(k):F;for(var V=-1,$=F.length,K=p[U++],se,me,Q,ae=new b,ie;++V<$;)(ie=ae.get(se=K(me=F[V])))?ie.push(me):ae.set(se,[me]);return E?(me=E(),Q=function(pe,ye){me.set(pe,D(E,ye,U))}):(me={},Q=function(pe,ye){me[pe]=D(E,ye,U)}),ae.forEach(Q),me}function R(E,F){if(F>=p.length)return E;var U=[],V=_[F++];return E.forEach(function($,K){U.push({key:$,values:R(K,F)})}),V?U.sort(function($,K){return V($.key,K.key)}):U}return v.map=function(E,F){return D(F,E,0)},v.entries=function(E){return R(D(e.map,E,0),0)},v.key=function(E){return p.push(E),v},v.sortKeys=function(E){return _[p.length-1]=E,v},v.sortValues=function(E){return k=E,v},v.rollup=function(E){return C=E,v},v},e.set=function(v){var p=new B;if(v)for(var _=0,k=v.length;_ Ne)E=E.L;else if(R=p-qO(E,_),R>Ne){if(!E.R){k=E;break}E=E.R}else{D>-Ne?(k=E.P,C=E):R>-Ne?(k=E,C=E.N):k=C=E;break}var F=R6(v);if(js.insert(k,F),!(!k&&!C)){if(k===C){e0(k),C=R6(k.site),js.insert(F,C),F.edge=C.edge=Nu(k.site,F.site),Qs(k),Qs(C);return}if(!C){F.edge=Nu(k.site,F.site);return}e0(k),e0(C);var U=k.site,V=U.x,$=U.y,K=v.x-V,se=v.y-$,me=C.site,Q=me.x-V,ae=me.y-$,ie=2*(K*ae-se*Q),pe=K*K+se*se,ye=Q*Q+ae*ae,oe={x:(ae*pe-se*ye)/ie+V,y:(K*ye-Q*pe)/ie+$};mv(C.edge,U,me,oe),F.edge=Nu(U,v,null,oe),C.edge=Nu(v,me,null,oe),Qs(k),Qs(C)}}function z6(v,p){var _=v.site,k=_.x,C=_.y,D=C-p;if(!D)return k;var R=v.P;if(!R)return-1/0;_=R.site;var E=_.x,F=_.y,U=F-p;if(!U)return E;var V=E-k,$=1/D-1/U,K=V/U;return $?(-K+Math.sqrt(K*K-2*$*(V*V/(-2*U)-F+U/2+C-D/2)))/$+k:(k+E)/2}function qO(v,p){var _=v.N;if(_)return z6(_,p);var k=v.site;return k.y===p?k.x:1/0}function F6(v){this.site=v,this.edges=[]}F6.prototype.prepare=function(){for(var v=this.edges,p=v.length,_;p--;)_=v[p].edge,(!_.b||!_.a)&&v.splice(p,1);return v.sort(N6),v.length};function EO(v){for(var p=v[0][0],_=v[1][0],k=v[0][1],C=v[1][1],D,R,E,F,U=Eo,V=U.length,$,K,se,me,Q,ae;V--;)if($=U[V],!(!$||!$.prepare()))for(se=$.edges,me=se.length,K=0;Kye&&(ye=V.x),V.y>oe&&(oe=V.y),se.push(V.x),me.push(V.y);else for(Q=0;Q
_&&(D=p.slice(_,D),E[R]?E[R]+=D:E[++R]=D),(k=k[0])===(C=C[0])?E[R]?E[R]+=C:E[++R]=C:(E[++R]=null,F.push({i:R,x:dl(k,C)})),_=wp.lastIndex;return _>4,y[f++]=(d&15)<<4|h>>2,y[f++]=(h&3)<<6|m&63;return g};e.decode=i,e.encode=n,Object.defineProperty(e,"__esModule",{value:!0})}))});var No=J((cye,n_)=>{"use strict";n_.exports=function(r){return window&&window.process&&window.process.versions?Object.prototype.toString.call(r)==="[object Object]":Object.prototype.toString.call(r)==="[object Object]"&&Object.getPrototypeOf(r).hasOwnProperty("hasOwnProperty")}});var hn=J(mi=>{"use strict";var QU=Vp().decode,eG=No(),Xp=Array.isArray,rG=ArrayBuffer,tG=DataView;function i_(e){return rG.isView(e)&&!(e instanceof tG)}mi.isTypedArray=i_;function Hv(e){return Xp(e)||i_(e)}mi.isArrayOrTypedArray=Hv;function aG(e){return!Hv(e[0])}mi.isArray1D=aG;mi.ensureArray=function(e,r){return Xp(e)||(e=[]),e.length=r,e};var Ma={u1c:typeof Uint8ClampedArray=="undefined"?void 0:Uint8ClampedArray,i1:typeof Int8Array=="undefined"?void 0:Int8Array,u1:typeof Uint8Array=="undefined"?void 0:Uint8Array,i2:typeof Int16Array=="undefined"?void 0:Int16Array,u2:typeof Uint16Array=="undefined"?void 0:Uint16Array,i4:typeof Int32Array=="undefined"?void 0:Int32Array,u4:typeof Uint32Array=="undefined"?void 0:Uint32Array,f4:typeof Float32Array=="undefined"?void 0:Float32Array,f8:typeof Float64Array=="undefined"?void 0:Float64Array};Ma.uint8c=Ma.u1c;Ma.uint8=Ma.u1;Ma.int8=Ma.i1;Ma.uint16=Ma.u2;Ma.int16=Ma.i2;Ma.uint32=Ma.u4;Ma.int32=Ma.i4;Ma.float32=Ma.f4;Ma.float64=Ma.f8;function Wp(e){return e.constructor===ArrayBuffer}mi.isArrayBuffer=Wp;mi.decodeTypedArraySpec=function(e){var r=[],t=nG(e),a=t.dtype,n=Ma[a];if(!n)throw new Error('Error in dtype: "'+a+'"');var i=n.BYTES_PER_ELEMENT,l=t.bdata;Wp(l)||(l=QU(l));var o=t.shape===void 0?[l.byteLength/i]:(""+t.shape).split(",");o.reverse();var s=o.length,u,f,c=+o[0],d=i*c,h=0;if(s===1)r=new n(l);else if(s===2)for(u=+o[1],f=0;f{"use strict";var o_=Xr(),Jp=hn().isArrayOrTypedArray;c_.exports=function(r,t){if(o_(t))t=String(t);else if(typeof t!="string"||t.slice(-4)==="[-1]")throw"bad property string";var a=t.split("."),n,i,l,o;for(o=0;o>4,y[f++]=(d&15)<<4|h>>2,y[f++]=(h&3)<<6|p&63;return g};e.decode=i,e.encode=n,Object.defineProperty(e,"__esModule",{value:!0})}))});var Uo=J((xge,c_)=>{"use strict";c_.exports=function(r){return window&&window.process&&window.process.versions?Object.prototype.toString.call(r)==="[object Object]":Object.prototype.toString.call(r)==="[object Object]"&&Object.getPrototypeOf(r).hasOwnProperty("hasOwnProperty")}});var xn=J(bi=>{"use strict";var nG=Jp().decode,iG=Uo(),$p=Array.isArray,lG=ArrayBuffer,oG=DataView;function v_(e){return lG.isView(e)&&!(e instanceof oG)}bi.isTypedArray=v_;function Bv(e){return $p(e)||v_(e)}bi.isArrayOrTypedArray=Bv;function sG(e){return!Bv(e[0])}bi.isArray1D=sG;bi.ensureArray=function(e,r){return $p(e)||(e=[]),e.length=r,e};var Da={u1c:typeof Uint8ClampedArray=="undefined"?void 0:Uint8ClampedArray,i1:typeof Int8Array=="undefined"?void 0:Int8Array,u1:typeof Uint8Array=="undefined"?void 0:Uint8Array,i2:typeof Int16Array=="undefined"?void 0:Int16Array,u2:typeof Uint16Array=="undefined"?void 0:Uint16Array,i4:typeof Int32Array=="undefined"?void 0:Int32Array,u4:typeof Uint32Array=="undefined"?void 0:Uint32Array,f4:typeof Float32Array=="undefined"?void 0:Float32Array,f8:typeof Float64Array=="undefined"?void 0:Float64Array};Da.uint8c=Da.u1c;Da.uint8=Da.u1;Da.int8=Da.i1;Da.uint16=Da.u2;Da.int16=Da.i2;Da.uint32=Da.u4;Da.int32=Da.i4;Da.float32=Da.f4;Da.float64=Da.f8;function Kp(e){return e.constructor===ArrayBuffer}bi.isArrayBuffer=Kp;bi.decodeTypedArraySpec=function(e){var r=[],t=uG(e),a=t.dtype,n=Da[a];if(!n)throw new Error('Error in dtype: "'+a+'"');var i=n.BYTES_PER_ELEMENT,l=t.bdata;Kp(l)||(l=nG(l));var o=t.shape===void 0?[l.byteLength/i]:(""+t.shape).split(",");o.reverse();var s=o.length,u,f,c=+o[0],d=i*c,h=0;if(s===1)r=new n(l);else if(s===2)for(u=+o[1],f=0;f{"use strict";var h_=Zr(),Qp=xn().isArrayOrTypedArray;y_.exports=function(r,t){if(h_(t))t=String(t);else if(typeof t!="string"||t.slice(-4)==="[-1]")throw"bad property string";var a=t.split("."),n,i,l,o;for(o=0;o
/g),d=0;d=I2&&l<=TM,u=o>=I2&&o<=TM;if(s&&(a=10*a+l-I2),u&&(n=10*n+o-I2),!s||!u){if(a!==n)return a-n;if(l!==o)return l-o}}return n-a};var T0=2e9;le.seedPseudoRandom=function(){T0=2e9};le.pseudoRandom=function(){var e=T0;return T0=(69069*T0+1)%4294967296,Math.abs(T0-e)<429496729?le.pseudoRandom():T0/4294967296};le.fillText=function(e,r,t){var a=Array.isArray(t)?function(l){t.push(l)}:function(l){t.text=l},n=le.extractOption(e,r,"htx","hovertext");if(le.isValidTextValue(n))return a(n);var i=le.extractOption(e,r,"tx","text");if(le.isValidTextValue(i))return a(i)};le.isValidTextValue=function(e){return e||e===0};le.formatPercent=function(e,r){r=r||0;for(var t=(Math.round(100*e*Math.pow(10,r))*Math.pow(.1,r)).toFixed(r)+"%",a=0;a