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 1.0.15 to 1.0.16

2

package.json
{
"name": "vega-scenegraph",
"version": "1.0.15",
"version": "1.0.16",
"description": "Vega scenegraph and renderers.",

@@ -5,0 +5,0 @@ "repository": {

@@ -92,2 +92,11 @@ function Bounds(b) {

prototype.alignsWith = function(b) {
return b && (
this.x1 == b.x1 ||
this.x2 == b.x2 ||
this.y1 == b.y1 ||
this.y2 == b.y2
);
};
prototype.intersects = function(b) {

@@ -94,0 +103,0 @@ return b && !(

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.vg||(e.vg={})).scene=t()}}(function(){return function t(e,n,i){function r(a,o){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!o&&l)return l(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var n=e[a][1][t];return r(n?n:t)},h,h.exports,t,e,n,i)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(t,e,n){},{}],2:[function(t,e,n){function i(e){var n=e.url;if(!n&&e.file)return c+e.file;if(e.baseURL&&!h.test(n)&&(u(n,"/")||"/"===e.baseURL[e.baseURL.length-1]||(n="/"+n),n=e.baseURL+n),!r.useXHR&&u(n,"//")&&(n=(e.defaultProtocol||"http")+":"+n),e.domainWhiteList){var i,s;if(r.useXHR){var a=document.createElement("a");a.href=n,""===a.host&&(a.href=a.href),i=a.hostname.toLowerCase(),s=window.location.hostname}else{var o=t("url").parse(n);i=o.hostname,s=null}if(s!==i){var l=e.domainWhiteList.some(function(t){var e=i.length-t.length;return t===i||e>1&&"."===i[e-1]&&i.lastIndexOf(t)===e});if(!l)throw"URL is not whitelisted: "+n}}return n}function r(t,e){var n,i=e||function(t){throw t};try{n=r.sanitizeUrl(t)}catch(s){return void i(s)}return n?r.useXHR?a(n,e):u(n,c)?o(n.slice(c.length),e):n.indexOf("://")<0?o(n,e):l(n,e):void i("Invalid URL: "+t.url)}function s(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function a(t,e){function n(){var t=r.status;!t&&s(r)||t>=200&&300>t||304===t?e(null,r.responseText):e(r,null)}var i=!!e,r=new XMLHttpRequest;return!this.XDomainRequest||"withCredentials"in r||!/^(http(s)?:)?\/\//.test(t)||(r=new XDomainRequest),i&&("onload"in r?r.onload=r.onerror=n:r.onreadystatechange=function(){r.readyState>3&&n()}),r.open("GET",t,i),r.send(),!i&&s(r)?r.responseText:void 0}function o(e,n){var i=t("fs");return n?void i.readFile(e,n):i.readFileSync(e,"utf8")}function l(e,n){if(!n)return t("sync-request")("GET",e).getBody();var i={url:e,encoding:null,gzip:!0};t("request")(i,function(t,e,i){t||200!==e.statusCode?(t=t||"Load failed with response code "+e.statusCode+".",n(t,null)):n(null,i)})}function u(t,e){return null==t?!1:0===t.lastIndexOf(e,0)}var h=/^([A-Za-z]+:)?\/\//,c="file://";r.sanitizeUrl=i,r.useXHR="undefined"!=typeof XMLHttpRequest,e.exports=r},{fs:1,request:1,"sync-request":1,url:1}],3:[function(t,e,n){e.exports={path:t("./path"),render:t("./render"),Item:t("./util/Item"),bound:t("./util/bound"),Bounds:t("./util/Bounds"),canvas:t("./util/canvas"),Gradient:t("./util/Gradient"),toJSON:t("./util/scene").toJSON,fromJSON:t("./util/scene").fromJSON}},{"./path":5,"./render":25,"./util/Bounds":31,"./util/Gradient":33,"./util/Item":35,"./util/bound":36,"./util/canvas":37,"./util/scene":39}],4:[function(t,e,n){function i(t,e,n,i,r,a,l,u,h){var c=o.call(arguments);if(s[c])return s[c];var f=l*(Math.PI/180),d=Math.sin(f),p=Math.cos(f);n=Math.abs(n),i=Math.abs(i);var g=p*(u-t)*.5+d*(h-e)*.5,v=p*(h-e)*.5-d*(u-t)*.5,m=g*g/(n*n)+v*v/(i*i);m>1&&(m=Math.sqrt(m),n*=m,i*=m);var y=p/n,x=d/n,k=-d/i,_=p/i,b=y*u+x*h,w=k*u+_*h,M=y*t+x*e,T=k*t+_*e,C=(M-b)*(M-b)+(T-w)*(T-w),A=1/C-.25;0>A&&(A=0);var P=Math.sqrt(A);a==r&&(P=-P);var I=.5*(b+M)-P*(T-w),L=.5*(w+T)+P*(M-b),R=Math.atan2(w-L,b-I),z=Math.atan2(T-L,M-I),O=z-R;0>O&&1===a?O+=2*Math.PI:O>0&&0===a&&(O-=2*Math.PI);for(var S=Math.ceil(Math.abs(O/(.5*Math.PI+.001))),D=[],q=0;S>q;++q){var N=R+q*O/S,E=R+(q+1)*O/S;D[q]=[I,L,N,E,n,i,d,p]}return s[c]=D}function r(t){var e=o.call(t);if(a[e])return a[e];var n=t[0],i=t[1],r=t[2],s=t[3],l=t[4],u=t[5],h=t[6],c=t[7],f=c*l,d=-h*u,p=h*l,g=c*u,v=Math.cos(r),m=Math.sin(r),y=Math.cos(s),x=Math.sin(s),k=.5*(s-r),_=Math.sin(.5*k),b=8/3*_*_/Math.sin(k),w=n+v-b*m,M=i+m+b*v,T=n+y,C=i+x,A=T+b*x,P=C-b*y;return a[e]=[f*w+d*M,p*w+g*M,f*A+d*P,p*A+g*P,f*T+d*C,p*T+g*C]}var s={},a={},o=[].join;e.exports={segments:i,bezier:r,cache:{segments:s,bezier:a}}},{}],5:[function(t,e,n){e.exports={parse:t("./parse"),render:t("./render")}},{"./parse":6,"./render":7}],6:[function(t,e,n){var i={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},r=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];e.exports=function(t){var e,n,s,a,o,l,u,h,c,f,d,p=[];for(e=t.slice().replace(r[0],"###$1").split(r[1]).slice(1),h=0,f=e.length;f>h;++h){for(n=e[h],s=n.slice(1).trim().replace(r[2],"$1###$2").split(r[3]),l=n.charAt(0),a=[l],c=0,d=s.length;d>c;++c)(o=+s[c])===o&&a.push(o);if(u=i[l.toLowerCase()],a.length-1>u)for(c=1,d=a.length;d>c;c+=u)p.push([l].concat(a.slice(c,c+u)));else p.push(a)}return p}},{}],7:[function(t,e,n){function i(t,e,n,i){for(var s=r.segments(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),a=0;a<s.length;++a){var o=r.bezier(s[a]);t.bezierCurveTo.apply(t,o)}}var r=t("./arc");e.exports=function(t,e,n,r){var s,a,o,l,u,h=null,c=0,f=0,d=0,p=0;null==n&&(n=0),null==r&&(r=0),t.beginPath();for(var g=0,v=e.length;v>g;++g){switch(s=e[g],s[0]){case"l":c+=s[1],f+=s[2],t.lineTo(c+n,f+r);break;case"L":c=s[1],f=s[2],t.lineTo(c+n,f+r);break;case"h":c+=s[1],t.lineTo(c+n,f+r);break;case"H":c=s[1],t.lineTo(c+n,f+r);break;case"v":f+=s[1],t.lineTo(c+n,f+r);break;case"V":f=s[1],t.lineTo(c+n,f+r);break;case"m":c+=s[1],f+=s[2],t.moveTo(c+n,f+r);break;case"M":c=s[1],f=s[2],t.moveTo(c+n,f+r);break;case"c":a=c+s[5],o=f+s[6],d=c+s[3],p=f+s[4],t.bezierCurveTo(c+s[1]+n,f+s[2]+r,d+n,p+r,a+n,o+r),c=a,f=o;break;case"C":c=s[5],f=s[6],d=s[3],p=s[4],t.bezierCurveTo(s[1]+n,s[2]+r,d+n,p+r,c+n,f+r);break;case"s":a=c+s[3],o=f+s[4],d=2*c-d,p=2*f-p,t.bezierCurveTo(d+n,p+r,c+s[1]+n,f+s[2]+r,a+n,o+r),d=c+s[1],p=f+s[2],c=a,f=o;break;case"S":a=s[3],o=s[4],d=2*c-d,p=2*f-p,t.bezierCurveTo(d+n,p+r,s[1]+n,s[2]+r,a+n,o+r),c=a,f=o,d=s[1],p=s[2];break;case"q":a=c+s[3],o=f+s[4],d=c+s[1],p=f+s[2],t.quadraticCurveTo(d+n,p+r,a+n,o+r),c=a,f=o;break;case"Q":a=s[3],o=s[4],t.quadraticCurveTo(s[1]+n,s[2]+r,a+n,o+r),c=a,f=o,d=s[1],p=s[2];break;case"t":a=c+s[1],o=f+s[2],null===h[0].match(/[QqTt]/)?(d=c,p=f):"t"===h[0]?(d=2*c-l,p=2*f-u):"q"===h[0]&&(d=2*c-d,p=2*f-p),l=d,u=p,t.quadraticCurveTo(d+n,p+r,a+n,o+r),c=a,f=o,d=c+s[1],p=f+s[2];break;case"T":a=s[1],o=s[2],d=2*c-d,p=2*f-p,t.quadraticCurveTo(d+n,p+r,a+n,o+r),c=a,f=o;break;case"a":i(t,c+n,f+r,[s[1],s[2],s[3],s[4],s[5],s[6]+c+n,s[7]+f+r]),c+=s[6],f+=s[7];break;case"A":i(t,c+n,f+r,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+r]),c=s[6],f=s[7];break;case"z":case"Z":t.closePath()}h=s}}},{"./arc":4}],8:[function(t,e,n){function i(){this._active=null,this._handlers={}}var r=i.prototype;r.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.padding(e)},r.element=function(){return this._el},r.padding=function(t){return this._padding=t||{top:0,left:0,bottom:0,right:0},this},r.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},r.on=function(){},r.off=function(){},r.handlers=function(){var t,e=this._handlers,n=[];for(t in e)n.push.apply(n,e[t]);return n},r.eventName=function(t){var e=t.indexOf(".");return 0>e?t:t.slice(0,e)},e.exports=i},{}],9:[function(t,e,n){function i(){this._el=null,this._bgcolor=null}var r=i.prototype;r.initialize=function(t,e,n,i){return this._el=t,this.resize(e,n,i)},r.element=function(){return this._el},r.scene=function(){return this._el&&this._el.firstChild},r.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},r.resize=function(t,e,n){return this._width=t,this._height=e,this._padding=n||{top:0,left:0,bottom:0,right:0},this},r.render=function(){return this},e.exports=i},{}],10:[function(t,e,n){function i(){s.call(this),this._down=null,this._touch=null,this._first=!0}var r=t("../../util/dom"),s=t("../Handler"),a=t("./marks"),o=s.prototype,l=i.prototype=Object.create(o);l.constructor=i,l.initialize=function(t,e,n){var i=this._canvas=r.find(t,"canvas");if(i){var s=this;this.events.forEach(function(t){i.addEventListener(t,function(e){l[t]?l[t].call(s,e):s.fire(t,e)})})}return o.initialize.call(this,t,e,n)},l.canvas=function(){return this._canvas},l.context=function(){return this._canvas.getContext("2d")},l.events=["keydown","keypress","keyup","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],l.DOMMouseScroll=function(t){this.fire("mousewheel",t)},l.mousemove=function(t){var e=this._active,n=this.pickEvent(t);n===e?this.fire("mousemove",t):(this.fire("mouseout",t),this._active=n,this.fire("mouseover",t),this.fire("mousemove",t))},l.mouseout=function(t){this.fire("mouseout",t),this._active=null},l.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},l.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},l.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},l.touchmove=function(t){this.fire("touchmove",t,!0)},l.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},l.fire=function(t,e,n){var i,r,s=n?this._touch:this._active,a=this._handlers[t];if(a)for(e.vegaType=t,i=0,r=a.length;r>i;++i)a[i].handler.call(this._obj,e,s)},l.on=function(t,e){var n=this.eventName(t),i=this._handlers;return(i[n]||(i[n]=[])).push({type:t,handler:e}),this},l.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}},l.pickEvent=function(t){var e,n,i=this._canvas.getBoundingClientRect(),r=this._padding;return this.pick(this._scene,e=t.clientX-i.left,n=t.clientY-i.top,e-r.left,n-r.top)},l.pick=function(t,e,n,i,r){var s=this.context(),o=a[t.marktype];return o.pick.call(this,s,t,e,n,i,r)},e.exports=i},{"../../util/dom":38,"../Handler":8,"./marks":17}],11:[function(t,e,n){function i(t){h.call(this),this._loader=new l(t)}function r(t,e){if(!e)return null;var n,i,r,a,l,u=new o;for(n=0,i=e.length;i>n;++n)r=e[n],a=r.mark,l=a.group,r=c[a.marktype].nested?a:r,u.union(s(r.bounds,l)),r["bounds:prev"]&&u.union(s(r["bounds:prev"],l));return u.round(),t.beginPath(),t.rect(u.x1,u.y1,u.width(),u.height()),t.clip(),u}function s(t,e){if(null==e)return t;for(var n=t.clone();null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}var a=t("../../util/dom"),o=t("../../util/Bounds"),l=t("../../util/ImageLoader"),u=t("../../util/canvas"),h=t("../Renderer"),c=t("./marks");i.RETINA=!0;var f=h.prototype,d=i.prototype=Object.create(f);d.constructor=i,d.initialize=function(t,e,n,i){return this._canvas=u.instance(e,n),t&&(a.clear(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),f.initialize.call(this,t,e,n,i)},d.resize=function(t,e,n){return f.resize.call(this,t,e,n),u.resize(this._canvas,this._width,this._height,this._padding,i.RETINA),this},d.canvas=function(){return this._canvas},d.context=function(){return this._canvas?this._canvas.getContext("2d"):null},d.pendingImages=function(){return this._loader.pending()},d.render=function(t,e){var n,i=this.context(),s=this._padding,a=this._width+s.left+s.right,o=this._height+s.top+s.bottom;return this._scene=t,i.save(),n=r(i,e),this.clear(-s.left,-s.top,a,o),this.draw(i,t,n),i.restore(),this._scene=null,this},d.draw=function(t,e,n){var i=c[e.marktype];i.draw.call(this,t,e,n)},d.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))},d.loadImage=function(t){var e=this,n=this._scene;return this._loader.loadImage(t,function(){e.renderAsync(n)})},d.renderAsync=function(t){var e=this;e._async_id&&clearTimeout(e._async_id),e._async_id=setTimeout(function(){e.render(t),delete e._async_id},10)},e.exports=i},{"../../util/Bounds":31,"../../util/ImageLoader":34,"../../util/canvas":37,"../../util/dom":38,"../Renderer":9,"./marks":17}],12:[function(t,e,n){e.exports={Handler:t("./CanvasHandler"),Renderer:t("./CanvasRenderer")}},{"./CanvasHandler":10,"./CanvasRenderer":11}],13:[function(t,e,n){function i(t,e){var n=e.x||0,i=e.y||0,r=e.innerRadius||0,a=e.outerRadius||0,o=(e.startAngle||0)-s,l=(e.endAngle||0)-s;t.beginPath(),0===r?t.moveTo(n,i):t.arc(n,i,r,o,l,0),t.arc(n,i,a,l,o,1),t.closePath()}var r=t("./util"),s=Math.PI/2;e.exports={draw:r.drawAll(i),pick:r.pickPath(i)}},{"./util":24}],14:[function(t,e,n){function i(t,e){var n=e[0],i=n.pathCache||(n.pathCache=a(l(e)));o(t,i)}function r(t,e,n,i,r,s){var a=e.items,o=e.bounds;return!a||!a.length||o&&!o.contains(r,s)?null:(null!=t.pixelratio&&1!==t.pixelratio&&(n*=t.pixelratio,i*=t.pixelratio),u(t,a,n,i)?a[0]:null)}var s=t("./util"),a=t("../../../path/parse"),o=t("../../../path/render"),l=t("../../../util/svg").path.area,u=s.testPath(i);e.exports={draw:s.drawOne(i),pick:r,nested:!0}},{"../../../path/parse":6,"../../../path/render":7,"../../../util/svg":40,"./util":24}],15:[function(t,e,n){function i(t,e,n){if(e.items&&e.items.length){var i,r,o,l,u,h,c,f,d,p,g,v,m,y=e.items,x=this;for(p=0,g=y.length;g>p;++p){for(i=y[p],o=i.axisItems||a,r=i.items||a,l=i.legendItems||a,u=i.x||0,h=i.y||0,c=i.width||0,f=i.height||0,(i.stroke||i.fill)&&(d=null==i.opacity?1:i.opacity,d>0&&(i.fill&&s.fill(t,i,d)&&t.fillRect(u,h,c,f),i.stroke&&s.stroke(t,i,d)&&t.strokeRect(u,h,c,f))),t.save(),t.translate(u,h),i.clip&&(t.beginPath(),t.rect(0,0,c,f),t.clip()),n&&n.translate(-u,-h),v=0,m=o.length;m>v;++v)"back"===o[v].layer&&x.draw(t,o[v],n);for(v=0,m=r.length;m>v;++v)x.draw(t,r[v],n);for(v=0,m=o.length;m>v;++v)"back"!==o[v].layer&&x.draw(t,o[v],n);for(v=0,m=l.length;m>v;++v)x.draw(t,l[v],n);n&&n.translate(u,h),t.restore()}}}function r(t,e,n,i,r,s){if(e.bounds&&!e.bounds.contains(r,s))return null;var o,l,u,h,c,f,d,p,g,v,m,y=e.items||a;for(g=y.length;--g>=0;)if(l=y[g],m=l.bounds,!m||m.contains(r,s)){for(u=l.axisItems||a,h=l.items||a,c=l.legendItems||a,d=l.x||0,p=l.y||0,t.save(),t.translate(d,p),d=r-d,p=s-p,v=c.length;--v>=0;)if(o=c[v],o.interactive!==!1&&(f=this.pick(o,n,i,d,p)))return t.restore(),f;for(v=u.length;--v>=0;)if(o=u[v],o.interactive!==!1&&"back"!==o.layer&&(f=this.pick(o,n,i,d,p)))return t.restore(),f;for(v=h.length;--v>=0;)if(o=h[v],o.interactive!==!1&&(f=this.pick(o,n,i,d,p)))return t.restore(),f;for(v=u.length;--v>=0;)if(o=u[v],o.interative!==!1&&"back"===o.layer&&(f=this.pick(o,n,i,d,p)))return t.restore(),f;if(t.restore(),e.interactive!==!1&&(l.fill||l.stroke)&&d>=0&&d<=l.width&&p>=0&&p<=l.height)return l}return null}var s=t("./util"),a=[];e.exports={draw:i,pick:r}},{"./util":24}],16:[function(t,e,n){function i(t,e,n){if(e.items&&e.items.length)for(var i,r=this,s=e.items,a=0,o=s.length;o>a;++a)if(i=s[a],!n||n.intersects(i.bounds)){i.image&&i.image.url===i.url||(i.image=r.loadImage(i.url),i.image.url=i.url);var l,u=i.x||0,h=i.y||0,c=i.width||i.image&&i.image.width||0,f=i.height||i.image&&i.image.height||0;u-="center"===i.align?c/2:"right"===i.align?c:0,h-="middle"===i.baseline?f/2:"bottom"===i.baseline?f:0,i.image.loaded&&(t.globalAlpha=null!=(l=i.opacity)?l:1,t.drawImage(i.image,u,h,c,f))}}var r=t("./util");e.exports={draw:i,pick:r.pick()}},{"./util":24}],17:[function(t,e,n){e.exports={arc:t("./arc"),area:t("./area"),group:t("./group"),image:t("./image"),line:t("./line"),path:t("./path"),rect:t("./rect"),rule:t("./rule"),symbol:t("./symbol"),text:t("./text")}},{"./arc":13,"./area":14,"./group":15,"./image":16,"./line":18,"./path":19,"./rect":20,"./rule":21,"./symbol":22,"./text":23}],18:[function(t,e,n){function i(t,e){var n=e[0],i=n.pathCache||(n.pathCache=a(l(e)));o(t,i)}function r(t,e,n,i,r,s){var a=e.items,o=e.bounds;return!a||!a.length||o&&!o.contains(r,s)?null:(null!=t.pixelratio&&1!==t.pixelratio&&(n*=t.pixelratio,i*=t.pixelratio),u(t,a,n,i)?a[0]:null)}var s=t("./util"),a=t("../../../path/parse"),o=t("../../../path/render"),l=t("../../../util/svg").path.line,u=s.testPath(i,!1);e.exports={draw:s.drawOne(i),pick:r,nested:!0}},{"../../../path/parse":6,"../../../path/render":7,"../../../util/svg":40,"./util":24}],19:[function(t,e,n){function i(t,e){if(null==e.path)return!0;var n=e.pathCache||(e.pathCache=s(e.path));a(t,n,e.x,e.y)}var r=t("./util"),s=t("../../../path/parse"),a=t("../../../path/render");e.exports={draw:r.drawAll(i),pick:r.pickPath(i)}},{"../../../path/parse":6,"../../../path/render":7,"./util":24}],20:[function(t,e,n){function i(t,e,n){if(e.items&&e.items.length)for(var i,s,a,o,l,u,h=e.items,c=0,f=h.length;f>c;++c)i=h[c],(!n||n.intersects(i.bounds))&&(s=null==i.opacity?1:i.opacity,0!==s&&(a=i.x||0,o=i.y||0,l=i.width||0,u=i.height||0,i.fill&&r.fill(t,i,s)&&t.fillRect(a,o,l,u),i.stroke&&r.stroke(t,i,s)&&t.strokeRect(a,o,l,u)))}var r=t("./util");e.exports={draw:i,pick:r.pick()}},{"./util":24}],21:[function(t,e,n){function i(t,e,n){if(e.items&&e.items.length)for(var i,r,s,o,l,u,h=e.items,c=0,f=h.length;f>c;++c)i=h[c],(!n||n.intersects(i.bounds))&&(r=null==i.opacity?1:i.opacity,0!==r&&(s=i.x||0,o=i.y||0,l=null!=i.x2?i.x2:s,u=null!=i.y2?i.y2:o,i.stroke&&a.stroke(t,i,r)&&(t.beginPath(),t.moveTo(s,o),t.lineTo(l,u),t.stroke())))}function r(t,e){var n=e.x||0,i=e.y||0,r=null!=e.x2?e.x2:n,s=null!=e.y2?e.y2:i,a=e.strokeWidth,o=e.strokeCap;t.lineWidth=null!=a?a:1,t.lineCap=null!=o?o:"butt",t.beginPath(),t.moveTo(n,i),t.lineTo(r,s)}function s(t,e,n,i){return t.isPointInStroke?(r(t,e),t.isPointInStroke(n,i)):!1}var a=t("./util");e.exports={draw:i,pick:a.pick(s)}},{"./util":24}],22:[function(t,e,n){function i(t,e){var n,i,r,o,l=null!=e.size?e.size:100,u=e.x,h=e.y;if(t.beginPath(),null==e.shape||"circle"===e.shape)return n=Math.sqrt(l/Math.PI),t.arc(u,h,n,0,2*Math.PI,0),void t.closePath();switch(e.shape){case"cross":n=Math.sqrt(l/5)/2,i=3*n,t.moveTo(u-i,h-n),t.lineTo(u-n,h-n),t.lineTo(u-n,h-i),t.lineTo(u+n,h-i),t.lineTo(u+n,h-n),t.lineTo(u+i,h-n),t.lineTo(u+i,h+n),t.lineTo(u+n,h+n),t.lineTo(u+n,h+i),t.lineTo(u-n,h+i),t.lineTo(u-n,h+n),t.lineTo(u-i,h+n);break;case"diamond":o=Math.sqrt(l/(2*a)),r=o*a,t.moveTo(u,h-o),t.lineTo(u+r,h),t.lineTo(u,h+o),t.lineTo(u-r,h);break;case"square":i=Math.sqrt(l),n=i/2,t.rect(u-n,h-n,i,i);break;case"triangle-down":r=Math.sqrt(l/s),o=r*s/2,t.moveTo(u,h+o),t.lineTo(u+r,h-o),t.lineTo(u-r,h-o);break;case"triangle-up":r=Math.sqrt(l/s),o=r*s/2,t.moveTo(u,h-o),t.lineTo(u+r,h+o),t.lineTo(u-r,h+o)}t.closePath()}var r=t("./util"),s=Math.sqrt(3),a=Math.tan(30*Math.PI/180);e.exports={draw:r.drawAll(i),pick:r.pickPath(i)}},{"./util":24}],23:[function(t,e,n){function i(t,e,n){if(e.items&&e.items.length)for(var i,r,s,a,u,h,c,f=e.items,d=0,p=f.length;p>d;++d)i=f[d],(!n||n.intersects(i.bounds))&&(c=o.value(i.text),c&&(r=null==i.opacity?1:i.opacity,0!==r&&(t.font=o.font(i),t.textAlign=i.align||"left",s=i.x||0,a=i.y||0,(u=i.radius)&&(h=(i.theta||0)-Math.PI/2,s+=u*Math.cos(h),a+=u*Math.sin(h)),i.angle&&(t.save(),t.translate(s,a),t.rotate(i.angle*Math.PI/180),s=a=0),s+=i.dx||0,a+=(i.dy||0)+o.offset(i),i.fill&&l.fill(t,i,r)&&t.fillText(c,s,a),i.stroke&&l.stroke(t,i,r)&&t.strokeText(c,s,a),i.angle&&t.restore())))}function r(t,e,n,i,r,s){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var o=a(e,u,!0),l=-e.angle*Math.PI/180,h=Math.cos(l),c=Math.sin(l),f=e.x,d=e.y,p=h*r-c*s+(f-f*h+d*c),g=c*r+h*s+(d-f*c-d*h);return o.contains(p,g)}var s=t("../../../util/Bounds"),a=t("../../../util/bound").text,o=t("../../../util/text"),l=t("./util"),u=new s;e.exports={draw:i,pick:l.pick(r)}},{"../../../util/Bounds":31,"../../../util/bound":36,"../../../util/text":41,"./util":24}],24:[function(t,e,n){function i(t,e,n,i){if(!t(e,i)){var r=null==n.opacity?1:n.opacity;0!==r&&(n.fill&&h(e,n,r)&&e.fill(),n.stroke&&c(e,n,r)&&e.stroke())}}function r(t,e,n,r){var s,a,o;for(s=0,a=n.items.length;a>s;++s)o=n.items[s],(!r||r.intersects(o.bounds))&&i(t,e,o,o)}function s(t){return function(e,n,i){r(t,e,n,i)}}function a(t){return function(e,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&i(t,e,n.items[0],n.items)}}function o(t){return t||(t=p),function(e,n,i,r,s,a){if(!n.items.length)return null;var o,l,u;for(null!=e.pixelratio&&1!==e.pixelratio&&(i*=e.pixelratio,r*=e.pixelratio),u=n.items.length;--u>=0;)if(o=n.items[u],l=o.bounds,(!l||l.contains(s,a))&&l&&t(e,o,i,r,s,a))return o;return null}}function l(t,e){return function(n,i,r,s){var a,o,l=Array.isArray(i)?i[0]:i,u=null==e?l.fill:e,h=l.stroke&&n.isPointInStroke;return h&&(a=l.strokeWidth,o=l.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=o?o:"butt"),t(n,i)?!1:u&&n.isPointInPath(r,s)||h&&n.isPointInStroke(r,s)}}function u(t){return o(l(t))}function h(t,e,n){return n*=null==e.fillOpacity?1:e.fillOpacity,n>0?(t.globalAlpha=n,t.fillStyle=f(t,e,e.fill),!0):!1}function c(t,e,n){var i,r=null!=(r=e.strokeWidth)?r:1;return 0>=r?!1:(n*=null==e.strokeOpacity?1:e.strokeOpacity,n>0?(t.globalAlpha=n,t.strokeStyle=f(t,e,e.stroke),t.lineWidth=r,t.lineCap=null!=(i=e.strokeCap)?i:"butt",t.vgLineDash(e.strokeDash||null),t.vgLineDashOffset(e.strokeDashOffset||0),!0):!1)}function f(t,e,n){return n.id?d(t,n,e.bounds):n}function d(t,e,n){var i,r,s=n.width(),a=n.height(),o=n.x1+e.x1*s,l=n.y1+e.y1*a,u=n.x1+e.x2*s,h=n.y1+e.y2*a,c=t.createLinearGradient(o,l,u,h),f=e.stops;for(i=0,r=f.length;r>i;++i)c.addColorStop(f[i].offset,f[i].color);return c}var p=function(){return!0};e.exports={drawOne:a,drawAll:s,pick:o,pickPath:u,testPath:l,stroke:c,fill:h,color:f,gradient:d}},{}],25:[function(t,e,n){e.exports={canvas:t("./canvas"),svg:t("./svg")}},{"./canvas":12,"./svg":29}],26:[function(t,e,n){function i(){s.call(this)}var r=t("../../util/dom"),s=t("../Handler"),a=s.prototype,o=i.prototype=Object.create(a);o.constructor=i,o.initialize=function(t,e,n){return this._svg=r.find(t,"svg"),a.initialize.call(this,t,e,n)},o.svg=function(){return this._svg},o.listener=function(t){var e=this;return function(n){var i=n.target,r=i.__data__;n.vegaType=n.type,r=Array.isArray(r)?r[0]:r,t.call(e._obj,n,r)}},o.on=function(t,e){var n=this.eventName(t),i=this._svg,r=this._handlers,s={type:t,handler:e,listener:this.listener(e)};return(r[n]||(r[n]=[])).push(s),i.addEventListener(n,s.listener),this},o.off=function(t,e){var n,i=this.eventName(t),r=this._svg,s=this._handlers[i];if(s){for(n=s.length;--n>=0;)(s[n].type===t&&!e||s[n].handler===e)&&(r.removeEventListener(i,s[n].listener),s.splice(n,1));return this}},e.exports=i},{"../../util/dom":38,"../Handler":8}],27:[function(t,e,n){function i(t){c.call(this),this._loader=new h(t),this._dirtyID=0}function r(t,e,n){var i,r,s;for(t=d.child(t,n,"linearGradient",g),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;r>i;++i)s=d.child(t,i,"stop",g),s.setAttribute("offset",e.stops[i].offset),s.setAttribute("stop-color",e.stops[i].color);d.clear(t,i)}function s(t,e,n){var i;t=d.child(t,n,"clipPath",g),t.setAttribute("id",e.id),i=d.child(t,0,"rect",g),i.setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)}function a(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 o(t,e,n,i,r){var s=d.child(t,i,e.tag,g,null,r);if(s.__data__=n,s.__values__={fill:"default"},"g"===e.tag){var a=d.child(s,0,"rect",g,"background");a.__data__=n}return n._svg=s}function l(t,e,n){e!==k[t]&&(null!=e?n?x.setAttributeNS(n,t,e):x.setAttribute(t,e):n?x.removeAttributeNS(n,t):x.removeAttribute(t),k[t]=e)}function u(){return"undefined"!=typeof window?window.location.href:""}var h=t("../../util/ImageLoader"),c=t("../Renderer"),f=t("../../util/text"),d=t("../../util/dom"),p=t("../../util/svg"),g=p.metadata.xmlns,v=t("./marks"),m=c.prototype,y=i.prototype=Object.create(m);y.constructor=i,y.initialize=function(t,e,n,i){return t&&(this._svg=d.child(t,0,"svg",g,"marks"),d.clear(t,1),this._root=d.child(this._svg,0,"g",g),d.clear(this._svg,1)),this._defs={clip_id:1,gradient:{},clipping:{}},this.background(this._bgcolor),m.initialize.call(this,t,e,n,i)},y.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),m.background.apply(this,arguments)},y.resize=function(t,e,n){if(m.resize.call(this,t,e,n),this._svg){var i=this._width,r=this._height,s=this._padding;this._svg.setAttribute("width",i+s.left+s.right),this._svg.setAttribute("height",r+s.top+s.bottom),this._root.setAttribute("transform","translate("+s.left+","+s.top+")")}return this},y.svg=function(){if(!this._svg)return null;var t={"class":"marks",width:this._width+this._padding.left+this._padding.right,height:this._height+this._padding.top+this._padding.bottom};for(var e in p.metadata)t[e]=p.metadata[e];return d.openTag("svg",t)+this._svg.innerHTML+d.closeTag("svg")},y.imageURL=function(t){return this._loader.imageURL(t)},y.render=function(t,e){return this._dirtyCheck(e)&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t,-1),d.clear(this._root,1)),this.updateDefs(),this},y.draw=function(t,e,n){this.drawMark(t,e,n,v[e.marktype])},y.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,a=0;for(t in n.gradient)i||(i=n.el=d.child(e,0,"defs",g)),r(i,n.gradient[t],a++);for(t in n.clipping)i||(i=n.el=d.child(e,0,"defs",g)),s(i,n.clipping[t],a++);i&&(0===a?(e.removeChild(i),n.el=null):d.clear(i,a))},y._resetDefs=function(){var t=this._defs;t.clip_id=1,t.gradient={},t.clipping={}},y.isDirty=function(t){return this._dirtyAll||t.dirty===this._dirtyID},y._dirtyCheck=function(t){if(this._dirtyAll=!0,!t)return!0;var e,n,i,r,s,o,l,u=++this._dirtyID;for(s=0,o=t.length;o>s;++s)e=t[s],n=e.mark,n.marktype!==i&&(i=n.marktype,r=v[i]),"exit"!==e.status?(e=r.nest?n.items[0]:e,e._update!==u&&(e._svg?this._update(r,e._svg,e):(this._dirtyAll=!1,a(e,u)),e._update=u)):e._svg&&(r.nest&&e.mark.items.length?(this._update(r,e._svg,e.mark.items[0]),l=e.mark.items[0],l._svg=e._svg,l._update=u):d.remove(e._svg),e._svg=null);return!this._dirtyAll},y.drawMark=function(t,e,n,i){if(this.isDirty(e)){var r,s,a,l,u,h,c=i.nest?e.items&&e.items.length?[e.items[0]]:[]:e.items||[],f=e.interactive===!1?"none":null,p="g"===i.tag,v=d.cssClass(e);for(r=d.child(t,n+1,"g",g,v),r.setAttribute("class",v),e._svg=r,!p&&f&&r.style.setProperty("pointer-events",f),s=0,a=c.length;a>s;++s)this.isDirty(u=c[s])&&(h=!(this._dirtyAll||u._svg),l=o(r,i,u,s,h),this._update(i,l,u),p&&(h&&(this._dirtyAll=!0),this._recurse(l,u),h&&(this._dirtyAll=!1)));return d.clear(r,s),r}},y._recurse=function(t,e){var n,i,r=e.items||[],s=e.legendItems||[],a=e.axisItems||[],o=0;for(n=0,i=a.length;i>n;++n)"back"===a[n].layer&&this.drawMark(t,a[n],o++,v.group);for(n=0,i=r.length;i>n;++n)this.draw(t,r[n],o++);for(n=0,i=a.length;i>n;++n)"back"!==a[n].layer&&this.drawMark(t,a[n],o++,v.group);for(n=0,i=s.length;i>n;++n)this.drawMark(t,s[n],o++,v.group);d.clear(t,1+o)};var x=null,k=null,_={group:function(t,e,n){x=e.childNodes[0],k=e.__values__,t.background(l,n,this);var i=n.mark.interactive===!1?"none":null;i!==k.events&&(x.style.setProperty("pointer-events",i),k.events=i)},text:function(t,e,n){var i=f.value(n.text);i!==k.text&&(e.textContent=i,k.text=i),i=f.font(n),i!==k.font&&(e.style.setProperty("font",i),k.font=i)}};y._update=function(t,e,n){x=e,k=e.__values__,t.attr(l,n,this);var i=_[t.type];i&&i(t,e,n),this.style(x,n)},y.style=function(t,e){if(null!=e){var n,i,r,s,a;for(n=0,i=p.styleProperties.length;i>n;++n)r=p.styleProperties[n],a=e[r],a!==k[r]&&(s=p.styles[r],null==a?"fill"===s?t.style.setProperty(s,"none"):t.style.removeProperty(s):(a.id&&(this._defs.gradient[a.id]=a,a="url("+u()+"#"+a.id+")"),t.style.setProperty(s,a+"")),k[r]=a)}},e.exports=i},{"../../util/ImageLoader":34,"../../util/dom":38,"../../util/svg":40,"../../util/text":41,"../Renderer":9,"./marks":30}],28:[function(t,e,n){function i(t){o.call(this),this._loader=new l(t),this._text={head:"",root:"",foot:"",defs:"",body:""},this._defs={clip_id:1,gradient:{},clipping:{}}}function r(t,e,n,i){m[i||t]=e}function s(t,e,n,i){if(null==t)return"";var r,s,a,o,l,c="";for("bgrect"===n&&e.interactive===!1&&(c+="pointer-events: none;"),"text"===n&&(c+="font: "+h.font(t)+";"),r=0,s=u.styleProperties.length;s>r;++r)a=u.styleProperties[r],o=u.styles[a],l=t[a],null==l?"fill"===o&&(c+=(c.length?" ":"")+"fill: none;"):(l.id&&(i.gradient[l.id]=l,l="url(#"+l.id+")"),c+=(c.length?" ":"")+o+": "+l+";");return c?'style="'+c+'"':null}function a(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var o=t("../Renderer"),l=t("../../util/ImageLoader"),u=t("../../util/svg"),h=t("../../util/text"),c=t("../../util/dom"),f=c.openTag,d=c.closeTag,p=t("./marks"),g=o.prototype,v=i.prototype=Object.create(g);v.constructor=i,v.resize=function(t,e,n){g.resize.call(this,t,e,n);var i=this._padding,r=this._text,s={"class":"marks",width:this._width+i.left+i.right,height:this._height+i.top+i.bottom};for(var a in u.metadata)s[a]=u.metadata[a];return r.head=f("svg",s),r.root=f("g",{transform:"translate("+i.left+","+i.top+")"}),r.foot=d("g")+d("svg"),this},v.svg=function(){var t=this._text;return t.head+t.defs+t.root+t.body+t.foot},v.render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},v.reset=function(){return this._defs.clip_id=0,this},v.buildDefs=function(){var t,e,n,i,r=this._defs,s="";for(e in r.gradient){for(n=r.gradient[e],i=n.stops,s+=f("linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<i.length;++t)s+=f("stop",{offset:i[t].offset,"stop-color":i[t].color})+d("stop");s+=d("linearGradient")}for(e in r.clipping)n=r.clipping[e],s+=f("clipPath",{id:e}),s+=f("rect",{x:0,y:0,width:n.width,height:n.height})+d("rect"),s+=d("clipPath");return s.length>0?f("defs")+s+d("defs"):""},v.imageURL=function(t){return this._loader.imageURL(t)};var m;v.attributes=function(t,e){return m={},t(r,e,this),m},v.mark=function(t){var e,n,i,r=p[t.marktype],o=r.tag,l=r.attr,u=r.nest||!1,g=u?t.items&&t.items.length?[t.items[0]]:[]:t.items||[],v=this._defs,m="";for("g"!==o&&t.interactive===!1&&(e='style="pointer-events: none;"'),m+=f("g",{"class":c.cssClass(t)},e),n=0;n<g.length;++n)i=g[n],e="g"!==o?s(i,t,o,v):null,m+=f(o,this.attributes(l,i),e),"text"===o?m+=a(h.value(i.text)):"g"===o&&(m+=f("rect",this.attributes(r.background,i),s(i,t,"bgrect",v))+d("rect"),m+=this.markGroup(i)),m+=d(o);return m+d("g")},v.markGroup=function(t){var e,n,i="",r=t.axisItems||[],s=t.items||[],a=t.legendItems||[];for(e=0,n=r.length;n>e;++e)"back"===r[e].layer&&(i+=this.mark(r[e]));for(e=0,n=s.length;n>e;++e)i+=this.mark(s[e]);for(e=0,n=r.length;n>e;++e)"back"!==r[e].layer&&(i+=this.mark(r[e]));for(e=0,n=a.length;n>e;++e)i+=this.mark(a[e]);return i},e.exports=i},{"../../util/ImageLoader":34,"../../util/dom":38,"../../util/svg":40,"../../util/text":41,"../Renderer":9,"./marks":30}],29:[function(t,e,n){e.exports={Handler:t("./SVGHandler"),Renderer:t("./SVGRenderer"),string:{Renderer:t("./SVGStringRenderer")}}},{"./SVGHandler":26,"./SVGRenderer":27,"./SVGStringRenderer":28}],30:[function(t,e,n){function i(t){return r(t.x||0,t.y||0)}function r(t,e){return"translate("+t+","+e+")"}var s=t("../../util/text"),a=t("../../util/svg"),o=a.textAlign,l=a.path;e.exports={arc:{tag:"path",type:"arc",attr:function(t,e){t("transform",i(e)),t("d",l.arc(e))}},area:{tag:"path",type:"area",nest:!0,attr:function(t,e){var n=e.mark.items;n.length&&t("d",l.area(n))}},group:{tag:"g",type:"group",attr:function(t,e,n){var r,s,a=null;t("transform",i(e)),e.clip&&(r=n._defs,a=e.clip_id||(e.clip_id="clip"+r.clip_id++),s=r.clipping[a]||(r.clipping[a]={id:a}),s.width=e.width||0,s.height=e.height||0),t("clip-path",a?"url(#"+a+")":null)},background:function(t,e){t("class","background"),t("width",e.width||0),t("height",e.height||0)}},image:{tag:"image",type:"image",attr:function(t,e,n){var i=e.x||0,s=e.y||0,a=e.width||0,o=e.height||0,l=n.imageURL(e.url);i-="center"===e.align?a/2:"right"===e.align?a:0,s-="middle"===e.baseline?o/2:"bottom"===e.baseline?o:0,t("href",l,"http://www.w3.org/1999/xlink","xlink:href"),t("transform",r(i,s)),t("width",a),t("height",o)}},line:{tag:"path",type:"line",nest:!0,attr:function(t,e){
var n=e.mark.items;n.length&&t("d",l.line(n))}},path:{tag:"path",type:"path",attr:function(t,e){t("transform",i(e)),t("d",e.path)}},rect:{tag:"rect",type:"rect",nest:!1,attr:function(t,e){t("transform",i(e)),t("width",e.width||0),t("height",e.height||0)}},rule:{tag:"line",type:"rule",attr:function(t,e){t("transform",i(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)}},symbol:{tag:"path",type:"symbol",attr:function(t,e){t("transform",i(e)),t("d",l.symbol(e))}},text:{tag:"text",type:"text",nest:!1,attr:function(t,e){var n,i=e.dx||0,a=(e.dy||0)+s.offset(e),l=e.x||0,u=e.y||0,h=e.angle||0,c=e.radius||0;c&&(n=(e.theta||0)-Math.PI/2,l+=c*Math.cos(n),u+=c*Math.sin(n)),t("text-anchor",o[e.align]||"start"),h?(n=r(l,u)+" rotate("+h+")",(i||a)&&(n+=" "+r(i,a))):n=r(l+i,u+a),t("transform",n)}}}},{"../../util/svg":40,"../../util/text":41}],31:[function(t,e,n){function i(t){this.clear(),t&&this.union(t)}var r=i.prototype;r.clone=function(){return new i(this)},r.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},r.set=function(t,e,n,i){return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this},r.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},r.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},r.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},r.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},r.rotate=function(t,e,n){var i=Math.cos(t),r=Math.sin(t),s=e-e*i+n*r,a=n-e*r-n*i,o=this.x1,l=this.x2,u=this.y1,h=this.y2;return this.clear().add(i*o-r*u+s,r*o+i*u+a).add(i*o-r*h+s,r*o+i*h+a).add(i*l-r*u+s,r*l+i*u+a).add(i*l-r*h+s,r*l+i*h+a)},r.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},r.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},r.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},r.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},r.width=function(){return this.x2-this.x1},r.height=function(){return this.y2-this.y1},e.exports=i},{}],32:[function(t,e,n){e.exports=function(t){function e(){}function n(e,n){t.add(e,n)}return{bounds:function(e){return arguments.length?(t=e,this):t},beginPath:e,closePath:e,moveTo:n,lineTo:n,quadraticCurveTo:function(e,n,i,r){t.add(e,n),t.add(i,r)},bezierCurveTo:function(e,n,i,r,s,a){t.add(e,n),t.add(i,r),t.add(s,a)}}}},{}],33:[function(t,e,n){function i(t){this.id="gradient_"+r++,this.type=t||"linear",this.stops=[],this.x1=0,this.x2=1,this.y1=0,this.y2=0}var r=0,s=i.prototype;s.stop=function(t,e){return this.stops.push({offset:t,color:e}),this},e.exports=i},{}],34:[function(t,e,n){(function(n){function i(t){this._pending=0,this._config=t||i.Config}function r(t,e){var n=a.sanitizeUrl(this.params(t));if(!n)return e&&e(t,null),null;var i=this,r=new Image;return i._pending+=1,r.onload=function(){i._pending-=1,r.loaded=!0,e&&e(null,r)},r.src=n,r}function s(t,e){var i=this,r=new("undefined"!=typeof window?window.canvas:"undefined"!=typeof n?n.canvas:null).Image;return i._pending+=1,a(this.params(t),function(t,n){return i._pending-=1,t?(e&&e(t,null),null):(r.src=n,r.loaded=!0,void(e&&e(null,r)))}),r}var a=t("datalib/src/import/load");i.Config=null;var o=i.prototype;o.pending=function(){return this._pending},o.params=function(t){var e,n={url:t};for(e in this._config)n[e]=this._config[e];return n},o.imageURL=function(t){return a.sanitizeUrl(this.params(t))},o.loadImage=function(t,e){return a.useXHR?r.call(this,t,e):s.call(this,t,e)},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"datalib/src/import/load":2}],35:[function(t,e,n){function i(t){this.mark=t}var r=i.prototype;r.hasPropertySet=function(t){var e=this.mark.def.properties;return e&&null!=e[t]},r.cousin=function(t,e){if(0===t)return this;t=t||-1;var n=this.mark,i=n.group,r=null==e?n.items.indexOf(this):e,s=i.items.indexOf(n)+t;return i.items[s].items[r]},r.sibling=function(t){if(0===t)return this;t=t||-1;var e=this.mark,n=e.items.indexOf(this)+t;return e.items[n]},r.remove=function(){var t=this,e=t.mark.items,n=e.indexOf(t);return n>=0&&(n===e.length-1?e.pop():e.splice(n,1)),t},r.touch=function(){this.pathCache&&(this.pathCache=null)},e.exports=i},{}],36:[function(t,e,n){function i(){return R||(R=k.instance(1,1).getContext("2d"))}function r(t,e){return t.stroke&&0!==t.opacity&&0!==t.stokeOpacity&&e.expand(null!=t.strokeWidth?t.strokeWidth:1),e}function s(t,e,n,i,s){return null==e?n.set(0,0,0,0):(T(z.bounds(n),e,i,s),r(t,n)),n}function a(t,e){var n=t.path?t.pathCache||(t.pathCache=M(t.path)):null;return s(t,n,e,t.x,t.y)}function o(t,e){if(0===t.items.length)return e;var n=t.items,i=n[0],r=i.pathCache||(i.pathCache=M(C(n)));return s(i,r,e)}function l(t,e){if(0===t.items.length)return e;var n=t.items,i=n[0],r=i.pathCache||(i.pathCache=M(A(n)));return s(i,r,e)}function u(t,e){var n,i;return r(t,e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0))}function h(t,e){var n=t.x||0,i=t.y||0,r=t.width||0,s=t.height||0;return n-="center"===t.align?r/2:"right"===t.align?r:0,i-="middle"===t.baseline?s/2:"bottom"===t.baseline?s:0,e.set(n,i,n+r,i+s)}function c(t,e){var n,i;return r(t,e.set(n=t.x||0,i=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i))}function f(t,e){var n,i,s,a,o,l,u,h,c,f=t.x||0,d=t.y||0,p=t.innerRadius||0,g=t.outerRadius||0,v=(t.startAngle||0)-P,m=(t.endAngle||0)-P,y=1/0,x=-(1/0),k=1/0,_=-(1/0),b=[v,m],w=v-v%P;for(i=0;4>i&&m>w;++i,w+=P)b.push(w);for(i=0,s=b.length;s>i;++i)n=b[i],a=Math.cos(n),l=p*a,h=g*a,o=Math.sin(n),u=p*o,c=g*o,y=Math.min(y,l,h),x=Math.max(x,l,h),k=Math.min(k,u,c),_=Math.max(_,u,c);return r(t,e.set(f+y,d+k,f+x,d+_))}function d(t,e){var n,i,s,a,o=null!=t.size?t.size:100,l=t.x||0,u=t.y||0;switch(t.shape){case"cross":i=3*Math.sqrt(o/5)/2,e.set(l-i,u-i,l+i,u+i);break;case"diamond":a=Math.sqrt(o/(2*L)),s=a*L,e.set(l-s,u-a,l+s,u+a);break;case"square":i=Math.sqrt(o),n=i/2,e.set(l-n,u-n,l+n,u+n);break;case"triangle-down":s=Math.sqrt(o/I),a=s*I/2,e.set(l-s,u-a,l+s,u+a);break;case"triangle-up":s=Math.sqrt(o/I),a=s*I/2,e.set(l-s,u-a,l+s,u+a);break;default:n=Math.sqrt(o/Math.PI),e.set(l-n,u-n,l+n,u+n)}return r(t,e)}function p(t,e,n){var r,s,a=i(),o=b.size(t),l=t.align,u=t.radius||0,h=t.x||0,c=t.y||0,f=t.dx||0,d=(t.dy||0)+b.offset(t)-Math.round(.8*o);return u&&(s=(t.theta||0)-Math.PI/2,h+=u*Math.cos(s),c+=u*Math.sin(s)),a.font=b.font(t),r=a.measureText(b.value(t.text)).width,"center"===l?f-=r/2:"right"===l&&(f-=r),e.set(f+=h,d+=c,f+r,d+o),t.angle&&!n&&e.rotate(t.angle*Math.PI/180,h,c),e.expand(n?0:1)}function g(t,e,n){var i,s,a=t.axisItems||[],o=t.items||[],l=t.legendItems||[];if(!t.clip){for(i=0,s=a.length;s>i;++i)e.union(a[i].bounds);for(i=0,s=o.length;s>i;++i)e.union(o[i].bounds);if(n)for(i=0,s=l.length;s>i;++i)e.union(l[i].bounds)}return(t.clip||t.width||t.height)&&r(t,e.add(0,0).add(t.width||0,t.height||0)),e.translate(t.x||0,t.y||0)}function v(t,e,n){var i=t.mark.marktype;e=e||O[i],e.nest&&(t=t.mark);var r=t.bounds,s=t["bounds:prev"]||(t["bounds:prev"]=new x);return r?(s.clear().union(r),r.clear()):t.bounds=new x,e(t,t.bounds,n),r||s.clear().union(t.bounds),t.bounds}function m(t,e,n){var i,r,s,a,o=t.marktype,l=O[o],u=t.items,h=u&&u.length;if(l.nest)return s=h?u[0]:(S.mark=t,S),a=v(s,l,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new x,h)for(i=0,r=u.length;r>i;++i)e.union(v(u[i],l,n));return t.bounds=e}var y=t("./BoundsContext"),x=t("./Bounds"),k=t("./canvas"),_=t("./svg"),b=t("./text"),w=t("../path"),M=w.parse,T=w.render,C=_.path.area,A=_.path.line,P=Math.PI/2,I=Math.sqrt(3),L=Math.tan(30*Math.PI/180),R=null,z=y(),O={group:g,symbol:d,image:h,rect:u,rule:c,arc:f,text:p,path:a,area:o,line:l};O.area.nest=!0,O.line.nest=!0;var S={mark:null};e.exports={mark:m,item:v,text:p,group:g}},{"../path":5,"./Bounds":31,"./BoundsContext":32,"./canvas":37,"./svg":40,"./text":41}],37:[function(t,e,n){(function(t){function n(e,n){e=e||1,n=n||1;var i;if("undefined"!=typeof document&&document.createElement)i=document.createElement("canvas"),i.width=e,i.height=n;else{var r="undefined"!=typeof window?window.canvas:"undefined"!=typeof t?t.canvas:null;if(!r.prototype)return null;i=new r(e,n)}return s(i)}function i(t,e,n,i,s){var a=this._ctx=t.getContext("2d"),o=1;return t.width=e+i.left+i.right,t.height=n+i.top+i.bottom,s&&"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&(a.pixelratio=o=r(t)||1),a.setTransform(o,0,0,o,o*i.left,o*i.top),t}function r(t){var e=t.getContext("2d"),n=window&&window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1,r=n/i;if(n!==i){var s=t.width,a=t.height;t.width=s*r,t.height=a*r,t.style.width=s+"px",t.style.height=a+"px"}return r}function s(t){var e=t.getContext("2d");if(!e.vgLineDash){var n=function(){},i=[];return e.setLineDash?(e.vgLineDash=function(t){this.setLineDash(t||i)},e.vgLineDashOffset=function(t){this.lineDashOffset=t}):void 0!==e.webkitLineDash?(e.vgLineDash=function(t){this.webkitLineDash=t||i},e.vgLineDashOffset=function(t){this.webkitLineDashOffset=t}):void 0!==e.mozDash?(e.vgLineDash=function(t){this.mozDash=t},e.vgLineDashOffset=n):(e.vgLineDash=n,e.vgLineDashOffset=n),t}}e.exports={instance:n,resize:i,lineDash:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],38:[function(t,e,n){function i(t,e,n){return n?t.createElementNS(n,e):t.createElement(e)}function r(t){if(t){var e=t.parentNode;e&&(e.removeChild(t),e.childNodes&&e.childNodes.length||r(e))}}e.exports={find:function(t,e){e=e.toLowerCase();for(var n=0,i=t.childNodes.length;i>n;++n)if(t.childNodes[n].tagName.toLowerCase()===e)return t.childNodes[n]},child:function(t,e,n,r,s,a){var o,l;return o=l=t.childNodes[e],(!o||a||o.tagName.toLowerCase()!==n.toLowerCase()||s&&o.getAttribute("class")!=s)&&(o=i(t.ownerDocument,n,r),t.insertBefore(o,l),s&&o.setAttribute("class",s)),o},clear:function(t,e){for(var n=t.childNodes.length;n>e;)t.removeChild(t.childNodes[--n]);return t},remove:r,cssClass:function(t){return"mark-"+t.marktype+(t.name?" "+t.name:"")},openTag:function(t,e,n){var i,r,s="<"+t;if(e)for(i in e)r=e[i],null!=r&&(s+=" "+i+'="'+r+'"');return n&&(s+=" "+n),s+">"},closeTag:function(t){return"</"+t+">"}}},{}],39:[function(t,e,n){function i(t,e){return JSON.stringify(t,l,e)}function r(t){var e="string"==typeof t?JSON.parse(t):t;return s(e)}function s(t){var e,n,i,r,l,u=t.marktype;for(i=0,r=o.length;r>i;++i)if(l=t[o[i]])for(e=0,n=l.length;n>e;++e)l[e][u?"mark":"group"]=t,u&&"group"!==u||s(l[e]);return u&&a.mark(t),t}var a=t("../util/bound"),o=["items","axisItems","legendItems"],l=["marktype","name","interactive","clip","items","axisItems","legendItems","layer","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","interpolate","tension","orient","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];e.exports={toJSON:i,fromJSON:r}},{"../util/bound":36}],40:[function(t,e,n){(function(t){function n(t){return t.x||0}function i(t){return t.y||0}function r(t){return(t.x||0)+(t.width||0)}function s(t){return(t.y||0)+(t.height||0)}function a(t){return null==t.size?100:t.size}function o(t){return t.shape||"circle"}var l=("undefined"!=typeof window?window.d3:"undefined"!=typeof t?t.d3:null).svg,u=l.area().x(n).y1(i).y0(s),h=l.area().y(i).x1(n).x0(r),c=l.line().x(n).y(i);e.exports={metadata:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},path:{arc:l.arc(),symbol:l.symbol().type(o).size(a),area:function(t){var e=t[0];return("horizontal"===e.orient?h:u).interpolate(e.interpolate||"linear").tension(e.tension||.7)(t)},line:function(t){var e=t[0];return c.interpolate(e.interpolate||"linear").tension(e.tension||.7)(t)}},textAlign:{left:"start",center:"middle",right:"end"},textBaseline:{top:"before-edge",bottom:"after-edge",middle:"central"},styles:{fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",opacity:"opacity"},styleProperties:["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","strokeCap","strokeDash","strokeDashOffset","opacity"]}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],41:[function(t,e,n){function i(t){return null!=t.fontSize?t.fontSize:11}e.exports={size:i,value:function(t){return null!=t?String(t):""},font:function(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+" ":"")+i(t)+"px "+(n||"sans-serif")},offset:function(t){var e=t.baseline,n=i(t);return Math.round("top"===e?.93*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}}},{}]},{},[3])(3)});
var n=e.mark.items;n.length&&t("d",l.line(n))}},path:{tag:"path",type:"path",attr:function(t,e){t("transform",i(e)),t("d",e.path)}},rect:{tag:"rect",type:"rect",nest:!1,attr:function(t,e){t("transform",i(e)),t("width",e.width||0),t("height",e.height||0)}},rule:{tag:"line",type:"rule",attr:function(t,e){t("transform",i(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)}},symbol:{tag:"path",type:"symbol",attr:function(t,e){t("transform",i(e)),t("d",l.symbol(e))}},text:{tag:"text",type:"text",nest:!1,attr:function(t,e){var n,i=e.dx||0,a=(e.dy||0)+s.offset(e),l=e.x||0,u=e.y||0,h=e.angle||0,c=e.radius||0;c&&(n=(e.theta||0)-Math.PI/2,l+=c*Math.cos(n),u+=c*Math.sin(n)),t("text-anchor",o[e.align]||"start"),h?(n=r(l,u)+" rotate("+h+")",(i||a)&&(n+=" "+r(i,a))):n=r(l+i,u+a),t("transform",n)}}}},{"../../util/svg":40,"../../util/text":41}],31:[function(t,e,n){function i(t){this.clear(),t&&this.union(t)}var r=i.prototype;r.clone=function(){return new i(this)},r.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},r.set=function(t,e,n,i){return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this},r.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},r.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},r.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},r.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},r.rotate=function(t,e,n){var i=Math.cos(t),r=Math.sin(t),s=e-e*i+n*r,a=n-e*r-n*i,o=this.x1,l=this.x2,u=this.y1,h=this.y2;return this.clear().add(i*o-r*u+s,r*o+i*u+a).add(i*o-r*h+s,r*o+i*h+a).add(i*l-r*u+s,r*l+i*u+a).add(i*l-r*h+s,r*l+i*h+a)},r.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},r.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},r.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},r.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},r.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},r.width=function(){return this.x2-this.x1},r.height=function(){return this.y2-this.y1},e.exports=i},{}],32:[function(t,e,n){e.exports=function(t){function e(){}function n(e,n){t.add(e,n)}return{bounds:function(e){return arguments.length?(t=e,this):t},beginPath:e,closePath:e,moveTo:n,lineTo:n,quadraticCurveTo:function(e,n,i,r){t.add(e,n),t.add(i,r)},bezierCurveTo:function(e,n,i,r,s,a){t.add(e,n),t.add(i,r),t.add(s,a)}}}},{}],33:[function(t,e,n){function i(t){this.id="gradient_"+r++,this.type=t||"linear",this.stops=[],this.x1=0,this.x2=1,this.y1=0,this.y2=0}var r=0,s=i.prototype;s.stop=function(t,e){return this.stops.push({offset:t,color:e}),this},e.exports=i},{}],34:[function(t,e,n){(function(n){function i(t){this._pending=0,this._config=t||i.Config}function r(t,e){var n=a.sanitizeUrl(this.params(t));if(!n)return e&&e(t,null),null;var i=this,r=new Image;return i._pending+=1,r.onload=function(){i._pending-=1,r.loaded=!0,e&&e(null,r)},r.src=n,r}function s(t,e){var i=this,r=new("undefined"!=typeof window?window.canvas:"undefined"!=typeof n?n.canvas:null).Image;return i._pending+=1,a(this.params(t),function(t,n){return i._pending-=1,t?(e&&e(t,null),null):(r.src=n,r.loaded=!0,void(e&&e(null,r)))}),r}var a=t("datalib/src/import/load");i.Config=null;var o=i.prototype;o.pending=function(){return this._pending},o.params=function(t){var e,n={url:t};for(e in this._config)n[e]=this._config[e];return n},o.imageURL=function(t){return a.sanitizeUrl(this.params(t))},o.loadImage=function(t,e){return a.useXHR?r.call(this,t,e):s.call(this,t,e)},e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"datalib/src/import/load":2}],35:[function(t,e,n){function i(t){this.mark=t}var r=i.prototype;r.hasPropertySet=function(t){var e=this.mark.def.properties;return e&&null!=e[t]},r.cousin=function(t,e){if(0===t)return this;t=t||-1;var n=this.mark,i=n.group,r=null==e?n.items.indexOf(this):e,s=i.items.indexOf(n)+t;return i.items[s].items[r]},r.sibling=function(t){if(0===t)return this;t=t||-1;var e=this.mark,n=e.items.indexOf(this)+t;return e.items[n]},r.remove=function(){var t=this,e=t.mark.items,n=e.indexOf(t);return n>=0&&(n===e.length-1?e.pop():e.splice(n,1)),t},r.touch=function(){this.pathCache&&(this.pathCache=null)},e.exports=i},{}],36:[function(t,e,n){function i(){return R||(R=k.instance(1,1).getContext("2d"))}function r(t,e){return t.stroke&&0!==t.opacity&&0!==t.stokeOpacity&&e.expand(null!=t.strokeWidth?t.strokeWidth:1),e}function s(t,e,n,i,s){return null==e?n.set(0,0,0,0):(T(z.bounds(n),e,i,s),r(t,n)),n}function a(t,e){var n=t.path?t.pathCache||(t.pathCache=M(t.path)):null;return s(t,n,e,t.x,t.y)}function o(t,e){if(0===t.items.length)return e;var n=t.items,i=n[0],r=i.pathCache||(i.pathCache=M(C(n)));return s(i,r,e)}function l(t,e){if(0===t.items.length)return e;var n=t.items,i=n[0],r=i.pathCache||(i.pathCache=M(A(n)));return s(i,r,e)}function u(t,e){var n,i;return r(t,e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0))}function h(t,e){var n=t.x||0,i=t.y||0,r=t.width||0,s=t.height||0;return n-="center"===t.align?r/2:"right"===t.align?r:0,i-="middle"===t.baseline?s/2:"bottom"===t.baseline?s:0,e.set(n,i,n+r,i+s)}function c(t,e){var n,i;return r(t,e.set(n=t.x||0,i=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i))}function f(t,e){var n,i,s,a,o,l,u,h,c,f=t.x||0,d=t.y||0,p=t.innerRadius||0,g=t.outerRadius||0,v=(t.startAngle||0)-P,m=(t.endAngle||0)-P,y=1/0,x=-(1/0),k=1/0,_=-(1/0),b=[v,m],w=v-v%P;for(i=0;4>i&&m>w;++i,w+=P)b.push(w);for(i=0,s=b.length;s>i;++i)n=b[i],a=Math.cos(n),l=p*a,h=g*a,o=Math.sin(n),u=p*o,c=g*o,y=Math.min(y,l,h),x=Math.max(x,l,h),k=Math.min(k,u,c),_=Math.max(_,u,c);return r(t,e.set(f+y,d+k,f+x,d+_))}function d(t,e){var n,i,s,a,o=null!=t.size?t.size:100,l=t.x||0,u=t.y||0;switch(t.shape){case"cross":i=3*Math.sqrt(o/5)/2,e.set(l-i,u-i,l+i,u+i);break;case"diamond":a=Math.sqrt(o/(2*L)),s=a*L,e.set(l-s,u-a,l+s,u+a);break;case"square":i=Math.sqrt(o),n=i/2,e.set(l-n,u-n,l+n,u+n);break;case"triangle-down":s=Math.sqrt(o/I),a=s*I/2,e.set(l-s,u-a,l+s,u+a);break;case"triangle-up":s=Math.sqrt(o/I),a=s*I/2,e.set(l-s,u-a,l+s,u+a);break;default:n=Math.sqrt(o/Math.PI),e.set(l-n,u-n,l+n,u+n)}return r(t,e)}function p(t,e,n){var r,s,a=i(),o=b.size(t),l=t.align,u=t.radius||0,h=t.x||0,c=t.y||0,f=t.dx||0,d=(t.dy||0)+b.offset(t)-Math.round(.8*o);return u&&(s=(t.theta||0)-Math.PI/2,h+=u*Math.cos(s),c+=u*Math.sin(s)),a.font=b.font(t),r=a.measureText(b.value(t.text)).width,"center"===l?f-=r/2:"right"===l&&(f-=r),e.set(f+=h,d+=c,f+r,d+o),t.angle&&!n&&e.rotate(t.angle*Math.PI/180,h,c),e.expand(n?0:1)}function g(t,e,n){var i,s,a=t.axisItems||[],o=t.items||[],l=t.legendItems||[];if(!t.clip){for(i=0,s=a.length;s>i;++i)e.union(a[i].bounds);for(i=0,s=o.length;s>i;++i)e.union(o[i].bounds);if(n)for(i=0,s=l.length;s>i;++i)e.union(l[i].bounds)}return(t.clip||t.width||t.height)&&r(t,e.add(0,0).add(t.width||0,t.height||0)),e.translate(t.x||0,t.y||0)}function v(t,e,n){var i=t.mark.marktype;e=e||O[i],e.nest&&(t=t.mark);var r=t.bounds,s=t["bounds:prev"]||(t["bounds:prev"]=new x);return r?(s.clear().union(r),r.clear()):t.bounds=new x,e(t,t.bounds,n),r||s.clear().union(t.bounds),t.bounds}function m(t,e,n){var i,r,s,a,o=t.marktype,l=O[o],u=t.items,h=u&&u.length;if(l.nest)return s=h?u[0]:(S.mark=t,S),a=v(s,l,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new x,h)for(i=0,r=u.length;r>i;++i)e.union(v(u[i],l,n));return t.bounds=e}var y=t("./BoundsContext"),x=t("./Bounds"),k=t("./canvas"),_=t("./svg"),b=t("./text"),w=t("../path"),M=w.parse,T=w.render,C=_.path.area,A=_.path.line,P=Math.PI/2,I=Math.sqrt(3),L=Math.tan(30*Math.PI/180),R=null,z=y(),O={group:g,symbol:d,image:h,rect:u,rule:c,arc:f,text:p,path:a,area:o,line:l};O.area.nest=!0,O.line.nest=!0;var S={mark:null};e.exports={mark:m,item:v,text:p,group:g}},{"../path":5,"./Bounds":31,"./BoundsContext":32,"./canvas":37,"./svg":40,"./text":41}],37:[function(t,e,n){(function(t){function n(e,n){e=e||1,n=n||1;var i;if("undefined"!=typeof document&&document.createElement)i=document.createElement("canvas"),i.width=e,i.height=n;else{var r="undefined"!=typeof window?window.canvas:"undefined"!=typeof t?t.canvas:null;if(!r.prototype)return null;i=new r(e,n)}return s(i)}function i(t,e,n,i,s){var a=this._ctx=t.getContext("2d"),o=1;return t.width=e+i.left+i.right,t.height=n+i.top+i.bottom,s&&"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&(a.pixelratio=o=r(t)||1),a.setTransform(o,0,0,o,o*i.left,o*i.top),t}function r(t){var e=t.getContext("2d"),n=window&&window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1,r=n/i;if(n!==i){var s=t.width,a=t.height;t.width=s*r,t.height=a*r,t.style.width=s+"px",t.style.height=a+"px"}return r}function s(t){var e=t.getContext("2d");if(!e.vgLineDash){var n=function(){},i=[];return e.setLineDash?(e.vgLineDash=function(t){this.setLineDash(t||i)},e.vgLineDashOffset=function(t){this.lineDashOffset=t}):void 0!==e.webkitLineDash?(e.vgLineDash=function(t){this.webkitLineDash=t||i},e.vgLineDashOffset=function(t){this.webkitLineDashOffset=t}):void 0!==e.mozDash?(e.vgLineDash=function(t){this.mozDash=t},e.vgLineDashOffset=n):(e.vgLineDash=n,e.vgLineDashOffset=n),t}}e.exports={instance:n,resize:i,lineDash:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],38:[function(t,e,n){function i(t,e,n){return n?t.createElementNS(n,e):t.createElement(e)}function r(t){if(t){var e=t.parentNode;e&&(e.removeChild(t),e.childNodes&&e.childNodes.length||r(e))}}e.exports={find:function(t,e){e=e.toLowerCase();for(var n=0,i=t.childNodes.length;i>n;++n)if(t.childNodes[n].tagName.toLowerCase()===e)return t.childNodes[n]},child:function(t,e,n,r,s,a){var o,l;return o=l=t.childNodes[e],(!o||a||o.tagName.toLowerCase()!==n.toLowerCase()||s&&o.getAttribute("class")!=s)&&(o=i(t.ownerDocument,n,r),t.insertBefore(o,l),s&&o.setAttribute("class",s)),o},clear:function(t,e){for(var n=t.childNodes.length;n>e;)t.removeChild(t.childNodes[--n]);return t},remove:r,cssClass:function(t){return"mark-"+t.marktype+(t.name?" "+t.name:"")},openTag:function(t,e,n){var i,r,s="<"+t;if(e)for(i in e)r=e[i],null!=r&&(s+=" "+i+'="'+r+'"');return n&&(s+=" "+n),s+">"},closeTag:function(t){return"</"+t+">"}}},{}],39:[function(t,e,n){function i(t,e){return JSON.stringify(t,l,e)}function r(t){var e="string"==typeof t?JSON.parse(t):t;return s(e)}function s(t){var e,n,i,r,l,u=t.marktype;for(i=0,r=o.length;r>i;++i)if(l=t[o[i]])for(e=0,n=l.length;n>e;++e)l[e][u?"mark":"group"]=t,u&&"group"!==u||s(l[e]);return u&&a.mark(t),t}var a=t("../util/bound"),o=["items","axisItems","legendItems"],l=["marktype","name","interactive","clip","items","axisItems","legendItems","layer","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","interpolate","tension","orient","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];e.exports={toJSON:i,fromJSON:r}},{"../util/bound":36}],40:[function(t,e,n){(function(t){function n(t){return t.x||0}function i(t){return t.y||0}function r(t){return(t.x||0)+(t.width||0)}function s(t){return(t.y||0)+(t.height||0)}function a(t){return null==t.size?100:t.size}function o(t){return t.shape||"circle"}var l=("undefined"!=typeof window?window.d3:"undefined"!=typeof t?t.d3:null).svg,u=l.area().x(n).y1(i).y0(s),h=l.area().y(i).x1(n).x0(r),c=l.line().x(n).y(i);e.exports={metadata:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},path:{arc:l.arc(),symbol:l.symbol().type(o).size(a),area:function(t){var e=t[0];return("horizontal"===e.orient?h:u).interpolate(e.interpolate||"linear").tension(e.tension||.7)(t)},line:function(t){var e=t[0];return c.interpolate(e.interpolate||"linear").tension(e.tension||.7)(t)}},textAlign:{left:"start",center:"middle",right:"end"},textBaseline:{top:"before-edge",bottom:"after-edge",middle:"central"},styles:{fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",opacity:"opacity"},styleProperties:["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","strokeCap","strokeDash","strokeDashOffset","opacity"]}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],41:[function(t,e,n){function i(t){return null!=t.fontSize?t.fontSize:11}e.exports={size:i,value:function(t){return null!=t?String(t):""},font:function(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+" ":"")+i(t)+"px "+(n||"sans-serif")},offset:function(t){var e=t.baseline,n=i(t);return Math.round("top"===e?.93*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}}},{}]},{},[3])(3)});

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