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 2.0.0-beta.19 to 2.0.0-beta.20

12

build/vega-scenegraph-schema.json

@@ -1195,2 +1195,14 @@ {

},
"limit": {
"type": "number",
"default": 0
},
"dir": {
"type": "string",
"default": "ltr"
},
"ellipsis": {
"type": "string",
"default": "…"
},
"align": {

@@ -1197,0 +1209,0 @@ "enum": [

4

build/vega-scenegraph.min.js

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

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

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

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

if (bounds && !bounds.intersects(item.bounds)) return; // bounds check
if (!(str = textValue(item.text))) return; // get text string
if (!(str = textValue(item))) return; // get text string

@@ -82,0 +82,0 @@ opacity = item.opacity == null ? 1 : item.opacity;

@@ -344,3 +344,3 @@ import Renderer from './Renderer';

text: function(mdef, el, item) {
var str = textValue(item.text);
var str = textValue(item);
if (str !== values.text) {

@@ -347,0 +347,0 @@ el.textContent = str;

@@ -176,3 +176,3 @@ import Renderer from './Renderer';

if (tag === 'text') {
str += escape_text(textValue(item.text));
str += escape_text(textValue(item));
} else if (tag === 'g') {

@@ -179,0 +179,0 @@ str += openTag('path',

import Canvas from './canvas/canvas';
var context;
var context = Canvas(1, 1),
fontHeight;
if (context) context = context.getContext('2d');
// make dumb, simple estimate if no canvas is available
function estimateWidth(item) {
// make dumb, simple estimate if no canvas is available
return ~~(0.8 * textValue(item).length * height(item));
return fontHeight = height(item), estimate(textValue(item));
}
function estimate(text) {
return ~~(0.8 * text.length * fontHeight);
}
// measure text width if canvas is available
function measureWidth(item) {
// measure text width if canvas is available
context.font = font(item);
return context.measureText(textValue(item.text)).width;
return context.font = font(item), measure(textValue(item));
}
function measure(text) {
return context.measureText(text).width;
}
function height(item) {

@@ -24,11 +34,44 @@ return item.fontSize != null ? item.fontSize : 11;

estimateWidth: estimateWidth,
width: (context = Canvas(1, 1))
? (context = context.getContext('2d'), measureWidth)
: estimateWidth
width: context ? measureWidth : estimateWidth
};
export function textValue(s) {
return s != null ? String(s) : '';
export function textValue(item) {
var s = item.text;
return s == null ? '' : item.limit > 0 ? truncate(item) : s + '';
}
export function truncate(item) {
var limit = +item.limit,
text = item.text + '',
width = context
? (context.font = font(item), measure)
: (fontHeight = height(item), estimate);
if (width(text) < limit) return text;
var ellipsis = item.ellipsis || '\u2026',
rtl = item.dir === 'rtl',
lo = 0,
hi = text.length, mid;
limit -= width(ellipsis);
if (rtl) {
while (lo < hi) {
mid = (lo + hi >>> 1);
if (width(text.slice(mid)) > limit) lo = mid + 1;
else hi = mid;
}
return ellipsis + text.slice(lo);
} else {
while (lo < hi) {
mid = 1 + (lo + hi >>> 1);
if (width(text.slice(0, mid)) < limit) lo = mid;
else hi = mid - 1;
}
return text.slice(0, lo) + ellipsis;
}
}
export function font(item, quote) {

@@ -35,0 +78,0 @@ var font = item.font;

Sorry, the diff of this file is not supported yet

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