Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stacked-sparklines

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stacked-sparklines - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

4

build/stacked-sparklines.js

@@ -1,2 +0,2 @@

function E(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ye(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function te(e){let t,r,n;e.length!==2?(t=E,r=(i,s)=>E(e(i),s),n=(i,s)=>e(i)-s):(t=e===E||e===ye?e:Bt,r=e,n=e);function a(i,s,u=0,d=i.length){if(u<d){if(t(s,s)!==0)return d;do{let l=u+d>>>1;r(i[l],s)<0?u=l+1:d=l}while(u<d)}return u}function o(i,s,u=0,d=i.length){if(u<d){if(t(s,s)!==0)return d;do{let l=u+d>>>1;r(i[l],s)<=0?u=l+1:d=l}while(u<d)}return u}function f(i,s,u=0,d=i.length){let l=a(i,s,u,d-1);return l>u&&n(i[l-1],s)>-n(i[l],s)?l-1:l}return{left:a,center:f,right:o}}function Bt(){return 0}function we(e){return e===null?NaN:+e}var Je=te(E),Ue=Je.right,Tt=Je.left,jt=te(we).center,$e=Ue;var Ft=Math.sqrt(50),Xt=Math.sqrt(10),Gt=Math.sqrt(2);function re(e,t,r){let n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),o=n/Math.pow(10,a),f=o>=Ft?10:o>=Xt?5:o>=Gt?2:1,i,s,u;return a<0?(u=Math.pow(10,-a)/f,i=Math.round(e*u),s=Math.round(t*u),i/u<e&&++i,s/u>t&&--s,u=-u):(u=Math.pow(10,a)*f,i=Math.round(e/u),s=Math.round(t/u),i*u<e&&++i,s*u>t&&--s),s<i&&.5<=r&&r<2?re(e,t,r*2):[i,s,u]}function ne(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[a,o,f]=n?re(t,e,r):re(e,t,r);if(!(o>=a))return[];let i=o-a+1,s=new Array(i);if(n)if(f<0)for(let u=0;u<i;++u)s[u]=(o-u)/-f;else for(let u=0;u<i;++u)s[u]=(o-u)*f;else if(f<0)for(let u=0;u<i;++u)s[u]=(a+u)/-f;else for(let u=0;u<i;++u)s[u]=(a+u)*f;return s}function Y(e,t,r){return t=+t,e=+e,r=+r,re(e,t,r)[2]}function ve(e,t,r){t=+t,e=+e,r=+r;let n=t<e,a=n?Y(t,e,r):Y(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function We(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ae(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Me(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Z(){}var Q=.7,fe=1/Q,j="\\s*([+-]?\\d+)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yt=/^#([0-9a-f]{3,8})$/,Qt=new RegExp(`^rgb\\(${j},${j},${j}\\)$`),Vt=new RegExp(`^rgb\\(${N},${N},${N}\\)$`),Zt=new RegExp(`^rgba\\(${j},${j},${j},${V}\\)$`),Jt=new RegExp(`^rgba\\(${N},${N},${N},${V}\\)$`),Ut=new RegExp(`^hsl\\(${V},${N},${N}\\)$`),Wt=new RegExp(`^hsla\\(${V},${N},${N},${V}\\)$`),Ke={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ae(Z,L,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:et,formatHex:et,formatHex8:Kt,formatHsl:er,formatRgb:tt,toString:tt});function et(){return this.rgb().formatHex()}function Kt(){return this.rgb().formatHex8()}function er(){return ft(this).formatHsl()}function tt(){return this.rgb().formatRgb()}function L(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Yt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?rt(t):r===3?new M(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?oe(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?oe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qt.exec(e))?new M(t[1],t[2],t[3],1):(t=Vt.exec(e))?new M(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zt.exec(e))?oe(t[1],t[2],t[3],t[4]):(t=Jt.exec(e))?oe(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ut.exec(e))?ot(t[1],t[2]/100,t[3]/100,1):(t=Wt.exec(e))?ot(t[1],t[2]/100,t[3]/100,t[4]):Ke.hasOwnProperty(e)?rt(Ke[e]):e==="transparent"?new M(NaN,NaN,NaN,0):null}function rt(e){return new M(e>>16&255,e>>8&255,e&255,1)}function oe(e,t,r,n){return n<=0&&(e=t=r=NaN),new M(e,t,r,n)}function tr(e){return e instanceof Z||(e=L(e)),e?(e=e.rgb(),new M(e.r,e.g,e.b,e.opacity)):new M}function F(e,t,r,n){return arguments.length===1?tr(e):new M(e,t,r,n??1)}function M(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ae(M,F,Me(Z,{brighter(e){return e=e==null?fe:Math.pow(fe,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Q:Math.pow(Q,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new M(I(this.r),I(this.g),I(this.b),ue(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:nt,formatHex:nt,formatHex8:rr,formatRgb:at,toString:at}));function nt(){return`#${H(this.r)}${H(this.g)}${H(this.b)}`}function rr(){return`#${H(this.r)}${H(this.g)}${H(this.b)}${H((isNaN(this.opacity)?1:this.opacity)*255)}`}function at(){let e=ue(this.opacity);return`${e===1?"rgb(":"rgba("}${I(this.r)}, ${I(this.g)}, ${I(this.b)}${e===1?")":`, ${e})`}`}function ue(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function I(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function H(e){return e=I(e),(e<16?"0":"")+e.toString(16)}function ot(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new S(e,t,r,n)}function ft(e){if(e instanceof S)return new S(e.h,e.s,e.l,e.opacity);if(e instanceof Z||(e=L(e)),!e)return new S;if(e instanceof S)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),f=NaN,i=o-a,s=(o+a)/2;return i?(t===o?f=(r-n)/i+(r<n)*6:r===o?f=(n-t)/i+2:f=(t-r)/i+4,i/=s<.5?o+a:2-o-a,f*=60):i=s>0&&s<1?0:f,new S(f,i,s,e.opacity)}function ut(e,t,r,n){return arguments.length===1?ft(e):new S(e,t,r,n??1)}function S(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ae(S,ut,Me(Z,{brighter(e){return e=e==null?fe:Math.pow(fe,e),new S(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Q:Math.pow(Q,e),new S(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new M(ke(e>=240?e-240:e+120,a,n),ke(e,a,n),ke(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new S(it(this.h),ie(this.s),ie(this.l),ue(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ue(this.opacity);return`${e===1?"hsl(":"hsla("}${it(this.h)}, ${ie(this.s)*100}%, ${ie(this.l)*100}%${e===1?")":`, ${e})`}`}}));function it(e){return e=(e||0)%360,e<0?e+360:e}function ie(e){return Math.max(0,Math.min(1,e||0))}function ke(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}function Se(e,t,r,n,a){var o=e*e,f=o*e;return((1-3*e+3*o-f)*t+(4-6*o+3*f)*r+(1+3*e+3*o-3*f)*n+f*a)/6}function lt(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),a=e[n],o=e[n+1],f=n>0?e[n-1]:2*a-o,i=n<t-1?e[n+2]:2*o-a;return Se((r-n/t)*t,f,a,o,i)}}function st(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),a=e[(n+t-1)%t],o=e[n%t],f=e[(n+1)%t],i=e[(n+2)%t];return Se((r-n/t)*t,a,o,f,i)}}var J=e=>()=>e;function nr(e,t){return function(r){return e+r*t}}function ar(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function ct(e){return(e=+e)==1?le:function(t,r){return r-t?ar(t,r,e):J(isNaN(t)?r:t)}}function le(e,t){var r=t-e;return r?nr(e,r):J(isNaN(e)?t:e)}var _e=function e(t){var r=ct(t);function n(a,o){var f=r((a=F(a)).r,(o=F(o)).r),i=r(a.g,o.g),s=r(a.b,o.b),u=le(a.opacity,o.opacity);return function(d){return a.r=f(d),a.g=i(d),a.b=s(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function dt(e){return function(t){var r=t.length,n=new Array(r),a=new Array(r),o=new Array(r),f,i;for(f=0;f<r;++f)i=F(t[f]),n[f]=i.r||0,a[f]=i.g||0,o[f]=i.b||0;return n=e(n),a=e(a),o=e(o),i.opacity=1,function(s){return i.r=n(s),i.g=a(s),i.b=o(s),i+""}}}var Qr=dt(lt),Vr=dt(st);function mt(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=e[a]*(1-o)+t[a]*o;return n}}function pt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xt(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),o=new Array(r),f;for(f=0;f<n;++f)a[f]=O(e[f],t[f]);for(;f<r;++f)o[f]=t[f];return function(i){for(f=0;f<n;++f)o[f]=a[f](i);return o}}function ht(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function q(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function gt(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=O(e[a],t[a]):n[a]=t[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var Ae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ne=new RegExp(Ae.source,"g");function or(e){return function(){return e}}function ir(e){return function(t){return e(t)+""}}function bt(e,t){var r=Ae.lastIndex=Ne.lastIndex=0,n,a,o,f=-1,i=[],s=[];for(e=e+"",t=t+"";(n=Ae.exec(e))&&(a=Ne.exec(t));)(o=a.index)>r&&(o=t.slice(r,o),i[f]?i[f]+=o:i[++f]=o),(n=n[0])===(a=a[0])?i[f]?i[f]+=a:i[++f]=a:(i[++f]=null,s.push({i:f,x:q(n,a)})),r=Ne.lastIndex;return r<t.length&&(o=t.slice(r),i[f]?i[f]+=o:i[++f]=o),i.length<2?s[0]?ir(s[0].x):or(t):(t=s.length,function(u){for(var d=0,l;d<t;++d)i[(l=s[d]).i]=l.x(u);return i.join("")})}function O(e,t){var r=typeof t,n;return t==null||r==="boolean"?J(t):(r==="number"?q:r==="string"?(n=L(t))?(t=n,_e):bt:t instanceof L?_e:t instanceof Date?ht:pt(t)?mt:Array.isArray(t)?xt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gt:q)(e,t)}function Re(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Le(e){return function(){return e}}function qe(e){return+e}var yt=[0,1];function X(e){return e}function Pe(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Le(isNaN(t)?NaN:.5)}function fr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function ur(e,t,r){var n=e[0],a=e[1],o=t[0],f=t[1];return a<n?(n=Pe(a,n),o=r(f,o)):(n=Pe(n,a),o=r(o,f)),function(i){return o(n(i))}}function lr(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),o=new Array(n),f=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++f<n;)a[f]=Pe(e[f],e[f+1]),o[f]=r(t[f],t[f+1]);return function(i){var s=$e(e,i,1,n)-1;return o[s](a[s](i))}}function wt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function sr(){var e=yt,t=yt,r=O,n,a,o,f=X,i,s,u;function d(){var c=Math.min(e.length,t.length);return f!==X&&(f=fr(e[0],e[c-1])),i=c>2?lr:ur,s=u=null,l}function l(c){return c==null||isNaN(c=+c)?o:(s||(s=i(e.map(n),t,r)))(n(f(c)))}return l.invert=function(c){return f(a((u||(u=i(t,e.map(n),q)))(c)))},l.domain=function(c){return arguments.length?(e=Array.from(c,qe),d()):e.slice()},l.range=function(c){return arguments.length?(t=Array.from(c),d()):t.slice()},l.rangeRound=function(c){return t=Array.from(c),r=Re,d()},l.clamp=function(c){return arguments.length?(f=c?!0:X,d()):f!==X},l.interpolate=function(c){return arguments.length?(r=c,d()):r},l.unknown=function(c){return arguments.length?(o=c,l):o},function(c,x){return n=c,a=x,d()}}function Ce(){return sr()(X,X)}function $t(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function z(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function A(e){return e=z(Math.abs(e)),e?e[1]:NaN}function vt(e,t){return function(r,n){for(var a=r.length,o=[],f=0,i=e[0],s=0;a>0&&i>0&&(s+i+1>n&&(i=Math.max(1,n-s)),o.push(r.substring(a-=i,a+i)),!((s+=i+1)>n));)i=e[f=(f+1)%e.length];return o.reverse().join(t)}}function Mt(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var cr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function P(e){if(!(t=cr.exec(e)))throw new Error("invalid format: "+e);var t;return new se({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}P.prototype=se.prototype;function se(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}se.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kt(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Ee;function St(e,t){var r=z(e,t);if(!r)return e+"";var n=r[0],a=r[1],o=a-(Ee=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,f=n.length;return o===f?n:o>f?n+new Array(o-f+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+z(e,Math.max(0,t+o-1))[0]}function He(e,t){var r=z(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}var Ie={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$t,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>He(e*100,t),r:He,s:St,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Oe(e){return e}var _t=Array.prototype.map,Nt=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function At(e){var t=e.grouping===void 0||e.thousands===void 0?Oe:vt(_t.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Oe:Mt(_t.call(e.numerals,String)),f=e.percent===void 0?"%":e.percent+"",i=e.minus===void 0?"\u2212":e.minus+"",s=e.nan===void 0?"NaN":e.nan+"";function u(l){l=P(l);var c=l.fill,x=l.align,p=l.sign,b=l.symbol,y=l.zero,$=l.width,w=l.comma,g=l.precision,_=l.trim,v=l.type;v==="n"?(w=!0,v="g"):Ie[v]||(g===void 0&&(g=12),_=!0,v="g"),(y||c==="0"&&x==="=")&&(y=!0,c="0",x="=");var Ot=b==="$"?r:b==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",zt=b==="$"?n:/[%p]/.test(v)?f:"",Qe=Ie[v],Dt=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function Ve(m){var C=Ot,k=zt,T,Ze,W;if(v==="c")k=Qe(m)+k,m="";else{m=+m;var K=m<0||1/m<0;if(m=isNaN(m)?s:Qe(Math.abs(m),g),_&&(m=kt(m)),K&&+m==0&&p!=="+"&&(K=!1),C=(K?p==="("?p:i:p==="-"||p==="("?"":p)+C,k=(v==="s"?Nt[8+Ee/3]:"")+k+(K&&p==="("?")":""),Dt){for(T=-1,Ze=m.length;++T<Ze;)if(W=m.charCodeAt(T),48>W||W>57){k=(W===46?a+m.slice(T+1):m.slice(T))+k,m=m.slice(0,T);break}}}w&&!y&&(m=t(m,1/0));var ee=C.length+m.length+k.length,R=ee<$?new Array($-ee+1).join(c):"";switch(w&&y&&(m=t(R+m,R.length?$-k.length:1/0),R=""),x){case"<":m=C+m+k+R;break;case"=":m=C+R+m+k;break;case"^":m=R.slice(0,ee=R.length>>1)+C+m+k+R.slice(ee);break;default:m=R+C+m+k;break}return o(m)}return Ve.toString=function(){return l+""},Ve}function d(l,c){var x=u((l=P(l),l.type="f",l)),p=Math.max(-8,Math.min(8,Math.floor(A(c)/3)))*3,b=Math.pow(10,-p),y=Nt[8+p/3];return function($){return x(b*$)+y}}return{format:u,formatPrefix:d}}var ce,de,me;ze({thousands:",",grouping:[3],currency:["$",""]});function ze(e){return ce=At(e),de=ce.format,me=ce.formatPrefix,ce}function De(e){return Math.max(0,-A(Math.abs(e)))}function Be(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(A(t)/3)))*3-A(Math.abs(e)))}function Te(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,A(t)-A(e))+1}function je(e,t,r,n){var a=ve(e,t,r),o;switch(n=P(n??",f"),n.type){case"s":{var f=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=Be(a,f))&&(n.precision=o),me(n,f)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=Te(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=De(a))&&(n.precision=o-(n.type==="%")*2);break}}return de(n)}function dr(e){var t=e.domain;return e.ticks=function(r){var n=t();return ne(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return je(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,o=n.length-1,f=n[a],i=n[o],s,u,d=10;for(i<f&&(u=f,f=i,i=u,u=a,a=o,o=u);d-- >0;){if(u=Y(f,i,r),u===s)return n[a]=f,n[o]=i,t(n);if(u>0)f=Math.floor(f/u)*u,i=Math.ceil(i/u)*u;else if(u<0)f=Math.ceil(f*u)/u,i=Math.floor(i*u)/u;else break;s=u}return e},e}function G(){var e=Ce();return e.copy=function(){return wt(e,G())},We.apply(e,arguments),dr(e)}function h(e){return function(){return e}}var Fe=Math.PI,Xe=2*Fe,D=1e-6,mr=Xe-D;function Rt(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function pr(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Rt;let r=10**t;return function(n){this._+=n[0];for(let a=1,o=n.length;a<o;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}var B=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Rt:pr(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,o,f){this._append`C${+t},${+r},${+n},${+a},${this._x1=+o},${this._y1=+f}`}arcTo(t,r,n,a,o){if(t=+t,r=+r,n=+n,a=+a,o=+o,o<0)throw new Error(`negative radius: ${o}`);let f=this._x1,i=this._y1,s=n-t,u=a-r,d=f-t,l=i-r,c=d*d+l*l;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(c>D)if(!(Math.abs(l*s-u*d)>D)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-f,p=a-i,b=s*s+u*u,y=x*x+p*p,$=Math.sqrt(b),w=Math.sqrt(c),g=o*Math.tan((Fe-Math.acos((b+c-y)/(2*$*w)))/2),_=g/w,v=g/$;Math.abs(_-1)>D&&this._append`L${t+_*d},${r+_*l}`,this._append`A${o},${o},0,0,${+(l*x>d*p)},${this._x1=t+v*s},${this._y1=r+v*u}`}}arc(t,r,n,a,o,f){if(t=+t,r=+r,n=+n,f=!!f,n<0)throw new Error(`negative radius: ${n}`);let i=n*Math.cos(a),s=n*Math.sin(a),u=t+i,d=r+s,l=1^f,c=f?a-o:o-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>D||Math.abs(this._y1-d)>D)&&this._append`L${u},${d}`,n&&(c<0&&(c=c%Xe+Xe),c>mr?this._append`A${n},${n},0,1,${l},${t-i},${r-s}A${n},${n},0,1,${l},${this._x1=u},${this._y1=d}`:c>D&&this._append`A${n},${n},0,${+(c>=Fe)},${l},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}};function Lt(){return new B}Lt.prototype=B.prototype;function pe(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new B(t)}var La=Array.prototype.slice;function xe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qt(e){this._context=e}qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function he(e){return new qt(e)}function ge(e){return e[0]}function be(e){return e[1]}function U(e,t){var r=h(!0),n=null,a=he,o=null,f=pe(i);e=typeof e=="function"?e:e===void 0?ge:h(e),t=typeof t=="function"?t:t===void 0?be:h(t);function i(s){var u,d=(s=xe(s)).length,l,c=!1,x;for(n==null&&(o=a(x=f())),u=0;u<=d;++u)!(u<d&&r(l=s[u],u,s))===c&&((c=!c)?o.lineStart():o.lineEnd()),c&&o.point(+e(l,u,s),+t(l,u,s));if(x)return o=null,x+""||null}return i.x=function(s){return arguments.length?(e=typeof s=="function"?s:h(+s),i):e},i.y=function(s){return arguments.length?(t=typeof s=="function"?s:h(+s),i):t},i.defined=function(s){return arguments.length?(r=typeof s=="function"?s:h(!!s),i):r},i.curve=function(s){return arguments.length?(a=s,n!=null&&(o=a(n)),i):a},i.context=function(s){return arguments.length?(s==null?n=o=null:o=a(n=s),i):n},i}function Ge(e,t,r){var n=null,a=h(!0),o=null,f=he,i=null,s=pe(u);e=typeof e=="function"?e:e===void 0?ge:h(+e),t=typeof t=="function"?t:t===void 0?h(0):h(+t),r=typeof r=="function"?r:r===void 0?be:h(+r);function u(l){var c,x,p,b=(l=xe(l)).length,y,$=!1,w,g=new Array(b),_=new Array(b);for(o==null&&(i=f(w=s())),c=0;c<=b;++c){if(!(c<b&&a(y=l[c],c,l))===$)if($=!$)x=c,i.areaStart(),i.lineStart();else{for(i.lineEnd(),i.lineStart(),p=c-1;p>=x;--p)i.point(g[p],_[p]);i.lineEnd(),i.areaEnd()}$&&(g[c]=+e(y,c,l),_[c]=+t(y,c,l),i.point(n?+n(y,c,l):g[c],r?+r(y,c,l):_[c]))}if(w)return i=null,w+""||null}function d(){return U().defined(a).curve(f).context(o)}return u.x=function(l){return arguments.length?(e=typeof l=="function"?l:h(+l),n=null,u):e},u.x0=function(l){return arguments.length?(e=typeof l=="function"?l:h(+l),u):e},u.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:h(+l),u):n},u.y=function(l){return arguments.length?(t=typeof l=="function"?l:h(+l),r=null,u):t},u.y0=function(l){return arguments.length?(t=typeof l=="function"?l:h(+l),u):t},u.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:h(+l),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(l){return arguments.length?(a=typeof l=="function"?l:h(!!l),u):a},u.curve=function(l){return arguments.length?(f=l,o!=null&&(i=f(o)),u):f},u.context=function(l){return arguments.length?(l==null?o=i=null:i=f(o=l),u):o},u}var xr=({area:e,line:t,className:r,background:n,foreground:a})=>`<g>
function E(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ye(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function te(e){let t,r,n;e.length!==2?(t=E,r=(i,s)=>E(e(i),s),n=(i,s)=>e(i)-s):(t=e===E||e===ye?e:Bt,r=e,n=e);function a(i,s,l=0,d=i.length){if(l<d){if(t(s,s)!==0)return d;do{let u=l+d>>>1;r(i[u],s)<0?l=u+1:d=u}while(l<d)}return l}function o(i,s,l=0,d=i.length){if(l<d){if(t(s,s)!==0)return d;do{let u=l+d>>>1;r(i[u],s)<=0?l=u+1:d=u}while(l<d)}return l}function f(i,s,l=0,d=i.length){let u=a(i,s,l,d-1);return u>l&&n(i[u-1],s)>-n(i[u],s)?u-1:u}return{left:a,center:f,right:o}}function Bt(){return 0}function we(e){return e===null?NaN:+e}var Je=te(E),Ue=Je.right,Tt=Je.left,jt=te(we).center,$e=Ue;var Ft=Math.sqrt(50),Xt=Math.sqrt(10),Gt=Math.sqrt(2);function re(e,t,r){let n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),o=n/Math.pow(10,a),f=o>=Ft?10:o>=Xt?5:o>=Gt?2:1,i,s,l;return a<0?(l=Math.pow(10,-a)/f,i=Math.round(e*l),s=Math.round(t*l),i/l<e&&++i,s/l>t&&--s,l=-l):(l=Math.pow(10,a)*f,i=Math.round(e/l),s=Math.round(t/l),i*l<e&&++i,s*l>t&&--s),s<i&&.5<=r&&r<2?re(e,t,r*2):[i,s,l]}function ne(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[a,o,f]=n?re(t,e,r):re(e,t,r);if(!(o>=a))return[];let i=o-a+1,s=new Array(i);if(n)if(f<0)for(let l=0;l<i;++l)s[l]=(o-l)/-f;else for(let l=0;l<i;++l)s[l]=(o-l)*f;else if(f<0)for(let l=0;l<i;++l)s[l]=(a+l)/-f;else for(let l=0;l<i;++l)s[l]=(a+l)*f;return s}function Y(e,t,r){return t=+t,e=+e,r=+r,re(e,t,r)[2]}function ve(e,t,r){t=+t,e=+e,r=+r;let n=t<e,a=n?Y(t,e,r):Y(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function We(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ae(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Me(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Z(){}var Q=.7,fe=1/Q,j="\\s*([+-]?\\d+)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yt=/^#([0-9a-f]{3,8})$/,Qt=new RegExp(`^rgb\\(${j},${j},${j}\\)$`),Vt=new RegExp(`^rgb\\(${N},${N},${N}\\)$`),Zt=new RegExp(`^rgba\\(${j},${j},${j},${V}\\)$`),Jt=new RegExp(`^rgba\\(${N},${N},${N},${V}\\)$`),Ut=new RegExp(`^hsl\\(${V},${N},${N}\\)$`),Wt=new RegExp(`^hsla\\(${V},${N},${N},${V}\\)$`),Ke={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ae(Z,L,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:et,formatHex:et,formatHex8:Kt,formatHsl:er,formatRgb:tt,toString:tt});function et(){return this.rgb().formatHex()}function Kt(){return this.rgb().formatHex8()}function er(){return ft(this).formatHsl()}function tt(){return this.rgb().formatRgb()}function L(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Yt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?rt(t):r===3?new M(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?oe(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?oe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Qt.exec(e))?new M(t[1],t[2],t[3],1):(t=Vt.exec(e))?new M(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zt.exec(e))?oe(t[1],t[2],t[3],t[4]):(t=Jt.exec(e))?oe(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ut.exec(e))?ot(t[1],t[2]/100,t[3]/100,1):(t=Wt.exec(e))?ot(t[1],t[2]/100,t[3]/100,t[4]):Ke.hasOwnProperty(e)?rt(Ke[e]):e==="transparent"?new M(NaN,NaN,NaN,0):null}function rt(e){return new M(e>>16&255,e>>8&255,e&255,1)}function oe(e,t,r,n){return n<=0&&(e=t=r=NaN),new M(e,t,r,n)}function tr(e){return e instanceof Z||(e=L(e)),e?(e=e.rgb(),new M(e.r,e.g,e.b,e.opacity)):new M}function F(e,t,r,n){return arguments.length===1?tr(e):new M(e,t,r,n??1)}function M(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ae(M,F,Me(Z,{brighter(e){return e=e==null?fe:Math.pow(fe,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Q:Math.pow(Q,e),new M(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new M(I(this.r),I(this.g),I(this.b),le(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:nt,formatHex:nt,formatHex8:rr,formatRgb:at,toString:at}));function nt(){return`#${H(this.r)}${H(this.g)}${H(this.b)}`}function rr(){return`#${H(this.r)}${H(this.g)}${H(this.b)}${H((isNaN(this.opacity)?1:this.opacity)*255)}`}function at(){let e=le(this.opacity);return`${e===1?"rgb(":"rgba("}${I(this.r)}, ${I(this.g)}, ${I(this.b)}${e===1?")":`, ${e})`}`}function le(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function I(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function H(e){return e=I(e),(e<16?"0":"")+e.toString(16)}function ot(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _(e,t,r,n)}function ft(e){if(e instanceof _)return new _(e.h,e.s,e.l,e.opacity);if(e instanceof Z||(e=L(e)),!e)return new _;if(e instanceof _)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),f=NaN,i=o-a,s=(o+a)/2;return i?(t===o?f=(r-n)/i+(r<n)*6:r===o?f=(n-t)/i+2:f=(t-r)/i+4,i/=s<.5?o+a:2-o-a,f*=60):i=s>0&&s<1?0:f,new _(f,i,s,e.opacity)}function lt(e,t,r,n){return arguments.length===1?ft(e):new _(e,t,r,n??1)}function _(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ae(_,lt,Me(Z,{brighter(e){return e=e==null?fe:Math.pow(fe,e),new _(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Q:Math.pow(Q,e),new _(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new M(ke(e>=240?e-240:e+120,a,n),ke(e,a,n),ke(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new _(it(this.h),ie(this.s),ie(this.l),le(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=le(this.opacity);return`${e===1?"hsl(":"hsla("}${it(this.h)}, ${ie(this.s)*100}%, ${ie(this.l)*100}%${e===1?")":`, ${e})`}`}}));function it(e){return e=(e||0)%360,e<0?e+360:e}function ie(e){return Math.max(0,Math.min(1,e||0))}function ke(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}function _e(e,t,r,n,a){var o=e*e,f=o*e;return((1-3*e+3*o-f)*t+(4-6*o+3*f)*r+(1+3*e+3*o-3*f)*n+f*a)/6}function ut(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),a=e[n],o=e[n+1],f=n>0?e[n-1]:2*a-o,i=n<t-1?e[n+2]:2*o-a;return _e((r-n/t)*t,f,a,o,i)}}function st(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),a=e[(n+t-1)%t],o=e[n%t],f=e[(n+1)%t],i=e[(n+2)%t];return _e((r-n/t)*t,a,o,f,i)}}var J=e=>()=>e;function nr(e,t){return function(r){return e+r*t}}function ar(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function ct(e){return(e=+e)==1?ue:function(t,r){return r-t?ar(t,r,e):J(isNaN(t)?r:t)}}function ue(e,t){var r=t-e;return r?nr(e,r):J(isNaN(e)?t:e)}var Se=function e(t){var r=ct(t);function n(a,o){var f=r((a=F(a)).r,(o=F(o)).r),i=r(a.g,o.g),s=r(a.b,o.b),l=ue(a.opacity,o.opacity);return function(d){return a.r=f(d),a.g=i(d),a.b=s(d),a.opacity=l(d),a+""}}return n.gamma=e,n}(1);function dt(e){return function(t){var r=t.length,n=new Array(r),a=new Array(r),o=new Array(r),f,i;for(f=0;f<r;++f)i=F(t[f]),n[f]=i.r||0,a[f]=i.g||0,o[f]=i.b||0;return n=e(n),a=e(a),o=e(o),i.opacity=1,function(s){return i.r=n(s),i.g=a(s),i.b=o(s),i+""}}}var Qr=dt(ut),Vr=dt(st);function mt(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=e[a]*(1-o)+t[a]*o;return n}}function pt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xt(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),o=new Array(r),f;for(f=0;f<n;++f)a[f]=O(e[f],t[f]);for(;f<r;++f)o[f]=t[f];return function(i){for(f=0;f<n;++f)o[f]=a[f](i);return o}}function ht(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function q(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function gt(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=O(e[a],t[a]):n[a]=t[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var Ae=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ne=new RegExp(Ae.source,"g");function or(e){return function(){return e}}function ir(e){return function(t){return e(t)+""}}function bt(e,t){var r=Ae.lastIndex=Ne.lastIndex=0,n,a,o,f=-1,i=[],s=[];for(e=e+"",t=t+"";(n=Ae.exec(e))&&(a=Ne.exec(t));)(o=a.index)>r&&(o=t.slice(r,o),i[f]?i[f]+=o:i[++f]=o),(n=n[0])===(a=a[0])?i[f]?i[f]+=a:i[++f]=a:(i[++f]=null,s.push({i:f,x:q(n,a)})),r=Ne.lastIndex;return r<t.length&&(o=t.slice(r),i[f]?i[f]+=o:i[++f]=o),i.length<2?s[0]?ir(s[0].x):or(t):(t=s.length,function(l){for(var d=0,u;d<t;++d)i[(u=s[d]).i]=u.x(l);return i.join("")})}function O(e,t){var r=typeof t,n;return t==null||r==="boolean"?J(t):(r==="number"?q:r==="string"?(n=L(t))?(t=n,Se):bt:t instanceof L?Se:t instanceof Date?ht:pt(t)?mt:Array.isArray(t)?xt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gt:q)(e,t)}function Re(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Le(e){return function(){return e}}function qe(e){return+e}var yt=[0,1];function X(e){return e}function Pe(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Le(isNaN(t)?NaN:.5)}function fr(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function lr(e,t,r){var n=e[0],a=e[1],o=t[0],f=t[1];return a<n?(n=Pe(a,n),o=r(f,o)):(n=Pe(n,a),o=r(o,f)),function(i){return o(n(i))}}function ur(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),o=new Array(n),f=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++f<n;)a[f]=Pe(e[f],e[f+1]),o[f]=r(t[f],t[f+1]);return function(i){var s=$e(e,i,1,n)-1;return o[s](a[s](i))}}function wt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function sr(){var e=yt,t=yt,r=O,n,a,o,f=X,i,s,l;function d(){var c=Math.min(e.length,t.length);return f!==X&&(f=fr(e[0],e[c-1])),i=c>2?ur:lr,s=l=null,u}function u(c){return c==null||isNaN(c=+c)?o:(s||(s=i(e.map(n),t,r)))(n(f(c)))}return u.invert=function(c){return f(a((l||(l=i(t,e.map(n),q)))(c)))},u.domain=function(c){return arguments.length?(e=Array.from(c,qe),d()):e.slice()},u.range=function(c){return arguments.length?(t=Array.from(c),d()):t.slice()},u.rangeRound=function(c){return t=Array.from(c),r=Re,d()},u.clamp=function(c){return arguments.length?(f=c?!0:X,d()):f!==X},u.interpolate=function(c){return arguments.length?(r=c,d()):r},u.unknown=function(c){return arguments.length?(o=c,u):o},function(c,x){return n=c,a=x,d()}}function Ce(){return sr()(X,X)}function $t(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function z(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function A(e){return e=z(Math.abs(e)),e?e[1]:NaN}function vt(e,t){return function(r,n){for(var a=r.length,o=[],f=0,i=e[0],s=0;a>0&&i>0&&(s+i+1>n&&(i=Math.max(1,n-s)),o.push(r.substring(a-=i,a+i)),!((s+=i+1)>n));)i=e[f=(f+1)%e.length];return o.reverse().join(t)}}function Mt(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var cr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function P(e){if(!(t=cr.exec(e)))throw new Error("invalid format: "+e);var t;return new se({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}P.prototype=se.prototype;function se(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}se.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kt(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var Ee;function _t(e,t){var r=z(e,t);if(!r)return e+"";var n=r[0],a=r[1],o=a-(Ee=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,f=n.length;return o===f?n:o>f?n+new Array(o-f+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+z(e,Math.max(0,t+o-1))[0]}function He(e,t){var r=z(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}var Ie={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:$t,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>He(e*100,t),r:He,s:_t,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Oe(e){return e}var St=Array.prototype.map,Nt=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function At(e){var t=e.grouping===void 0||e.thousands===void 0?Oe:vt(St.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Oe:Mt(St.call(e.numerals,String)),f=e.percent===void 0?"%":e.percent+"",i=e.minus===void 0?"\u2212":e.minus+"",s=e.nan===void 0?"NaN":e.nan+"";function l(u){u=P(u);var c=u.fill,x=u.align,p=u.sign,b=u.symbol,y=u.zero,$=u.width,w=u.comma,g=u.precision,S=u.trim,v=u.type;v==="n"?(w=!0,v="g"):Ie[v]||(g===void 0&&(g=12),S=!0,v="g"),(y||c==="0"&&x==="=")&&(y=!0,c="0",x="=");var Ot=b==="$"?r:b==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",zt=b==="$"?n:/[%p]/.test(v)?f:"",Qe=Ie[v],Dt=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function Ve(m){var C=Ot,k=zt,T,Ze,W;if(v==="c")k=Qe(m)+k,m="";else{m=+m;var K=m<0||1/m<0;if(m=isNaN(m)?s:Qe(Math.abs(m),g),S&&(m=kt(m)),K&&+m==0&&p!=="+"&&(K=!1),C=(K?p==="("?p:i:p==="-"||p==="("?"":p)+C,k=(v==="s"?Nt[8+Ee/3]:"")+k+(K&&p==="("?")":""),Dt){for(T=-1,Ze=m.length;++T<Ze;)if(W=m.charCodeAt(T),48>W||W>57){k=(W===46?a+m.slice(T+1):m.slice(T))+k,m=m.slice(0,T);break}}}w&&!y&&(m=t(m,1/0));var ee=C.length+m.length+k.length,R=ee<$?new Array($-ee+1).join(c):"";switch(w&&y&&(m=t(R+m,R.length?$-k.length:1/0),R=""),x){case"<":m=C+m+k+R;break;case"=":m=C+R+m+k;break;case"^":m=R.slice(0,ee=R.length>>1)+C+m+k+R.slice(ee);break;default:m=R+C+m+k;break}return o(m)}return Ve.toString=function(){return u+""},Ve}function d(u,c){var x=l((u=P(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(A(c)/3)))*3,b=Math.pow(10,-p),y=Nt[8+p/3];return function($){return x(b*$)+y}}return{format:l,formatPrefix:d}}var ce,de,me;ze({thousands:",",grouping:[3],currency:["$",""]});function ze(e){return ce=At(e),de=ce.format,me=ce.formatPrefix,ce}function De(e){return Math.max(0,-A(Math.abs(e)))}function Be(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(A(t)/3)))*3-A(Math.abs(e)))}function Te(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,A(t)-A(e))+1}function je(e,t,r,n){var a=ve(e,t,r),o;switch(n=P(n??",f"),n.type){case"s":{var f=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=Be(a,f))&&(n.precision=o),me(n,f)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=Te(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=De(a))&&(n.precision=o-(n.type==="%")*2);break}}return de(n)}function dr(e){var t=e.domain;return e.ticks=function(r){var n=t();return ne(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return je(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,o=n.length-1,f=n[a],i=n[o],s,l,d=10;for(i<f&&(l=f,f=i,i=l,l=a,a=o,o=l);d-- >0;){if(l=Y(f,i,r),l===s)return n[a]=f,n[o]=i,t(n);if(l>0)f=Math.floor(f/l)*l,i=Math.ceil(i/l)*l;else if(l<0)f=Math.ceil(f*l)/l,i=Math.floor(i*l)/l;else break;s=l}return e},e}function G(){var e=Ce();return e.copy=function(){return wt(e,G())},We.apply(e,arguments),dr(e)}function h(e){return function(){return e}}var Fe=Math.PI,Xe=2*Fe,D=1e-6,mr=Xe-D;function Rt(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function pr(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Rt;let r=10**t;return function(n){this._+=n[0];for(let a=1,o=n.length;a<o;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}var B=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Rt:pr(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,o,f){this._append`C${+t},${+r},${+n},${+a},${this._x1=+o},${this._y1=+f}`}arcTo(t,r,n,a,o){if(t=+t,r=+r,n=+n,a=+a,o=+o,o<0)throw new Error(`negative radius: ${o}`);let f=this._x1,i=this._y1,s=n-t,l=a-r,d=f-t,u=i-r,c=d*d+u*u;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(c>D)if(!(Math.abs(u*s-l*d)>D)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-f,p=a-i,b=s*s+l*l,y=x*x+p*p,$=Math.sqrt(b),w=Math.sqrt(c),g=o*Math.tan((Fe-Math.acos((b+c-y)/(2*$*w)))/2),S=g/w,v=g/$;Math.abs(S-1)>D&&this._append`L${t+S*d},${r+S*u}`,this._append`A${o},${o},0,0,${+(u*x>d*p)},${this._x1=t+v*s},${this._y1=r+v*l}`}}arc(t,r,n,a,o,f){if(t=+t,r=+r,n=+n,f=!!f,n<0)throw new Error(`negative radius: ${n}`);let i=n*Math.cos(a),s=n*Math.sin(a),l=t+i,d=r+s,u=1^f,c=f?a-o:o-a;this._x1===null?this._append`M${l},${d}`:(Math.abs(this._x1-l)>D||Math.abs(this._y1-d)>D)&&this._append`L${l},${d}`,n&&(c<0&&(c=c%Xe+Xe),c>mr?this._append`A${n},${n},0,1,${u},${t-i},${r-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=d}`:c>D&&this._append`A${n},${n},0,${+(c>=Fe)},${u},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}};function Lt(){return new B}Lt.prototype=B.prototype;function pe(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new B(t)}var La=Array.prototype.slice;function xe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qt(e){this._context=e}qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function he(e){return new qt(e)}function ge(e){return e[0]}function be(e){return e[1]}function U(e,t){var r=h(!0),n=null,a=he,o=null,f=pe(i);e=typeof e=="function"?e:e===void 0?ge:h(e),t=typeof t=="function"?t:t===void 0?be:h(t);function i(s){var l,d=(s=xe(s)).length,u,c=!1,x;for(n==null&&(o=a(x=f())),l=0;l<=d;++l)!(l<d&&r(u=s[l],l,s))===c&&((c=!c)?o.lineStart():o.lineEnd()),c&&o.point(+e(u,l,s),+t(u,l,s));if(x)return o=null,x+""||null}return i.x=function(s){return arguments.length?(e=typeof s=="function"?s:h(+s),i):e},i.y=function(s){return arguments.length?(t=typeof s=="function"?s:h(+s),i):t},i.defined=function(s){return arguments.length?(r=typeof s=="function"?s:h(!!s),i):r},i.curve=function(s){return arguments.length?(a=s,n!=null&&(o=a(n)),i):a},i.context=function(s){return arguments.length?(s==null?n=o=null:o=a(n=s),i):n},i}function Ge(e,t,r){var n=null,a=h(!0),o=null,f=he,i=null,s=pe(l);e=typeof e=="function"?e:e===void 0?ge:h(+e),t=typeof t=="function"?t:t===void 0?h(0):h(+t),r=typeof r=="function"?r:r===void 0?be:h(+r);function l(u){var c,x,p,b=(u=xe(u)).length,y,$=!1,w,g=new Array(b),S=new Array(b);for(o==null&&(i=f(w=s())),c=0;c<=b;++c){if(!(c<b&&a(y=u[c],c,u))===$)if($=!$)x=c,i.areaStart(),i.lineStart();else{for(i.lineEnd(),i.lineStart(),p=c-1;p>=x;--p)i.point(g[p],S[p]);i.lineEnd(),i.areaEnd()}$&&(g[c]=+e(y,c,u),S[c]=+t(y,c,u),i.point(n?+n(y,c,u):g[c],r?+r(y,c,u):S[c]))}if(w)return i=null,w+""||null}function d(){return U().defined(a).curve(f).context(o)}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:h(+u),n=null,l):e},l.x0=function(u){return arguments.length?(e=typeof u=="function"?u:h(+u),l):e},l.x1=function(u){return arguments.length?(n=u==null?null:typeof u=="function"?u:h(+u),l):n},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:h(+u),r=null,l):t},l.y0=function(u){return arguments.length?(t=typeof u=="function"?u:h(+u),l):t},l.y1=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:h(+u),l):r},l.lineX0=l.lineY0=function(){return d().x(e).y(t)},l.lineY1=function(){return d().x(e).y(r)},l.lineX1=function(){return d().x(n).y(t)},l.defined=function(u){return arguments.length?(a=typeof u=="function"?u:h(!!u),l):a},l.curve=function(u){return arguments.length?(f=u,o!=null&&(i=f(o)),l):f},l.context=function(u){return arguments.length?(u==null?o=i=null:i=f(o=u),l):o},l}var xr=({area:e,line:t,className:r,background:n,foreground:a})=>`<g>
<path

@@ -20,2 +20,2 @@ class="${r}__area"

text-anchor="${i}"
>${t}</text>`},Ct=e=>{let t=hr(e),r=Pt({text:e.labelLeft,alignment:"left",...e}),n=Pt({text:e.labelRight,alignment:"right",...e}),a=e.rows.map(({area:d,line:l})=>xr({...e,area:d,line:l})).join(""),o=[r,n,t,a].join(""),{className:f,size:i,viewBox:s,background:u}=e;return`<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" class="${f}" width="${i}" height="${i}" viewBox="${s}" preserveAspectRatio="none" style="background-color: ${u}">${o}</svg>`};var Et=e=>{let t={width:100*e.scale,height:100*e.scale,margin:100*e.scale*e.margin},r=e.dataMax??e.data.reduce((l,c)=>Math.max(l,Math.max(...c)),0),n=e.dataMin??e.data.reduce((l,c)=>Math.min(l,Math.min(...c)),1/0),a=G().domain([0,e.data[0].length-1]).range([0,t.width]),o=t.height/(e.data.length-1),f=e.rowHeight??e.data.length*2/100,i=t.height*f,s=e.data.reverse().map((l,c)=>{let x=t.height-c*o,p=[x,x-i],b=G().domain([n,r]).range(p),y=U().x((w,g)=>a(g)).y(w=>b(w)),$=Ge().x((w,g)=>a(g)).y0(()=>b(e.baseline??n)).y1(w=>b(w));return{line:y(l),area:$(l)}}).reverse(),u=`${-t.margin} ${-t.margin} ${t.width+t.margin*2} ${t.height+t.margin*2}`;return Ct({...e,rows:s,viewBox:u,layout:t})};var Ht=e=>({className:e.classList[0]||"default",caption:e.getAttribute("data-caption")||!1,captionHtml:e.getAttribute("data-caption-html")||!1,background:e.getAttribute("data-background")||"#fff000",foreground:e.getAttribute("data-foreground")||"#000fff",margin:e.getAttribute("data-margin")||.5,scale:e.getAttribute("data-scale")||1,size:e.getAttribute("data-size")||400,dataMax:e.getAttribute("data-max")||null,dataMin:e.getAttribute("data-min")||null,rowHeight:e.getAttribute("data-row-height")||null,baseline:e.getAttribute("data-baseline")||!1,labelLeft:e.getAttribute("data-label-left")||"",labelRight:e.getAttribute("data-label-right")||""});var It=[[-.81,-.4,-.01,-.71,.39,.1,-1.01,1.04,2.81,.17,5.44,13.67,14.36,8.96,11.48,13.15,8.74,3.28,-.67,-.07,-.15,-.29,-.37,.33,-.18],[-.61,-.63,-.54,-.62,-.3,.29,1.43,2.53,11.68,16.03,14.95,10.81,8.24,5.22,5.67,7,9.64,7.37,1.44,.2,-.09,.28,.07,.05,.04],[-1.43,.33,-.16,-1.25,-.16,-.41,.43,2.22,6.52,13.16,27.12,11.9,17.06,18.08,8.29,4.75,4.96,3.09,-.13,-.6,-.68,-.59,-.68,-.51,-.29],[-1.09,-.19,.4,.03,-.14,-.75,.2,2.5,6.05,10.53,33.2,18.15,10.22,17.63,7.83,11.74,3.45,2.66,-.11,-.36,-.35,1.02,-.82,.23,-.64],[-1.13,-.85,-.85,-1.06,-.81,-.6,-.06,1.27,4.77,12.54,10.28,4.82,5.62,8.47,7.88,3.87,4.62,2.36,1.35,-.43,.21,.7,.22,.14,-.37],[-.66,-1.76,-.38,-.6,.18,1.78,2.01,2.47,7.19,10.31,10.99,19.27,12.18,8.95,10.52,18.94,14,5.12,1.28,.41,-.9,.04,.2,-.11,-.33],[-.36,-.52,-.23,-.04,.27,.09,.57,3.79,16.83,13.03,2.41,8.41,4.45,4.63,5.9,11.17,14.8,5.13,.27,1.53,-.91,-.62,-.61,-.78,-.51],[-.73,.5,-.41,-.44,-.13,.15,2.18,4.03,10.98,25.26,35.17,16.13,15.67,11.82,10.31,6.05,4.51,1.68,.57,.13,-.13,-.44,.29,-.14,-.07],[-.89,-.37,-.61,-.51,-.49,1.26,2.18,1.56,6.59,13.01,18.05,9.66,15.96,10.44,.5,-2.47,1.8,2.08,.26,-.23,.21,.13,-.14,.88,-.72],[-.69,-.18,.14,.57,-.48,1.25,1.14,2.65,10.9,14.59,27.44,26.18,17.38,18.72,19.93,16.58,8.48,3.63,1.45,-.13,-.32,-.31,-.75,-.55,.21],[-.65,-1.51,.3,.21,1.04,1.14,1.91,4.6,23.05,27.89,25.32,17.98,19.08,12.44,8.35,12.64,18,7.95,2.21,-.47,-.69,-.06,-.31,.12,-.86],[.31,-.1,.15,.45,1.73,1.71,2.01,6,17.5,24.58,30.58,20.53,17.12,15.7,9.56,12.45,10.85,8.4,4.79,-.27,-.37,-.56,-.24,-.13,-.4],[-.74,.11,-.38,-.75,-.14,-.05,.96,2.91,4.92,13.59,25.15,24.22,16.01,16.59,30.8,18.3,7.41,2.51,2.11,-.52,.11,-.03,0,.19,-.13],[-.35,-.08,-.49,.04,.05,.37,1.37,3.5,6.79,9.17,15.54,23.36,16.32,15.79,13.07,19.7,12.5,4.68,2.5,-.57,-.25,-.09,-.75,-.4,-.55],[-.67,-.52,-.42,-.34,.05,.55,3.1,7.66,23.27,21.85,17.01,20.46,16.62,11.11,8.79,17.57,21.33,9.54,2.57,.39,-.31,-.11,-.96,.31,-.44]];var Ye=class extends HTMLElement{constructor(){super()}connectedCallback(){let t=Ht(this),r;if(this.getAttribute("data-test"))r=It;else{try{r=JSON.parse(this.getAttribute("data-data"))||[[]]}catch{console.warn("StackedSparklines requires the data-data attribute to be a valid JSON array.");return}if(!Array.isArray(r)||!Array.isArray(r[0])){console.warn("StackedSparklines requires data-data attribute to be an array of arrays.");return}}let a=Et({data:r,...t});this.innerHTML=a}};typeof window<"u"&&"customElements"in window&&window.customElements.define("stacked-sparklines",Ye);
>${t}</text>`},Ct=e=>{let t=hr(e),r=Pt({text:e.labelLeft,alignment:"left",...e}),n=Pt({text:e.labelRight,alignment:"right",...e}),a=e.rows.map(({area:d,line:u})=>xr({...e,area:d,line:u})).join(""),o=[r,n,t,a].join(""),{className:f,size:i,viewBox:s,background:l}=e;return`<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" class="${f}__inner" width="${i}" height="${i}" viewBox="${s}" preserveAspectRatio="none" style="background-color: ${l}">${o}</svg>`};var Et=e=>{let t={width:100*e.scale,height:100*e.scale,margin:100*e.scale*e.margin},r=e.dataMax??e.data.reduce((u,c)=>Math.max(u,Math.max(...c)),0),n=e.dataMin??e.data.reduce((u,c)=>Math.min(u,Math.min(...c)),1/0),a=G().domain([0,e.data[0].length-1]).range([0,t.width]),o=t.height/(e.data.length-1),f=e.rowHeight??e.data.length*2/100,i=t.height*f,s=e.data.reverse().map((u,c)=>{let x=t.height-c*o,p=[x,x-i],b=G().domain([n,r]).range(p),y=U().x((w,g)=>a(g)).y(w=>b(w)),$=Ge().x((w,g)=>a(g)).y0(()=>b(e.baseline??n)).y1(w=>b(w));return{line:y(u),area:$(u)}}).reverse(),l=`${-t.margin} ${-t.margin} ${t.width+t.margin*2} ${t.height+t.margin*2}`;return Ct({...e,rows:s,viewBox:l,layout:t})};var Ht=e=>({className:e.classList[0]||"stacked-sparklines",caption:e.getAttribute("data-caption")||!1,captionHtml:e.getAttribute("data-caption-html")||!1,background:e.getAttribute("data-background")||"#efeeeb",foreground:e.getAttribute("data-foreground")||"#666",margin:e.getAttribute("data-margin")||.5,scale:e.getAttribute("data-scale")||1,size:e.getAttribute("data-size")||400,dataMax:e.getAttribute("data-max")||null,dataMin:e.getAttribute("data-min")||null,rowHeight:e.getAttribute("data-row-height")||null,baseline:e.getAttribute("data-baseline")||!1,labelLeft:e.getAttribute("data-label-left")||"",labelRight:e.getAttribute("data-label-right")||""});var It=[[-.81,-.4,-.01,-.71,.39,.1,-1.01,1.04,2.81,.17,5.44,13.67,14.36,8.96,11.48,13.15,8.74,3.28,-.67,-.07,-.15,-.29,-.37,.33,-.18],[-.61,-.63,-.54,-.62,-.3,.29,1.43,2.53,11.68,16.03,14.95,10.81,8.24,5.22,5.67,7,9.64,7.37,1.44,.2,-.09,.28,.07,.05,.04],[-1.43,.33,-.16,-1.25,-.16,-.41,.43,2.22,6.52,13.16,27.12,11.9,17.06,18.08,8.29,4.75,4.96,3.09,-.13,-.6,-.68,-.59,-.68,-.51,-.29],[-1.09,-.19,.4,.03,-.14,-.75,.2,2.5,6.05,10.53,33.2,18.15,10.22,17.63,7.83,11.74,3.45,2.66,-.11,-.36,-.35,1.02,-.82,.23,-.64],[-1.13,-.85,-.85,-1.06,-.81,-.6,-.06,1.27,4.77,12.54,10.28,4.82,5.62,8.47,7.88,3.87,4.62,2.36,1.35,-.43,.21,.7,.22,.14,-.37],[-.66,-1.76,-.38,-.6,.18,1.78,2.01,2.47,7.19,10.31,10.99,19.27,12.18,8.95,10.52,18.94,14,5.12,1.28,.41,-.9,.04,.2,-.11,-.33],[-.36,-.52,-.23,-.04,.27,.09,.57,3.79,16.83,13.03,2.41,8.41,4.45,4.63,5.9,11.17,14.8,5.13,.27,1.53,-.91,-.62,-.61,-.78,-.51],[-.73,.5,-.41,-.44,-.13,.15,2.18,4.03,10.98,25.26,35.17,16.13,15.67,11.82,10.31,6.05,4.51,1.68,.57,.13,-.13,-.44,.29,-.14,-.07],[-.89,-.37,-.61,-.51,-.49,1.26,2.18,1.56,6.59,13.01,18.05,9.66,15.96,10.44,.5,-2.47,1.8,2.08,.26,-.23,.21,.13,-.14,.88,-.72],[-.69,-.18,.14,.57,-.48,1.25,1.14,2.65,10.9,14.59,27.44,26.18,17.38,18.72,19.93,16.58,8.48,3.63,1.45,-.13,-.32,-.31,-.75,-.55,.21],[-.65,-1.51,.3,.21,1.04,1.14,1.91,4.6,23.05,27.89,25.32,17.98,19.08,12.44,8.35,12.64,18,7.95,2.21,-.47,-.69,-.06,-.31,.12,-.86],[.31,-.1,.15,.45,1.73,1.71,2.01,6,17.5,24.58,30.58,20.53,17.12,15.7,9.56,12.45,10.85,8.4,4.79,-.27,-.37,-.56,-.24,-.13,-.4],[-.74,.11,-.38,-.75,-.14,-.05,.96,2.91,4.92,13.59,25.15,24.22,16.01,16.59,30.8,18.3,7.41,2.51,2.11,-.52,.11,-.03,0,.19,-.13],[-.35,-.08,-.49,.04,.05,.37,1.37,3.5,6.79,9.17,15.54,23.36,16.32,15.79,13.07,19.7,12.5,4.68,2.5,-.57,-.25,-.09,-.75,-.4,-.55],[-.67,-.52,-.42,-.34,.05,.55,3.1,7.66,23.27,21.85,17.01,20.46,16.62,11.11,8.79,17.57,21.33,9.54,2.57,.39,-.31,-.11,-.96,.31,-.44]];var Ye=class extends HTMLElement{constructor(){super()}connectedCallback(){let t=Ht(this),r;if(this.getAttribute("data-test"))r=It;else{try{r=JSON.parse(this.getAttribute("data-data"))||[[]]}catch{console.warn("StackedSparklines requires the data-data attribute to be a valid JSON array.");return}if(!Array.isArray(r)||!Array.isArray(r[0])){console.warn("StackedSparklines requires data-data attribute to be an array of arrays.");return}}let a=Et({data:r,...t});this.innerHTML=a}};typeof window<"u"&&"customElements"in window&&window.customElements.define("stacked-sparklines",Ye);
{
"name": "stacked-sparklines",
"version": "0.0.5",
"version": "0.0.6",
"description": "SVG stacked sparklines web component",

@@ -5,0 +5,0 @@ "main": "./build/stacked-sparklines.js",

@@ -64,3 +64,3 @@ # Stacked Sparklines

### `data` (required)
### `data-data` (required)

@@ -79,19 +79,19 @@ This is the data that will be rendered into the SVG graph. We're drawing a stack of lines, so the `data` option expects an array of arrays (one array for each line to be drawn).

### `caption`
### `data-caption`
This is a string that will be rendered as a caption below the graph.
### `caption-html`
### `data-caption-html`
This is a string that will be rendered as a caption below the graph. It will be rendered as HTML, so you can include links, formatting-tags, etc.
### `background` and `foreground`
### `data-background` and `data-foreground`
These are the colours that will be used for the graph's background and foreground. They can be provided as any value that would be accepted by CSS (e.g. `#00b7c6`, `rgb(0,183,198)`, `hsl(185,100%,39%)`, `--custom-property-name`, etc.).
### `size`
### `data-size`
This is the size of the graph. It defines the percentage of the available space that the graph will take up, so should be a number between `0` and `1` (e.g. `0.5` for 50% of the available space).
This is the size of the graph, in pixels. The graphs are square, so this value defines both the `width` and `height` of the rendered SVG.
### `margin`
### `data-margin`

@@ -138,3 +138,3 @@ This is the margin around the graph. It defines the percentage margin rendered around the outside of the graph, so should be a number between `0` and `1` (e.g. `0.1` for 10% margin).

The default class name is `"default"`.
The default class name is `"stacked-sparklines"`.

@@ -145,3 +145,4 @@ ### Provided class names

* `.PREFIX`: the root element
* `.PREFIX`: the root element (a.k.a. the `<stacked-sparklines>` component itself)
* `.PREFIX__inner`: the `<svg>` element (the direct child of the `<stacked-sparklines>` component)
* `.PREFIX__area`: the area under the lines

@@ -148,0 +149,0 @@ * `.PREFIX__line`: the lines themselves

@@ -84,3 +84,3 @@ const renderRow = ({ area, line, className, background, foreground }) => {

return `<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" class="${className}" width="${size}" height="${size}" viewBox="${viewBox}" preserveAspectRatio="none" style="background-color: ${background}">${components}</svg>`;
return `<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" class="${className}__inner" width="${size}" height="${size}" viewBox="${viewBox}" preserveAspectRatio="none" style="background-color: ${background}">${components}</svg>`;
};
export const getOptions = target => ({
className: target.classList[0] || "default",
className: target.classList[0] || "stacked-sparklines",
caption: target.getAttribute("data-caption") || false,
captionHtml: target.getAttribute("data-caption-html") || false,
background: target.getAttribute("data-background") || "#fff000",
foreground: target.getAttribute("data-foreground") || "#000fff",
background: target.getAttribute("data-background") || "#efeeeb",
foreground: target.getAttribute("data-foreground") || "#666",
margin: target.getAttribute("data-margin") || 0.5,

@@ -8,0 +8,0 @@ scale: target.getAttribute("data-scale") || 1,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc