Socket
Socket
Sign inDemoInstall

vega-scenegraph

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-scenegraph - npm Package Compare versions

Comparing version 4.5.1 to 4.6.0

src/util/canvas/blend.js

235

build/vega-scenegraph-schema.json

@@ -230,2 +230,23 @@ {

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -374,2 +395,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -506,2 +548,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -645,2 +708,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -787,2 +871,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -937,2 +1042,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -1063,2 +1189,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -1192,2 +1339,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -1312,2 +1480,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -1437,2 +1626,23 @@ "type": "number",

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -1538,6 +1748,8 @@ "type": "number",

"enum": [
"alphabetic",
"top",
"middle",
"bottom",
"alphabetic"
"line-top",
"line-bottom"
],

@@ -1657,2 +1869,23 @@ "default": "alphabetic"

},
"blend": {
"enum": [
null,
"multiply",
"screen",
"overlay",
"darken",
"lighten",
"color-dodge",
"color-burn",
"hard-light",
"soft-light",
"difference",
"exclusion",
"hue",
"saturation",
"color",
"luminosity"
],
"default": null
},
"opacity": {

@@ -1659,0 +1892,0 @@ "type": "number",

2

build/vega-scenegraph.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-canvas"),require("vega-loader"),require("d3-shape"),require("d3-path")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-canvas","vega-loader","d3-shape","d3-path"],e):e((t=t||self).vega={},t.vega,t.vega,t.vega,t.d3,t.d3)}(this,(function(t,e,n,i,r,o){"use strict";function s(t){this.clear(),t&&this.union(t)}var a=s.prototype;a.clone=function(){return new s(this)},a.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},a.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},a.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},a.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},a.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},a.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},a.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},a.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},a.rotate=function(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},a.rotatedPoints=function(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),u=Math.sin(t),l=e-e*a+n*u,h=n-e*u-n*a;return[a*i-u*r+l,u*i+a*r+h,a*i-u*s+l,u*i+a*s+h,a*o-u*r+l,u*o+a*r+h,a*o-u*s+l,u*o+a*s+h]},a.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},a.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},a.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},a.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},a.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},a.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},a.width=function(){return this.x2-this.x1},a.height=function(){return this.y2-this.y1};var u=0;function l(t){return t&&t.gradient}function h(t,e,n){let i=t.id,r=t.gradient,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+u++,"radial"===r?(t.x1=c(t.x1,.5),t.y1=c(t.y1,.5),t.r1=c(t.r1,0),t.x2=c(t.x2,.5),t.y2=c(t.y2,.5),t.r2=c(t.r2,.5),o="p_"):(t.x1=c(t.x1,0),t.y1=c(t.y1,0),t.x2=c(t.x2,1),t.y2=c(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function c(t,e){return null!=t?t:e}function f(t){this.mark=t,this.bounds=this.bounds||new s}function d(t){f.call(this,t),this.items=this.items||[]}function v(t){this._pending=0,this._loader=t||i.loader()}e.inherits(d,f);var g=v.prototype;function p(t){t._pending+=1}function y(t){t._pending-=1}g.pending=function(){return this._pending},g.sanitizeURL=function(t){var e=this;return p(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return y(e),t})).catch((function(){return y(e),null}))},g.loadImage=function(t){var e=this,i=n.image();return p(e),e._loader.sanitize(t,{context:"image"}).then((function(t){var n=t.href;if(!n||!i)throw{url:n};var r=new i;return r.onload=function(){y(e)},r.onerror=function(){y(e)},r.src=n,r})).catch((function(t){return y(e),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},g.ready=function(){var t=this;return new Promise((function(e){!function n(i){t.pending()?setTimeout((function(){n(!0)}),10):e(i)}(!1)}))};var m={basis:{curve:r.curveBasis},"basis-closed":{curve:r.curveBasisClosed},"basis-open":{curve:r.curveBasisOpen},bundle:{curve:r.curveBundle,tension:"beta",value:.85},cardinal:{curve:r.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:r.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:r.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:r.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:r.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:r.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:r.curveLinear},"linear-closed":{curve:r.curveLinearClosed},monotone:{horizontal:r.curveMonotoneY,vertical:r.curveMonotoneX},natural:{curve:r.curveNatural},step:{curve:r.curveStep},"step-after":{curve:r.curveStepAfter},"step-before":{curve:r.curveStepBefore}};function _(t,n,i){var r=e.hasOwnProperty(m,t)&&m[t],o=null;return r&&(o=r.curve||r[n||"vertical"],r.tension&&null!=i&&(o=o[r.tension](i))),o}var x={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},b=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function k(t){var e,n,i,r,o,s,a,u,l,h,c,f=[];for(u=0,h=(e=t.slice().replace(b[0],"###$1").split(b[1]).slice(1)).length;u<h;++u){for(i=(n=e[u]).slice(1).trim().replace(b[2],"$1###$2").split(b[3]),r=[s=n.charAt(0)],l=0,c=i.length;l<c;++l)(o=+i[l])===o&&r.push(o);if(a=x[s.toLowerCase()],r.length-1>a)for(l=1,c=r.length;l<c;l+=a)f.push([s].concat(r.slice(l,l+a)));else f.push(r)}return f}const w=Math.PI/180,T=Math.PI/2,A=2*Math.PI,M=Math.sqrt(3)/2;var z={},C={},R=[].join;function P(t){var e=R.call(t);if(C[e])return C[e];var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],l=t[7],h=l*s,c=-u*a,f=u*s,d=l*a,v=Math.cos(r),g=Math.sin(r),p=Math.cos(o),y=Math.sin(o),m=.5*(o-r),_=Math.sin(.5*m),x=8/3*_*_/Math.sin(m),b=n+v-x*g,k=i+g+x*v,w=n+p,T=i+y,A=w+x*y,M=T-x*p;return C[e]=[h*b+c*k,f*b+d*k,h*A+c*M,f*A+d*M,h*w+c*T,f*w+d*T]}var L=["l",0,0,0,0,0,0,0];function S(t,e,n){var i=L[0]=t[0];if("a"===i||"A"===i)L[1]=e*t[1],L[2]=n*t[2],L[3]=t[3],L[4]=t[4],L[5]=t[5],L[6]=e*t[6],L[7]=n*t[7];else if("h"===i||"H"===i)L[1]=e*t[1];else if("v"===i||"V"===i)L[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)L[r]=(r%2==1?e:n)*t[r];return L}function N(t,e,n,i,r,o){var s,a,u,l,h,c=null,f=0,d=0,v=0,g=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),t.beginPath&&t.beginPath();for(var p=0,y=e.length;p<y;++p){switch(s=e[p],1===r&&1===o||(s=S(s,r,o)),s[0]){case"l":f+=s[1],d+=s[2],t.lineTo(f+n,d+i);break;case"L":f=s[1],d=s[2],t.lineTo(f+n,d+i);break;case"h":f+=s[1],t.lineTo(f+n,d+i);break;case"H":f=s[1],t.lineTo(f+n,d+i);break;case"v":d+=s[1],t.lineTo(f+n,d+i);break;case"V":d=s[1],t.lineTo(f+n,d+i);break;case"m":f+=s[1],d+=s[2],t.moveTo(f+n,d+i);break;case"M":f=s[1],d=s[2],t.moveTo(f+n,d+i);break;case"c":a=f+s[5],u=d+s[6],v=f+s[3],g=d+s[4],t.bezierCurveTo(f+s[1]+n,d+s[2]+i,v+n,g+i,a+n,u+i),f=a,d=u;break;case"C":f=s[5],d=s[6],v=s[3],g=s[4],t.bezierCurveTo(s[1]+n,s[2]+i,v+n,g+i,f+n,d+i);break;case"s":a=f+s[3],u=d+s[4],v=2*f-v,g=2*d-g,t.bezierCurveTo(v+n,g+i,f+s[1]+n,d+s[2]+i,a+n,u+i),v=f+s[1],g=d+s[2],f=a,d=u;break;case"S":a=s[3],u=s[4],v=2*f-v,g=2*d-g,t.bezierCurveTo(v+n,g+i,s[1]+n,s[2]+i,a+n,u+i),f=a,d=u,v=s[1],g=s[2];break;case"q":a=f+s[3],u=d+s[4],v=f+s[1],g=d+s[2],t.quadraticCurveTo(v+n,g+i,a+n,u+i),f=a,d=u;break;case"Q":a=s[3],u=s[4],t.quadraticCurveTo(s[1]+n,s[2]+i,a+n,u+i),f=a,d=u,v=s[1],g=s[2];break;case"t":a=f+s[1],u=d+s[2],null===c[0].match(/[QqTt]/)?(v=f,g=d):"t"===c[0]?(v=2*f-l,g=2*d-h):"q"===c[0]&&(v=2*f-v,g=2*d-g),l=v,h=g,t.quadraticCurveTo(v+n,g+i,a+n,u+i),d=u,v=(f=a)+s[1],g=d+s[2];break;case"T":a=s[1],u=s[2],v=2*f-v,g=2*d-g,t.quadraticCurveTo(v+n,g+i,a+n,u+i),f=a,d=u;break;case"a":O(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+f+n,s[7]+d+i]),f+=s[6],d+=s[7];break;case"A":O(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),f=s[6],d=s[7];break;case"z":case"Z":t.closePath()}c=s}}function O(t,e,n,i){for(var r=function(t,e,n,i,r,o,s,a,u){var l=R.call(arguments);if(z[l])return z[l];var h=s*w,c=Math.sin(h),f=Math.cos(h),d=f*(a-t)*.5+c*(u-e)*.5,v=f*(u-e)*.5-c*(a-t)*.5,g=d*d/((n=Math.abs(n))*n)+v*v/((i=Math.abs(i))*i);g>1&&(n*=g=Math.sqrt(g),i*=g);var p=f/n,y=c/n,m=-c/i,_=f/i,x=p*a+y*u,b=m*a+_*u,k=p*t+y*e,M=m*t+_*e,C=(k-x)*(k-x)+(M-b)*(M-b),P=1/C-.25;P<0&&(P=0);var L=Math.sqrt(P);o==r&&(L=-L);var S=.5*(x+k)-L*(M-b),N=.5*(b+M)+L*(k-x),O=Math.atan2(b-N,x-S),q=Math.atan2(M-N,k-S),E=q-O;E<0&&1===o?E+=A:E>0&&0===o&&(E-=A);for(var D=Math.ceil(Math.abs(E/(T+.001))),I=[],B=0;B<D;++B){var V=O+B*E/D,H=O+(B+1)*E/D;I[B]=[S,N,V,H,n,i,c,f]}return z[l]=I}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var s=P(r[o]);t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}var q={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,A)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,o=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-o),t.lineTo(r,-o),t.lineTo(0,-n),t.lineTo(-r,-o),t.lineTo(-i,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n,r=i-.5773502691896257*n,o=n/4;t.moveTo(0,-i-r),t.lineTo(-o,i-r),t.lineTo(o,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n,r=i-.5773502691896257*n;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function E(t){return e.hasOwnProperty(q,t)?q[t]:function(t){if(!e.hasOwnProperty(D,t)){var n=k(t);D[t]={draw:function(t,e){N(t,n,0,0,Math.sqrt(e)/2)}}}return D[t]}(t)}var D={};const I=.448084975506;function B(t){return t.x}function V(t){return t.y}function H(t){return t.width}function W(t){return t.height}function G(t){return"function"==typeof t?t:()=>+t}function U(t,e,n){return Math.max(e,Math.min(t,n))}function X(){var t=B,e=V,n=H,i=W,r=G(0),s=r,a=r,u=r,l=null;function h(h,c,f){var d,v=null!=c?c:+t.call(this,h),g=null!=f?f:+e.call(this,h),p=+n.call(this,h),y=+i.call(this,h),m=Math.min(p,y)/2,_=U(+r.call(this,h),0,m),x=U(+s.call(this,h),0,m),b=U(+a.call(this,h),0,m),k=U(+u.call(this,h),0,m);if(l||(l=d=o.path()),_<=0&&x<=0&&b<=0&&k<=0)l.rect(v,g,p,y);else{var w=v+p,T=g+y;l.moveTo(v+_,g),l.lineTo(w-x,g),l.bezierCurveTo(w-I*x,g,w,g+I*x,w,g+x),l.lineTo(w,T-k),l.bezierCurveTo(w,T-I*k,w-I*k,T,w-k,T),l.lineTo(v+b,T),l.bezierCurveTo(v+I*b,T,v,T-I*b,v,T-b),l.lineTo(v,g+_),l.bezierCurveTo(v,g+I*_,v+I*_,g,v+_,g),l.closePath()}if(d)return l=null,d+""||null}return h.x=function(e){return arguments.length?(t=G(e),h):t},h.y=function(t){return arguments.length?(e=G(t),h):e},h.width=function(t){return arguments.length?(n=G(t),h):n},h.height=function(t){return arguments.length?(i=G(t),h):i},h.cornerRadius=function(t,e,n,i){return arguments.length?(r=G(t),s=null!=e?G(e):r,u=null!=n?G(n):r,a=null!=i?G(i):s,h):r},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function j(){var t,e,n,i,r,s,a,u,l=null;function h(t,e,n){var i=n/2;if(r){var o=a-e,h=t-s;if(o||h){var c=Math.sqrt(o*o+h*h),f=(o/=c)*u,d=(h/=c)*u,v=Math.atan2(h,o);l.moveTo(s-f,a-d),l.lineTo(t-o*i,e-h*i),l.arc(t,e,i,v-Math.PI,v),l.lineTo(s+f,a+d),l.arc(s,a,u,v,v+Math.PI)}else l.arc(t,e,i,0,A);l.closePath()}else r=1;s=t,a=e,u=i}function c(s){var a,u,c,f=s.length,d=!1;for(null==l&&(l=c=o.path()),a=0;a<=f;++a)!(a<f&&i(u=s[a],a,s))===d&&(d=!d)&&(r=0),d&&h(+t(u,a,s),+e(u,a,s),+n(u,a,s));if(c)return l=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(i=t,c):i},c.context=function(t){return arguments.length?(l=null==t?null:t,c):l},c}function F(t,e){return null!=t?t:e}const J=t=>t.x||0,Y=t=>t.y||0,$=t=>!(!1===t.defined),Q=r.arc().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),Z=r.area().x(J).y1(Y).y0(t=>(t.y||0)+(t.height||0)).defined($),K=r.area().y(Y).x1(J).x0(t=>(t.x||0)+(t.width||0)).defined($),tt=r.line().x(J).y(Y).defined($),et=X().x(J).y(Y).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>F(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>F(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>F(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>F(t.cornerRadiusBottomLeft,t.cornerRadius)||0),nt=r.symbol().type(t=>E(t.shape||"circle")).size(t=>F(t.size,64)),it=j().x(J).y(Y).defined($).size(t=>t.size||1);function rt(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function ot(t,e,n,i){return et.context(t)(e,n,i)}function st(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}var at,ut,lt,ht=A-1e-8;function ct(t){return at=t,ct}function ft(){}function dt(t,e){at.add(t,e)}function vt(t,e){dt(ut=t,lt=e)}function gt(t){dt(t,at.y1)}function pt(t){dt(at.x1,t)}function yt(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function mt(t,e,n,i,r){const o=i-t+3*e-3*n,s=t+n-2*e,a=t-e;let u,l=0,h=0;Math.abs(o)>1e-14?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,h=(-s-u)/o)):l=.5*a/s,0<l&&l<1&&r(_t(l,t,e,n,i)),0<h&&h<1&&r(_t(h,t,e,n,i))}function _t(t,e,n,i,r){const o=1-t,s=o*o,a=t*t;return s*o*e+3*s*t*n+3*o*a*i+a*t*r}ct.beginPath=ft,ct.closePath=ft,ct.moveTo=vt,ct.lineTo=vt,ct.rect=function(t,e,n,i){dt(t+n,e+i),vt(t,e)},ct.quadraticCurveTo=function(t,e,n,i){yt(ut,t,n,gt),yt(lt,e,i,pt),vt(n,i)},ct.bezierCurveTo=function(t,e,n,i,r,o){mt(ut,t,n,r,gt),mt(lt,e,i,o,pt),vt(r,o)},ct.arc=function(t,e,n,i,r,o){if(ut=n*Math.cos(r)+t,lt=n*Math.sin(r)+e,Math.abs(r-i)>ht)dt(t-n,e-n),dt(t+n,e+n);else{const s=i=>dt(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,u;if(s(i),s(r),r!==i)if((i%=A)<0&&(i+=A),(r%=A)<0&&(r+=A),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=A,a=i-i%T,u=0;u<4&&a>r;++u,a-=T)s(a);else for(a=i-i%T+T,u=0;u<4&&a<r;++u,a+=T)s(a)}};var xt=(xt=n.canvas(1,1))?xt.getContext("2d"):null;const bt=new s;function kt(t){return function(e,n){if(!xt)return!0;t(xt,e),bt.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=bt;for(let t=r;t<=s;++t)for(let e=i;e<=o;++e)if(xt.isPointInPath(e,t))return!0;return!1}}function wt(t,e){return e.contains(t.x||0,t.y||0)}function Tt(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,o=t.height||0;return e.intersects(bt.set(n,i,n+r,i+o))}function At(t,e){const n=t.x||0,i=t.y||0;return Mt(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Mt(t,e,n,i,r){const{x1:o,y1:s,x2:a,y2:u}=t,l=i-e,h=r-n;let c,f,d,v,g=0,p=1;for(v=0;v<4;++v){if(0===v&&(c=-l,f=-(o-e)),1===v&&(c=l,f=a-e),2===v&&(c=-h,f=-(s-n)),3===v&&(c=h,f=u-n),Math.abs(c)<1e-10&&f<0)return!1;if(d=f/c,c<0){if(d>p)return!1;d>g&&(g=d)}else if(c>0){if(d<g)return!1;d<p&&(p=d)}}return!0}function zt(t,e){return null==t?e:t}function Ct(t,e,n){return l(n)?function(t,e,n){const i=n.width(),r=n.height(),o=e.stops,s=o.length,a="radial"===e.gradient?t.createRadialGradient(n.x1+zt(e.x1,.5)*i,n.y1+zt(e.y1,.5)*r,Math.max(i,r)*zt(e.r1,0),n.x1+zt(e.x2,.5)*i,n.y1+zt(e.y2,.5)*r,Math.max(i,r)*zt(e.r2,.5)):t.createLinearGradient(n.x1+zt(e.x1,0)*i,n.y1+zt(e.y1,0)*r,n.x1+zt(e.x2,1)*i,n.y1+zt(e.y2,0)*r);for(let t=0;t<s;++t)a.addColorStop(o[t].offset,o[t].color);return a}(t,n,e.bounds):n}function Rt(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Ct(t,e,e.fill),!0)}var Pt=[];function Lt(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Ct(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Pt),t.lineDashOffset=e.strokeDashOffset||0),!0))}function St(t,e){return t.zindex-e.zindex||t.index-e.index}function Nt(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(St)}function Ot(t,e){var n,i,r=t.items;if(r&&r.length){var o=Nt(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}}function qt(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var o=Nt(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function Et(t){return function(e,n,i){Ot(n,(function(n){i&&!i.intersects(n.bounds)||It(t,e,n,n)}))}}function Dt(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||It(t,e,n.items[0],n.items)}}function It(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(n.fill&&Rt(e,n,r)&&e.fill(),n.stroke&&Lt(e,n,r)&&e.stroke()))}function Bt(t){return t=t||e.truthy,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,qt(n,(function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0}))}}function Vt(t,e){return function(n,i,r,o){var s,a,u=Array.isArray(i)?i[0]:i,l=null==e?u.fill:e,h=u.stroke&&n.isPointInStroke;return h&&(s=u.strokeWidth,a=u.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(l&&n.isPointInPath(r,o)||h&&n.isPointInStroke(r,o))}}function Ht(t){return Bt(Vt(t))}function Wt(t,e){return"translate("+t+","+e+")"}function Gt(t){return"rotate("+t+")"}function Ut(t){return Wt(t.x||0,t.y||0)}function Xt(t){return Wt(t.x||0,t.y||0)+(t.angle?" "+Gt(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}function jt(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=w),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",Xt(n)),t("d",e(null,n))},bound:function(t,n){var i=n.x||0,r=n.y||0;return e(ct(t),n),st(t,n).translate(i,r),n.angle&&t.rotate(n.angle*w,i,r),t},draw:Et(i),pick:Ht(i),isect:n||kt(i)}}var Ft=jt("arc",(function(t,e){return Q.context(t)(e)}));function Jt(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=Vt(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(ct(t),i),st(t,i[0]))},draw:Dt(i),pick:function(t,e,n,i,o,s){var a=e.items,u=e.bounds;return!a||!a.length||u&&!u.contains(o,s)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:wt,tip:n}}var Yt=Jt("area",(function(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?K:Z).curve(_(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",s=t.length,a=1/0;--s>=0;)!1!==t[s].defined&&(i=Math.abs(t[s][o]-r))<a&&(a=i,n=t[s]);return n}));function $t(t,e){t.beginPath(),rt(e)?ot(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}var Qt=1;function Zt(t,n,i){var r=n.clip,o=t._defs,s=n.clip_id||(n.clip_id="clip"+Qt++),a=o.clipping[s]||(o.clipping[s]={id:s});return e.isFunction(r)?a.path=r(null):rt(i)?a.path=ot(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+s+")"}function Kt(t){var e=null!=(e=t.strokeWidth)?e:1;return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function te(t,e){var n=Kt(e);t("d",ot(null,e,n,n))}function ee(t,e,n,i){var r=Kt(e);t.beginPath(),ot(t,e,(n||0)+r,(i||0)+r)}var ne=Vt(ee),ie=Vt(ee,!1);var re={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Ut(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,i=0,r=n.length;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),st(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var i=this;Ot(e,(function(e){var r=e.x||0,o=e.y||0,s=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(ee(t,e,r,o),e.fill&&Rt(t,e,a)&&t.fill(),e.stroke&&!s&&Lt(t,e,a)&&t.stroke()),t.save(),t.translate(r,o),e.clip&&$t(t,e),n&&n.translate(-r,-o),Ot(e,(function(e){i.draw(t,e,n)})),n&&n.translate(r,o),t.restore(),s&&e.stroke&&a&&(ee(t,e,r,o),Lt(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;var s=this,a=n*t.pixelRatio,u=i*t.pixelRatio;return qt(e,(function(l){var h,c,f,d,v,g,p,y,m;if((!(y=l.bounds)||y.contains(r,o))&&(d=l.x||0,v=l.y||0,g=d+(l.width||0),p=v+(l.height||0),!(m=l.clip)||!(r<d||r>g||o<d||o>p)))return t.save(),t.translate(d,v),d=r-d,v=o-v,m&&rt(l)&&!ne(t,l,a,u)?(t.restore(),null):(c=l.strokeForeground,(f=!1!==e.interactive)&&c&&l.stroke&&ie(t,l,a,u)?(t.restore(),l):(!(h=qt(l,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,d,v)?s.pick(t,n,i,d,v):null})))&&f&&(l.fill||!c&&l.stroke)&&ne(t,l,a,u)&&(h=l),t.restore(),h||null))}))},isect:Tt,content:function(t,e,n){t("clip-path",e.clip?Zt(n,e,e):null)},background:function(t,e){t("class","background"),te(t,e)},foreground:function(t,e){t("class","foreground"),e.strokeForeground?te(t,e):t("d","")}};function oe(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function se(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function ae(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function ue(t,e){return"center"===t?e/2:"right"===t?e:0}function le(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var he={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var i=oe(e,n),r=e.x||0,o=e.y||0,s=se(e,i),a=ae(e,i),u=!1===e.aspect?"none":"xMidYMid";r-=ue(e.align,s),o-=le(e.baseline,a),!i.src&&i.toDataURL?t("href",i.toDataURL(),"http://www.w3.org/1999/xlink","xlink:href"):t("href",i.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",Wt(r,o)),t("width",s),t("height",a),t("preserveAspectRatio",u)},bound:function(t,e){var n=e.image,i=e.x||0,r=e.y||0,o=se(e,n),s=ae(e,n);return i-=ue(e.align,o),r-=le(e.baseline,s),t.set(i,r,i+o,r+s)},draw:function(t,e,n){var i=this;Ot(e,(function(e){if(!n||n.intersects(e.bounds)){var r,o,s,a,u=oe(e,i),l=e.x||0,h=e.y||0,c=se(e,u),f=ae(e,u);l-=ue(e.align,c),h-=le(e.baseline,f),!1!==e.aspect&&(o=u.width/u.height,s=e.width/e.height,o==o&&s==s&&o!==s&&(s<o?(h+=(f-(a=c/o))/2,f=a):(l+=(c-(a=f*o))/2,c=a))),(u.complete||u.toDataURL)&&(t.globalAlpha=null!=(r=e.opacity)?r:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(u,l,h,c,f))}}))},pick:Bt(),isect:e.truthy,get:oe,xOffset:ue,yOffset:le},ce=Jt("line",(function(t,e){var n=e[0],i=n.interpolate||"linear";return tt.curve(_(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i<r)return t[o];return null}));function fe(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,o=e.scaleX||1,s=e.scaleY||1,a=(e.angle||0)*w,u=e.pathCache;u&&u.path===n||((e.pathCache=u=k(n)).path=n),a&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(a),N(t,u,0,0,o,s),t.rotate(-a),t.translate(-i,-r)):N(t,u,i,r,o,s)}var de={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",Xt(e)),t("d",e.path)},bound:function(t,e){return fe(ct(t),e)?t.set(0,0,0,0):st(t,e,!0),e.angle&&t.rotate(e.angle*w,e.x||0,e.y||0),t},draw:Et(fe),pick:Ht(fe),isect:kt(fe)};function ve(t,e){t.beginPath(),ot(t,e)}var ge={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",ot(null,e))},bound:function(t,e){var n,i;return st(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:Et(ve),pick:Ht(ve),isect:Tt};function pe(t,e,n){var i,r,o,s;return!(!e.stroke||!Lt(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,s=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,s),!0)}var ye={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Ut(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return st(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){Ot(e,(function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&pe(t,e,i)&&t.stroke()}}))},pick:Bt((function(t,e,n,i){return!!t.isPointInStroke&&(pe(t,e,1)&&t.isPointInStroke(n,i))})),isect:At},me=jt("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),_e=jt("symbol",(function(t,e){return nt.context(t)(e)}),wt);const xe=e.lruCache();var be={height:ze,measureWidth:Ae,estimateWidth:we,width:we,canvas:ke};function ke(t){be.width=t&&xt?Ae:we}function we(t,e){return Te(Pe(t,e),ze(t))}function Te(t,e){return~~(.8*t.length*e)}function Ae(t,e){return ze(t)<=0||!(e=Pe(t,e))?0:Me(e,Se(t))}function Me(t,e){const n=`(${e}) ${t}`;let i=xe.get(n);return void 0===i&&(xt.font=e,i=xt.measureText(t).width,xe.set(n,i)),i}function ze(t){return null!=t.fontSize?+t.fontSize||0:11}function Ce(t){return null!=t.lineHeight?t.lineHeight:ze(t)+2}function Re(t){return n=t.lineBreak&&t.text&&!e.isArray(t.text)?t.text.split(t.lineBreak):t.text,e.isArray(n)?n.length>1?n:n[0]:n;var n}function Pe(t,e){return null==e?"":t.limit>0?function(t,e){var n=+t.limit,i=e+"",r=function(t){if(be.width===Ae){const e=Se(t);return t=>Me(t,e)}{const e=ze(t);return t=>Te(t,e)}}(t);if(r(i)<n)return i;var o,s=t.ellipsis||"…",a="rtl"===t.dir,u=0,l=i.length;if(n-=r(s),a){for(;u<l;)o=u+l>>>1,r(i.slice(o))>n?u=o+1:l=o;return s+i.slice(u)}for(;u<l;)o=1+(u+l>>>1),r(i.slice(0,o))<n?u=o:l=o-1;return i.slice(0,u)+s}(t,e):e+""}function Le(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Se(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+ze(t)+"px "+Le(t,e)}function Ne(t){var e=t.baseline,n=ze(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}ke(!0);var Oe={left:"start",center:"middle",right:"end"},qe=new s;function Ee(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-T,n+=r*Math.cos(e),i+=r*Math.sin(e)),qe.x1=n,qe.y1=i,qe}function De(t,n,i){var r,o=be.height(n),s=n.align,a=Ee(n),u=a.x1,l=a.y1,h=n.dx||0,c=(n.dy||0)+Ne(n)-Math.round(.8*o),f=Re(n);if(e.isArray(f)?(o+=Ce(n)*(f.length-1),r=f.reduce((t,e)=>Math.max(t,be.width(n,e)),0)):r=be.width(n,f),"center"===s?h-=r/2:"right"===s&&(h-=r),t.set(h+=u,c+=l,h+r,c+o),n.angle&&!i)t.rotate(n.angle*w,u,l);else if(2===i)return t.rotatedPoints(n.angle*w,u,l);return t}var Ie={arc:Ft,area:Yt,group:re,image:he,line:ce,path:de,rect:ge,rule:ye,shape:me,symbol:_e,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+Ne(e),o=Ee(e),s=o.x1,a=o.y1,u=e.angle||0;t("text-anchor",Oe[e.align]||"start"),u?(n=Wt(s,a)+" "+Gt(u),(i||r)&&(n+=" "+Wt(i,r))):n=Wt(s+i,a+r),t("transform",n)},bound:De,draw:function(t,n,i){Ot(n,(function(n){var r,o,s,a,u,l,h,c=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===c||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=Se(n),t.textAlign=n.align||"left",o=(r=Ee(n)).x1,s=r.y1,n.angle&&(t.save(),t.translate(o,s),t.rotate(n.angle*w),o=s=0),o+=n.dx||0,s+=(n.dy||0)+Ne(n),l=Re(n),e.isArray(l))for(u=Ce(n),a=0;a<l.length;++a)h=Pe(n,l[a]),n.fill&&Rt(t,n,c)&&t.fillText(h,o,s),n.stroke&&Lt(t,n,c)&&t.strokeText(h,o,s),s+=u;else h=Pe(n,l),n.fill&&Rt(t,n,c)&&t.fillText(h,o,s),n.stroke&&Lt(t,n,c)&&t.strokeText(h,o,s);n.angle&&t.restore()}}))},pick:Bt((function(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var s=Ee(e),a=s.x1,u=s.y1,l=De(qe,e,1),h=-e.angle*w,c=Math.cos(h),f=Math.sin(h),d=c*r-f*o+(a-c*a+f*u),v=f*r+c*o+(u-f*a-c*u);return l.contains(d,v)})),isect:function(t,e){var n=De(qe,t,2);return Mt(e,n[0],n[1],n[2],n[3])||Mt(e,n[0],n[1],n[4],n[5])||Mt(e,n[4],n[5],n[6],n[7])||Mt(e,n[2],n[3],n[6],n[7])}},trail:Jt("trail",(function(t,e){return it.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function Be(t,e,n){var i=Ie[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new s),t,n)}var Ve={mark:null};function He(t,e,n){var i,r,o,a,u=Ie[t.marktype],l=u.bound,h=t.items,c=h&&h.length;if(u.nested)return c?o=h[0]:(Ve.mark=t,o=Ve),a=Be(o,l,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new s,c)for(i=0,r=h.length;i<r;++i)e.union(Be(h[i],l,n));return t.bounds=e}var We=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant"];function Ge(t,e){return JSON.stringify(t,We,e)}function Ue(t){return function t(e){var n,i,r,o=e.marktype,s=e.items;if(s)for(i=0,r=s.length;i<r;++i)n=o?"mark":"group",s[i][n]=e,s[i].zindex&&(s[i][n].zdirty=!0),"group"===(o||n)&&t(s[i]);o&&He(e);return e}("string"==typeof t?JSON.parse(t):t)}function Xe(t){arguments.length?this.root=Ue(t):(this.root=Fe({marktype:"group",name:"root",role:"frame"}),this.root.items=[new d(this.root)])}var je=Xe.prototype;function Fe(t,e){return{bounds:new s,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function Je(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Ye(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function $e(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=Je(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function Qe(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function Ze(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Ke(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function tn(t,e){this._active=null,this._handlers={},this._loader=t||i.loader(),this._tooltip=e||en}function en(t,e,n,i){t.element().setAttribute("title",i||"")}je.toJSON=function(t){return Ge(this.root,t||0)},je.mark=function(t,e,n){var i=Fe(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};var nn=tn.prototype;function rn(t){this._el=null,this._bgcolor=null,this._loader=new v(t)}nn.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},nn.element=function(){return this._el},nn.canvas=function(){return this._el&&this._el.firstChild},nn.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},nn.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},nn.on=function(){},nn.off=function(){},nn._handlerIndex=function(t,e,n){for(var i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},nn.handlers=function(t){var e,n=this._handlers,i=[];if(t)i.push.apply(i,n[this.eventName(t)]);else for(e in n)i.push.apply(i,n[e]);return i},nn.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},nn.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),i=Je(null,"a");for(var r in e)i.setAttribute(r,e[r]);i.dispatchEvent(n)})).catch((function(){}))},nn.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,s=t&&t.mark;if(s&&(r=Ie[s.marktype]).tip){for((o=Ke(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(s.items,o)}return t}(e,t,this.canvas(),this._origin);var i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},nn.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.x1+i[0]+n.left,s=r.y1+i[1]+n.top,a=r.width(),u=r.height();t.mark&&(t=t.mark.group);)o+=t.x||0,s+=t.y||0;return{x:o,y:s,width:a,height:u,left:o,top:s,right:o+a,bottom:s+u}}};var on=rn.prototype;on.initialize=function(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},on.element=function(){return this._el},on.canvas=function(){return this._el&&this._el.firstChild},on.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},on.resize=function(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},on.dirty=function(){},on.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},on._render=function(){},on.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},on._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then((function(t){t&&r(),n._ready=null}))}return i},on.sanitizeURL=function(t){return this._load("sanitizeURL",t)},on.loadImage=function(t){return this._load("loadImage",t)};function sn(t,e){tn.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var an=e.inherits(sn,tn);function un(t,e,n){return function(i){var r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function ln(t){return function(e){this.fire(t,e),this._active=null}}an.initialize=function(t,e,n){var i=this._canvas=t&&Ye(t,"canvas");if(i){var r=this;this.events.forEach((function(t){i.addEventListener(t,(function(e){an[t]?an[t].call(r,e):r.fire(t,e)}))}))}return tn.prototype.initialize.call(this,t,e,n)},an.canvas=function(){return this._canvas},an.context=function(){return this._canvas.getContext("2d")},an.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],an.DOMMouseScroll=function(t){this.fire("mousewheel",t)},an.mousemove=un("mousemove","mouseover","mouseout"),an.dragover=un("dragover","dragenter","dragleave"),an.mouseout=ln("mouseout"),an.dragleave=ln("dragleave"),an.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},an.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},an.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},an.touchmove=function(t){this.fire("touchmove",t,!0)},an.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},an.fire=function(t,e,n){var i,r,o=n?this._touch:this._active,s=this._handlers[t];if(e.vegaType=t,"click"===t&&o&&o.href?this.handleHref(e,o,o.href):"mousemove"!==t&&"mouseout"!==t||this.handleTooltip(e,o,"mouseout"!==t),s)for(i=0,r=s.length;i<r;++i)s[i].handler.call(this._obj,e,o)},an.on=function(t,e){var n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(i[n]||(i[n]=[])).push({type:t,handler:e}),this},an.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},an.pickEvent=function(t){var e=Ke(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},an.pick=function(t,e,n,i,r){var o=this.context();return Ie[t.marktype].pick.call(this,o,t,e,n,i,r)};var hn="undefined"!=typeof window&&window.devicePixelRatio||1;function cn(t){rn.call(this,t),this._redraw=!1,this._dirty=new s}var fn=e.inherits(cn,rn),dn=rn.prototype,vn=new s;function gn(t,e,n){return vn.set(0,0,e,n).translate(-t[0],-t[1])}function pn(t,e){tn.call(this,t,e);var n=this;n._hrefHandler=mn(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=mn(n,(function(t,e){n.handleTooltip(t,e,"mouseout"!==t.type)}))}fn.initialize=function(t,e,i,r,o,s){return this._options=s,this._canvas=n.canvas(1,1,s&&s.type),t&&(Qe(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),dn.initialize.call(this,t,e,i,r,o)},fn.resize=function(t,e,n,i){return dn.resize.call(this,t,e,n,i),function(t,e,n,i,r,o){var s,a="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,u=t.getContext("2d"),l=a?hn:r;for(s in t.width=e*l,t.height=n*l,o)u[s]=o[s];a&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),u.pixelRatio=l,u.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},fn.canvas=function(){return this._canvas},fn.context=function(){return this._canvas?this._canvas.getContext("2d"):null},fn.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=vn.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},fn._render=function(t){var e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty;return e.save(),this._redraw||o.empty()?(this._redraw=!1,o=gn(n,i,r).expand(1)):o=function(t,e,n){return e.expand(1).round(),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,o.intersect(gn(n,i,r)),n),this.clear(-n[0],-n[1],i,r),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},fn.draw=function(t,n,i){var r=Ie[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):$t(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},fn.clear=function(t,e,n,i){var r=this.context();r.clearRect(t,e,n,i),null!=this._bgcolor&&(r.fillStyle=this._bgcolor,r.fillRect(t,e,n,i))};var yn=e.inherits(pn,tn);function mn(t,e){return function(n){var i=n.target.__data__;n.vegaType=n.type,i=Array.isArray(i)?i[0]:i,e.call(t._obj,n,i)}}function _n(t,e,n){var i,r,o="<"+t;if(e)for(i in e)null!=(r=e[i])&&(o+=" "+i+'="'+r+'"');return n&&(o+=" "+n),o+">"}function xn(t){return"</"+t+">"}yn.initialize=function(t,e,n){var i=this._svg;return i&&(i.removeEventListener("click",this._hrefHandler),i.removeEventListener("mousemove",this._tooltipHandler),i.removeEventListener("mouseout",this._tooltipHandler)),this._svg=i=t&&Ye(t,"svg"),i&&(i.addEventListener("click",this._hrefHandler),i.addEventListener("mousemove",this._tooltipHandler),i.addEventListener("mouseout",this._tooltipHandler)),tn.prototype.initialize.call(this,t,e,n)},yn.canvas=function(){return this._svg},yn.on=function(t,e){var n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){var r={type:t,handler:e,listener:mn(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},yn.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this};var bn={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},kn={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},wn=Object.keys(kn),Tn=bn.xmlns;function An(t){rn.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var Mn=e.inherits(An,rn),zn=rn.prototype;function Cn(t,e,n){var i,r,o;if("radial"===e.gradient){var s=$e(t,n++,"pattern",Tn);s.setAttribute("id","p_"+e.id),s.setAttribute("viewBox","0,0,1,1"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("preserveAspectRatio","xMidYMid slice"),(s=$e(s,0,"rect",Tn)).setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","url("+Dn()+"#"+e.id+")"),(t=$e(t,n++,"radialGradient",Tn)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=$e(t,n++,"linearGradient",Tn)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(i=0,r=e.stops.length;i<r;++i)(o=$e(t,i,"stop",Tn)).setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return Qe(t,i),n}function Rn(t,e,n){var i;return(t=$e(t,n,"clipPath",Tn)).setAttribute("id",e.id),e.path?(i=$e(t,0,"path",Tn)).setAttribute("d",e.path):((i=$e(t,0,"rect",Tn)).setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)),Qe(t,1),n+1}function Pn(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function Ln(t,e,n,i,r){var o,s=t._svg;if(!s&&(s=Je(o=e.ownerDocument,i,Tn),t._svg=s,t.mark&&(s.__data__=t,s.__values__={fill:"default"},"g"===i))){var a=Je(o,"path",Tn);s.appendChild(a),a.__data__=t;var u=Je(o,"g",Tn);s.appendChild(u),u.__data__=t;var l=Je(o,"path",Tn);s.appendChild(l),l.__data__=t,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(s,n))&&e.insertBefore(s,n?n.nextSibling:e.firstChild),s}Mn.initialize=function(t,e,n,i){return t&&(this._svg=$e(t,0,"svg",Tn),this._svg.setAttribute("class","marks"),Qe(t,1),this._root=$e(this._svg,0,"g",Tn),Qe(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),zn.initialize.call(this,t,e,n,i)},Mn.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),zn.background.apply(this,arguments)},Mn.resize=function(t,e,n,i){return zn.resize.call(this,t,e,n,i),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},Mn.canvas=function(){return this._svg},Mn.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in bn)t[e]=bn[e];var n=this._bgcolor?_n("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+xn("rect"):"";return _n("svg",t)+n+this._svg.innerHTML+xn("svg")},Mn._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Qe(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},Mn.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,r=0;for(t in n.gradient)i||(n.el=i=$e(e,0,"defs",Tn)),r=Cn(i,n.gradient[t],r);for(t in n.clipping)i||(n.el=i=$e(e,0,"defs",Tn)),r=Rn(i,n.clipping[t],r);i&&(0===r?(e.removeChild(i),n.el=null):Qe(i,r))},Mn._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},Mn.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},Mn.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},Mn._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,i,r,o,s,a,u=++this._dirtyID;for(o=0,s=t.length;o<s;++o)(n=(e=t[o]).mark).marktype!==i&&(i=n.marktype,r=Ie[i]),n.zdirty&&n.dirty!==u&&(this._dirtyAll=!1,Pn(e,u),n.items.forEach((function(t){t.dirty=u}))),n.zdirty||(e.exit?(r.nested&&n.items.length?(a=n.items[0])._svg&&this._update(r,a._svg,a):e._svg&&(a=e._svg.parentNode)&&a.removeChild(e._svg),e._svg=null):(e=r.nested?n.items[0]:e)._update!==u&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,Pn(e,u)),e._update=u));return!this._dirtyAll},Mn.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var i,r=this,o=this._svg,s=Ie[e.marktype],a=!1===e.interactive?"none":null,u="g"===s.tag,l=null,h=0;function c(t){var e=r.isDirty(t),n=Ln(t,i,l,s.tag,o);e&&(r._update(s,n,t),u&&function(t,e,n){e=e.lastChild.previousSibling;var i,r=0;Ot(n,(function(n){i=t.draw(e,n,i),++r})),Qe(e,1+r)}(r,n,t)),l=n,++h}return(i=Ln(e,t,n,"g",o)).setAttribute("class",Ze(e)),u||i.style.setProperty("pointer-events",a),e.clip?i.setAttribute("clip-path",Zt(r,e,e.group)):i.removeAttribute("clip-path"),s.nested?e.items.length&&c(e.items[0]):Ot(e,c),Qe(i,h),i};var Sn=null,Nn=null,On={group:function(t,e,n){var i,r;Sn=i=e.childNodes[2],Nn=i.__values__,t.foreground(En,n,this),Nn=e.__values__,Sn=e.childNodes[1],t.content(En,n,this),Sn=r=e.childNodes[0],t.background(En,n,this);var o=!1===n.mark.interactive?"none":null;if(o!==Nn.events&&(i.style.setProperty("pointer-events",o),r.style.setProperty("pointer-events",o),Nn.events=o),n.strokeForeground&&n.stroke){const t=n.fill;i.style.removeProperty("display"),this.style(r,n),r.style.removeProperty("stroke"),t&&(n.fill=null),Nn=i.__values__,this.style(i,n),t&&(n.fill=t),Sn=null}else i.style.setProperty("display","none"),i.style.setProperty("fill","none")},image:function(t,e,n){!1===n.smooth?(qn(e,"image-rendering","optimizeSpeed"),qn(e,"image-rendering","pixelated")):qn(e,"image-rendering",null)},text:function(t,n,i){var r,o,s,a,u=Re(i);e.isArray(u)?(r=(o=u.map(t=>Pe(i,t))).join("\n"))!==Nn.text&&(Qe(n,0),s=n.ownerDocument,a=Ce(i),o.forEach((t,e)=>{const r=Je(s,"tspan",Tn);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",a)),n.appendChild(r)}),Nn.text=r):(o=Pe(i,u))!==Nn.text&&(n.textContent=o,Nn.text=o),qn(n,"font-family",Le(i)),qn(n,"font-size",ze(i)+"px"),qn(n,"font-style",i.fontStyle),qn(n,"font-variant",i.fontVariant),qn(n,"font-weight",i.fontWeight)}};function qn(t,e,n){n!==Nn[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),Nn[e]=n)}function En(t,e,n){e!==Nn[t]&&(null!=e?n?Sn.setAttributeNS(n,t,e):Sn.setAttribute(t,e):n?Sn.removeAttributeNS(n,t):Sn.removeAttribute(t),Nn[t]=e)}function Dn(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function In(t){rn.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}Mn._update=function(t,e,n){Sn=e,Nn=e.__values__,t.attr(En,n,this);var i=On[t.type];i&&i.call(this,t,e,n),Sn&&this.style(Sn,n)},Mn.style=function(t,e){var n,i,r,o,s;if(null!=e)for(n=0,i=wn.length;n<i;++n)s=e[r=wn[n]],"font"===r&&(s=Le(e)),s!==Nn[r]&&(o=kn[r],null==s?"fill"===o?t.style.setProperty(o,"none"):t.style.removeProperty(o):(l(s)&&(s=h(s,this._defs.gradient,Dn())),t.style.setProperty(o,s+"")),Nn[r]=s)};var Bn,Vn=e.inherits(In,rn),Hn=rn.prototype;function Wn(t,e,n,i){Bn[i||t]=e}function Gn(t,e,n,i){if(null==t)return"";var r,o,s,a,u,c="";for("bgrect"===n&&!1===e.interactive&&(c+="pointer-events: none; "),"bgfore"===n&&(!1===e.interactive&&(c+="pointer-events: none; "),c+="display: none; "),"image"===n&&!1===t.smooth&&(c+="image-rendering: optimizeSpeed; image-rendering: pixelated; "),"text"===n&&(c+="font-family: "+Le(t)+"; ",c+="font-size: "+ze(t)+"px; ",t.fontStyle&&(c+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(c+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(c+="font-weight: "+t.fontWeight+"; ")),r=0,o=wn.length;r<o;++r)s=wn[r],a=kn[s],null==(u=t[s])?"fill"===a&&(c+="fill: none; "):"transparent"!==u||"fill"!==a&&"stroke"!==a?(l(u)&&(u=h(u,i.gradient,"")),c+=a+": "+u+"; "):c+=a+": none; ";return c?'style="'+c.trim()+'"':null}function Un(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Vn.resize=function(t,e,n,i){Hn.resize.call(this,t,e,n,i);var r=this._origin,o=this._text,s={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var a in bn)s[a]=bn[a];o.head=_n("svg",s);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),o.bg=u?_n("rect",{width:this._width,height:this._height,style:"fill: "+u+";"})+xn("rect"):"",o.root=_n("g",{transform:"translate("+r+")"}),o.foot=xn("g")+xn("svg"),this},Vn.background=function(){var t=Hn.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},Vn.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},Vn._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},Vn.buildDefs=function(){var t,e,n,i,r,o=this._defs,s="";for(e in o.gradient){for(r=(n=o.gradient[e]).stops,"radial"===n.gradient?(s+=_n(i="pattern",{id:"p_"+e,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s+=_n("rect",{width:"1",height:"1",fill:"url(#"+e+")"})+xn("rect"),s+=xn(i),s+=_n(i="radialGradient",{id:e,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):s+=_n(i="linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<r.length;++t)s+=_n("stop",{offset:r[t].offset,"stop-color":r[t].color})+xn("stop");s+=xn(i)}for(e in o.clipping)n=o.clipping[e],s+=_n("clipPath",{id:e}),n.path?s+=_n("path",{d:n.path})+xn("path"):s+=_n("rect",{x:0,y:0,width:n.width,height:n.height})+xn("rect"),s+=xn("clipPath");return s.length>0?_n("defs")+s+xn("defs"):""},Vn.attributes=function(t,e){return Bn={},t(Wn,e,this),Bn},Vn.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then((function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t}))}return null},Vn.mark=function(t){var n,i=this,r=Ie[t.marktype],o=r.tag,s=this._defs,a="";function u(u){var l=i.href(u);if(l&&(a+=_n("a",l)),n="g"!==o?Gn(u,t,o,s):null,a+=_n(o,i.attributes(r.attr,u),n),"text"===o){const t=Re(u);if(e.isArray(t)){const e={x:0,dy:Ce(u)};for(let n=0;n<t.length;++n)a+=_n("tspan",n?e:null)+Un(Pe(u,t[n]))+xn("tspan")}else a+=Un(Pe(u,t))}else if("g"===o){const e=u.strokeForeground,n=u.fill,o=u.stroke;e&&o&&(u.stroke=null),a+=_n("path",i.attributes(r.background,u),Gn(u,t,"bgrect",s))+xn("path"),a+=_n("g",i.attributes(r.content,u))+i.markGroup(u)+xn("g"),e&&o?(n&&(u.fill=null),u.stroke=o,a+=_n("path",i.attributes(r.foreground,u),Gn(u,t,"bgrect",s))+xn("path"),n&&(u.fill=n)):a+=_n("path",i.attributes(r.foreground,u),Gn({},t,"bgfore",s))+xn("path")}a+=xn(o),l&&(a+=xn("a"))}return"g"!==o&&!1===t.interactive&&(n='style="pointer-events: none;"'),a+=_n("g",{class:Ze(t),"clip-path":t.clip?Zt(i,t,t.group):null},n),r.nested?t.items&&t.items.length&&u(t.items[0]):Ot(t,u),a+xn("g")},Vn.markGroup=function(t){var e=this,n="";return Ot(t,(function(t){n+=e.mark(t)})),n};var Xn={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},jn={};function Fn(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,s=r.length;let a=0;if("group"===o)for(;a<s;++a)Jn(r[a],e,n,i);else for(const t=Ie[o].isect;a<s;++a){let n=r[a];Yn(n,e,t)&&i.push(n)}}return i}function Jn(t,e,n,i){n&&n(t.mark)&&Yn(t,e,Ie.group.isect)&&i.push(t);const r=t.items,o=r&&r.length;if(o){const s=t.x||0,a=t.y||0;e.translate(-s,-a);for(let t=0;t<o;++t)Fn(r[t],e,n,i);e.translate(s,a)}return i}function Yn(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}jn.canvas=jn.png={renderer:cn,headless:cn,handler:sn},jn.svg={renderer:An,headless:In,handler:pn},jn.none={};var $n=new s;function Qn(t,n,i){return t===n||("path"===i?Zn(t,n):t instanceof Date&&n instanceof Date?+t==+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=1e-9:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&function(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!Qn(t[n],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function Zn(t,e){return Qn(k(t),k(e))}t.Bounds=s,t.CanvasHandler=sn,t.CanvasRenderer=cn,t.Gradient=function(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=d,t.Handler=tn,t.Item=f,t.Marks=Ie,t.RenderType=Xn,t.Renderer=rn,t.ResourceLoader=v,t.SVGHandler=pn,t.SVGRenderer=An,t.SVGStringRenderer=In,t.Scenegraph=Xe,t.boundClip=function(t){var n=t.clip;if(e.isFunction(n))n(ct($n.clear()));else{if(!n)return;$n.set(0,0,t.group.width,t.group.height)}t.bounds.intersect($n)},t.boundContext=ct,t.boundItem=Be,t.boundMark=He,t.boundStroke=st,t.closeTag=xn,t.domChild=$e,t.domClear=Qe,t.domCreate=Je,t.domFind=Ye,t.font=Se,t.fontFamily=Le,t.fontSize=ze,t.intersect=function(t,n,i){const r=[],o=(new s).union(n),a=t.marktype;return a?Fn(t,o,i,r):"group"===a?Jn(t,o,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=Mt,t.intersectPath=kt,t.intersectPoint=wt,t.intersectRule=At,t.lineHeight=Ce,t.multiLineOffset=function(t){const n=Re(t);return(e.isArray(n)?n.length-1:0)*Ce(t)},t.openTag=_n,t.pathCurves=_,t.pathEqual=Zn,t.pathParse=k,t.pathRectangle=X,t.pathRender=N,t.pathSymbols=E,t.pathTrail=j,t.point=Ke,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(jn[t]=e,this):jn[t]},t.resetSVGClipId=function(){Qt=1},t.sceneEqual=Qn,t.sceneFromJSON=Ue,t.scenePickVisit=qt,t.sceneToJSON=Ge,t.sceneVisit=Ot,t.sceneZOrder=Nt,t.textMetrics=be,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-canvas"),require("vega-loader"),require("d3-shape"),require("d3-path")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-canvas","vega-loader","d3-shape","d3-path"],e):e((t=t||self).vega={},t.vega,t.vega,t.vega,t.d3,t.d3)}(this,(function(t,e,n,i,r,o){"use strict";function s(t){this.clear(),t&&this.union(t)}var a=s.prototype;a.clone=function(){return new s(this)},a.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},a.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},a.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},a.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},a.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},a.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},a.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},a.scale=function(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},a.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},a.rotate=function(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},a.rotatedPoints=function(t,e,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),u=e-e*a+n*l,h=n-e*l-n*a;return[a*i-l*r+u,l*i+a*r+h,a*i-l*s+u,l*i+a*s+h,a*o-l*r+u,l*o+a*r+h,a*o-l*s+u,l*o+a*s+h]},a.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},a.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},a.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},a.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},a.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},a.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},a.width=function(){return this.x2-this.x1},a.height=function(){return this.y2-this.y1};var l=0;function u(t){return t&&t.gradient}function h(t,e,n){let i=t.id,r=t.gradient,o="radial"===r?"p_":"";return i||(i=t.id="gradient_"+l++,"radial"===r?(t.x1=c(t.x1,.5),t.y1=c(t.y1,.5),t.r1=c(t.r1,0),t.x2=c(t.x2,.5),t.y2=c(t.y2,.5),t.r2=c(t.r2,.5),o="p_"):(t.x1=c(t.x1,0),t.y1=c(t.y1,0),t.x2=c(t.x2,1),t.y2=c(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function c(t,e){return null!=t?t:e}function f(t){this.mark=t,this.bounds=this.bounds||new s}function d(t){f.call(this,t),this.items=this.items||[]}function v(t){this._pending=0,this._loader=t||i.loader()}e.inherits(d,f);var g=v.prototype;function p(t){t._pending+=1}function y(t){t._pending-=1}g.pending=function(){return this._pending},g.sanitizeURL=function(t){var e=this;return p(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return y(e),t})).catch((function(){return y(e),null}))},g.loadImage=function(t){const i=this,r=n.image();return p(i),i._loader.sanitize(t,{context:"image"}).then((function(t){const n=t.href;if(!n||!r)throw{url:n};const o=new r,s=e.hasOwnProperty(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=s&&(o.crossOrigin=s),o.onload=()=>y(i),o.onerror=()=>y(i),o.src=n,o})).catch((function(t){return y(i),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},g.ready=function(){var t=this;return new Promise((function(e){!function n(i){t.pending()?setTimeout((function(){n(!0)}),10):e(i)}(!1)}))};var m={basis:{curve:r.curveBasis},"basis-closed":{curve:r.curveBasisClosed},"basis-open":{curve:r.curveBasisOpen},bundle:{curve:r.curveBundle,tension:"beta",value:.85},cardinal:{curve:r.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:r.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:r.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:r.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:r.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:r.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:r.curveLinear},"linear-closed":{curve:r.curveLinearClosed},monotone:{horizontal:r.curveMonotoneY,vertical:r.curveMonotoneX},natural:{curve:r.curveNatural},step:{curve:r.curveStep},"step-after":{curve:r.curveStepAfter},"step-before":{curve:r.curveStepBefore}};function _(t,n,i){var r=e.hasOwnProperty(m,t)&&m[t],o=null;return r&&(o=r.curve||r[n||"vertical"],r.tension&&null!=i&&(o=o[r.tension](i))),o}var x={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},b=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function k(t){var e,n,i,r,o,s,a,l,u,h,c,f=[];for(l=0,h=(e=t.slice().replace(b[0],"###$1").split(b[1]).slice(1)).length;l<h;++l){for(i=(n=e[l]).slice(1).trim().replace(b[2],"$1###$2").split(b[3]),r=[s=n.charAt(0)],u=0,c=i.length;u<c;++u)(o=+i[u])===o&&r.push(o);if(a=x[s.toLowerCase()],r.length-1>a)for(u=1,c=r.length;u<c;u+=a)f.push([s].concat(r.slice(u,u+a)));else f.push(r)}return f}const w=Math.PI/180,T=Math.PI/2,A=2*Math.PI,M=Math.sqrt(3)/2;var C={},z={},R=[].join;function P(t){var e=R.call(t);if(z[e])return z[e];var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],u=t[7],h=u*s,c=-l*a,f=l*s,d=u*a,v=Math.cos(r),g=Math.sin(r),p=Math.cos(o),y=Math.sin(o),m=.5*(o-r),_=Math.sin(.5*m),x=8/3*_*_/Math.sin(m),b=n+v-x*g,k=i+g+x*v,w=n+p,T=i+y,A=w+x*y,M=T-x*p;return z[e]=[h*b+c*k,f*b+d*k,h*A+c*M,f*A+d*M,h*w+c*T,f*w+d*T]}var L=["l",0,0,0,0,0,0,0];function S(t,e,n){var i=L[0]=t[0];if("a"===i||"A"===i)L[1]=e*t[1],L[2]=n*t[2],L[3]=t[3],L[4]=t[4],L[5]=t[5],L[6]=e*t[6],L[7]=n*t[7];else if("h"===i||"H"===i)L[1]=e*t[1];else if("v"===i||"V"===i)L[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)L[r]=(r%2==1?e:n)*t[r];return L}function O(t,e,n,i,r,o){var s,a,l,u,h,c=null,f=0,d=0,v=0,g=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),t.beginPath&&t.beginPath();for(var p=0,y=e.length;p<y;++p){switch(s=e[p],1===r&&1===o||(s=S(s,r,o)),s[0]){case"l":f+=s[1],d+=s[2],t.lineTo(f+n,d+i);break;case"L":f=s[1],d=s[2],t.lineTo(f+n,d+i);break;case"h":f+=s[1],t.lineTo(f+n,d+i);break;case"H":f=s[1],t.lineTo(f+n,d+i);break;case"v":d+=s[1],t.lineTo(f+n,d+i);break;case"V":d=s[1],t.lineTo(f+n,d+i);break;case"m":f+=s[1],d+=s[2],t.moveTo(f+n,d+i);break;case"M":f=s[1],d=s[2],t.moveTo(f+n,d+i);break;case"c":a=f+s[5],l=d+s[6],v=f+s[3],g=d+s[4],t.bezierCurveTo(f+s[1]+n,d+s[2]+i,v+n,g+i,a+n,l+i),f=a,d=l;break;case"C":f=s[5],d=s[6],v=s[3],g=s[4],t.bezierCurveTo(s[1]+n,s[2]+i,v+n,g+i,f+n,d+i);break;case"s":a=f+s[3],l=d+s[4],v=2*f-v,g=2*d-g,t.bezierCurveTo(v+n,g+i,f+s[1]+n,d+s[2]+i,a+n,l+i),v=f+s[1],g=d+s[2],f=a,d=l;break;case"S":a=s[3],l=s[4],v=2*f-v,g=2*d-g,t.bezierCurveTo(v+n,g+i,s[1]+n,s[2]+i,a+n,l+i),f=a,d=l,v=s[1],g=s[2];break;case"q":a=f+s[3],l=d+s[4],v=f+s[1],g=d+s[2],t.quadraticCurveTo(v+n,g+i,a+n,l+i),f=a,d=l;break;case"Q":a=s[3],l=s[4],t.quadraticCurveTo(s[1]+n,s[2]+i,a+n,l+i),f=a,d=l,v=s[1],g=s[2];break;case"t":a=f+s[1],l=d+s[2],null===c[0].match(/[QqTt]/)?(v=f,g=d):"t"===c[0]?(v=2*f-u,g=2*d-h):"q"===c[0]&&(v=2*f-v,g=2*d-g),u=v,h=g,t.quadraticCurveTo(v+n,g+i,a+n,l+i),d=l,v=(f=a)+s[1],g=d+s[2];break;case"T":a=s[1],l=s[2],v=2*f-v,g=2*d-g,t.quadraticCurveTo(v+n,g+i,a+n,l+i),f=a,d=l;break;case"a":N(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+f+n,s[7]+d+i]),f+=s[6],d+=s[7];break;case"A":N(t,f+n,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),f=s[6],d=s[7];break;case"z":case"Z":t.closePath()}c=s}}function N(t,e,n,i){for(var r=function(t,e,n,i,r,o,s,a,l){var u=R.call(arguments);if(C[u])return C[u];var h=s*w,c=Math.sin(h),f=Math.cos(h),d=f*(a-t)*.5+c*(l-e)*.5,v=f*(l-e)*.5-c*(a-t)*.5,g=d*d/((n=Math.abs(n))*n)+v*v/((i=Math.abs(i))*i);g>1&&(n*=g=Math.sqrt(g),i*=g);var p=f/n,y=c/n,m=-c/i,_=f/i,x=p*a+y*l,b=m*a+_*l,k=p*t+y*e,M=m*t+_*e,z=(k-x)*(k-x)+(M-b)*(M-b),P=1/z-.25;P<0&&(P=0);var L=Math.sqrt(P);o==r&&(L=-L);var S=.5*(x+k)-L*(M-b),O=.5*(b+M)+L*(k-x),N=Math.atan2(b-O,x-S),q=Math.atan2(M-O,k-S),E=q-N;E<0&&1===o?E+=A:E>0&&0===o&&(E-=A);for(var D=Math.ceil(Math.abs(E/(T+.001))),I=[],B=0;B<D;++B){var V=N+B*E/D,H=N+(B+1)*E/D;I[B]=[S,O,V,H,n,i,c,f]}return C[u]=I}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var s=P(r[o]);t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}var q={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,A)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/7,r=n/2.5,o=n/8;t.moveTo(-i,n),t.lineTo(i,n),t.lineTo(i,-o),t.lineTo(r,-o),t.lineTo(0,-n),t.lineTo(-r,-o),t.lineTo(-i,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n,r=i-.5773502691896257*n,o=n/4;t.moveTo(0,-i-r),t.lineTo(-o,i-r),t.lineTo(o,i-r),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n,r=i-.5773502691896257*n;t.moveTo(0,-i-r),t.lineTo(-n,i-r),t.lineTo(n,i-r),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=M*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function E(t){return e.hasOwnProperty(q,t)?q[t]:function(t){if(!e.hasOwnProperty(D,t)){var n=k(t);D[t]={draw:function(t,e){O(t,n,0,0,Math.sqrt(e)/2)}}}return D[t]}(t)}var D={};const I=.448084975506;function B(t){return t.x}function V(t){return t.y}function H(t){return t.width}function G(t){return t.height}function W(t){return"function"==typeof t?t:()=>+t}function U(t,e,n){return Math.max(e,Math.min(t,n))}function X(){var t=B,e=V,n=H,i=G,r=W(0),s=r,a=r,l=r,u=null;function h(h,c,f){var d,v=null!=c?c:+t.call(this,h),g=null!=f?f:+e.call(this,h),p=+n.call(this,h),y=+i.call(this,h),m=Math.min(p,y)/2,_=U(+r.call(this,h),0,m),x=U(+s.call(this,h),0,m),b=U(+a.call(this,h),0,m),k=U(+l.call(this,h),0,m);if(u||(u=d=o.path()),_<=0&&x<=0&&b<=0&&k<=0)u.rect(v,g,p,y);else{var w=v+p,T=g+y;u.moveTo(v+_,g),u.lineTo(w-x,g),u.bezierCurveTo(w-I*x,g,w,g+I*x,w,g+x),u.lineTo(w,T-k),u.bezierCurveTo(w,T-I*k,w-I*k,T,w-k,T),u.lineTo(v+b,T),u.bezierCurveTo(v+I*b,T,v,T-I*b,v,T-b),u.lineTo(v,g+_),u.bezierCurveTo(v,g+I*_,v+I*_,g,v+_,g),u.closePath()}if(d)return u=null,d+""||null}return h.x=function(e){return arguments.length?(t=W(e),h):t},h.y=function(t){return arguments.length?(e=W(t),h):e},h.width=function(t){return arguments.length?(n=W(t),h):n},h.height=function(t){return arguments.length?(i=W(t),h):i},h.cornerRadius=function(t,e,n,i){return arguments.length?(r=W(t),s=null!=e?W(e):r,l=null!=n?W(n):r,a=null!=i?W(i):s,h):r},h.context=function(t){return arguments.length?(u=null==t?null:t,h):u},h}function j(){var t,e,n,i,r,s,a,l,u=null;function h(t,e,n){var i=n/2;if(r){var o=a-e,h=t-s;if(o||h){var c=Math.sqrt(o*o+h*h),f=(o/=c)*l,d=(h/=c)*l,v=Math.atan2(h,o);u.moveTo(s-f,a-d),u.lineTo(t-o*i,e-h*i),u.arc(t,e,i,v-Math.PI,v),u.lineTo(s+f,a+d),u.arc(s,a,l,v,v+Math.PI)}else u.arc(t,e,i,0,A);u.closePath()}else r=1;s=t,a=e,l=i}function c(s){var a,l,c,f=s.length,d=!1;for(null==u&&(u=c=o.path()),a=0;a<=f;++a)!(a<f&&i(l=s[a],a,s))===d&&(d=!d)&&(r=0),d&&h(+t(l,a,s),+e(l,a,s),+n(l,a,s));if(c)return u=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(i=t,c):i},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function F(t,e){return null!=t?t:e}const J=t=>t.x||0,Y=t=>t.y||0,$=t=>!(!1===t.defined),Q=r.arc().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),Z=r.area().x(J).y1(Y).y0(t=>(t.y||0)+(t.height||0)).defined($),K=r.area().y(Y).x1(J).x0(t=>(t.x||0)+(t.width||0)).defined($),tt=r.line().x(J).y(Y).defined($),et=X().x(J).y(Y).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>F(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>F(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>F(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>F(t.cornerRadiusBottomLeft,t.cornerRadius)||0),nt=r.symbol().type(t=>E(t.shape||"circle")).size(t=>F(t.size,64)),it=j().x(J).y(Y).defined($).size(t=>t.size||1);function rt(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function ot(t,e,n,i){return et.context(t)(e,n,i)}function st(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const i=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(i+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,i):0))}return t}var at,lt,ut,ht=A-1e-8;function ct(t){return at=t,ct}function ft(){}function dt(t,e){at.add(t,e)}function vt(t,e){dt(lt=t,ut=e)}function gt(t){dt(t,at.y1)}function pt(t){dt(at.x1,t)}function yt(t,e,n,i){const r=(t-e)/(t+n-2*e);0<r&&r<1&&i(t+(e-t)*r)}function mt(t,e,n,i,r){const o=i-t+3*e-3*n,s=t+n-2*e,a=t-e;let l,u=0,h=0;Math.abs(o)>1e-14?(l=s*s+a*o,l>=0&&(l=Math.sqrt(l),u=(-s+l)/o,h=(-s-l)/o)):u=.5*a/s,0<u&&u<1&&r(_t(u,t,e,n,i)),0<h&&h<1&&r(_t(h,t,e,n,i))}function _t(t,e,n,i,r){const o=1-t,s=o*o,a=t*t;return s*o*e+3*s*t*n+3*o*a*i+a*t*r}ct.beginPath=ft,ct.closePath=ft,ct.moveTo=vt,ct.lineTo=vt,ct.rect=function(t,e,n,i){dt(t+n,e+i),vt(t,e)},ct.quadraticCurveTo=function(t,e,n,i){yt(lt,t,n,gt),yt(ut,e,i,pt),vt(n,i)},ct.bezierCurveTo=function(t,e,n,i,r,o){mt(lt,t,n,r,gt),mt(ut,e,i,o,pt),vt(r,o)},ct.arc=function(t,e,n,i,r,o){if(lt=n*Math.cos(r)+t,ut=n*Math.sin(r)+e,Math.abs(r-i)>ht)dt(t-n,e-n),dt(t+n,e+n);else{const s=i=>dt(n*Math.cos(i)+t,n*Math.sin(i)+e);let a,l;if(s(i),s(r),r!==i)if((i%=A)<0&&(i+=A),(r%=A)<0&&(r+=A),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=A,a=i-i%T,l=0;l<4&&a>r;++l,a-=T)s(a);else for(a=i-i%T+T,l=0;l<4&&a<r;++l,a+=T)s(a)}};var xt=(xt=n.canvas(1,1))?xt.getContext("2d"):null;const bt=new s;function kt(t){return function(e,n){if(!xt)return!0;t(xt,e),bt.clear().union(e.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=bt;for(let t=r;t<=s;++t)for(let e=i;e<=o;++e)if(xt.isPointInPath(e,t))return!0;return!1}}function wt(t,e){return e.contains(t.x||0,t.y||0)}function Tt(t,e){const n=t.x||0,i=t.y||0,r=t.width||0,o=t.height||0;return e.intersects(bt.set(n,i,n+r,i+o))}function At(t,e){const n=t.x||0,i=t.y||0;return Mt(e,n,i,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i)}function Mt(t,e,n,i,r){const{x1:o,y1:s,x2:a,y2:l}=t,u=i-e,h=r-n;let c,f,d,v,g=0,p=1;for(v=0;v<4;++v){if(0===v&&(c=-u,f=-(o-e)),1===v&&(c=u,f=a-e),2===v&&(c=-h,f=-(s-n)),3===v&&(c=h,f=l-n),Math.abs(c)<1e-10&&f<0)return!1;if(d=f/c,c<0){if(d>p)return!1;d>g&&(g=d)}else if(c>0){if(d<g)return!1;d<p&&(p=d)}}return!0}function Ct(t,e){t.globalCompositeOperation=e.blend||"source-over"}function zt(t,e){return null==t?e:t}function Rt(t,e){const n=e.length;for(let i=0;i<n;++i)t.addColorStop(e[i].offset,e[i].color);return t}function Pt(t,e,i){return u(i)?function(t,e,i){const r=i.width(),o=i.height();let s;if("radial"===e.gradient)s=t.createRadialGradient(i.x1+zt(e.x1,.5)*r,i.y1+zt(e.y1,.5)*o,Math.max(r,o)*zt(e.r1,0),i.x1+zt(e.x2,.5)*r,i.y1+zt(e.y2,.5)*o,Math.max(r,o)*zt(e.r2,.5));else{const a=zt(e.x1,0),l=zt(e.y1,0),u=zt(e.x2,1),h=zt(e.y2,0);if(a!==u&&l!==h&&r!==o){const i=n.canvas(Math.ceil(r),Math.ceil(o)),s=i.getContext("2d");return s.scale(r,o),s.fillStyle=Rt(s.createLinearGradient(a,l,u,h),e.stops),s.fillRect(0,0,r,o),t.createPattern(i,"no-repeat")}s=t.createLinearGradient(i.x1+a*r,i.y1+l*o,i.x1+u*r,i.y1+h*o)}return Rt(s,e.stops)}(t,i,e.bounds):i}function Lt(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Pt(t,e,e.fill),!0)}var St=[];function Ot(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Pt(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||St),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Nt(t,e){return t.zindex-e.zindex||t.index-e.index}function qt(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)(e=r[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Nt)}function Et(t,e){var n,i,r=t.items;if(r&&r.length){var o=qt(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}}function Dt(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var o=qt(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(i=(r=t.items).length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function It(t){return function(e,n,i){Et(n,(function(n){i&&!i.intersects(n.bounds)||Vt(t,e,n,n)}))}}function Bt(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||Vt(t,e,n.items[0],n.items)}}function Vt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(Ct(e,n),n.fill&&Lt(e,n,r)&&e.fill(),n.stroke&&Ot(e,n,r)&&e.stroke()))}function Ht(t){return t=t||e.truthy,function(e,n,i,r,o,s){return i*=e.pixelRatio,r*=e.pixelRatio,Dt(n,(function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0}))}}function Gt(t,e){return function(n,i,r,o){var s,a,l=Array.isArray(i)?i[0]:i,u=null==e?l.fill:e,h=l.stroke&&n.isPointInStroke;return h&&(s=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(u&&n.isPointInPath(r,o)||h&&n.isPointInStroke(r,o))}}function Wt(t){return Ht(Gt(t))}function Ut(t,e){return"translate("+t+","+e+")"}function Xt(t){return"rotate("+t+")"}function jt(t){return Ut(t.x||0,t.y||0)}function Ft(t){return Ut(t.x||0,t.y||0)+(t.angle?" "+Xt(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}function Jt(t,e,n){function i(t,n){var i=n.x||0,r=n.y||0,o=n.angle||0;t.translate(i,r),o&&t.rotate(o*=w),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",Ft(n)),t("d",e(null,n))},bound:function(t,n){var i=n.x||0,r=n.y||0;return e(ct(t),n),st(t,n).translate(i,r),n.angle&&t.rotate(n.angle*w,i,r),t},draw:It(i),pick:Wt(i),isect:n||kt(i)}}var Yt=Jt("arc",(function(t,e){return Q.context(t)(e)}));function $t(t,e,n){function i(t,n){t.beginPath(),e(t,n)}var r=Gt(i);return{type:t,tag:"path",nested:!0,attr:function(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))},bound:function(t,n){var i=n.items;return 0===i.length?t:(e(ct(t),i),st(t,i[0]))},draw:Bt(i),pick:function(t,e,n,i,o,s){var a=e.items,l=e.bounds;return!a||!a.length||l&&!l.contains(o,s)?null:(n*=t.pixelRatio,i*=t.pixelRatio,r(t,a,n,i)?a[0]:null)},isect:wt,tip:n}}var Qt=$t("area",(function(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?K:Z).curve(_(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",s=t.length,a=1/0;--s>=0;)!1!==t[s].defined&&(i=Math.abs(t[s][o]-r))<a&&(a=i,n=t[s]);return n}));function Zt(t,e){t.beginPath(),rt(e)?ot(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}var Kt=1;function te(t,n,i){var r=n.clip,o=t._defs,s=n.clip_id||(n.clip_id="clip"+Kt++),a=o.clipping[s]||(o.clipping[s]={id:s});return e.isFunction(r)?a.path=r(null):rt(i)?a.path=ot(null,i,0,0):(a.width=i.width||0,a.height=i.height||0),"url(#"+s+")"}function ee(t){var e=null!=(e=t.strokeWidth)?e:1;return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function ne(t,e){var n=ee(e);t("d",ot(null,e,n,n))}function ie(t,e,n,i){var r=ee(e);t.beginPath(),ot(t,e,(n||0)+r,(i||0)+r)}var re=Gt(ie),oe=Gt(ie,!1);var se={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",jt(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,i=0,r=n.length;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),st(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var i=this;Et(e,(function(e){var r=e.x||0,o=e.y||0,s=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(ie(t,e,r,o),Ct(t,e),e.fill&&Lt(t,e,a)&&t.fill(),e.stroke&&!s&&Ot(t,e,a)&&t.stroke()),t.save(),t.translate(r,o),e.clip&&Zt(t,e),n&&n.translate(-r,-o),Et(e,(function(e){i.draw(t,e,n)})),n&&n.translate(r,o),t.restore(),s&&e.stroke&&a&&(ie(t,e,r,o),Ct(t,e),Ot(t,e,a)&&t.stroke())}))},pick:function(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;var s=this,a=n*t.pixelRatio,l=i*t.pixelRatio;return Dt(e,(function(u){var h,c,f,d,v,g,p,y,m;if((!(y=u.bounds)||y.contains(r,o))&&(d=u.x||0,v=u.y||0,g=d+(u.width||0),p=v+(u.height||0),!(m=u.clip)||!(r<d||r>g||o<d||o>p)))return t.save(),t.translate(d,v),d=r-d,v=o-v,m&&rt(u)&&!re(t,u,a,l)?(t.restore(),null):(c=u.strokeForeground,(f=!1!==e.interactive)&&c&&u.stroke&&oe(t,u,a,l)?(t.restore(),u):(!(h=Dt(u,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,d,v)?s.pick(t,n,i,d,v):null})))&&f&&(u.fill||!c&&u.stroke)&&re(t,u,a,l)&&(h=u),t.restore(),h||null))}))},isect:Tt,content:function(t,e,n){t("clip-path",e.clip?te(n,e,e):null)},background:function(t,e){t("class","background"),ne(t,e)},foreground:function(t,e){t("class","foreground"),e.strokeForeground?ne(t,e):t("d","")}};function ae(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function le(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function ue(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function he(t,e){return"center"===t?e/2:"right"===t?e:0}function ce(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var fe={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var i=ae(e,n),r=e.x||0,o=e.y||0,s=le(e,i),a=ue(e,i),l=!1===e.aspect?"none":"xMidYMid";r-=he(e.align,s),o-=ce(e.baseline,a),!i.src&&i.toDataURL?t("href",i.toDataURL(),"http://www.w3.org/1999/xlink","xlink:href"):t("href",i.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",Ut(r,o)),t("width",s),t("height",a),t("preserveAspectRatio",l)},bound:function(t,e){var n=e.image,i=e.x||0,r=e.y||0,o=le(e,n),s=ue(e,n);return i-=he(e.align,o),r-=ce(e.baseline,s),t.set(i,r,i+o,r+s)},draw:function(t,e,n){var i=this;Et(e,(function(e){if(!n||n.intersects(e.bounds)){var r,o,s,a,l=ae(e,i),u=e.x||0,h=e.y||0,c=le(e,l),f=ue(e,l);u-=he(e.align,c),h-=ce(e.baseline,f),!1!==e.aspect&&(o=l.width/l.height,s=e.width/e.height,o==o&&s==s&&o!==s&&(s<o?(h+=(f-(a=c/o))/2,f=a):(u+=(c-(a=f*o))/2,c=a))),(l.complete||l.toDataURL)&&(Ct(t,e),t.globalAlpha=null!=(r=e.opacity)?r:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(l,u,h,c,f))}}))},pick:Ht(),isect:e.truthy,get:ae,xOffset:he,yOffset:ce},de=$t("line",(function(t,e){var n=e[0],i=n.interpolate||"linear";return tt.curve(_(i,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,i,r=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(i=t[o].y-e[1])*i<r)return t[o];return null}));function ve(t,e){var n=e.path;if(null==n)return!0;var i=e.x||0,r=e.y||0,o=e.scaleX||1,s=e.scaleY||1,a=(e.angle||0)*w,l=e.pathCache;l&&l.path===n||((e.pathCache=l=k(n)).path=n),a&&t.rotate&&t.translate?(t.translate(i,r),t.rotate(a),O(t,l,0,0,o,s),t.rotate(-a),t.translate(-i,-r)):O(t,l,i,r,o,s)}var ge={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,i=e.scaleY||1;1===n&&1===i||t("vector-effect","non-scaling-stroke"),t("transform",Ft(e)),t("d",e.path)},bound:function(t,e){return ve(ct(t),e)?t.set(0,0,0,0):st(t,e,!0),e.angle&&t.rotate(e.angle*w,e.x||0,e.y||0),t},draw:It(ve),pick:Wt(ve),isect:kt(ve)};function pe(t,e){t.beginPath(),ot(t,e)}var ye={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",ot(null,e))},bound:function(t,e){var n,i;return st(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)},draw:It(pe),pick:Wt(pe),isect:Tt};function me(t,e,n){var i,r,o,s;return!(!e.stroke||!Ot(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,s=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,s),!0)}var _e={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",jt(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,i;return st(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)},draw:function(t,e,n){Et(e,(function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&me(t,e,i)&&(Ct(t,e),t.stroke())}}))},pick:Ht((function(t,e,n,i){return!!t.isPointInStroke&&(me(t,e,1)&&t.isPointInStroke(n,i))})),isect:At},xe=Jt("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),be=Jt("symbol",(function(t,e){return nt.context(t)(e)}),wt);const ke=e.lruCache();var we={height:Re,measureWidth:Ce,estimateWidth:Ae,width:Ae,canvas:Te};function Te(t){we.width=t&&xt?Ce:Ae}function Ae(t,e){return Me(Se(t,e),Re(t))}function Me(t,e){return~~(.8*t.length*e)}function Ce(t,e){return Re(t)<=0||!(e=Se(t,e))?0:ze(e,Ne(t))}function ze(t,e){const n=`(${e}) ${t}`;let i=ke.get(n);return void 0===i&&(xt.font=e,i=xt.measureText(t).width,ke.set(n,i)),i}function Re(t){return null!=t.fontSize?+t.fontSize||0:11}function Pe(t){return null!=t.lineHeight?t.lineHeight:Re(t)+2}function Le(t){return n=t.lineBreak&&t.text&&!e.isArray(t.text)?t.text.split(t.lineBreak):t.text,e.isArray(n)?n.length>1?n:n[0]:n;var n}function Se(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,i=function(t){if(we.width===Ce){const e=Ne(t);return t=>ze(t,e)}{const e=Re(t);return t=>Me(t,e)}}(t);if(i(e)<n)return e;var r,o=t.ellipsis||"…",s="rtl"===t.dir,a=0,l=e.length;if(n-=i(o),s){for(;a<l;)r=a+l>>>1,i(e.slice(r))>n?a=r+1:l=r;return o+e.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(e.slice(0,r))<n?a=r:l=r-1;return e.slice(0,a)+o}(t,n):n}function Oe(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Ne(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Re(t)+"px "+Oe(t,e)}function qe(t){var e=t.baseline,n=Re(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Pe(t):"line-bottom"===e?.29*n-.5*Pe(t):0)}Te(!0);var Ee={left:"start",center:"middle",right:"end"},De=new s;function Ie(t){var e,n=t.x||0,i=t.y||0,r=t.radius||0;return r&&(e=(t.theta||0)-T,n+=r*Math.cos(e),i+=r*Math.sin(e)),De.x1=n,De.y1=i,De}function Be(t,n,i){var r,o=we.height(n),s=n.align,a=Ie(n),l=a.x1,u=a.y1,h=n.dx||0,c=(n.dy||0)+qe(n)-Math.round(.8*o),f=Le(n);if(e.isArray(f)?(o+=Pe(n)*(f.length-1),r=f.reduce((t,e)=>Math.max(t,we.width(n,e)),0)):r=we.width(n,f),"center"===s?h-=r/2:"right"===s&&(h-=r),t.set(h+=l,c+=u,h+r,c+o),n.angle&&!i)t.rotate(n.angle*w,l,u);else if(2===i)return t.rotatedPoints(n.angle*w,l,u);return t}var Ve={arc:Yt,area:Qt,group:se,image:fe,line:de,path:ge,rect:ye,rule:_e,shape:xe,symbol:be,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,i=e.dx||0,r=(e.dy||0)+qe(e),o=Ie(e),s=o.x1,a=o.y1,l=e.angle||0;t("text-anchor",Ee[e.align]||"start"),l?(n=Ut(s,a)+" "+Xt(l),(i||r)&&(n+=" "+Ut(i,r))):n=Ut(s+i,a+r),t("transform",n)},bound:Be,draw:function(t,n,i){Et(n,(function(n){var r,o,s,a,l,u,h,c=null==n.opacity?1:n.opacity;if(!(i&&!i.intersects(n.bounds)||0===c||n.fontSize<=0||null==n.text||0===n.text.length)){if(t.font=Ne(n),t.textAlign=n.align||"left",o=(r=Ie(n)).x1,s=r.y1,n.angle&&(t.save(),t.translate(o,s),t.rotate(n.angle*w),o=s=0),o+=n.dx||0,s+=(n.dy||0)+qe(n),u=Le(n),Ct(t,n),e.isArray(u))for(l=Pe(n),a=0;a<u.length;++a)h=Se(n,u[a]),n.fill&&Lt(t,n,c)&&t.fillText(h,o,s),n.stroke&&Ot(t,n,c)&&t.strokeText(h,o,s),s+=l;else h=Se(n,u),n.fill&&Lt(t,n,c)&&t.fillText(h,o,s),n.stroke&&Ot(t,n,c)&&t.strokeText(h,o,s);n.angle&&t.restore()}}))},pick:Ht((function(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var s=Ie(e),a=s.x1,l=s.y1,u=Be(De,e,1),h=-e.angle*w,c=Math.cos(h),f=Math.sin(h),d=c*r-f*o+(a-c*a+f*l),v=f*r+c*o+(l-f*a-c*l);return u.contains(d,v)})),isect:function(t,e){var n=Be(De,t,2);return Mt(e,n[0],n[1],n[2],n[3])||Mt(e,n[0],n[1],n[4],n[5])||Mt(e,n[4],n[5],n[6],n[7])||Mt(e,n[2],n[3],n[6],n[7])}},trail:$t("trail",(function(t,e){return it.context(t)(e)}),(function(t,e){for(var n,i,r=t.length;--r>=0;)if(!1!==t[r].defined&&(n=t[r].x-e[0])*n+(i=t[r].y-e[1])*i<(n=t[r].size||1)*n)return t[r];return null}))};function He(t,e,n){var i=Ve[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new s),t,n)}var Ge={mark:null};function We(t,e,n){var i,r,o,a,l=Ve[t.marktype],u=l.bound,h=t.items,c=h&&h.length;if(l.nested)return c?o=h[0]:(Ge.mark=t,o=Ge),a=He(o,u,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new s,c)for(i=0,r=h.length;i<r;++i)e.union(He(h[i],u,n));return t.bounds=e}var Ue=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant"];function Xe(t,e){return JSON.stringify(t,Ue,e)}function je(t){return function t(e){var n,i,r,o=e.marktype,s=e.items;if(s)for(i=0,r=s.length;i<r;++i)n=o?"mark":"group",s[i][n]=e,s[i].zindex&&(s[i][n].zdirty=!0),"group"===(o||n)&&t(s[i]);o&&We(e);return e}("string"==typeof t?JSON.parse(t):t)}function Fe(t){arguments.length?this.root=je(t):(this.root=Ye({marktype:"group",name:"root",role:"frame"}),this.root.items=[new d(this.root)])}var Je=Fe.prototype;function Ye(t,e){return{bounds:new s,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function $e(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Qe(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function Ze(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=$e(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function Ke(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function tn(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function en(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function nn(t,e){this._active=null,this._handlers={},this._loader=t||i.loader(),this._tooltip=e||rn}function rn(t,e,n,i){t.element().setAttribute("title",i||"")}Je.toJSON=function(t){return Xe(this.root,t||0)},Je.mark=function(t,e,n){var i=Ye(t,e=e||this.root.items[0]);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};var on=nn.prototype;function sn(t){this._el=null,this._bgcolor=null,this._loader=new v(t)}on.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},on.element=function(){return this._el},on.canvas=function(){return this._el&&this._el.firstChild},on.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},on.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},on.on=function(){},on.off=function(){},on._handlerIndex=function(t,e,n){for(var i=t?t.length:0;--i>=0;)if(t[i].type===e&&(!n||t[i].handler===n))return i;return-1},on.handlers=function(t){var e,n=this._handlers,i=[];if(t)i.push.apply(i,n[this.eventName(t)]);else for(e in n)i.push.apply(i,n[e]);return i},on.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},on.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),i=$e(null,"a");for(var r in e)i.setAttribute(r,e[r]);i.dispatchEvent(n)})).catch((function(){}))},on.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,i){var r,o,s=t&&t.mark;if(s&&(r=Ve[s.marktype]).tip){for((o=en(e,n))[0]-=i[0],o[1]-=i[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=r.tip(s.items,o)}return t}(e,t,this.canvas(),this._origin);var i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}},on.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,o=r.x1+i[0]+n.left,s=r.y1+i[1]+n.top,a=r.width(),l=r.height();t.mark&&(t=t.mark.group);)o+=t.x||0,s+=t.y||0;return{x:o,y:s,width:a,height:l,left:o,top:s,right:o+a,bottom:s+l}}};var an=sn.prototype;an.initialize=function(t,e,n,i,r){return this._el=t,this.resize(e,n,i,r)},an.element=function(){return this._el},an.canvas=function(){return this._el&&this._el.firstChild},an.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},an.resize=function(t,e,n,i){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=i||1,this},an.dirty=function(){},an.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},an._render=function(){},an.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},an._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then((function(t){t&&r(),n._ready=null}))}return i},an.sanitizeURL=function(t){return this._load("sanitizeURL",t)},an.loadImage=function(t){return this._load("loadImage",t)};function ln(t,e){nn.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var un=e.inherits(ln,nn);function hn(t,e,n){return function(i){var r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i)),this.fire(t,i)}}function cn(t){return function(e){this.fire(t,e),this._active=null}}un.initialize=function(t,e,n){var i=this._canvas=t&&Qe(t,"canvas");if(i){var r=this;this.events.forEach((function(t){i.addEventListener(t,(function(e){un[t]?un[t].call(r,e):r.fire(t,e)}))}))}return nn.prototype.initialize.call(this,t,e,n)},un.canvas=function(){return this._canvas},un.context=function(){return this._canvas.getContext("2d")},un.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],un.DOMMouseScroll=function(t){this.fire("mousewheel",t)},un.mousemove=hn("mousemove","mouseover","mouseout"),un.dragover=hn("dragover","dragenter","dragleave"),un.mouseout=cn("mouseout"),un.dragleave=cn("dragleave"),un.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},un.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},un.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},un.touchmove=function(t){this.fire("touchmove",t,!0)},un.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},un.fire=function(t,e,n){var i,r,o=n?this._touch:this._active,s=this._handlers[t];if(e.vegaType=t,"click"===t&&o&&o.href?this.handleHref(e,o,o.href):"mousemove"!==t&&"mouseout"!==t||this.handleTooltip(e,o,"mouseout"!==t),s)for(i=0,r=s.length;i<r;++i)s[i].handler.call(this._obj,e,o)},un.on=function(t,e){var n=this.eventName(t),i=this._handlers;return this._handlerIndex(i[n],t,e)<0&&(i[n]||(i[n]=[])).push({type:t,handler:e}),this},un.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&i.splice(r,1),this},un.pickEvent=function(t){var e=en(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},un.pick=function(t,e,n,i,r){var o=this.context();return Ve[t.marktype].pick.call(this,o,t,e,n,i,r)};var fn="undefined"!=typeof window&&window.devicePixelRatio||1;function dn(t){sn.call(this,t),this._redraw=!1,this._dirty=new s}var vn=e.inherits(dn,sn),gn=sn.prototype,pn=new s;function yn(t,e,n){return pn.set(0,0,e,n).translate(-t[0],-t[1])}function mn(t,e){nn.call(this,t,e);var n=this;n._hrefHandler=xn(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=xn(n,(function(t,e){n.handleTooltip(t,e,"mouseout"!==t.type)}))}vn.initialize=function(t,e,i,r,o,s){return this._options=s,this._canvas=n.canvas(1,1,s&&s.type),t&&(Ke(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),gn.initialize.call(this,t,e,i,r,o)},vn.resize=function(t,e,n,i){return gn.resize.call(this,t,e,n,i),function(t,e,n,i,r,o){const s="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,a=t.getContext("2d"),l=s?fn:r;t.width=e*l,t.height=n*l;for(const t in o)a[t]=o[t];s&&1!==l&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},vn.canvas=function(){return this._canvas},vn.context=function(){return this._canvas?this._canvas.getContext("2d"):null},vn.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=pn.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},vn._render=function(t){var e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty;return e.save(),this._redraw||o.empty()?(this._redraw=!1,o=yn(n,i,r).expand(1)):o=function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,o.intersect(yn(n,i,r)),n),this.clear(-n[0],-n[1],i,r),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},vn.draw=function(t,n,i){var r=Ve[n.marktype];n.clip&&function(t,n){var i=n.clip;t.save(),e.isFunction(i)?(t.beginPath(),i(t),t.clip()):Zt(t,n.group)}(t,n),r.draw.call(this,t,n,i),n.clip&&t.restore()},vn.clear=function(t,e,n,i){var r=this.context();r.clearRect(t,e,n,i),null!=this._bgcolor&&(r.fillStyle=this._bgcolor,r.fillRect(t,e,n,i))};var _n=e.inherits(mn,nn);function xn(t,e){return function(n){var i=n.target.__data__;n.vegaType=n.type,i=Array.isArray(i)?i[0]:i,e.call(t._obj,n,i)}}function bn(t,e,n){var i,r,o="<"+t;if(e)for(i in e)null!=(r=e[i])&&(o+=" "+i+'="'+r+'"');return n&&(o+=" "+n),o+">"}function kn(t){return"</"+t+">"}_n.initialize=function(t,e,n){var i=this._svg;return i&&(i.removeEventListener("click",this._hrefHandler),i.removeEventListener("mousemove",this._tooltipHandler),i.removeEventListener("mouseout",this._tooltipHandler)),this._svg=i=t&&Qe(t,"svg"),i&&(i.addEventListener("click",this._hrefHandler),i.addEventListener("mousemove",this._tooltipHandler),i.addEventListener("mouseout",this._tooltipHandler)),nn.prototype.initialize.call(this,t,e,n)},_n.canvas=function(){return this._svg},_n.on=function(t,e){var n=this.eventName(t),i=this._handlers;if(this._handlerIndex(i[n],t,e)<0){var r={type:t,handler:e,listener:xn(this,e)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},_n.off=function(t,e){var n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this};var wn={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Tn={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},An=Object.keys(Tn),Mn=wn.xmlns;function Cn(t){sn.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var zn=e.inherits(Cn,sn),Rn=sn.prototype;function Pn(t,e,n){var i,r,o;if("radial"===e.gradient){var s=Ze(t,n++,"pattern",Mn);s.setAttribute("id","p_"+e.id),s.setAttribute("viewBox","0,0,1,1"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("preserveAspectRatio","xMidYMid slice"),(s=Ze(s,0,"rect",Mn)).setAttribute("width","1"),s.setAttribute("height","1"),s.setAttribute("fill","url("+Bn()+"#"+e.id+")"),(t=Ze(t,n++,"radialGradient",Mn)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=Ze(t,n++,"linearGradient",Mn)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(i=0,r=e.stops.length;i<r;++i)(o=Ze(t,i,"stop",Mn)).setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);return Ke(t,i),n}function Ln(t,e,n){var i;return(t=Ze(t,n,"clipPath",Mn)).setAttribute("id",e.id),e.path?(i=Ze(t,0,"path",Mn)).setAttribute("d",e.path):((i=Ze(t,0,"rect",Mn)).setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)),Ke(t,1),n+1}function Sn(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function On(t,e,n,i,r){var o,s=t._svg;if(!s&&(s=$e(o=e.ownerDocument,i,Mn),t._svg=s,t.mark&&(s.__data__=t,s.__values__={fill:"default"},"g"===i))){var a=$e(o,"path",Mn);s.appendChild(a),a.__data__=t;var l=$e(o,"g",Mn);s.appendChild(l),l.__data__=t;var u=$e(o,"path",Mn);s.appendChild(u),u.__data__=t,u.__values__={fill:"default"}}return(s.ownerSVGElement!==r||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(s,n))&&e.insertBefore(s,n?n.nextSibling:e.firstChild),s}zn.initialize=function(t,e,n,i){return t&&(this._svg=Ze(t,0,"svg",Mn),this._svg.setAttribute("class","marks"),Ke(t,1),this._root=Ze(this._svg,0,"g",Mn),Ke(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),Rn.initialize.call(this,t,e,n,i)},zn.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),Rn.background.apply(this,arguments)},zn.resize=function(t,e,n,i){return Rn.resize.call(this,t,e,n,i),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},zn.canvas=function(){return this._svg},zn.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in wn)t[e]=wn[e];var n=this._bgcolor?bn("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+kn("rect"):"";return bn("svg",t)+n+this._svg.innerHTML+kn("svg")},zn._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Ke(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},zn.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,r=0;for(t in n.gradient)i||(n.el=i=Ze(e,0,"defs",Mn)),r=Pn(i,n.gradient[t],r);for(t in n.clipping)i||(n.el=i=Ze(e,0,"defs",Mn)),r=Ln(i,n.clipping[t],r);i&&(0===r?(e.removeChild(i),n.el=null):Ke(i,r))},zn._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},zn.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},zn.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},zn._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,i,r,o,s,a,l=++this._dirtyID;for(o=0,s=t.length;o<s;++o)(n=(e=t[o]).mark).marktype!==i&&(i=n.marktype,r=Ve[i]),n.zdirty&&n.dirty!==l&&(this._dirtyAll=!1,Sn(e,l),n.items.forEach((function(t){t.dirty=l}))),n.zdirty||(e.exit?(r.nested&&n.items.length?(a=n.items[0])._svg&&this._update(r,a._svg,a):e._svg&&(a=e._svg.parentNode)&&a.removeChild(e._svg),e._svg=null):(e=r.nested?n.items[0]:e)._update!==l&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,Sn(e,l)),e._update=l));return!this._dirtyAll},zn.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var i,r=this,o=this._svg,s=Ve[e.marktype],a=!1===e.interactive?"none":null,l="g"===s.tag,u=null,h=0;function c(t){var e=r.isDirty(t),n=On(t,i,u,s.tag,o);e&&(r._update(s,n,t),l&&function(t,e,n){e=e.lastChild.previousSibling;var i,r=0;Et(n,(function(n){i=t.draw(e,n,i),++r})),Ke(e,1+r)}(r,n,t)),u=n,++h}return(i=On(e,t,n,"g",o)).setAttribute("class",tn(e)),l||i.style.setProperty("pointer-events",a),e.clip?i.setAttribute("clip-path",te(r,e,e.group)):i.removeAttribute("clip-path"),s.nested?e.items.length&&c(e.items[0]):Et(e,c),Ke(i,h),i};var Nn=null,qn=null,En={group:function(t,e,n){var i,r;Nn=i=e.childNodes[2],qn=i.__values__,t.foreground(In,n,this),qn=e.__values__,Nn=e.childNodes[1],t.content(In,n,this),Nn=r=e.childNodes[0],t.background(In,n,this);var o=!1===n.mark.interactive?"none":null;if(o!==qn.events&&(i.style.setProperty("pointer-events",o),r.style.setProperty("pointer-events",o),qn.events=o),n.strokeForeground&&n.stroke){const t=n.fill;i.style.removeProperty("display"),this.style(r,n),r.style.removeProperty("stroke"),t&&(n.fill=null),qn=i.__values__,this.style(i,n),t&&(n.fill=t),Nn=null}else i.style.setProperty("display","none"),i.style.setProperty("fill","none")},image:function(t,e,n){!1===n.smooth?(Dn(e,"image-rendering","optimizeSpeed"),Dn(e,"image-rendering","pixelated")):Dn(e,"image-rendering",null)},text:function(t,n,i){var r,o,s,a,l=Le(i);e.isArray(l)?(r=(o=l.map(t=>Se(i,t))).join("\n"))!==qn.text&&(Ke(n,0),s=n.ownerDocument,a=Pe(i),o.forEach((t,e)=>{const r=$e(s,"tspan",Mn);r.__data__=i,r.textContent=t,e&&(r.setAttribute("x",0),r.setAttribute("dy",a)),n.appendChild(r)}),qn.text=r):(o=Se(i,l))!==qn.text&&(n.textContent=o,qn.text=o),Dn(n,"font-family",Oe(i)),Dn(n,"font-size",Re(i)+"px"),Dn(n,"font-style",i.fontStyle),Dn(n,"font-variant",i.fontVariant),Dn(n,"font-weight",i.fontWeight)}};function Dn(t,e,n){n!==qn[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),qn[e]=n)}function In(t,e,n){e!==qn[t]&&(null!=e?n?Nn.setAttributeNS(n,t,e):Nn.setAttribute(t,e):n?Nn.removeAttributeNS(n,t):Nn.removeAttribute(t),qn[t]=e)}function Bn(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Vn(t){sn.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}zn._update=function(t,e,n){Nn=e,qn=e.__values__,t.attr(In,n,this);var i=En[t.type];i&&i.call(this,t,e,n),Nn&&this.style(Nn,n)},zn.style=function(t,e){var n,i,r,o,s;if(null!=e)for(n=0,i=An.length;n<i;++n)s=e[r=An[n]],"font"===r&&(s=Oe(e)),s!==qn[r]&&(o=Tn[r],null==s?"fill"===o?t.style.setProperty(o,"none"):t.style.removeProperty(o):(u(s)&&(s=h(s,this._defs.gradient,Bn())),t.style.setProperty(o,s+"")),qn[r]=s)};var Hn,Gn=e.inherits(Vn,sn),Wn=sn.prototype;function Un(t,e,n,i){Hn[i||t]=e}function Xn(t,e,n,i){if(null==t)return"";var r,o,s,a,l,c="";for("bgrect"===n&&!1===e.interactive&&(c+="pointer-events: none; "),"bgfore"===n&&(!1===e.interactive&&(c+="pointer-events: none; "),c+="display: none; "),"image"===n&&!1===t.smooth&&(c+="image-rendering: optimizeSpeed; image-rendering: pixelated; "),"text"===n&&(c+="font-family: "+Oe(t)+"; ",c+="font-size: "+Re(t)+"px; ",t.fontStyle&&(c+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(c+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(c+="font-weight: "+t.fontWeight+"; ")),r=0,o=An.length;r<o;++r)s=An[r],a=Tn[s],null==(l=t[s])?"fill"===a&&(c+="fill: none; "):"transparent"!==l||"fill"!==a&&"stroke"!==a?(u(l)&&(l=h(l,i.gradient,"")),c+=a+": "+l+"; "):c+=a+": none; ";return c?'style="'+c.trim()+'"':null}function jn(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Gn.resize=function(t,e,n,i){Wn.resize.call(this,t,e,n,i);var r=this._origin,o=this._text,s={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var a in wn)s[a]=wn[a];o.head=bn("svg",s);var l=this._bgcolor;return"transparent"!==l&&"none"!==l||(l=null),o.bg=l?bn("rect",{width:this._width,height:this._height,style:"fill: "+l+";"})+kn("rect"):"",o.root=bn("g",{transform:"translate("+r+")"}),o.foot=kn("g")+kn("svg"),this},Gn.background=function(){var t=Wn.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},Gn.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},Gn._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},Gn.buildDefs=function(){var t,e,n,i,r,o=this._defs,s="";for(e in o.gradient){for(r=(n=o.gradient[e]).stops,"radial"===n.gradient?(s+=bn(i="pattern",{id:"p_"+e,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s+=bn("rect",{width:"1",height:"1",fill:"url(#"+e+")"})+kn("rect"),s+=kn(i),s+=bn(i="radialGradient",{id:e,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):s+=bn(i="linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<r.length;++t)s+=bn("stop",{offset:r[t].offset,"stop-color":r[t].color})+kn("stop");s+=kn(i)}for(e in o.clipping)n=o.clipping[e],s+=bn("clipPath",{id:e}),n.path?s+=bn("path",{d:n.path})+kn("path"):s+=bn("rect",{x:0,y:0,width:n.width,height:n.height})+kn("rect"),s+=kn("clipPath");return s.length>0?bn("defs")+s+kn("defs"):""},Gn.attributes=function(t,e){return Hn={},t(Un,e,this),Hn},Gn.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then((function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t}))}return null},Gn.mark=function(t){var n,i=this,r=Ve[t.marktype],o=r.tag,s=this._defs,a="";function l(l){var u=i.href(l);if(u&&(a+=bn("a",u)),n="g"!==o?Xn(l,t,o,s):null,a+=bn(o,i.attributes(r.attr,l),n),"text"===o){const t=Le(l);if(e.isArray(t)){const e={x:0,dy:Pe(l)};for(let n=0;n<t.length;++n)a+=bn("tspan",n?e:null)+jn(Se(l,t[n]))+kn("tspan")}else a+=jn(Se(l,t))}else if("g"===o){const e=l.strokeForeground,n=l.fill,o=l.stroke;e&&o&&(l.stroke=null),a+=bn("path",i.attributes(r.background,l),Xn(l,t,"bgrect",s))+kn("path"),a+=bn("g",i.attributes(r.content,l))+i.markGroup(l)+kn("g"),e&&o?(n&&(l.fill=null),l.stroke=o,a+=bn("path",i.attributes(r.foreground,l),Xn(l,t,"bgrect",s))+kn("path"),n&&(l.fill=n)):a+=bn("path",i.attributes(r.foreground,l),Xn({},t,"bgfore",s))+kn("path")}a+=kn(o),u&&(a+=kn("a"))}return"g"!==o&&!1===t.interactive&&(n='style="pointer-events: none;"'),a+=bn("g",{class:tn(t),"clip-path":t.clip?te(i,t,t.group):null},n),r.nested?t.items&&t.items.length&&l(t.items[0]):Et(t,l),a+kn("g")},Gn.markGroup=function(t){var e=this,n="";return Et(t,(function(t){n+=e.mark(t)})),n};var Fn={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},Jn={};function Yn(t,e,n,i){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const r=t.items,o=t.marktype,s=r.length;let a=0;if("group"===o)for(;a<s;++a)$n(r[a],e,n,i);else for(const t=Ve[o].isect;a<s;++a){let n=r[a];Qn(n,e,t)&&i.push(n)}}return i}function $n(t,e,n,i){n&&n(t.mark)&&Qn(t,e,Ve.group.isect)&&i.push(t);const r=t.items,o=r&&r.length;if(o){const s=t.x||0,a=t.y||0;e.translate(-s,-a);for(let t=0;t<o;++t)Yn(r[t],e,n,i);e.translate(s,a)}return i}function Qn(t,e,n){const i=t.bounds;return e.encloses(i)||e.intersects(i)&&n(t,e)}Jn.canvas=Jn.png={renderer:dn,headless:dn,handler:ln},Jn.svg={renderer:Cn,headless:Vn,handler:mn},Jn.none={};var Zn=new s;function Kn(t,n,i){return t===n||("path"===i?ti(t,n):t instanceof Date&&n instanceof Date?+t==+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=1e-9:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&function(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!Kn(t[n],e[n],n))return!1;return typeof t==typeof e}(t,n):t==n)}function ti(t,e){return Kn(k(t),k(e))}t.Bounds=s,t.CanvasHandler=ln,t.CanvasRenderer=dn,t.Gradient=function(t,e){var n,i=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}},t.GroupItem=d,t.Handler=nn,t.Item=f,t.Marks=Ve,t.RenderType=Fn,t.Renderer=sn,t.ResourceLoader=v,t.SVGHandler=mn,t.SVGRenderer=Cn,t.SVGStringRenderer=Vn,t.Scenegraph=Fe,t.boundClip=function(t){var n=t.clip;if(e.isFunction(n))n(ct(Zn.clear()));else{if(!n)return;Zn.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Zn)},t.boundContext=ct,t.boundItem=He,t.boundMark=We,t.boundStroke=st,t.closeTag=kn,t.domChild=Ze,t.domClear=Ke,t.domCreate=$e,t.domFind=Qe,t.font=Ne,t.fontFamily=Oe,t.fontSize=Re,t.intersect=function(t,n,i){const r=[],o=(new s).union(n),a=t.marktype;return a?Yn(t,o,i,r):"group"===a?$n(t,o,i,r):e.error("Intersect scene must be mark node or group item.")},t.intersectBoxLine=Mt,t.intersectPath=kt,t.intersectPoint=wt,t.intersectRule=At,t.lineHeight=Pe,t.multiLineOffset=function(t){const n=Le(t);return(e.isArray(n)?n.length-1:0)*Pe(t)},t.openTag=bn,t.pathCurves=_,t.pathEqual=ti,t.pathParse=k,t.pathRectangle=X,t.pathRender=O,t.pathSymbols=E,t.pathTrail=j,t.point=en,t.renderModule=function(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(Jn[t]=e,this):Jn[t]},t.resetSVGClipId=function(){Kt=1},t.sceneEqual=Kn,t.sceneFromJSON=je,t.scenePickVisit=Dt,t.sceneToJSON=Xe,t.sceneVisit=Et,t.sceneZOrder=qt,t.textMetrics=we,Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "vega-scenegraph",
"version": "4.5.1",
"version": "4.6.0",
"description": "Vega scenegraph and renderers.",

@@ -25,6 +25,6 @@ "license": "BSD-3-Clause",

"vega-canvas": "^1.2.1",
"vega-loader": "^4.1.4",
"vega-util": "^1.13.0"
"vega-loader": "^4.2.0",
"vega-util": "^1.13.1"
},
"gitHead": "49a57c10b309addc513a52a38e1959ee169d4758"
"gitHead": "2bee653f2a56c2c0d4393d69d172b9ccdb0fe2f9"
}

@@ -14,4 +14,4 @@ function duplicate(_) {

function build(strict) {
var schema = duplicate(BASE);
for (var type in MARKS) {
const schema = duplicate(BASE);
for (const type in MARKS) {
buildMark(type, schema.refs, strict);

@@ -23,3 +23,3 @@ }

function buildMark(type, refs, strict) {
var mark = duplicate(MARK_BASE);
const mark = duplicate(MARK_BASE);
mark.properties.marktype.enum = [ type ];

@@ -29,3 +29,3 @@ mark.properties.items.items.$ref += type;

var item = duplicate(ITEM_BASE);
const item = duplicate(ITEM_BASE);
extend(item.properties, MARKS[type].properties || {});

@@ -41,37 +41,37 @@ if (strict) item.additionalProperties = false;

// Based on http://www.w3.org/TR/SVG/paths.html#PathDataBNF
var wsp = '[ \t\r\f]*',
csp = '([ \t\r\f]+,?[ \t\r\f]*|,[ \t\r\f]*)?',
sep = csp + '?',
pos = '[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?',
num = '[-+]?' + pos,
nseq = num + '(' + sep + num + ')*',
p = num + sep + num,
p2 = p + sep + p,
p3 = p + '(' + sep + p + '){2}',
pseq = p + '(' + sep + p + ')*',
arc = pos + sep + pos + sep + num + csp + '[01]' + sep + '[01]' + sep + p,
m = '[Mm]' + wsp + pseq,
lt = '[LlTt]' + wsp + pseq,
hv = '[HhVv]' + wsp + nseq,
c = '[Cc]' + wsp + p3 + '(' + sep + p3 + ')*',
qs = '[QqSs]' + wsp + p2 + '(' + sep + p2 + ')*',
a = '[Aa]' + wsp + arc + '(' + sep + arc + ')*',
z = '[Zz]',
draw = '(' + [z, lt, hv, c, qs, a].join('|') + ')',
move = m + wsp + '(' + draw + '(' + sep + draw + ')*' + ')?',
path = wsp + '(' + move + '(' + sep + move + ')*' + ')?' + wsp;
const wsp = '[ \t\r\f]*',
csp = '([ \t\r\f]+,?[ \t\r\f]*|,[ \t\r\f]*)?',
sep = csp + '?',
pos = '[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?',
num = '[-+]?' + pos,
nseq = num + '(' + sep + num + ')*',
p = num + sep + num,
p2 = p + sep + p,
p3 = p + '(' + sep + p + '){2}',
pseq = p + '(' + sep + p + ')*',
arc = pos + sep + pos + sep + num + csp + '[01]' + sep + '[01]' + sep + p,
m = '[Mm]' + wsp + pseq,
lt = '[LlTt]' + wsp + pseq,
hv = '[HhVv]' + wsp + nseq,
c = '[Cc]' + wsp + p3 + '(' + sep + p3 + ')*',
qs = '[QqSs]' + wsp + p2 + '(' + sep + p2 + ')*',
a = '[Aa]' + wsp + arc + '(' + sep + arc + ')*',
z = '[Zz]',
draw = '(' + [z, lt, hv, c, qs, a].join('|') + ')',
move = m + wsp + '(' + draw + '(' + sep + draw + ')*' + ')?',
path = wsp + '(' + move + '(' + sep + move + ')*' + ')?' + wsp;
return path;
}
const COLOR_NAMES = 'aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen';
function css_color_names() {
return COLOR_NAMES.split('|').map(function(name) {
return name.split('').map(function(c) {
return '[' + c.toUpperCase() + c.toLowerCase() + ']';
}).join('');
}).join('|');
return COLOR_NAMES.split('|').map(
name => name.split('')
.map(c => `[${c.toUpperCase()}${c.toLowerCase()}]`)
.join('')
).join('|');
}
var COLOR_NAMES = 'aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen';
var BASE = {
const BASE = {
"$schema": "http://json-schema.org/draft-06/schema#",

@@ -165,3 +165,3 @@ "title": "Vega scenegraph",

var MARK_BASE = {
const MARK_BASE = {
"type": "object",

@@ -182,3 +182,22 @@ "properties": {

var ITEM_BASE = {
const BLEND_MODE = [
null,
'multiply',
'screen',
'overlay',
'darken',
'lighten',
'color-dodge',
'color-burn',
'hard-light',
'soft-light',
'difference',
'exclusion',
'hue',
'saturation',
'color',
'luminosity',
];
const ITEM_BASE = {
"type": "object",

@@ -190,2 +209,3 @@ "properties": {

"height": { "type": "number" },
"blend": { "enum": BLEND_MODE, "default": null },
"opacity": { "type": "number", "default": 1 },

@@ -209,3 +229,3 @@ "fill": { "$ref": "#/refs/paint" },

var AREA_INTERPOLATE = [
const AREA_INTERPOLATE = [
'basis',

@@ -222,3 +242,3 @@ 'cardinal',

var LINE_INTERPOLATE = [
const LINE_INTERPOLATE = [
'basis',

@@ -243,3 +263,28 @@ 'basis-closed',

var MARKS = {
const TEXT_BASELINE = [
'alphabetic',
'top',
'middle',
'bottom',
'line-top',
'line-bottom'
];
const TEXT_FONT_WEIGHT = [
'normal',
'bold',
'bolder',
'lighter',
100,
200,
300,
400,
500,
600,
700,
800,
900
];
const MARKS = {
"group": {

@@ -347,3 +392,3 @@ "properties": {

"baseline": {
"enum": [ "top", "middle", "bottom", "alphabetic" ],
"enum": TEXT_BASELINE,
"default": "alphabetic"

@@ -363,6 +408,3 @@ },

"fontWeight": {
"enum": [
"normal", "bold", "bolder", "lighter",
100, 200, 300, 400, 500, 600, 700, 800, 900
],
"enum": TEXT_FONT_WEIGHT,
"default": "normal"

@@ -384,3 +426,3 @@ },

var schema = build(true);
const schema = build(true);
process.stdout.write(JSON.stringify(schema, null, 2));

@@ -80,2 +80,10 @@ export default function Bounds(b) {

prototype.scale = function(s) {
this.x1 *= s;
this.y1 *= s;
this.x2 *= s;
this.y2 *= s;
return this;
};
prototype.translate = function(dx, dy) {

@@ -82,0 +90,0 @@ this.x1 += dx;

@@ -58,6 +58,11 @@ import Renderer from './Renderer';

// align to base pixel grid in case of non-integer scaling (#2425)
if (g.pixelRatio % 1) {
b.scale(g.pixelRatio).round().scale(1 / g.pixelRatio);
}
// to avoid artifacts translate if origin has fractional pixels
b.translate(-(origin[0] % 1), -(origin[1] % 1));
// set clipping path
// set clip path
g.beginPath();

@@ -64,0 +69,0 @@ g.rect(b.x1, b.y1, b.width(), b.height());

@@ -5,5 +5,6 @@ import {hasCornerRadius, rectangle} from '../path/shapes';

import {visit, pickVisit} from '../util/visit';
import blend from '../util/canvas/blend';
import {clipGroup} from '../util/canvas/clip';
import fill from '../util/canvas/fill';
import stroke from '../util/canvas/stroke';
import fill from '../util/canvas/fill';
import {hitPath} from '../util/canvas/pick';

@@ -86,2 +87,3 @@ import clip from '../util/svg/clip';

rectanglePath(context, group, gx, gy);
blend(context, group);
if (group.fill && fill(context, group, opacity)) {

@@ -113,2 +115,3 @@ context.fill();

rectanglePath(context, group, gx, gy);
blend(context, group);
if (stroke(context, group, opacity)) {

@@ -115,0 +118,0 @@ context.stroke();

import {visit} from '../util/visit';
import blend from '../util/canvas/blend';
import {pick} from '../util/canvas/pick';

@@ -108,2 +109,3 @@ import {translate} from '../util/svg/transform';

if (image.complete || image.toDataURL) {
blend(context, item);
context.globalAlpha = (opacity = item.opacity) != null ? opacity : 1;

@@ -110,0 +112,0 @@ context.imageSmoothingEnabled = item.smooth !== false;

import boundStroke from '../bound/boundStroke';
import {intersectRule} from '../util/intersect';
import {visit} from '../util/visit';
import blend from '../util/canvas/blend';
import {pick} from '../util/canvas/pick';

@@ -45,2 +46,3 @@ import stroke from '../util/canvas/stroke';

if (opacity && path(context, item, opacity)) {
blend(context, item);
context.stroke();

@@ -47,0 +49,0 @@ }

@@ -6,2 +6,3 @@ import Bounds from '../Bounds';

import {visit} from '../util/visit';
import blend from '../util/canvas/blend';
import fill from '../util/canvas/fill';

@@ -122,2 +123,3 @@ import {pick} from '../util/canvas/pick';

tl = textLines(item);
blend(context, item);
if (isArray(tl)) {

@@ -124,0 +126,0 @@ lh = lineHeight(item);

import {image} from 'vega-canvas';
import {loader} from 'vega-loader';
import {hasOwnProperty} from 'vega-util';

@@ -39,4 +40,4 @@ export default function ResourceLoader(customLoader) {

prototype.loadImage = function(uri) {
var loader = this,
Image = image();
const loader = this,
Image = image();
increment(loader);

@@ -47,16 +48,17 @@

.then(function(opt) {
var url = opt.href;
const url = opt.href;
if (!url || !Image) throw {url: url};
var img = new Image();
const img = new Image();
img.onload = function() {
decrement(loader);
};
// set crossOrigin only if cors is defined; empty string sets anonymous mode
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin
const cors = hasOwnProperty(opt, 'crossOrigin') ? opt.crossOrigin : 'anonymous';
if (cors != null) img.crossOrigin = cors;
img.onerror = function() {
decrement(loader);
}
// attempt to load image resource
img.onload = () => decrement(loader);
img.onerror = () => decrement(loader);
img.src = url;
img.src = url;
return img;

@@ -63,0 +65,0 @@ })

@@ -152,4 +152,4 @@ import Renderer from './Renderer';

// coordinates, in a way that is cumbersome to replicate in canvas.
// So we wrap the radial gradient in a pattern element, allowing us
// to mantain a circular gradient that matches what canvas provides.
// We wrap the radial gradient in a pattern element, allowing us to
// maintain a circular gradient that matches what canvas provides.
var pt = domChild(el, index++, 'pattern', ns);

@@ -156,0 +156,0 @@ pt.setAttribute('id', patternPrefix + grad.id);

@@ -104,4 +104,4 @@ import Renderer from './Renderer';

// coordinates, in a way that is cumbersome to replicate in canvas.
// So we wrap the radial gradient in a pattern element, allowing us
// to mantain a circular gradient that matches what canvas provides.
// We wrap the radial gradient in a pattern element, allowing us to
// maintain a circular gradient that matches what canvas provides.

@@ -108,0 +108,0 @@ defs += openTag(tag = 'pattern', {

@@ -5,5 +5,5 @@ import {isGradient} from '../../Gradient';

export default function(context, item, value) {
return isGradient(value) ?
gradient(context, value, item.bounds) :
value;
return isGradient(value)
? gradient(context, value, item.bounds)
: value;
}

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

import blend from './blend';
import fill from './fill';

@@ -29,2 +30,4 @@ import stroke from './stroke';

blend(context, item);
if (item.fill && fill(context, item, opacity)) {

@@ -31,0 +34,0 @@ context.fill();

@@ -1,32 +0,62 @@

export default function(context, gradient, bounds) {
import {canvas} from 'vega-canvas';
function v(value, dflt) {
return value == null ? dflt : value;
}
function addStops(gradient, stops) {
const n = stops.length;
for (let i=0; i<n; ++i) {
gradient.addColorStop(stops[i].offset, stops[i].color);
}
return gradient;
}
export default function(context, spec, bounds) {
const w = bounds.width(),
h = bounds.height(),
stop = gradient.stops,
n = stop.length;
h = bounds.height();
let gradient;
const canvasGradient = gradient.gradient === 'radial'
? context.createRadialGradient(
bounds.x1 + v(gradient.x1, 0.5) * w,
bounds.y1 + v(gradient.y1, 0.5) * h,
Math.max(w, h) * v(gradient.r1, 0),
bounds.x1 + v(gradient.x2, 0.5) * w,
bounds.y1 + v(gradient.y2, 0.5) * h,
Math.max(w, h) * v(gradient.r2, 0.5)
)
: context.createLinearGradient(
bounds.x1 + v(gradient.x1, 0) * w,
bounds.y1 + v(gradient.y1, 0) * h,
bounds.x1 + v(gradient.x2, 1) * w,
bounds.y1 + v(gradient.y2, 0) * h
if (spec.gradient === 'radial') {
gradient = context.createRadialGradient(
bounds.x1 + v(spec.x1, 0.5) * w,
bounds.y1 + v(spec.y1, 0.5) * h,
Math.max(w, h) * v(spec.r1, 0),
bounds.x1 + v(spec.x2, 0.5) * w,
bounds.y1 + v(spec.y2, 0.5) * h,
Math.max(w, h) * v(spec.r2, 0.5)
);
} else { // linear gradient
const x1 = v(spec.x1, 0),
y1 = v(spec.y1, 0),
x2 = v(spec.x2, 1),
y2 = v(spec.y2, 0);
if (x1 === x2 || y1 === y2 || w === h) {
// axis aligned: use normal gradient
gradient = context.createLinearGradient(
bounds.x1 + x1 * w,
bounds.y1 + y1 * h,
bounds.x1 + x2 * w,
bounds.y1 + y2 * h
);
} else {
// not axis aligned: render gradient into a pattern (#2365)
// this allows us to use normalized bounding box coordinates
const image = canvas(Math.ceil(w), Math.ceil(h)),
ictx = image.getContext('2d');
for (let i=0; i<n; ++i) {
canvasGradient.addColorStop(stop[i].offset, stop[i].color);
ictx.scale(w, h);
ictx.fillStyle = addStops(
ictx.createLinearGradient(x1, y1, x2, y2),
spec.stops
);
ictx.fillRect(0, 0, w, h);
return context.createPattern(image, 'no-repeat');
}
}
return canvasGradient;
return addStops(gradient, spec.stops);
}
function v(value, dflt) {
return value == null ? dflt : value;
}

@@ -8,14 +8,12 @@ function devicePixelRatio() {

export default function(canvas, width, height, origin, scaleFactor, opt) {
var inDOM = typeof HTMLElement !== 'undefined'
&& canvas instanceof HTMLElement
&& canvas.parentNode != null;
const inDOM = typeof HTMLElement !== 'undefined'
&& canvas instanceof HTMLElement
&& canvas.parentNode != null,
context = canvas.getContext('2d'),
ratio = inDOM ? pixelRatio : scaleFactor;
var context = canvas.getContext('2d'),
ratio = inDOM ? pixelRatio : scaleFactor,
key;
canvas.width = width * ratio;
canvas.height = height * ratio;
for (key in opt) {
for (const key in opt) {
context[key] = opt[key];

@@ -22,0 +20,0 @@ }

@@ -6,3 +6,3 @@ import boundMark from '../bound/boundMark';

'x', 'y', 'width', 'height', 'align', 'baseline', // layout
'fill', 'fillOpacity', 'opacity', // fill
'fill', 'fillOpacity', 'opacity', 'blend', // fill
'stroke', 'strokeOpacity', 'strokeWidth', 'strokeCap', // stroke

@@ -9,0 +9,0 @@ 'strokeDash', 'strokeDashOffset', // stroke dash

@@ -12,5 +12,6 @@ export var styles = {

'strokeMiterLimit': 'stroke-miterlimit',
'opacity': 'opacity'
'opacity': 'opacity',
'blend': 'mix-blend-mode'
};
export var styleProperties = Object.keys(styles);

@@ -73,5 +73,4 @@ import {context} from './canvas/context';

export function textValue(item, line) {
return line == null ? ''
: item.limit > 0 ? truncate(item, line)
: line + '';
const text = line == null ? '' : (line + '').trim();
return item.limit > 0 && text.length ? truncate(item, text) : text;
}

@@ -91,5 +90,4 @@

function truncate(item, line) {
function truncate(item, text) {
var limit = +item.limit,
text = line + '',
width = widthGetter(item);

@@ -142,9 +140,13 @@

// why? not all browsers support SVG 1.1 'alignment-baseline' :(
// this also ensures consistent layout across renderers
var baseline = item.baseline,
h = fontSize(item);
return Math.round(
baseline === 'top' ? 0.79*h :
baseline === 'middle' ? 0.30*h :
baseline === 'bottom' ? -0.21*h : 0
baseline === 'top' ? 0.79 * h :
baseline === 'middle' ? 0.30 * h :
baseline === 'bottom' ? -0.21 * h :
baseline === 'line-top' ? 0.29 * h + 0.5 * lineHeight(item) :
baseline === 'line-bottom' ? 0.29 * h - 0.5 * lineHeight(item) : 0
);
}

Sorry, the diff of this file is too big to display

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