This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathvega-lite.min.js
5 lines (5 loc) · 117 KB
/
vega-lite.min.js
1
2
3
4
5
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.vl=e()}}(function(){return function e(t,n,i){function a(o,l){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!l&&c)return c(o,!0);if(r)return r(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return a(n?n:e)},u,u.exports,e,t,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(e,t,n){},{}],2:[function(e,t,n){(function(e){function n(e,t){var n,i="";for(n=0;n<e;++n)i+=t;return i}function i(e,t,n){var i=0,a=e.split(c);return e=n?(a=a.reverse()).filter(function(e){return i+=e.length,i<=t}).reverse():a.filter(function(e){return i+=e.length,i<=t}),e.length?e.join("").trim():a[0].slice(0,t)}var a=t.exports,r="__name__";a.namedfunc=function(e,t){return t[r]=e,t},a.name=function(e){return null==e?null:e[r]},a.identity=function(e){return e},a.true=a.namedfunc("true",function(){return!0}),a.false=a.namedfunc("false",function(){return!1}),a.duplicate=function(e){return JSON.parse(JSON.stringify(e))},a.equal=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},a.extend=function(e){for(var t,n,i=1,a=arguments.length;i<a;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e},a.length=function(e){return null!=e&&null!=e.length?e.length:null},a.keys=function(e){var t,n=[];for(t in e)n.push(t);return n},a.vals=function(e){var t,n=[];for(t in e)n.push(e[t]);return n},a.toMap=function(e,t){return(t=a.$(t))?e.reduce(function(e,n){return e[t(n)]=1,e},{}):e.reduce(function(e,t){return e[t]=1,e},{})},a.keystr=function(e){var t=e.length;if(!t)return"";for(var n=String(e[0]),i=1;i<t;++i)n+="|"+String(e[i]);return n};var o=Object.prototype.toString;a.isObject=function(e){return e===Object(e)},a.isFunction=function(e){return"[object Function]"===o.call(e)},a.isString=function(e){return"string"==typeof value||"[object String]"===o.call(e)},a.isArray=Array.isArray||function(e){return"[object Array]"===o.call(e)},a.isNumber=function(e){return"number"==typeof e||"[object Number]"===o.call(e)},a.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==o.call(e)},a.isDate=function(e){return"[object Date]"===o.call(e)},a.isValid=function(e){return null!=e&&e===e},a.isBuffer="function"==typeof e&&e.isBuffer||a.false,a.number=function(e){return null==e||""===e?null:+e},a.boolean=function(e){return null==e||""===e?null:"false"!==e&&!!e},a.date=function(e,t){var n=t?t:Date;return null==e||""===e?null:n.parse(e)},a.array=function(e){return null!=e?a.isArray(e)?e:[e]:[]},a.str=function(e){return a.isArray(e)?"["+e.map(a.str)+"]":a.isObject(e)||a.isString(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e};var l=/\[(.*?)\]|[^.\[]+/g;a.field=function(e){return String(e).match(l).map(function(e){return"["!==e[0]?e:"'"!==e[1]&&'"'!==e[1]?e.slice(1,-1):e.slice(2,-2).replace(/\\(["'])/g,"$1")})},a.accessor=function(e){return null==e||a.isFunction(e)?e:a.namedfunc(e,Function("x","return x["+a.field(e).map(a.str).join("][")+"];"))},a.$=a.accessor,a.mutator=function(e){var t;return a.isString(e)&&(t=a.field(e)).length>1?function(e,n){for(var i=0;i<t.length-1;++i)e=e[t[i]];e[t[i]]=n}:function(t,n){t[e]=n}},a.$func=function(e,t){return function(n){n=a.$(n)||a.identity;var i=e+(a.name(n)?"_"+a.name(n):"");return a.namedfunc(i,function(e){return t(n(e))})}},a.$valid=a.$func("valid",a.isValid),a.$length=a.$func("length",a.length),a.$in=function(e,t){e=a.$(e);var n=a.isArray(t)?a.toMap(t):t;return function(t){return!!n[e(t)]}},a.comparator=function(e){var t=[];return void 0===e&&(e=[]),e=a.array(e).map(function(e){var n=1;return"-"===e[0]?(n=-1,e=e.slice(1)):"+"===e[0]&&(n=1,e=e.slice(1)),t.push(n),a.accessor(e)}),function(n,i){var r,o,l,c;for(r=0,o=e.length;r<o;++r)if(l=e[r],c=a.cmp(l(n),l(i)))return c*t[r];return 0}},a.cmp=function(e,t){return(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0)},a.numcmp=function(e,t){return e-t},a.stablesort=function(e,t,n){var i=e.reduce(function(e,t,i){return e[n(t)]=i,e},{});return e.sort(function(e,a){var r=t(e),o=t(a);return r<o?-1:r>o?1:i[n(e)]-i[n(a)]}),e},a.permute=function(e){for(var t,n,i=e.length;i;)n=Math.floor(Math.random()*i--),t=e[i],e[i]=e[n],e[n]=t},a.pad=function(e,t,i,a){a=a||" ";var r=t-e.length;if(r<=0)return e;switch(i){case"left":return n(r,a)+e;case"middle":case"center":return n(Math.floor(r/2),a)+e+n(Math.ceil(r/2),a);default:return e+n(r,a)}},a.truncate=function(e,t,n,a,r){var o=e.length;if(o<=t)return e;r=void 0!==r?String(r):"…";var l=Math.max(0,t-r.length);switch(n){case"left":return r+(a?i(e,l,1):e.slice(o-l));case"middle":case"center":var c=Math.ceil(l/2),s=Math.floor(l/2);return(a?i(e,c):e.slice(0,c))+r+(a?i(e,s,1):e.slice(o-s));default:return(a?i(e,l):e.slice(0,l))+r}};var c=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}).call(this,e("buffer").Buffer)},{buffer:1}],3:[function(e,t,n){var i="undefined"!=typeof JSON?JSON:e("jsonify");t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n=t.space||"";"number"==typeof n&&(n=Array(n+1).join(" "));var o="boolean"==typeof t.cycles&&t.cycles,l=t.replacer||function(e,t){return t},c=t.cmp&&function(e){return function(t){return function(n,i){var a={key:n,value:t[n]},r={key:i,value:t[i]};return e(a,r)}}}(t.cmp),s=[];return function e(t,u,f,d){var p=n?"\n"+new Array(d+1).join(n):"",m=n?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),f=l.call(t,u,f),void 0!==f){if("object"!=typeof f||null===f)return i.stringify(f);if(a(f)){for(var h=[],g=0;g<f.length;g++){var y=e(f,g,f[g],d+1)||i.stringify(null);h.push(p+n+y)}return"["+h.join(",")+p+"]"}if(s.indexOf(f)!==-1){if(o)return i.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}s.push(f);for(var v=r(f).sort(c&&c(f)),h=[],g=0;g<v.length;g++){var u=v[g],O=e(f,u,f[u],d+1);if(O){var S=i.stringify(u)+m+O;h.push(p+n+S)}}return s.splice(s.indexOf(f),1),"{"+h.join(",")+p+"}"}}({"":e},"",e,0)};var a=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},r=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},n=[];for(var i in e)t.call(e,i)&&n.push(i);return n}},{jsonify:4}],4:[function(e,t,n){n.parse=e("./lib/parse"),n.stringify=e("./lib/stringify")},{"./lib/parse":5,"./lib/stringify":6}],5:[function(e,t,n){var i,a,r,o,l={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},c=function(e){throw{name:"SyntaxError",message:e,at:i,text:r}},s=function(e){return e&&e!==a&&c("Expected '"+e+"' instead of '"+a+"'"),a=r.charAt(i),i+=1,a},u=function(){var e,t="";for("-"===a&&(t="-",s("-"));a>="0"&&a<="9";)t+=a,s();if("."===a)for(t+=".";s()&&a>="0"&&a<="9";)t+=a;if("e"===a||"E"===a)for(t+=a,s(),"-"!==a&&"+"!==a||(t+=a,s());a>="0"&&a<="9";)t+=a,s();return e=+t,isFinite(e)?e:void c("Bad number")},f=function(){var e,t,n,i="";if('"'===a)for(;s();){if('"'===a)return s(),i;if("\\"===a)if(s(),"u"===a){for(n=0,t=0;t<4&&(e=parseInt(s(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof l[a])break;i+=l[a]}else i+=a}c("Bad string")},d=function(){for(;a&&a<=" ";)s()},p=function(){switch(a){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}c("Unexpected '"+a+"'")},m=function(){var e=[];if("["===a){if(s("["),d(),"]"===a)return s("]"),e;for(;a;){if(e.push(o()),d(),"]"===a)return s("]"),e;s(","),d()}}c("Bad array")},h=function(){var e,t={};if("{"===a){if(s("{"),d(),"}"===a)return s("}"),t;for(;a;){if(e=f(),d(),s(":"),Object.hasOwnProperty.call(t,e)&&c('Duplicate key "'+e+'"'),t[e]=o(),d(),"}"===a)return s("}"),t;s(","),d()}}c("Bad object")};o=function(){switch(d(),a){case"{":return h();case"[":return m();case'"':return f();case"-":return u();default:return a>="0"&&a<="9"?u():p()}},t.exports=function(e,t){var n;return r=e,i=0,a=" ",n=o(),d(),a&&c("Syntax error"),"function"==typeof t?function e(n,i){var a,r,o=n[i];if(o&&"object"==typeof o)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r=e(o,a),void 0!==r?o[a]=r:delete o[a]);return t.call(n,i,o)}({"":n},""):n}},{}],6:[function(e,t,n){function i(e){return c.lastIndex=0,c.test(e)?'"'+e.replace(c,function(e){var t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function a(e,t){var n,c,s,u,f,d=r,p=t[e];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(e)),"function"==typeof l&&(p=l.call(t,e,p)),typeof p){case"string":return i(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(r+=o,f=[],"[object Array]"===Object.prototype.toString.apply(p)){for(u=p.length,n=0;n<u;n+=1)f[n]=a(n,p)||"null";return s=0===f.length?"[]":r?"[\n"+r+f.join(",\n"+r)+"\n"+d+"]":"["+f.join(",")+"]",r=d,s}if(l&&"object"==typeof l)for(u=l.length,n=0;n<u;n+=1)c=l[n],"string"==typeof c&&(s=a(c,p),s&&f.push(i(c)+(r?": ":":")+s));else for(c in p)Object.prototype.hasOwnProperty.call(p,c)&&(s=a(c,p),s&&f.push(i(c)+(r?": ":":")+s));return s=0===f.length?"{}":r?"{\n"+r+f.join(",\n"+r)+"\n"+d+"}":"{"+f.join(",")+"}",r=d,s}}var r,o,l,c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};t.exports=function(e,t,n){var i;if(r="",o="","number"==typeof n)for(i=0;i<n;i+=1)o+=" ";else"string"==typeof n&&(o=n);if(l=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return a("",{"":e})}},{}],7:[function(e,t,n){t.exports={name:"vega-lite",author:'Jeffrey Heer, Dominik Moritz, Kanit "Ham" Wongsuphasawat',version:"1.3.1",collaborators:["Kanit Wongsuphasawat <[email protected]> (http://kanitw.yellowpigz.com)","Dominik Moritz <[email protected]> (http://www.domoritz.de)","Jeffrey Heer <[email protected]> (http://jheer.org)"],description:"Vega-lite provides a higher-level grammar for visual analysis, comparable to ggplot or Tableau, that generates complete Vega specifications.",main:"src/vl.js",types:"src/vl.d.ts",bin:{vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},directories:{test:"test"},scripts:{build:"browserify src/vl.ts -p tsify -d -s vl | exorcist vega-lite.js.map > vega-lite.js ",postbuild:"uglifyjs vega-lite.js -cm --source-map vega-lite.min.js.map > vega-lite.min.js && npm run schema","build:all":"npm run clean && npm run data && npm run build && npm test && npm run lint && npm run build:images","build:images":"npm run data && scripts/generate-images.sh","build:toc":"bundle exec jekyll build --incremental -q && scripts/generate-toc",cover:"npm run pretest && istanbul cover node_modules/.bin/_mocha -- --recursive",clean:"rm -f vega-lite.* vega-lite-schema.json & find -E src test site -regex '.*\\.(js|js.map|d.ts)' -delete & rm -rf examples/_diff examples/_original examples/_output examples/images && rm -rf data",data:"rsync -r node_modules/vega-datasets/data/* data",deploy:"scripts/deploy.sh","deploy:gh":"scripts/deploy-gh.sh",lint:"tslint -c tslint.json 'src/**/*.ts' 'test/**/*.ts' --exclude '**/*.d.ts'",prestart:"npm run build && npm run data && scripts/index-examples",start:"npm run watch & browser-sync start --server --files 'vega-lite.js' --index 'test-gallery.html'",poststart:"rm examples/all-examples.json",schema:"typescript-json-schema --required true src/spec.ts ExtendedSpec > vega-lite-schema.json",presite:"tsc && npm run build && bower install && npm run data && npm run build:toc",site:"bundle exec jekyll serve --incremental",pretest:"tsc && npm run data",test:"npm run schema && mocha --recursive --require source-map-support/register test examples","test:debug":"npm run schema && mocha --debug-brk --recursive --require source-map-support/register test examples","watch:build":"watchify src/vl.ts -p tsify -v -d -s vl -o 'exorcist vega-lite.js.map > vega-lite.js'","watch:test":"nodemon -x 'npm test && npm run lint'",watch:"nodemon -x 'npm run build && npm test && npm run lint'","x-compile":"./scripts/examples-compile.sh","x-diff":"./scripts/examples-diff.sh"},repository:{type:"git",url:"https://github.com/vega/vega-lite.git"},license:"BSD-3-Clause",bugs:{url:"https://github.com/vega/vega-lite/issues"},homepage:"https://github.com/vega/vega-lite",devDependencies:{"@types/chai":"^3.4.34","@types/d3":"^3.5.36","@types/json-stable-stringify":"^1.0.29","@types/mocha":"^2.2.32","@types/node":"^6.0.45","browser-sync":"~2.17.3",browserify:"~13.1.0",chai:"~3.5.0",cheerio:"~0.22.0",exorcist:"~0.4.0",istanbul:"~0.4.5",mocha:"~3.1.2",nodemon:"~1.11.0","source-map-support":"~0.4.2",tsify:"~2.0.2",tslint:"~3.15.1",typescript:"^2.0.3","typescript-json-schema":"~0.3.4","uglify-js":"~2.7.3",vega:"~2.6.3","vega-datasets":"vega/vega-datasets#gh-pages",watchify:"~3.7.0","yaml-front-matter":"~3.4.0","z-schema":"~3.18.0"},dependencies:{datalib:"~1.7.2","json-stable-stringify":"~1.0.1",yargs:"~6.3.0"}}},{}],8:[function(e,t,n){"use strict";var i;!function(e){e[e.VALUES="values"]="VALUES",e[e.COUNT="count"]="COUNT",e[e.VALID="valid"]="VALID",e[e.MISSING="missing"]="MISSING",e[e.DISTINCT="distinct"]="DISTINCT",e[e.SUM="sum"]="SUM",e[e.MEAN="mean"]="MEAN",e[e.AVERAGE="average"]="AVERAGE",e[e.VARIANCE="variance"]="VARIANCE",e[e.VARIANCEP="variancep"]="VARIANCEP",e[e.STDEV="stdev"]="STDEV",e[e.STDEVP="stdevp"]="STDEVP",e[e.MEDIAN="median"]="MEDIAN",e[e.Q1="q1"]="Q1",e[e.Q3="q3"]="Q3",e[e.MODESKEW="modeskew"]="MODESKEW",e[e.MIN="min"]="MIN",e[e.MAX="max"]="MAX",e[e.ARGMIN="argmin"]="ARGMIN",e[e.ARGMAX="argmax"]="ARGMAX"}(i=n.AggregateOp||(n.AggregateOp={})),n.AGGREGATE_OPS=[i.VALUES,i.COUNT,i.VALID,i.MISSING,i.DISTINCT,i.SUM,i.MEAN,i.AVERAGE,i.VARIANCE,i.VARIANCEP,i.STDEV,i.STDEVP,i.MEDIAN,i.Q1,i.Q3,i.MODESKEW,i.MIN,i.MAX,i.ARGMIN,i.ARGMAX],n.SUM_OPS=[i.COUNT,i.SUM,i.DISTINCT,i.VALID,i.MISSING],n.SHARED_DOMAIN_OPS=[i.MEAN,i.AVERAGE,i.STDEV,i.STDEVP,i.MEDIAN,i.Q1,i.Q3,i.MIN,i.MAX]},{}],9:[function(e,t,n){"use strict";var i;!function(e){e[e.TOP="top"]="TOP",e[e.RIGHT="right"]="RIGHT",e[e.LEFT="left"]="LEFT",e[e.BOTTOM="bottom"]="BOTTOM"}(i=n.AxisOrient||(n.AxisOrient={})),n.defaultAxisConfig={offset:void 0,grid:void 0,labels:!0,labelMaxLength:25,tickSize:void 0,characterWidth:6},n.defaultFacetAxisConfig={axisWidth:0,labels:!0,grid:!1,tickSize:0}},{}],10:[function(e,t,n){"use strict";function i(e){switch(e){case a.ROW:case a.COLUMN:case a.SIZE:case a.SHAPE:return 6;default:return 10}}var a=e("./channel");n.autoMaxBins=i},{"./channel":11}],11:[function(e,t,n){"use strict";function i(e,t){return!!a(e)[t]}function a(e){switch(e){case n.X:case n.Y:case n.COLOR:case n.DETAIL:case n.ORDER:case n.OPACITY:case n.ROW:case n.COLUMN:return{point:!0,tick:!0,rule:!0,circle:!0,square:!0,bar:!0,line:!0,area:!0,text:!0};case n.X2:case n.Y2:return{rule:!0,bar:!0,area:!0};case n.SIZE:return{point:!0,tick:!0,rule:!0,circle:!0,square:!0,bar:!0,text:!0};case n.SHAPE:return{point:!0};case n.TEXT:return{text:!0};case n.PATH:return{line:!0}}return{}}function r(e){switch(e){case n.X:case n.Y:case n.COLOR:case n.OPACITY:case n.LABEL:case n.DETAIL:return{measure:!0,dimension:!0};case n.ROW:case n.COLUMN:case n.SHAPE:return{measure:!1,dimension:!0};case n.X2:case n.Y2:case n.SIZE:case n.TEXT:return{measure:!0,dimension:!1};case n.PATH:return{measure:!1,dimension:!0}}throw new Error("Invalid encoding channel"+e)}function o(e){return!c.contains([n.DETAIL,n.PATH,n.TEXT,n.LABEL,n.ORDER],e)}var l,c=e("./util");!function(e){e[e.X="x"]="X",e[e.Y="y"]="Y",e[e.X2="x2"]="X2",e[e.Y2="y2"]="Y2",e[e.ROW="row"]="ROW",e[e.COLUMN="column"]="COLUMN",e[e.SHAPE="shape"]="SHAPE",e[e.SIZE="size"]="SIZE",e[e.COLOR="color"]="COLOR",e[e.TEXT="text"]="TEXT",e[e.DETAIL="detail"]="DETAIL",e[e.LABEL="label"]="LABEL",e[e.PATH="path"]="PATH",e[e.ORDER="order"]="ORDER",e[e.OPACITY="opacity"]="OPACITY"}(l=n.Channel||(n.Channel={})),n.X=l.X,n.Y=l.Y,n.X2=l.X2,n.Y2=l.Y2,n.ROW=l.ROW,n.COLUMN=l.COLUMN,n.SHAPE=l.SHAPE,n.SIZE=l.SIZE,n.COLOR=l.COLOR,n.TEXT=l.TEXT,n.DETAIL=l.DETAIL,n.LABEL=l.LABEL,n.PATH=l.PATH,n.ORDER=l.ORDER,n.OPACITY=l.OPACITY,n.CHANNELS=[n.X,n.Y,n.X2,n.Y2,n.ROW,n.COLUMN,n.SIZE,n.SHAPE,n.COLOR,n.PATH,n.ORDER,n.OPACITY,n.TEXT,n.DETAIL,n.LABEL],n.UNIT_CHANNELS=c.without(n.CHANNELS,[n.ROW,n.COLUMN]),n.UNIT_SCALE_CHANNELS=c.without(n.UNIT_CHANNELS,[n.PATH,n.ORDER,n.DETAIL,n.TEXT,n.LABEL,n.X2,n.Y2]),n.NONSPATIAL_CHANNELS=c.without(n.UNIT_CHANNELS,[n.X,n.Y,n.X2,n.Y2]),n.NONSPATIAL_SCALE_CHANNELS=c.without(n.UNIT_SCALE_CHANNELS,[n.X,n.Y,n.X2,n.Y2]),n.STACK_GROUP_CHANNELS=[n.COLOR,n.DETAIL,n.ORDER,n.OPACITY,n.SIZE],n.supportMark=i,n.getSupportedMark=a,n.getSupportedRole=r,n.hasScale=o},{"./util":61}],12:[function(e,t,n){"use strict";function i(e,t){return t.reduce(function(t,n){return e.axis(n)&&(t[n]=r(n,e)),t},{})}function a(e,t){var i=e===O.COLUMN,a=e===O.ROW,r=i?"x":a?"y":e,o={type:r,scale:t.scaleName(e),grid:!0,tickSize:0,properties:{labels:{text:{value:""}},axis:{stroke:{value:"transparent"}}}},l=t.axis(e);["layer","ticks","values","subdivide"].forEach(function(i){var a,r=(a=n[i])?a(t,e,o):l[i];void 0!==r&&(o[i]=r)});var c=t.axis(e).properties||{};return["grid"].forEach(function(n){var i=R[n]?R[n](t,e,c[n]||{},o):c[n];void 0!==i&&N.keys(i).length>0&&(o.properties=o.properties||{},o.properties[n]=i)}),o}function r(e,t){var i=e===O.COLUMN,a=e===O.ROW,r=i?"x":a?"y":e,o=t.axis(e),l={type:r,scale:t.scaleName(e)};["format","grid","layer","offset","orient","tickSize","ticks","tickSizeEnd","title","titleOffset","values","tickPadding","tickSize","tickSizeMajor","tickSizeMinor","subdivide"].forEach(function(i){var a,r=(a=n[i])?a(t,e,l):o[i];void 0!==r&&(l[i]=r)});var c=t.axis(e).properties||{};return["axis","labels","grid","title","ticks","majorTicks","minorTicks"].forEach(function(n){var i=R[n]?R[n](t,e,c[n]||{},l):c[n];void 0!==i&&N.keys(i).length>0&&(l.properties=l.properties||{},l.properties[n]=i)}),l}function o(e,t){return A.numberFormat(e.fieldDef(t),e.axis(t).format,e.config(),t)}function l(e,t){return e.axis(t).offset}function c(e,t){var n=e.axis(t).grid;return void 0!==n?n:!e.isOrdinalScale(t)&&!e.fieldDef(t).bin}function s(e,t){if(t!==O.ROW&&t!==O.COLUMN)return c(e,t)&&(t===O.Y||t===O.X)&&!(e.parent()&&e.parent().isFacet())}function u(e,t,n){var i=e.axis(t).layer;return void 0!==i?i:n.grid?"back":void 0}function f(e,t){var n=e.axis(t).orient;return n?n:t===O.COLUMN?v.AxisOrient.TOP:void 0}function d(e,t){var n=e.axis(t).ticks;return void 0!==n?n:t!==O.X||e.fieldDef(t).bin?void 0:5}function p(e,t){var n=e.axis(t).tickSize;if(void 0!==n)return n}function m(e,t){var n=e.axis(t).tickSizeEnd;if(void 0!==n)return n}function h(e,t){var n=e.axis(t);if(void 0!==n.title)return n.title;var i,a=E.title(e.fieldDef(t),e.config());if(n.titleMaxLength)i=n.titleMaxLength;else if(t!==O.X||e.isOrdinalScale(O.X)){if(t===O.Y&&!e.isOrdinalScale(O.Y)){var r=e;i=r.height/e.axis(O.Y).characterWidth}}else{var r=e;i=r.width/e.axis(O.X).characterWidth}return i?N.truncate(a,i):a}function g(e,t){var n=e.axis(t).titleOffset;if(void 0!==n)return n}function y(e,t){var n=e.axis(t).values;return n&&S.isDateTime(n[0])?n.map(function(e){return S.timestamp(e,!0)}):n}var v=e("../axis"),O=e("../channel"),S=e("../datetime"),E=e("../fielddef"),T=e("../type"),N=e("../util"),A=e("./common");n.parseAxisComponent=i,n.parseInnerAxis=a,n.parseAxis=r,n.format=o,n.offset=l,n.gridShow=c,n.grid=s,n.layer=u,n.orient=f,n.ticks=d,n.tickSize=p,n.tickSizeEnd=m,n.title=h,n.titleOffset=g,n.values=y;var R;!function(e){function t(e,t,n){var i=e.axis(t);return N.extend(void 0!==i.axisColor?{stroke:{value:i.axisColor}}:{},void 0!==i.axisWidth?{strokeWidth:{value:i.axisWidth}}:{},n||{})}function n(e,t,n){var i=e.axis(t);return N.extend(void 0!==i.gridColor?{stroke:{value:i.gridColor}}:{},void 0!==i.gridOpacity?{strokeOpacity:{value:i.gridOpacity}}:{},void 0!==i.gridWidth?{strokeWidth:{value:i.gridWidth}}:{},void 0!==i.gridDash?{strokeDashOffset:{value:i.gridDash}}:{},n||{})}function i(e,t,n,i){var a=e.fieldDef(t),r=e.axis(t),o=e.config();return r.labels?(N.contains([T.NOMINAL,T.ORDINAL],a.type)&&r.labelMaxLength?n=N.extend({text:{template:'{{ datum["data"] | truncate:'+r.labelMaxLength+" }}"}},n||{}):a.type===T.TEMPORAL&&(n=N.extend({text:{template:A.timeTemplate('datum["data"]',a.timeUnit,r.format,r.shortTimeLabels,o)}},n)),void 0!==r.labelAngle?n.angle={value:r.labelAngle}:t===O.X&&(N.contains([T.NOMINAL,T.ORDINAL],a.type)||a.bin||a.type===T.TEMPORAL)&&(n.angle={value:270}),void 0!==r.labelAlign?n.align={value:r.labelAlign}:n.angle&&(270===n.angle.value?n.align={value:"top"===i.orient?"left":"x"===i.type?"right":"center"}:90===n.angle.value&&(n.align={value:"center"})),void 0!==r.labelBaseline?n.baseline={value:r.labelBaseline}:n.angle&&(270===n.angle.value?n.baseline={value:"x"===i.type?"middle":"bottom"}:90===n.angle.value&&(n.baseline={value:"bottom"})),void 0!==r.tickLabelColor&&(n.fill={value:r.tickLabelColor}),void 0!==r.tickLabelFont&&(n.font={value:r.tickLabelFont}),void 0!==r.tickLabelFontSize&&(n.fontSize={value:r.tickLabelFontSize}),0===N.keys(n).length?void 0:n):N.extend({text:""},n)}function a(e,t,n){var i=e.axis(t);return N.extend(void 0!==i.tickColor?{stroke:{value:i.tickColor}}:{},void 0!==i.tickWidth?{strokeWidth:{value:i.tickWidth}}:{},n||{})}function r(e,t,n){var i=e.axis(t);return N.extend(void 0!==i.titleColor?{fill:{value:i.titleColor}}:{},void 0!==i.titleFont?{font:{value:i.titleFont}}:{},void 0!==i.titleFontSize?{fontSize:{value:i.titleFontSize}}:{},void 0!==i.titleFontWeight?{fontWeight:{value:i.titleFontWeight}}:{},n||{})}e.axis=t,e.grid=n,e.labels=i,e.ticks=a,e.title=r}(R=n.properties||(n.properties={}))},{"../axis":9,"../channel":11,"../datetime":46,"../fielddef":49,"../type":60,"../util":61,"./common":13}],13:[function(e,t,n){"use strict";function i(e,t,n){return E.isSomeFacetSpec(e)?new y.FacetModel(e,t,n):E.isLayerSpec(e)?new v.LayerModel(e,t,n):E.isUnitSpec(e)?new S.UnitModel(e,t,n):(console.error("Invalid spec."),null)}function a(e,t){var i=t.config().mark.filled,a=t.encoding().color,r=t.encoding().opacity;i?o(e,t,n.FILL_CONFIG):o(e,t,n.STROKE_CONFIG);var l,c;t.has(d.COLOR)?l={scale:t.scaleName(d.COLOR),field:t.field(d.COLOR,a.type===h.ORDINAL?{prefix:"rank"}:{})}:a&&a.value&&(l={value:a.value}),t.has(d.OPACITY)?c={scale:t.scaleName(d.OPACITY),field:t.field(d.OPACITY,r.type===h.ORDINAL?{prefix:"rank"}:{})}:r&&r.value&&(c={value:r.value}),void 0!==l?i?e.fill=l:e.stroke=l:e[i?"fill":"stroke"]=e[i?"fill":"stroke"]||{value:t.config().mark.color},!e.fill&&g.contains([u.BAR,u.POINT,u.CIRCLE,u.SQUARE],t.mark())&&(e.fill={value:"transparent"}),void 0!==c&&(e.opacity=c)}function r(e,t,n){return n.forEach(function(n){var i=t[n];void 0!==i&&(e[n]={value:i})}),e}function o(e,t,n){return r(e,t.config().mark,n)}function l(e,t,n,i){if(e.type===h.QUANTITATIVE&&!e.bin)return t?t:e.aggregate===f.AggregateOp.COUNT&&i===d.TEXT?"d":n.numberFormat}function c(e){return(e.sort===m.SortOrder.DESCENDING?"-":"")+p.field(e,{binSuffix:"mid"})}function s(e,t,n,i,a){if(!t||n){var r=n||a.timeFormat;return"{{"+e+" | time:'"+r+"'}}"}return O.template(t,e,i)}var u=e("../mark"),f=e("../aggregate"),d=e("../channel"),p=e("../fielddef"),m=e("../sort"),h=e("../type"),g=e("../util"),y=e("./facet"),v=e("./layer"),O=e("../timeunit"),S=e("./unit"),E=e("../spec");n.buildModel=i,n.STROKE_CONFIG=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","opacity"],n.FILL_CONFIG=["fill","fillOpacity","opacity"],n.FILL_STROKE_CONFIG=g.union(n.STROKE_CONFIG,n.FILL_CONFIG),n.applyColorAndOpacity=a,n.applyConfig=r,n.applyMarkConfig=o,n.numberFormat=l,n.sortField=c,n.timeTemplate=s},{"../aggregate":8,"../channel":11,"../fielddef":49,"../mark":52,"../sort":55,"../spec":56,"../timeunit":58,"../type":60,"../util":61,"./facet":29,"./layer":30,"./unit":43}],14:[function(e,t,n){"use strict";function i(e){var t=l.normalize(e),n=s.buildModel(t,null,"");return n.parse(),a(n)}function a(e){var t=e.config(),n=c.extend({width:1,height:1,padding:"auto"},t.viewport?{viewport:t.viewport}:{},t.background?{background:t.background}:{},{data:[].concat(e.assembleData([]),e.assembleLayout([])),marks:[r(e)]});return{spec:n}}function r(e){var t=c.extend({name:e.name("root"),type:"group"},e.description()?{description:e.description()}:{},{from:{data:e.name(o.LAYOUT+"")},properties:{update:c.extend({width:{field:e.name("width")},height:{field:e.name("height")}},e.assembleParentGroupProperties(e.config().cell))}});return c.extend(t,e.assembleGroup())}var o=e("../data"),l=e("../spec"),c=e("../util"),s=e("./common");n.compile=i,n.assembleRootGroup=r},{"../data":45,"../spec":56,"../util":61,"./common":13}],15:[function(e,t,n){"use strict";function i(e,t,n,i){return d.extend(["filled","opacity","orient","align"].reduce(function(o,c){var u=i.mark[c];switch(c){case"filled":void 0===u&&(o[c]=e!==s.POINT&&e!==s.LINE&&e!==s.RULE);break;case"opacity":void 0===u&&(d.contains([s.POINT,s.TICK,s.CIRCLE,s.SQUARE],e)&&(l.isAggregate(t)&&!l.has(t,r.DETAIL)||(o[c]=.7)),e!==s.BAR||n||(l.has(t,r.COLOR)||l.has(t,r.DETAIL)||l.has(t,r.SIZE))&&(o[c]=.7),e===s.AREA&&(o[c]=.7));break;case"orient":o[c]=a(e,t,i.mark);break;case"align":void 0===u&&(o[c]=l.has(t,r.X)?"center":"right")}return o},{}),i.mark)}function a(e,t,n){switch(void 0===n&&(n={}),e){case s.POINT:case s.CIRCLE:case s.SQUARE:case s.TEXT:return}var i=t.y&&t.y2,a=t.x&&t.x2;switch(e){case s.TICK:var l=t.x?p.scaleType(t.x.scale||{},t.x,r.X,e):null,d=t.y?p.scaleType(t.y.scale||{},t.y,r.Y,e):null;return l!==u.ScaleType.ORDINAL&&(!t.y||d===u.ScaleType.ORDINAL)||t.y.bin?o.Orient.VERTICAL:o.Orient.HORIZONTAL;case s.RULE:if(a)return o.Orient.HORIZONTAL;if(i)return o.Orient.VERTICAL;if(t.y)return o.Orient.HORIZONTAL;if(t.x)return o.Orient.VERTICAL;return;case s.BAR:case s.AREA:if(i)return o.Orient.VERTICAL;if(a)return o.Orient.HORIZONTAL;case s.LINE:var m=c.isMeasure(t.x)||c.isMeasure(t.x2),h=c.isMeasure(t.y)||c.isMeasure(t.y2);if(m&&!h)return o.Orient.HORIZONTAL;if(!m&&h)return o.Orient.VERTICAL;if(m&&h){if(t.x.type===f.TEMPORAL)return o.Orient.VERTICAL;if(t.y.type===f.TEMPORAL)return o.Orient.HORIZONTAL}return o.Orient.VERTICAL}return console.warn("orient unimplemented for mark",e),o.Orient.VERTICAL}var r=e("../channel"),o=e("../config"),l=e("../encoding"),c=e("../fielddef"),s=e("../mark"),u=e("../scale"),f=e("../type"),d=e("../util"),p=e("../compile/scale");n.initMarkConfig=i,n.orient=a},{"../channel":11,"../compile/scale":42,"../config":44,"../encoding":47,"../fielddef":49,"../mark":52,"../scale":53,"../type":60,"../util":61}],16:[function(e,t,n){"use strict";var i,a=e("../../bin"),r=e("../../channel"),o=e("../../fielddef"),l=e("../../util");!function(e){function t(e,t){return"format('"+e+"', "+t+")"}function n(e){return e.reduce(function(n,i,c){var s=e.fieldDef(c).bin;if(s){var u=l.extend({type:"bin",field:i.field,output:{start:o.field(i,{binSuffix:"start"}),mid:o.field(i,{binSuffix:"mid"}),end:o.field(i,{binSuffix:"end"})}},"boolean"==typeof s?{}:s);u.maxbins||u.step||(u.maxbins=a.autoMaxBins(c));var f=[u],d=e.isOrdinalScale(c)||c===r.COLOR;if(d){var p=(e.axis(c)||e.legend(c)||{}).format||e.config().numberFormat,m=o.field(i,{datum:!0,binSuffix:"start"}),h=o.field(i,{datum:!0,binSuffix:"end"});f.push({type:"formula",field:o.field(i,{binSuffix:"range"}),expr:t(p,m)+" + '-' + "+t(p,h)})}var g=l.hash(s)+"_"+i.field+"oc:"+d;n[g]=f}return n},{})}function i(e){var t=n(e),i=e.child().component.data;return i.source||(l.extend(t,i.bin),delete i.bin),t}function c(e){var t=n(e);return e.children().forEach(function(e){var n=e.component.data;n.source||(l.extend(t,n.bin),delete n.bin)}),t}function s(e){return l.flatten(l.vals(e.bin))}e.parseUnit=n,e.parseFacet=i,e.parseLayer=c,e.assemble=s}(i=n.bin||(n.bin={}))},{"../../bin":10,"../../channel":11,"../../fielddef":49,"../../util":61}],17:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../type"),o=e("../../util");!function(e){function t(e){var t={};return e.has(a.COLOR)&&e.encoding().color.type===r.ORDINAL&&(t[e.field(a.COLOR)]=[{type:"sort",by:e.field(a.COLOR)},{type:"rank",field:e.field(a.COLOR),output:{rank:e.field(a.COLOR,{prefix:"rank"})}}]),t}function n(e){var t=e.child().component.data;if(!t.source){var n=t.colorRank;return delete t.colorRank,n}return{}}function i(e){var t={};return e.children().forEach(function(e){var n=e.component.data;n.source||(o.extend(t,n.colorRank),delete n.colorRank)}),t}function l(e){return o.flatten(o.vals(e.colorRank))}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=l}(i=n.colorRank||(n.colorRank={}))},{"../../channel":11,"../../type":60,"../../util":61}],18:[function(e,t,n){"use strict";function i(e){return{formatParse:s.formatParse.parseUnit(e),nullFilter:u.nullFilter.parseUnit(e),filter:f.filter.parseUnit(e),nonPositiveFilter:m.nonPositiveFilter.parseUnit(e),source:c.source.parseUnit(e),bin:d.bin.parseUnit(e),calculate:p.formula.parseUnit(e),timeUnit:y.timeUnit.parseUnit(e),timeUnitDomain:v.timeUnitDomain.parseUnit(e),summary:h.summary.parseUnit(e),stackScale:g.stackScale.parseUnit(e),colorRank:O.colorRank.parseUnit(e)}}function a(e){return{formatParse:s.formatParse.parseFacet(e),nullFilter:u.nullFilter.parseFacet(e),filter:f.filter.parseFacet(e),nonPositiveFilter:m.nonPositiveFilter.parseFacet(e),source:c.source.parseFacet(e),bin:d.bin.parseFacet(e),calculate:p.formula.parseFacet(e),timeUnit:y.timeUnit.parseFacet(e),timeUnitDomain:v.timeUnitDomain.parseFacet(e),summary:h.summary.parseFacet(e),stackScale:g.stackScale.parseFacet(e),colorRank:O.colorRank.parseFacet(e)}}function r(e){return{filter:f.filter.parseLayer(e),formatParse:s.formatParse.parseLayer(e),nullFilter:u.nullFilter.parseLayer(e),nonPositiveFilter:m.nonPositiveFilter.parseLayer(e),source:c.source.parseLayer(e),bin:d.bin.parseLayer(e),calculate:p.formula.parseLayer(e),timeUnit:y.timeUnit.parseLayer(e),timeUnitDomain:v.timeUnitDomain.parseLayer(e),summary:h.summary.parseLayer(e),stackScale:g.stackScale.parseLayer(e),colorRank:O.colorRank.parseLayer(e)}}function o(e,t){var n=e.component.data,i=c.source.assemble(e,n);if(i&&t.push(i),h.summary.assemble(n,e).forEach(function(e){t.push(e)}),t.length>0){var a=t[t.length-1],r=O.colorRank.assemble(n);r.length>0&&(a.transform=(a.transform||[]).concat(r));var o=m.nonPositiveFilter.assemble(n);o.length>0&&(a.transform=(a.transform||[]).concat(o))}else{if(l.keys(n.colorRank).length>0)throw new Error("Invalid colorRank not merged");if(l.keys(n.nonPositiveFilter).length>0)throw new Error("Invalid nonPositiveFilter not merged")}var s=g.stackScale.assemble(n);return s&&t.push(s),v.timeUnitDomain.assemble(n).forEach(function(e){t.push(e)}),t}var l=e("../../util"),c=e("./source"),s=e("./formatparse"),u=e("./nullfilter"),f=e("./filter"),d=e("./bin"),p=e("./formula"),m=e("./nonpositivenullfilter"),h=e("./summary"),g=e("./stackscale"),y=e("./timeunit"),v=e("./timeunitdomain"),O=e("./colorrank");n.parseUnitData=i,n.parseFacetData=a,n.parseLayerData=r,n.assembleData=o},{"../../util":61,"./bin":16,"./colorrank":17,"./filter":19,"./formatparse":20,"./formula":21,"./nonpositivenullfilter":22,"./nullfilter":23,"./source":24,"./stackscale":25,"./summary":26,"./timeunit":27,"./timeunitdomain":28}],19:[function(e,t,n){"use strict";var i,a=e("../../filter"),r=e("../../util");!function(e){function t(e){var t=e.filter();return r.isArray(t)?"("+t.map(function(e){return a.expression(e)}).filter(function(e){return void 0!==e}).join(") && (")+")":t?a.expression(t):void 0;
}function n(e){var n=t(e),i=e.child().component.data;return!i.source&&i.filter&&(n=(n?n+" && ":"")+i.filter,delete i.filter),n}function i(e){var n=t(e);return e.children().forEach(function(t){var i=t.component.data;e.compatibleSource(t)&&i.filter&&i.filter===n&&delete i.filter}),n}function o(e){var t=e.filter;return t?[{type:"filter",test:t}]:[]}e.parse=t,e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=o}(i=n.filter||(n.filter={}))},{"../../filter":50,"../../util":61}],20:[function(e,t,n){"use strict";var i,a=e("../../datetime"),r=e("../../fielddef"),o=e("../../filter"),l=e("../../type"),c=e("../../util");!function(e){function t(e){var t=(e.calculate()||[]).reduce(function(e,t){return e[t.field]=!0,e},{}),n={},i=e.filter();c.isArray(i)||(i=[i]),i.forEach(function(e){var t=null;o.isEqualFilter(e)?t=e.equal:o.isRangeFilter(e)?t=e.range[0]:o.isOneOfFilter(e)&&(t=(e.oneOf||e.in)[0]),t&&(a.isDateTime(t)?n[e.field]="date":c.isNumber(t)?n[e.field]="number":c.isString(t)&&(n[e.field]="string"))}),e.forEach(function(e){if(e.type===l.TEMPORAL)n[e.field]="date";else if(e.type===l.QUANTITATIVE){if(r.isCount(e)||t[e.field])return;n[e.field]="number"}});var s=e.data();if(s&&s.format&&s.format.parse){var u=s.format.parse;c.keys(u).forEach(function(e){n[e]=u[e]})}return n}function n(e){var n=t(e),i=e.child().component.data;return!i.source&&i.formatParse&&(c.extend(n,i.formatParse),delete i.formatParse),n}function i(e){var n=t(e);return e.children().forEach(function(t){var i=t.component.data;e.compatibleSource(t)&&!c.differ(i.formatParse,n)&&(c.extend(n,i.formatParse),delete i.formatParse)}),n}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i}(i=n.formatParse||(n.formatParse={}))},{"../../datetime":46,"../../fielddef":49,"../../filter":50,"../../type":60,"../../util":61}],21:[function(e,t,n){"use strict";var i,a=e("../../util");!function(e){function t(e){return(e.calculate()||[]).reduce(function(e,t){return e[a.hash(t)]=t,e},{})}function n(e){var n=t(e),i=e.child().component.data;return i.source||(a.extend(n,i.calculate),delete i.calculate),n}function i(e){var n=t(e);return e.children().forEach(function(e){var t=e.component.data;!t.source&&t.calculate&&(a.extend(n||{},t.calculate),delete t.calculate)}),n}function r(e){return a.vals(e.calculate).reduce(function(e,t){return e.push(a.extend({type:"formula"},t)),e},[])}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=r}(i=n.formula||(n.formula={}))},{"../../util":61}],22:[function(e,t,n){"use strict";var i,a=e("../../scale"),r=e("../../util");!function(e){function t(e){return e.channels().reduce(function(t,n){var i=e.scale(n);return e.field(n)&&i?(t[e.field(n)]=i.type===a.ScaleType.LOG,t):t},{})}function n(e){var t=e.child().component.data;if(!t.source){var n=t.nonPositiveFilter;return delete t.nonPositiveFilter,n}return{}}function i(e){var t={};return e.children().forEach(function(n){var i=n.component.data;e.compatibleSource(n)&&!r.differ(i.nonPositiveFilter,t)&&(r.extend(t,i.nonPositiveFilter),delete i.nonPositiveFilter)}),t}function o(e){return r.keys(e.nonPositiveFilter).filter(function(t){return e.nonPositiveFilter[t]}).map(function(e){return{type:"filter",test:'datum["'+e+'"] > 0'}})}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=o}(i=n.nonPositiveFilter||(n.nonPositiveFilter={}))},{"../../scale":53,"../../util":61}],23:[function(e,t,n){"use strict";var i,a=e("../../type"),r=e("../../util"),o={nominal:!1,ordinal:!1,quantitative:!0,temporal:!0};!function(e){function t(e){var t=e.filterInvalid();return e.reduce(function(e,n){return"*"!==n.field&&(t||void 0===t&&n.field&&o[n.type]?e[n.field]=n:e[n.field]=null),e},{})}function n(e){var n=t(e),i=e.child().component.data;return i.source||(r.extend(n,i.nullFilter),delete i.nullFilter),n}function i(e){var n=t(e);return e.children().forEach(function(t){var i=t.component.data;e.compatibleSource(t)&&!r.differ(i.nullFilter,n)&&(r.extend(n,i.nullFilter),delete i.nullFilter)}),n}function l(e){var t=r.keys(e.nullFilter).reduce(function(t,n){var i=e.nullFilter[n];return null!==i&&(t.push('datum["'+i.field+'"] !== null'),r.contains([a.QUANTITATIVE,a.TEMPORAL],i.type)&&t.push('!isNaN(datum["'+i.field+'"])')),t},[]);return t.length>0?[{type:"filter",test:t.join(" && ")}]:[]}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=l}(i=n.nullFilter||(n.nullFilter={}))},{"../../type":60,"../../util":61}],24:[function(e,t,n){"use strict";var i,a=e("../../data"),r=e("../../util"),o=e("./nullfilter"),l=e("./filter"),c=e("./bin"),s=e("./formula"),u=e("./timeunit");!function(e){function t(e){var t=e.data();if(t){var n={name:e.dataName(a.SOURCE)};if(t.values&&t.values.length>0)n.values=t.values,n.format={type:"json"};else if(t.url){n.url=t.url;var i=/(?:\.([^.]+))?$/.exec(n.url)[1];r.contains(["json","csv","tsv","topojson"],i)||(i="json");var o=t.format||{},l=o.type||t.formatType;n.format=r.extend({type:l?l:i},o.property?{property:o.property}:{},o.feature?{feature:o.feature}:o.mesh?{mesh:o.mesh}:{})}return n}if(!e.parent())return{name:e.dataName(a.SOURCE)}}function n(e){var n=t(e);return e.child().component.data.source||e.child().renameData(e.child().dataName(a.SOURCE),e.dataName(a.SOURCE)),n}function i(e){var n=t(e);return e.children().forEach(function(t){var n=t.component.data;if(e.compatibleSource(t)){var i=!n.filter&&!n.formatParse&&!n.nullFilter;i?(t.renameData(t.dataName(a.SOURCE),e.dataName(a.SOURCE)),delete n.source):n.source={name:t.dataName(a.SOURCE),source:e.dataName(a.SOURCE)}}}),n}function f(e,t){if(t.source){var n=t.source;return t.formatParse&&(t.source.format=t.source.format||{},t.source.format.parse=t.formatParse),n.transform=[].concat(s.formula.assemble(t),o.nullFilter.assemble(t),l.filter.assemble(t),c.bin.assemble(t),u.timeUnit.assemble(t)),n}return null}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=f}(i=n.source||(n.source={}))},{"../../data":45,"../../util":61,"./bin":16,"./filter":19,"./formula":21,"./nullfilter":23,"./timeunit":27}],25:[function(e,t,n){"use strict";var i,a=e("../../data"),r=e("../../fielddef"),o=e("../../util");!function(e){function t(e){var t=e.stack();if(t){var n=t.groupbyChannel,i=t.fieldChannel,r=[],l=e.field(n);return l&&r.push(l),{name:e.dataName(a.STACKED_SCALE),source:e.dataName(a.SUMMARY),transform:[o.extend({type:"aggregate",summarize:[{ops:["sum"],field:e.field(i)}]},r.length>0?{groupby:r}:{})]}}return null}function n(e){var t=e.child(),n=t.component.data;if(!n.source&&n.stackScale){var i=n.stackScale,o=e.dataName(a.STACKED_SCALE);return t.renameData(i.name,o),i.name=o,i.source=e.dataName(a.SUMMARY),i.transform[0].groupby=e.reduce(function(e,t){return e.push(r.field(t)),e},i.transform[0].groupby),delete n.stackScale,i}return null}function i(e){return null}function l(e){return e.stackScale}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=l}(i=n.stackScale||(n.stackScale={}))},{"../../data":45,"../../fielddef":49,"../../util":61}],26:[function(e,t,n){"use strict";var i,a=e("../../aggregate"),r=e("../../data"),o=e("../../fielddef"),l=e("../../util");!function(e){function t(e,t){return t.bin?(e[o.field(t,{binSuffix:"start"})]=!0,e[o.field(t,{binSuffix:"mid"})]=!0,e[o.field(t,{binSuffix:"end"})]=!0,e[o.field(t,{binSuffix:"range"})]=!0):e[o.field(t)]=!0,e}function n(e){var n={},i={};return e.forEach(function(e,r){e.aggregate?e.aggregate===a.AggregateOp.COUNT?(i["*"]=i["*"]||{},i["*"].count=!0):(i[e.field]=i[e.field]||{},i[e.field][e.aggregate]=!0):t(n,e)}),[{name:e.dataName(r.SUMMARY),dimensions:n,measures:i}]}function i(e){var n=e.child().component.data;if(!n.source&&n.summary){var i=n.summary.map(function(n){n.dimensions=e.reduce(t,n.dimensions);var i=n.name.substr(e.child().name("").length);return e.child().renameData(n.name,i),n.name=i,n});return delete n.summary,i}return[]}function c(e,t){for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];for(var a in i)i.hasOwnProperty(a)&&(n in e?e[n][a]=!0:e[n]={op:!0})}}function s(e){var t={};return e.children().forEach(function(n){var i=n.component.data;!i.source&&i.summary&&i.summary.forEach(function(a){var o=l.hash(a.dimensions);o in t?c(t[o].measures,a.measures):(a.name=e.dataName(r.SUMMARY)+"_"+l.keys(t).length,t[o]=a),n.renameData(n.dataName(r.SUMMARY),t[o].name),delete i.summary})}),l.vals(t)}function u(e,t){return e.summary?e.summary.reduce(function(e,n){var i=n.dimensions,a=n.measures,o=l.keys(i),c=l.reduce(a,function(e,t,n){return e[n]=l.keys(t),e},{});return l.keys(a).length>0&&e.push({name:n.name,source:t.dataName(r.SOURCE),transform:[{type:"aggregate",groupby:o,summarize:c}]}),e},[]):[]}e.parseUnit=n,e.parseFacet=i,e.parseLayer=s,e.assemble=u}(i=n.summary||(n.summary={}))},{"../../aggregate":8,"../../data":45,"../../fielddef":49,"../../util":61}],27:[function(e,t,n){"use strict";var i,a=e("../../fielddef"),r=e("../../timeunit"),o=e("../../type"),l=e("../../util");!function(e){function t(e){return e.reduce(function(e,t,n){if(t.type===o.TEMPORAL&&t.timeUnit){var i=a.field(t);e[i]={type:"formula",field:a.field(t),expr:r.fieldExpr(t.timeUnit,t.field)}}return e},{})}function n(e){var n=t(e),i=e.child().component.data;return i.source||(l.extend(n,i.timeUnit),delete i.timeUnit),n}function i(e){var n=t(e);return e.children().forEach(function(e){var t=e.component.data;t.source||(l.extend(n,t.timeUnit),delete t.timeUnit)}),n}function c(e){return l.vals(e.timeUnit)}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=c}(i=n.timeUnit||(n.timeUnit={}))},{"../../fielddef":49,"../../timeunit":58,"../../type":60,"../../util":61}],28:[function(e,t,n){"use strict";var i,a=e("../../datetime"),r=e("../../timeunit"),o=e("../../util");!function(e){function t(e){return e.reduce(function(e,t,n){if(t.timeUnit){var i=r.imputedDomain(t.timeUnit,n);i&&(e[t.timeUnit]=!0)}return e},{})}function n(e){return o.extend(t(e),e.child().component.data.timeUnitDomain)}function i(e){return o.extend(t(e),e.children().forEach(function(e){return e.component.data.timeUnitDomain}))}function l(e){return o.keys(e.timeUnitDomain).reduce(function(e,t){var n=t,i=r.imputedDomain(n,null);if(i){var o={};o[n]='datum["data"]',e.push({name:n,values:i,transform:[{type:"formula",field:"date",expr:a.dateTimeExpr(o)}]})}return e},[])}e.parseUnit=t,e.parseFacet=n,e.parseLayer=i,e.assemble=l}(i=n.timeUnitDomain||(n.timeUnitDomain={}))},{"../../datetime":46,"../../timeunit":58,"../../util":61}],29:[function(e,t,n){"use strict";function i(e){var t=e.child(),n=v.extend({},t.config().cell,t.config().facet.cell);return v.extend({x:e.has(f.COLUMN)?{scale:e.scaleName(f.COLUMN),field:e.field(f.COLUMN),offset:e.scale(f.COLUMN).padding/2}:{value:e.config().facet.scale.padding/2},y:e.has(f.ROW)?{scale:e.scaleName(f.ROW),field:e.field(f.ROW),offset:e.scale(f.ROW).padding/2}:{value:e.config().facet.scale.padding/2},width:{field:{parent:e.child().sizeName("width")}},height:{field:{parent:e.child().sizeName("height")}}},t.assembleParentGroupProperties(n))}function a(e,t){var n=null,i=e.child();return i.has(t)&&i.axis(t)&&(n=t===f.X?r(e):o(e),i.axis(t)&&O.gridShow(i,t)?i.component.axis[t]=O.parseInnerAxis(t,i):delete i.component.axis[t]),n}function r(e){var t=e.has(f.COLUMN);return v.extend({name:e.name("x-axes"),type:"group"},t?{from:{data:e.dataTable(),transform:[{type:"aggregate",groupby:[e.field(f.COLUMN)],summarize:{"*":["count"]}}]}}:{},{properties:{update:{width:{field:{parent:e.child().sizeName("width")}},height:{field:{group:"height"}},x:t?{scale:e.scaleName(f.COLUMN),field:e.field(f.COLUMN),offset:e.scale(f.COLUMN).padding/2}:{value:e.config().facet.scale.padding/2}}},axes:[O.parseAxis(f.X,e.child())]})}function o(e){var t=e.has(f.ROW);return v.extend({name:e.name("y-axes"),type:"group"},t?{from:{data:e.dataTable(),transform:[{type:"aggregate",groupby:[e.field(f.ROW)],summarize:{"*":["count"]}}]}}:{},{properties:{update:{width:{field:{group:"width"}},height:{field:{parent:e.child().sizeName("height")}},y:t?{scale:e.scaleName(f.ROW),field:e.field(f.ROW),offset:e.scale(f.ROW).padding/2}:{value:e.config().facet.scale.padding/2}}},axes:[O.parseAxis(f.Y,e.child())]})}function l(e){var t=e.config().facet.grid,n={name:e.name("row-grid"),type:"rule",from:{data:e.dataTable(),transform:[{type:"facet",groupby:[e.field(f.ROW)]}]},properties:{update:{y:{scale:e.scaleName(f.ROW),field:e.field(f.ROW)},x:{value:0,offset:-t.offset},x2:{field:{group:"width"},offset:t.offset},stroke:{value:t.color},strokeOpacity:{value:t.opacity},strokeWidth:{value:.5}}}};return[n,{name:e.name("row-grid-end"),type:"rule",properties:{update:{y:{field:{group:"height"}},x:{value:0,offset:-t.offset},x2:{field:{group:"width"},offset:t.offset},stroke:{value:t.color},strokeOpacity:{value:t.opacity},strokeWidth:{value:.5}}}}]}function c(e){var t=e.config().facet.grid,n={name:e.name("column-grid"),type:"rule",from:{data:e.dataTable(),transform:[{type:"facet",groupby:[e.field(f.COLUMN)]}]},properties:{update:{x:{scale:e.scaleName(f.COLUMN),field:e.field(f.COLUMN)},y:{value:0,offset:-t.offset},y2:{field:{group:"height"},offset:t.offset},stroke:{value:t.color},strokeOpacity:{value:t.opacity},strokeWidth:{value:.5}}}};return[n,{name:e.name("column-grid-end"),type:"rule",properties:{update:{x:{field:{group:"width"}},y:{value:0,offset:-t.offset},y2:{field:{group:"height"},offset:t.offset},stroke:{value:t.color},strokeOpacity:{value:t.opacity},strokeWidth:{value:.5}}}}]}var s=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},u=e("../axis"),f=e("../channel"),d=e("../config"),p=e("../data"),m=e("../encoding"),h=e("../fielddef"),g=e("../scale"),y=e("../type"),v=e("../util"),O=e("./axis"),S=e("./common"),E=e("./data/data"),T=e("./layout"),N=e("./model"),A=e("./scale"),R=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this,r=a._config=a._initConfig(t.config,n),o=a._child=S.buildModel(t.spec,a,a.name("child")),l=a._facet=a._initFacet(t.facet);return a._scale=a._initScale(l,r,o),a._axis=a._initAxis(l,r,o),a}return s(t,e),t.prototype._initConfig=function(e,t){return v.mergeDeep(v.duplicate(d.defaultConfig),t?t.config():{},e)},t.prototype._initFacet=function(e){e=v.duplicate(e);var t=this;return m.channelMappingForEach(this.channels(),e,function(e,n){e.type&&(e.type=y.getFullName(e.type)),h.isDimension(e)||t.addWarning(n+" encoding should be ordinal.")}),e},t.prototype._initScale=function(e,t,n){return[f.ROW,f.COLUMN].reduce(function(i,a){if(e[a]){var r=e[a].scale||{};i[a]=v.extend({type:g.ScaleType.ORDINAL,round:t.facet.scale.round,padding:a===f.ROW&&n.has(f.Y)||a===f.COLUMN&&n.has(f.X)?t.facet.scale.padding:0},r)}return i},{})},t.prototype._initAxis=function(e,t,n){return[f.ROW,f.COLUMN].reduce(function(i,a){if(e[a]){var r=e[a].axis;if(r!==!1){var o=i[a]=v.extend({},t.facet.axis,r===!0?{}:r||{});if(a===f.ROW){var l=n.axis(f.Y);l&&l.orient!==u.AxisOrient.RIGHT&&!o.orient&&(o.orient=u.AxisOrient.RIGHT),n.has(f.X)&&!o.labelAngle&&(o.labelAngle=o.orient===u.AxisOrient.RIGHT?90:270)}}}return i},{})},t.prototype.facet=function(){return this._facet},t.prototype.has=function(e){return!!this._facet[e]},t.prototype.child=function(){return this._child},t.prototype.hasSummary=function(){for(var e=this.component.data.summary,t=0;t<e.length;t++)if(v.keys(e[t].measures).length>0)return!0;return!1},t.prototype.dataTable=function(){return(this.hasSummary()?p.SUMMARY:p.SOURCE)+""},t.prototype.fieldDef=function(e){return this.facet()[e]},t.prototype.stack=function(){return null},t.prototype.parseData=function(){this.child().parseData(),this.component.data=E.parseFacetData(this)},t.prototype.parseSelectionData=function(){},t.prototype.parseLayoutData=function(){this.child().parseLayoutData(),this.component.layout=T.parseFacetLayout(this)},t.prototype.parseScale=function(){var e=this.child(),t=this;e.parseScale();var n=this.component.scale=A.parseScaleComponent(this);v.keys(e.component.scale).forEach(function(i){n[i]=e.component.scale[i],v.vals(n[i]).forEach(function(n){var i=n.name.substr(e.name("").length),a=t.scaleName(i,!0);e.renameScale(n.name,a),n.name=a}),delete e.component.scale[i]})},t.prototype.parseMark=function(){this.child().parseMark(),this.component.mark=v.extend({name:this.name("cell"),type:"group",from:v.extend(this.dataTable()?{data:this.dataTable()}:{},{transform:[{type:"facet",groupby:[].concat(this.has(f.ROW)?[this.field(f.ROW)]:[],this.has(f.COLUMN)?[this.field(f.COLUMN)]:[])}]}),properties:{update:i(this)}},this.child().assembleGroup())},t.prototype.parseAxis=function(){this.child().parseAxis(),this.component.axis=O.parseAxisComponent(this,[f.ROW,f.COLUMN])},t.prototype.parseAxisGroup=function(){var e=a(this,f.X),t=a(this,f.Y);this.component.axisGroup=v.extend(e?{x:e}:{},t?{y:t}:{})},t.prototype.parseGridGroup=function(){var e=this.child();this.component.gridGroup=v.extend(!e.has(f.X)&&this.has(f.COLUMN)?{column:c(this)}:{},!e.has(f.Y)&&this.has(f.ROW)?{row:l(this)}:{})},t.prototype.parseLegend=function(){this.child().parseLegend(),this.component.legend=this._child.component.legend,this._child.component.legend={}},t.prototype.assembleParentGroupProperties=function(){return null},t.prototype.assembleData=function(e){return E.assembleData(this,e),this._child.assembleData(e)},t.prototype.assembleLayout=function(e){return this._child.assembleLayout(e),T.assembleLayout(this,e)},t.prototype.assembleMarks=function(){return[].concat(v.vals(this.component.axisGroup),v.flatten(v.vals(this.component.gridGroup)),this.component.mark)},t.prototype.channels=function(){return[f.ROW,f.COLUMN]},t.prototype.mapping=function(){return this.facet()},t.prototype.isFacet=function(){return!0},t}(N.Model);n.FacetModel=R},{"../axis":9,"../channel":11,"../config":44,"../data":45,"../encoding":47,"../fielddef":49,"../scale":53,"../type":60,"../util":61,"./axis":12,"./common":13,"./data/data":18,"./layout":31,"./model":41,"./scale":42}],30:[function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},a=e("../util"),r=e("../config"),o=e("./data/data"),l=e("./layout"),c=e("./model"),s=e("./common"),u=e("../vega.schema"),f=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this;return a._width=t.width,a._height=t.height,a._config=a._initConfig(t.config,n),a._children=t.layers.map(function(e,t){return s.buildModel(e,a,a.name("layer_"+t))}),a}return i(t,e),t.prototype._initConfig=function(e,t){return a.mergeDeep(a.duplicate(r.defaultConfig),e,t?t.config():{})},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return!1},t.prototype.children=function(){return this._children},t.prototype.isOrdinalScale=function(e){return this._children[0].isOrdinalScale(e)},t.prototype.dataTable=function(){return this._children[0].dataTable()},t.prototype.fieldDef=function(e){return null},t.prototype.stack=function(){return null},t.prototype.parseData=function(){this._children.forEach(function(e){e.parseData()}),this.component.data=o.parseLayerData(this)},t.prototype.parseSelectionData=function(){},t.prototype.parseLayoutData=function(){this._children.forEach(function(e,t){e.parseLayoutData()}),this.component.layout=l.parseLayerLayout(this)},t.prototype.parseScale=function(){var e=this,t=this.component.scale={};this._children.forEach(function(n){n.parseScale(),a.keys(n.component.scale).forEach(function(i){var r=n.component.scale[i];if(r){var o=t[i];if(o&&o.main){var l=o.main.domain,c=r.main.domain;if(a.isArray(l))a.isArray(r.main.domain)?o.main.domain=l.concat(c):e.addWarning("custom domain scale cannot be unioned with default field-based domain");else{var s=u.isUnionedDomain(l)?l.fields:[l];a.isArray(c)&&e.addWarning("custom domain scale cannot be unioned with default field-based domain");var f=u.isDataRefDomain(c)?s.concat([c]):u.isUnionedDomain(c)?s.concat(c.fields):s;f=a.unique(f,a.hash),f.length>1?o.main.domain={fields:f}:o.main.domain=f[0]}o.colorLegend=o.colorLegend?o.colorLegend:r.colorLegend,o.binColorLegend=o.binColorLegend?o.binColorLegend:r.binColorLegend}else t[i]=r;a.vals(r).forEach(function(t){var i=t.name.substr(n.name("").length),a=e.scaleName(i,!0);n.renameScale(t.name,a),t.name=a}),delete r[i]}})})},t.prototype.parseMark=function(){this._children.forEach(function(e){e.parseMark()})},t.prototype.parseAxis=function(){var e=this.component.axis={};this._children.forEach(function(t){t.parseAxis(),a.keys(t.component.axis).forEach(function(n){e[n]||(e[n]=t.component.axis[n])})})},t.prototype.parseAxisGroup=function(){return null},t.prototype.parseGridGroup=function(){return null},t.prototype.parseLegend=function(){var e=this.component.legend={};this._children.forEach(function(t){t.parseLegend(),a.keys(t.component.legend).forEach(function(n){e[n]||(e[n]=t.component.legend[n])})})},t.prototype.assembleParentGroupProperties=function(){return null},t.prototype.assembleData=function(e){return o.assembleData(this,e),this._children.forEach(function(t){t.assembleData(e)}),e},t.prototype.assembleLayout=function(e){return this._children.forEach(function(t){t.assembleLayout(e)}),l.assembleLayout(this,e)},t.prototype.assembleMarks=function(){return a.flatten(this._children.map(function(e){return e.assembleMarks()}))},t.prototype.channels=function(){return[]},t.prototype.mapping=function(){return null},t.prototype.isLayer=function(){return!0},t.prototype.compatibleSource=function(e){var t=this.data(),n=e.component.data,i=!n.source||t&&t.url===n.source.url;return i},t}(c.Model);n.LayerModel=f},{"../config":44,"../util":61,"../vega.schema":63,"./common":13,"./data/data":18,"./layout":31,"./model":41}],31:[function(e,t,n){"use strict";function i(e,t){var n=e.component.layout;if(!n.width&&!n.height)return t;var i=y.keys(y.extend(n.width.distinct,n.height.distinct)),a=n.width.formula.concat(n.height.formula).map(function(e){return y.extend({type:"formula"},e)});return[i.length>0?{name:e.dataName(h.LAYOUT),source:e.dataTable(),transform:[{type:"aggregate",summarize:i.map(function(e){return{field:e,ops:["distinct"]}})}].concat(a)}:{name:e.dataName(h.LAYOUT),values:[{}],transform:a}]}function a(e){return{width:r(e,m.X),height:r(e,m.Y)}}function r(e,t){return{distinct:d(e,t),formula:[{field:e.channelSizeName(t),expr:o(e,t)}]}}function o(e,t){var n=e.scale(t);return n&&n.type===g.ScaleType.ORDINAL&&n.bandSize!==g.BANDSIZE_FIT?"("+p(e,t)+" + 1) * "+n.bandSize:(t===m.X?e.width:e.height)+""}function l(e){return{width:c(e,m.COLUMN),height:c(e,m.ROW)}}function c(e,t){var n=e.child().component.layout,i=t===m.ROW?"height":"width",a=n[i],r=y.extend(d(e,t),a.distinct),o=a.formula.concat([{field:e.channelSizeName(t),expr:s(e,t,e.child().channelSizeName(t))}]);return delete n[i],{distinct:r,formula:o}}function s(e,t,n){var i=e.scale(t);return e.has(t)?'(datum["'+n+'"] + '+i.padding+") * "+p(e,t):'datum["'+n+'"] + '+e.config().facet.scale.padding}function u(e){return{width:f(e,m.X),height:f(e,m.Y)}}function f(e,t){var n=e.children()[0].component.layout,i=t===m.Y?"height":"width",a=n[i],r=a.distinct,o=[{field:e.channelSizeName(t),expr:a.formula[0].expr}];return e.children().forEach(function(e){delete e.component.layout[i]}),{distinct:r,formula:o}}function d(e,t){if(e.has(t)&&e.isOrdinalScale(t)){var n=e.scale(t);if(n.type===g.ScaleType.ORDINAL&&!(n.domain instanceof Array)){var i=e.field(t),a={};return a[i]=!0,a}}return{}}function p(e,t){var n=e.scale(t);if(n.domain instanceof Array)return n.domain.length;var i=e.fieldDef(t).timeUnit,a=i?v.imputedDomain(i,t):null;return null!==a?a.length:e.field(t,{datum:!0,prefix:"distinct"})}var m=e("../channel"),h=e("../data"),g=e("../scale"),y=e("../util"),v=e("../timeunit");n.assembleLayout=i,n.parseUnitLayout=a,n.unitSizeExpr=o,n.parseFacetLayout=l,n.parseLayerLayout=u,n.cardinalityExpr=p},{"../channel":11,"../data":45,"../scale":53,"../timeunit":58,"../util":61}],32:[function(e,t,n){"use strict";function i(e){return[s.COLOR,s.SIZE,s.SHAPE,s.OPACITY].reduce(function(t,n){return e.legend(n)&&(t[n]=r(e,n)),t},{})}function a(e,t){switch(t){case s.COLOR:var n=e.encoding().color,i=e.scaleName(c(n)?g.COLOR_LEGEND:s.COLOR);return e.config().mark.filled?{fill:i}:{stroke:i};case s.SIZE:return{size:e.scaleName(s.SIZE)};case s.SHAPE:return{shape:e.scaleName(s.SHAPE)};case s.OPACITY:return{opacity:e.scaleName(s.OPACITY)}}return null}function r(e,t){var n=e.fieldDef(t),i=e.legend(t),r=e.config(),c=a(e,t);c.title=o(i,n,r);var s=h.numberFormat(n,i.format,r,t);s&&(c.format=s);var u=l(i);u&&(c.values=u),["offset","orient"].forEach(function(e){var t=i[e];void 0!==t&&(c[e]=t)});var f="boolean"!=typeof i&&i.properties||{};return["title","symbols","legend","labels"].forEach(function(i){var a=y[i]?y[i](n,f[i],e,t):f[i];void 0!==a&&m.keys(a).length>0&&(c.properties=c.properties||{},c.properties[i]=a)}),c}function o(e,t,n){return void 0!==e.title?e.title:f.title(t,n)}function l(e){var t=e.values;return t&&u.isDateTime(t[0])?t.map(function(e){return u.timestamp(e,!0)}):t}function c(e){return e.type===p.ORDINAL||e.bin||e.timeUnit}var s=e("../channel"),u=e("../datetime"),f=e("../fielddef"),d=e("../mark"),p=e("../type"),m=e("../util"),h=e("./common"),g=e("./scale");n.parseLegendComponent=i,n.parseLegend=r,n.title=o,n.values=l,n.useColorLegendScale=c;var y;!function(e){function t(e,t,n,i){var a={},r=n.mark(),o=n.legend(i);switch(r){case d.BAR:case d.TICK:case d.TEXT:a.shape={value:"square"};break;case d.CIRCLE:case d.SQUARE:a.shape={value:r};break;case d.POINT:case d.LINE:case d.AREA:}var l=n.config(),u=l.mark.filled,f=i===s.COLOR?m.without(h.FILL_STROKE_CONFIG,[u?"fill":"stroke","strokeDash","strokeDashOffset"]):m.without(h.FILL_STROKE_CONFIG,["strokeDash","strokeDashOffset"]);f=m.without(f,["strokeDash","strokeDashOffset"]),h.applyMarkConfig(a,n,f),u&&(a.strokeWidth={value:0}),i===s.OPACITY&&delete a.opacity;var p;return n.has(s.COLOR)&&i===s.COLOR?c(e)&&(p={scale:n.scaleName(s.COLOR),field:"data"}):n.encoding().color&&n.encoding().color.value&&(p={value:n.encoding().color.value}),void 0!==p?u?a.fill=p:a.stroke=p:i!==s.COLOR&&(a[u?"fill":"stroke"]=a[u?"fill":"stroke"]||{value:l.mark.color}),void 0!==o.symbolColor?a.fill={value:o.symbolColor}:void 0===a.fill&&(void 0!==l.mark.fill?a.fill={value:l.mark.fill}:void 0!==l.mark.stroke&&(a.stroke={value:l.mark.stroke})),i!==s.SHAPE&&(void 0!==o.symbolShape?a.shape={value:o.symbolShape}:void 0!==l.mark.shape&&(a.shape={value:l.mark.shape})),i!==s.SIZE&&void 0!==o.symbolSize&&(a.size={value:o.symbolSize}),void 0!==o.symbolStrokeWidth&&(a.strokeWidth={value:o.symbolStrokeWidth}),a=m.extend(a,t||{}),m.keys(a).length>0?a:void 0}function n(e,t,n,i){var a=n.legend(i),r=n.config(),o={};return i===s.COLOR&&(e.type===p.ORDINAL?t=m.extend({text:{scale:n.scaleName(g.COLOR_LEGEND),field:"data"}},t||{}):e.bin?t=m.extend({text:{scale:n.scaleName(g.COLOR_LEGEND_LABEL),field:"data"}},t||{}):e.type===p.TEMPORAL&&(t=m.extend({text:{template:h.timeTemplate('datum["data"]',e.timeUnit,a.format,a.shortTimeLabels,r)}},t||{}))),void 0!==a.labelAlign&&(o.align={value:a.labelAlign}),void 0!==a.labelColor&&(o.fill={value:a.labelColor}),void 0!==a.labelFont&&(o.font={value:a.labelFont}),void 0!==a.labelFontSize&&(o.fontSize={value:a.labelFontSize}),void 0!==a.labelBaseline&&(o.baseline={value:a.labelBaseline}),o=m.extend(o,t||{}),m.keys(o).length>0?o:void 0}function i(e,t,n,i){var a=n.legend(i),r={};return void 0!==a.titleColor&&(r.fill={value:a.titleColor}),void 0!==a.titleFont&&(r.font={value:a.titleFont}),void 0!==a.titleFontSize&&(r.fontSize={value:a.titleFontSize}),void 0!==a.titleFontWeight&&(r.fontWeight={value:a.titleFontWeight}),r=m.extend(r,t||{}),m.keys(r).length>0?r:void 0}e.symbols=t,e.labels=n,e.title=i}(y=n.properties||(n.properties={}))},{"../channel":11,"../datetime":46,"../fielddef":49,"../mark":52,"../type":60,"../util":61,"./common":13,"./scale":42}],33:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../config"),o=e("../../fielddef"),l=e("../../scale"),c=e("../../util"),s=e("../common");!function(e){function t(){return"area"}function n(e){var t={},n=e.config(),r=n.mark.orient;t.orient={value:r};var o=e.stack();t.x=i(e.encoding().x,e.scaleName(a.X),e.scale(a.X),r,o),t.y=f(e.encoding().y,e.scaleName(a.Y),e.scale(a.Y),r,o);var l=u(e.encoding().x,e.encoding().x2,e.scaleName(a.X),e.scale(a.X),r,o);l&&(t.x2=l);var c=d(e.encoding().y,e.encoding().y2,e.scaleName(a.Y),e.scale(a.Y),r,o);return c&&(t.y2=c),s.applyColorAndOpacity(t,e),s.applyMarkConfig(t,e,["interpolate","tension"]),t}function i(e,t,n,i,r){if(r&&a.X===r.fieldChannel)return{scale:t,field:o.field(e,{suffix:"start"})};if(e){if(e.field)return{scale:t,field:o.field(e,{binSuffix:"mid"})};if(e.value)return{scale:t,value:e.value}}return{value:0}}function u(e,t,n,i,s,u){if(s===r.Orient.HORIZONTAL){if(u&&a.X===u.fieldChannel)return{scale:n,field:o.field(e,{suffix:"end"})};if(t){if(t.field)return{scale:n,field:o.field(t)};if(t.value)return{scale:n,value:t.value}}return c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],i.type)||i.zero===!1?{value:0}:{scale:n,value:0}}}function f(e,t,n,i,r){if(r&&a.Y===r.fieldChannel)return{scale:t,field:o.field(e,{suffix:"start"})};if(e){if(e.field)return{scale:t,field:o.field(e,{binSuffix:"mid"})};if(e.value)return{scale:t,value:e.value}}return{value:0}}function d(e,t,n,i,s,u){if(s!==r.Orient.HORIZONTAL){if(u&&a.Y===u.fieldChannel)return{scale:n,field:o.field(e,{suffix:"end"})};if(t){if(t.field)return{scale:n,field:o.field(t)};if(t.value)return{scale:n,value:t.value}}return c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],i.type)||i.zero===!1?{field:{group:"height"}}:{scale:n,value:0}}}e.markType=t,e.properties=n,e.x=i,e.x2=u,e.y=f,e.y2=d}(i=n.area||(n.area={}))},{"../../channel":11,"../../config":44,"../../fielddef":49,"../../scale":53,"../../util":61,"../common":13}],34:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../config"),o=e("../../fielddef"),l=e("../../scale"),c=e("../../util"),s=e("../common");!function(e){function t(){return"rect"}function n(e){var t={},n=e.config().mark.orient,u=e.stack(),f=e.encoding().x,d=e.encoding().x2,p=o.isMeasure(f)||o.isMeasure(d);u&&a.X===u.fieldChannel?(t.x={scale:e.scaleName(a.X),field:e.field(a.X,{suffix:"start"})},t.x2={scale:e.scaleName(a.X),field:e.field(a.X,{suffix:"end"})}):p?n===r.Orient.HORIZONTAL?(e.has(a.X)?t.x={scale:e.scaleName(a.X),field:e.field(a.X)}:t.x={scale:e.scaleName(a.X),value:0},e.has(a.X2)?t.x2={scale:e.scaleName(a.X),field:e.field(a.X2)}:c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],e.scale(a.X).type)||e.scale(a.X).zero===!1?t.x2={value:0}:t.x2={scale:e.scaleName(a.X),value:0}):(t.xc={scale:e.scaleName(a.X),field:e.field(a.X)},t.width={value:i(e,a.X)}):(e.has(a.X)?e.encoding().x.bin?e.has(a.SIZE)&&n!==r.Orient.HORIZONTAL?(t.xc={scale:e.scaleName(a.X),field:e.field(a.X,{binSuffix:"mid"})},t.width={scale:e.scaleName(a.SIZE),field:e.field(a.SIZE)}):(t.x={scale:e.scaleName(a.X),field:e.field(a.X,{binSuffix:"start"}),offset:1},t.x2={scale:e.scaleName(a.X),field:e.field(a.X,{binSuffix:"end"})}):e.scale(a.X).bandSize===l.BANDSIZE_FIT?t.x={scale:e.scaleName(a.X),field:e.field(a.X),offset:.5}:t.xc={scale:e.scaleName(a.X),field:e.field(a.X)}:t.x={value:0,offset:2},t.width=e.has(a.X)&&e.scale(a.X).bandSize===l.BANDSIZE_FIT?{scale:e.scaleName(a.X),band:!0,offset:-.5}:e.has(a.SIZE)&&n!==r.Orient.HORIZONTAL?{scale:e.scaleName(a.SIZE),field:e.field(a.SIZE)}:{value:i(e,a.X)});var m=e.encoding().y,h=e.encoding().y2,g=o.isMeasure(m)||o.isMeasure(h);return u&&a.Y===u.fieldChannel?(t.y={scale:e.scaleName(a.Y),field:e.field(a.Y,{suffix:"start"})},t.y2={scale:e.scaleName(a.Y),field:e.field(a.Y,{suffix:"end"})}):g?n!==r.Orient.HORIZONTAL?(e.has(a.Y)?t.y={scale:e.scaleName(a.Y),field:e.field(a.Y)}:t.y={scale:e.scaleName(a.Y),value:0},e.has(a.Y2)?t.y2={
scale:e.scaleName(a.Y),field:e.field(a.Y2)}:c.contains([l.ScaleType.LOG,l.ScaleType.TIME,l.ScaleType.UTC],e.scale(a.Y).type)||e.scale(a.Y).zero===!1?t.y2={field:{group:"height"}}:t.y2={scale:e.scaleName(a.Y),value:0}):(t.yc={scale:e.scaleName(a.Y),field:e.field(a.Y)},t.height={value:i(e,a.Y)}):(e.has(a.Y)?e.encoding().y.bin?e.has(a.SIZE)&&n===r.Orient.HORIZONTAL?(t.yc={scale:e.scaleName(a.Y),field:e.field(a.Y,{binSuffix:"mid"})},t.height={scale:e.scaleName(a.SIZE),field:e.field(a.SIZE)}):(t.y={scale:e.scaleName(a.Y),field:e.field(a.Y,{binSuffix:"start"})},t.y2={scale:e.scaleName(a.Y),field:e.field(a.Y,{binSuffix:"end"}),offset:1}):e.scale(a.Y).bandSize===l.BANDSIZE_FIT?t.y={scale:e.scaleName(a.Y),field:e.field(a.Y),offset:.5}:t.yc={scale:e.scaleName(a.Y),field:e.field(a.Y)}:t.y2={field:{group:"height"},offset:-1},t.height=e.has(a.Y)&&e.scale(a.Y).bandSize===l.BANDSIZE_FIT?{scale:e.scaleName(a.Y),band:!0,offset:-.5}:e.has(a.SIZE)&&n===r.Orient.HORIZONTAL?{scale:e.scaleName(a.SIZE),field:e.field(a.SIZE)}:{value:i(e,a.Y)}),s.applyColorAndOpacity(t,e),t}function i(e,t){var n=e.encoding().size;if(n&&void 0!==n.value)return n.value;var i=e.config().mark;return i.barSize?i.barSize:e.isOrdinalScale(t)?e.scale(t).bandSize-1:e.has(t)?i.barThinSize:e.config().scale.bandSize-1}e.markType=t,e.properties=n}(i=n.bar||(n.bar={}))},{"../../channel":11,"../../config":44,"../../fielddef":49,"../../scale":53,"../../util":61,"../common":13}],35:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../fielddef"),o=e("../common");!function(e){function t(){return"line"}function n(e){var t={},n=e.config(),r=e.stack();t.x=i(e.encoding().x,e.scaleName(a.X),r,n),t.y=l(e.encoding().y,e.scaleName(a.Y),r,n);var s=c(e.encoding().size,n);return s&&(t.strokeWidth=s),o.applyColorAndOpacity(t,e),o.applyMarkConfig(t,e,["interpolate","tension"]),t}function i(e,t,n,i){if(e){if(n&&a.X===n.fieldChannel)return{scale:t,field:r.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:r.field(e,{binSuffix:"mid"})}}return{value:0}}function l(e,t,n,i){if(e){if(n&&a.Y===n.fieldChannel)return{scale:t,field:r.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:r.field(e,{binSuffix:"mid"})}}return{field:{group:"height"}}}function c(e,t){return e&&void 0!==e.value?{value:e.value}:{value:t.mark.lineSize}}e.markType=t,e.properties=n}(i=n.line||(n.line={}))},{"../../channel":11,"../../fielddef":49,"../common":13}],36:[function(e,t,n){"use strict";function i(e){return S.contains([y.LINE,y.AREA],e.mark())?a(e):r(e)}function a(e){var t=e.mark(),n=e.parent()&&e.parent().isFacet(),i={data:e.dataTable()},a=c(e),r=[{name:e.name("marks"),type:x[t].markType(),from:S.extend(n||a.length>0?{}:i,{transform:[{type:"sort",by:l(e)}]}),properties:{update:x[t].properties(e)}}];if(a.length>0){var u={type:"facet",groupby:a},f=e.stack()?s(e,!0).concat(u):[].concat(u,e.has(p.ORDER)?[{type:"sort",by:o(e)}]:[]);return[{name:e.name("pathgroup"),type:"group",from:S.extend(n?{}:i,{transform:f}),properties:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:r}]}return r}function r(e){var t=e.mark(),n=e.parent()&&e.parent().isFacet(),i={data:e.dataTable()},a=[];return t===y.TEXT&&e.has(p.COLOR)&&e.config().mark.applyColorToBackground&&!e.has(p.X)&&!e.has(p.Y)&&a.push(S.extend({name:e.name("background"),type:"rect"},n?{}:{from:i},{properties:{update:b.text.background(e)}})),a.push(S.extend({name:e.name("marks"),type:x[t].markType()},!n||e.stack()||e.has(p.ORDER)?{from:S.extend(n?{}:i,e.stack()?{transform:s(e,!1)}:e.has(p.ORDER)?{transform:[{type:"sort",by:o(e)}]}:{})}:{},{properties:{update:x[t].properties(e)}})),a}function o(e){if(e.has(p.ORDER)){var t=e.encoding().order;return t instanceof Array?t.map(N.sortField):N.sortField(t)}return null}function l(e){if(e.mark()===y.LINE&&e.has(p.PATH)){var t=e.encoding().path;return t instanceof Array?t.map(N.sortField):N.sortField(t)}var n=e.config().mark.orient===m.Orient.HORIZONTAL?p.Y:p.X,i=e.sort(n);return O.isSortField(i)?"-"+g.field({aggregate:h.isAggregate(e.encoding())?i.op:void 0,field:i.field}):"-"+e.field(n,{binSuffix:"mid"})}function c(e){return[p.COLOR,p.DETAIL,p.OPACITY,p.SHAPE].reduce(function(t,n){return e.has(n)&&!e.fieldDef(n).aggregate&&t.push(e.field(n)),t},[])}function s(e,t){var n=u(e);return t?[f(e,n),d(e,n)]:[d(e,n)]}function u(e){var t=e.encoding();return p.STACK_GROUP_CHANNELS.reduce(function(n,i){var a=t[i];if(h.has(t,i))if(S.isArray(a))a.forEach(function(e){n.push(g.field(e))});else{var r=a,o=e.scale(i),l=g.field(r,{binSuffix:o&&o.type===v.ScaleType.ORDINAL?"range":"start"});l&&n.push(l)}return n},[])}function f(e,t){var n=e.stack();return{type:"impute",field:e.field(n.fieldChannel),groupby:t,orderby:[e.field(n.groupbyChannel,{binSuffix:"mid"})],method:"value",value:0}}function d(e,t){var n=e.stack(),i=e.encoding(),a=e.has(p.ORDER)?(S.isArray(i[p.ORDER])?i[p.ORDER]:[i[p.ORDER]]).map(N.sortField):t.map(function(e){return"-"+e}),r=e.field(n.fieldChannel),o={type:"stack",groupby:[e.field(n.groupbyChannel,{binSuffix:"mid"})||"undefined"],field:e.field(n.fieldChannel),sortby:a,output:{start:r+"_start",end:r+"_end"}};return n.offset&&(o.offset=n.offset),o}var p=e("../../channel"),m=e("../../config"),h=e("../../encoding"),g=e("../../fielddef"),y=e("../../mark"),v=e("../../scale"),O=e("../../sort"),S=e("../../util"),E=e("./area"),T=e("./bar"),N=e("../common"),A=e("./line"),R=e("./point"),L=e("./rule"),b=e("./text"),I=e("./tick"),x={area:E.area,bar:T.bar,line:A.line,point:R.point,text:b.text,tick:I.tick,rule:L.rule,circle:R.circle,square:R.square};n.parseMark=i},{"../../channel":11,"../../config":44,"../../encoding":47,"../../fielddef":49,"../../mark":52,"../../scale":53,"../../sort":55,"../../util":61,"../common":13,"./area":33,"./bar":34,"./line":35,"./point":37,"./rule":38,"./text":39,"./tick":40}],37:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../fielddef"),o=e("../common");!function(e){function t(){return"symbol"}function n(e,t){var n={},r=e.config(),u=e.stack();return n.x=i(e.encoding().x,e.scaleName(a.X),u,r),n.y=l(e.encoding().y,e.scaleName(a.Y),u,r),n.size=c(e.encoding().size,e.scaleName(a.SIZE),e.scale(a.SIZE),r),n.shape=s(e.encoding().shape,e.scaleName(a.SHAPE),e.scale(a.SHAPE),r,t),o.applyColorAndOpacity(n,e),n}function i(e,t,n,i){if(e){if(n&&a.X===n.fieldChannel)return{scale:t,field:r.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:r.field(e,{binSuffix:"mid"})}}return{value:i.scale.bandSize/2}}function l(e,t,n,i){if(e){if(n&&a.Y===n.fieldChannel)return{scale:t,field:r.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:r.field(e,{binSuffix:"mid"})}}return{value:i.scale.bandSize/2}}function c(e,t,n,i){if(e){if(e.field)return{scale:t,field:r.field(e,{scaleType:n.type})};if(void 0!==e.value)return{value:e.value}}return{value:i.mark.size}}function s(e,t,n,i,a){if(a)return{value:a};if(e){if(e.field)return{scale:t,field:r.field(e,{scaleType:n.type})};if(e.value)return{value:e.value}}return{value:i.mark.shape}}e.markType=t,e.properties=n}(i=n.point||(n.point={}));var l;!function(e){function t(){return"symbol"}function n(e){return i.properties(e,"circle")}e.markType=t,e.properties=n}(l=n.circle||(n.circle={}));var c;!function(e){function t(){return"symbol"}function n(e){return i.properties(e,"square")}e.markType=t,e.properties=n}(c=n.square||(n.square={}))},{"../../channel":11,"../../fielddef":49,"../common":13}],38:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../config"),o=e("../common");!function(e){function t(){return"rule"}function n(e){var t={};return e.config().mark.orient===r.Orient.VERTICAL?(e.has(a.X)?t.x={scale:e.scaleName(a.X),field:e.field(a.X,{binSuffix:"mid"})}:t.x={value:0},e.has(a.Y)?t.y={scale:e.scaleName(a.Y),field:e.field(a.Y,{binSuffix:"mid"})}:t.y={field:{group:"height"}},e.has(a.Y2)?t.y2={scale:e.scaleName(a.Y),field:e.field(a.Y2,{binSuffix:"mid"})}:t.y2={value:0}):(e.has(a.Y)?t.y={scale:e.scaleName(a.Y),field:e.field(a.Y,{binSuffix:"mid"})}:t.y={value:0},e.has(a.X)?t.x={scale:e.scaleName(a.X),field:e.field(a.X,{binSuffix:"mid"})}:t.x={value:0},e.has(a.X2)?t.x2={scale:e.scaleName(a.X),field:e.field(a.X2,{binSuffix:"mid"})}:t.x2={field:{group:"width"}}),o.applyColorAndOpacity(t,e),e.has(a.SIZE)?t.strokeWidth={scale:e.scaleName(a.SIZE),field:e.field(a.SIZE)}:t.strokeWidth={value:i(e)},t}function i(e){var t=e.encoding().size;return t&&void 0!==t.value?t.value:e.config().mark.ruleSize}e.markType=t,e.properties=n}(i=n.rule||(n.rule={}))},{"../../channel":11,"../../config":44,"../common":13}],39:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../common"),o=e("../../fielddef"),l=e("../../type");!function(e){function t(){return"text"}function n(e){return{x:{value:0},y:{value:0},width:{field:{group:"width"}},height:{field:{group:"height"}},fill:{scale:e.scaleName(a.COLOR),field:e.field(a.COLOR,e.encoding().color.type===l.ORDINAL?{prefix:"rank"}:{})}}}function i(e){var t={};r.applyMarkConfig(t,e,["angle","align","baseline","dx","dy","font","fontWeight","fontStyle","radius","theta","text"]);var n=e.config(),i=e.stack(),o=e.encoding().text;if(t.x=c(e.encoding().x,e.scaleName(a.X),i,n,o),t.y=s(e.encoding().y,e.scaleName(a.Y),i,n),t.fontSize=u(e.encoding().size,e.scaleName(a.SIZE),n),t.text=f(o,e.scaleName(a.TEXT),n),!e.config().mark.applyColorToBackground||e.has(a.X)||e.has(a.Y))r.applyColorAndOpacity(t,e);else{t.fill={value:"black"};var l=e.config().mark.opacity;l&&(t.opacity={value:l})}return t}function c(e,t,n,i,r){if(e){if(n&&a.X===n.fieldChannel)return{scale:t,field:o.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:o.field(e,{binSuffix:"mid"})}}return r&&r.type===l.QUANTITATIVE?{field:{group:"width"},offset:-5}:{value:i.scale.textBandWidth/2}}function s(e,t,n,i){if(e){if(n&&a.Y===n.fieldChannel)return{scale:t,field:o.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:o.field(e,{binSuffix:"mid"})}}return{value:i.scale.bandSize/2}}function u(e,t,n){if(e){if(e.field)return{scale:t,field:o.field(e)};if(e.value)return{value:e.value}}return{value:n.mark.fontSize}}function f(e,t,n){if(e){if(e.field){if(l.QUANTITATIVE===e.type){var i=r.numberFormat(e,n.mark.format,n,a.TEXT),c="number"+(i?":'"+i+"'":"");return{template:"{{"+o.field(e,{datum:!0})+" | "+c+"}}"}}return l.TEMPORAL===e.type?{template:r.timeTemplate(o.field(e,{datum:!0}),e.timeUnit,n.mark.format,n.mark.shortTimeLabels,n)}:{field:e.field}}if(e.value)return{value:e.value}}return{value:n.mark.text}}e.markType=t,e.background=n,e.properties=i}(i=n.text||(n.text={}))},{"../../channel":11,"../../fielddef":49,"../../type":60,"../common":13}],40:[function(e,t,n){"use strict";var i,a=e("../../channel"),r=e("../../config"),o=e("../../fielddef"),l=e("../common");!function(e){function t(){return"rect"}function n(e){var t={},n=e.config(),o=e.stack();return t.xc=i(e.encoding().x,e.scaleName(a.X),o,n),t.yc=c(e.encoding().y,e.scaleName(a.Y),o,n),n.mark.orient===r.Orient.HORIZONTAL?(t.width=s(e.encoding().size,e.scaleName(a.SIZE),n,(e.scale(a.X)||{}).bandSize),t.height={value:n.mark.tickThickness}):(t.width={value:n.mark.tickThickness},t.height=s(e.encoding().size,e.scaleName(a.SIZE),n,(e.scale(a.Y)||{}).bandSize)),l.applyColorAndOpacity(t,e),t}function i(e,t,n,i){if(e){if(n&&a.X===n.fieldChannel)return{scale:t,field:o.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:o.field(e,{binSuffix:"mid"})};if(e.value)return{value:e.value}}return{value:i.scale.bandSize/2}}function c(e,t,n,i){if(e){if(n&&a.Y===n.fieldChannel)return{scale:t,field:o.field(e,{suffix:"end"})};if(e.field)return{scale:t,field:o.field(e,{binSuffix:"mid"})};if(e.value)return{value:e.value}}return{value:i.scale.bandSize/2}}function s(e,t,n,i){if(e){if(e.field)return{scale:t,field:e.field};if(void 0!==e.value)return{value:e.value}}if(n.mark.tickSize)return{value:n.mark.tickSize};var a=void 0!==i?i:n.scale.bandSize;return{value:a/1.5}}e.markType=t,e.properties=n}(i=n.tick||(n.tick={}))},{"../../channel":11,"../../config":44,"../../fielddef":49,"../common":13}],41:[function(e,t,n){"use strict";var i=e("../channel"),a=e("../encoding"),r=e("../fielddef"),o=e("../scale"),l=e("../util"),c=e("./scale"),s=function(){function e(){this._nameMap={}}return e.prototype.rename=function(e,t){this._nameMap[e]=t},e.prototype.has=function(e){return void 0!==this._nameMap[e]},e.prototype.get=function(e){for(;this._nameMap[e];)e=this._nameMap[e];return e},e}(),u=function(){function e(e,t,n){this._warnings=[],this._parent=t,this._name=e.name||n,this._dataNameMap=t?t._dataNameMap:new s,this._scaleNameMap=t?t._scaleNameMap:new s,this._sizeNameMap=t?t._sizeNameMap:new s,this._data=e.data,this._description=e.description,this._transform=e.transform,e.transform&&void 0===e.transform.filterInvalid&&void 0!==e.transform.filterNull&&(e.transform.filterInvalid=e.transform.filterNull,console.warn("filterNull is deprecated. Please use filterInvalid instead.")),this.component={data:null,layout:null,mark:null,scale:null,axis:null,axisGroup:null,gridGroup:null,legend:null}}return e.prototype.parse=function(){this.parseData(),this.parseSelectionData(),this.parseLayoutData(),this.parseScale(),this.parseAxis(),this.parseLegend(),this.parseAxisGroup(),this.parseGridGroup(),this.parseMark()},e.prototype.assembleScales=function(){return l.flatten(l.vals(this.component.scale).map(function(e){var t=[e.main];return e.colorLegend&&t.push(e.colorLegend),e.binColorLegend&&t.push(e.binColorLegend),t}))},e.prototype.assembleAxes=function(){return l.vals(this.component.axis)},e.prototype.assembleLegends=function(){return l.vals(this.component.legend)},e.prototype.assembleGroup=function(){var e={};e.marks=this.assembleMarks();var t=this.assembleScales();t.length>0&&(e.scales=t);var n=this.assembleAxes();n.length>0&&(e.axes=n);var i=this.assembleLegends();return i.length>0&&(e.legends=i),e},e.prototype.reduce=function(e,t,n){return a.channelMappingReduce(this.channels(),this.mapping(),e,t,n)},e.prototype.forEach=function(e,t){a.channelMappingForEach(this.channels(),this.mapping(),e,t)},e.prototype.parent=function(){return this._parent},e.prototype.name=function(e,t){return void 0===t&&(t="_"),(this._name?this._name+t:"")+e},e.prototype.description=function(){return this._description},e.prototype.data=function(){return this._data},e.prototype.renameData=function(e,t){this._dataNameMap.rename(e,t)},e.prototype.dataName=function(e){return this._dataNameMap.get(this.name(String(e)))},e.prototype.renameSize=function(e,t){this._sizeNameMap.rename(e,t)},e.prototype.channelSizeName=function(e){return this.sizeName(e===i.X||e===i.COLUMN?"width":"height")},e.prototype.sizeName=function(e){return this._sizeNameMap.get(this.name(e,"_"))},e.prototype.calculate=function(){return this._transform?this._transform.calculate:void 0},e.prototype.filterInvalid=function(){var e=this._transform||{};return void 0===e.filterInvalid?this.parent()?this.parent().filterInvalid():void 0:e.filterInvalid},e.prototype.filter=function(){return this._transform?this._transform.filter:void 0},e.prototype.field=function(e,t){void 0===t&&(t={});var n=this.fieldDef(e);return n.bin&&(t=l.extend({binSuffix:this.scale(e).type===o.ScaleType.ORDINAL?"range":"start"},t)),r.field(n,t)},e.prototype.scale=function(e){return this._scale[e]},e.prototype.isOrdinalScale=function(e){var t=this.scale(e);return t&&t.type===o.ScaleType.ORDINAL},e.prototype.renameScale=function(e,t){this._scaleNameMap.rename(e,t)},e.prototype.scaleName=function(e,t){var n=l.contains([c.COLOR_LEGEND,c.COLOR_LEGEND_LABEL],e)?"color":e;return t?this.name(e+""):this._scale&&this._scale[n]||this._scaleNameMap.has(this.name(e+""))?this._scaleNameMap.get(this.name(e+"")):void 0},e.prototype.sort=function(e){return(this.mapping()[e]||{}).sort},e.prototype.axis=function(e){return this._axis[e]},e.prototype.legend=function(e){return this._legend[e]},e.prototype.config=function(){return this._config},e.prototype.addWarning=function(e){l.warning(e),this._warnings.push(e)},e.prototype.warnings=function(){return this._warnings},e.prototype.isUnit=function(){return!1},e.prototype.isFacet=function(){return!1},e.prototype.isLayer=function(){return!1},e}();n.Model=u},{"../channel":11,"../encoding":47,"../fielddef":49,"../scale":53,"../util":61,"./scale":42}],42:[function(e,t,n){"use strict";function i(e){return e.channels().reduce(function(t,n){if(e.scale(n)){var i=e.fieldDef(n),l={main:a(e,i,n)};n===T.COLOR&&e.legend(T.COLOR)&&(i.type===k.ORDINAL||i.bin||i.timeUnit)&&(l.colorLegend=r(e,i),i.bin&&(l.binColorLegend=o(e,i))),t[n]=l}return t},{})}function a(e,t,i){var a=e.scale(i),r=e.sort(i),o={name:e.scaleName(i+"",!0),type:a.type};return i===T.X&&e.has(T.X2)?e.has(T.X)?o.domain={fields:[s(a,e,T.X),s(a,e,T.X2)]}:o.domain=s(a,e,T.X2):i===T.Y&&e.has(T.Y2)?e.has(T.Y)?o.domain={fields:[s(a,e,T.Y),s(a,e,T.Y2)]}:o.domain=s(a,e,T.Y2):o.domain=s(a,e,i),D.extend(o,d(a,e,i)),r&&(x.isSortField(r)?r.order:r)===x.SortOrder.DESCENDING&&(o.reverse=!0),["round","clamp","nice","exponent","zero","points","padding"].forEach(function(r){var l=n[r](a,i,t,e,o);void 0!==l&&(o[r]=l)}),o}function r(e,t){return{name:e.scaleName(n.COLOR_LEGEND,!0),type:I.ScaleType.ORDINAL,domain:{data:e.dataTable(),field:e.field(T.COLOR,t.bin||t.timeUnit?{}:{prefix:"rank"}),sort:!0},range:{data:e.dataTable(),field:e.field(T.COLOR),sort:!0}}}function o(e,t){return{name:e.scaleName(n.COLOR_LEGEND_LABEL,!0),type:I.ScaleType.ORDINAL,domain:{data:e.dataTable(),field:e.field(T.COLOR),sort:!0},range:{data:e.dataTable(),field:L.field(t,{binSuffix:"range"}),sort:{field:e.field(T.COLOR,{binSuffix:"start"}),op:"min"}}}}function l(e,t,n,i){if(!T.hasScale(n))return null;if(D.contains([T.ROW,T.COLUMN,T.SHAPE],n))return e&&void 0!==e.type&&e.type!==I.ScaleType.ORDINAL&&console.warn("Channel",n,"does not work with scale type =",e.type),I.ScaleType.ORDINAL;if(void 0!==e.type)return e.type;switch(t.type){case k.NOMINAL:return I.ScaleType.ORDINAL;case k.ORDINAL:return n===T.COLOR?I.ScaleType.LINEAR:I.ScaleType.ORDINAL;case k.TEMPORAL:return n===T.COLOR?I.ScaleType.TIME:t.timeUnit?M.defaultScaleType(t.timeUnit):I.ScaleType.TIME;case k.QUANTITATIVE:return t.bin?D.contains([T.X,T.Y,T.COLOR],n)?I.ScaleType.LINEAR:I.ScaleType.ORDINAL:I.ScaleType.LINEAR}return null}function c(e,t,n,i,a,r){return e===I.ScaleType.ORDINAL?void 0===i?t?t:r===T.X&&a===b.TEXT?n.textBandWidth:n.bandSize:(t&&console.warn("bandSize for",r,"overridden as top-level",r===T.X?"width":"height","is provided."),I.BANDSIZE_FIT):void 0}function s(e,t,n){var i=t.fieldDef(n);if(e.domain)return R.isDateTime(e.domain[0])?e.domain.map(function(e){return R.timestamp(e,!0)}):e.domain;if(i.type===k.TEMPORAL)return M.imputedDomain(i.timeUnit,n)?{data:i.timeUnit,field:"date"}:{data:t.dataTable(),field:t.field(n),sort:{field:t.field(n),op:"min"}};var a=t.stack();if(a&&n===a.fieldChannel)return a.offset===C.StackOffset.NORMALIZE?[0,1]:{data:t.dataName(A.STACKED_SCALE),field:t.field(n,{prefix:"sum"})};var r=f(e,t,n),o=u(t,n,e.type);return r?{data:A.SOURCE,field:t.field(n,{noAggregate:!0})}:i.bin?e.type===I.ScaleType.ORDINAL?{data:t.dataTable(),field:t.field(n,{binSuffix:"range"}),sort:{field:t.field(n,{binSuffix:"start"}),op:"min"}}:n===T.COLOR?{data:t.dataTable(),field:t.field(n,{binSuffix:"start"})}:{data:t.dataTable(),field:[t.field(n,{binSuffix:"start"}),t.field(n,{binSuffix:"end"})]}:o?{data:o.op?A.SOURCE:t.dataTable(),field:i.type===k.ORDINAL&&n===T.COLOR?t.field(n,{prefix:"rank"}):t.field(n),sort:o}:{data:t.dataTable(),field:i.type===k.ORDINAL&&n===T.COLOR?t.field(n,{prefix:"rank"}):t.field(n)}}function u(e,t,n){if(n===I.ScaleType.ORDINAL){var i=e.sort(t);return x.isSortField(i)?{op:i.op,field:i.field}:!!D.contains([x.SortOrder.ASCENDING,x.SortOrder.DESCENDING,void 0],i)||void 0}}function f(e,t,n){var i=t.fieldDef(n);return e.useRawDomain&&i.aggregate&&E.SHARED_DOMAIN_OPS.indexOf(i.aggregate)>=0&&(i.type===k.QUANTITATIVE&&!i.bin&&e.type!==I.ScaleType.LOG||i.type===k.TEMPORAL&&D.contains([I.ScaleType.TIME,I.ScaleType.UTC],e.type))}function d(e,t,n){var i=t.fieldDef(n),a=t.config().scale;if(e.type===I.ScaleType.ORDINAL&&e.bandSize&&e.bandSize!==I.BANDSIZE_FIT&&D.contains([T.X,T.Y],n))return{bandSize:e.bandSize};if(e.range&&!D.contains([T.X,T.Y,T.ROW,T.COLUMN],n))return{range:e.range};switch(n){case T.ROW:return{range:"height"};case T.COLUMN:return{range:"width"}}var r=t;switch(n){case T.X:return{rangeMin:0,rangeMax:r.width};case T.Y:return{rangeMin:r.height,rangeMax:0};case T.SIZE:if(r.mark()===b.BAR){if(void 0!==a.barSizeRange)return{range:a.barSizeRange};var o=t.config().mark.orient===N.Orient.HORIZONTAL?T.Y:T.X;return{range:[t.config().mark.barThinSize,t.scale(o).bandSize]}}if(r.mark()===b.TEXT)return{range:a.fontSizeRange};if(r.mark()===b.RULE)return{range:a.ruleSizeRange};if(r.mark()===b.TICK)return{range:a.tickSizeRange};if(void 0!==a.pointSizeRange)return{range:a.pointSizeRange};var l=p(r);return{range:[9,(l-2)*(l-2)]};case T.SHAPE:return{range:a.shapeRange};case T.COLOR:return i.type===k.NOMINAL?{range:a.nominalColorRange}:{range:a.sequentialColorRange};case T.OPACITY:return{range:a.opacity}}return{}}function p(e){var t=e.config().scale,n=e.has(T.X),i=e.has(T.Y),a=L.isMeasure(e.encoding().x),r=L.isMeasure(e.encoding().y);return n&&i?a!==r?e.scale(a?T.Y:T.X).bandSize:Math.min(e.scale(T.X).bandSize||t.bandSize,e.scale(T.Y).bandSize||t.bandSize):i?r?e.config().scale.bandSize:e.scale(T.Y).bandSize:n?a?e.config().scale.bandSize:e.scale(T.X).bandSize:e.config().scale.bandSize}function m(e){if(D.contains([I.ScaleType.LINEAR,I.ScaleType.POW,I.ScaleType.SQRT,I.ScaleType.LOG,I.ScaleType.TIME,I.ScaleType.UTC],e.type))return e.clamp}function h(e){if(e.type===I.ScaleType.POW)return e.exponent}function g(e,t,n){if(D.contains([I.ScaleType.LINEAR,I.ScaleType.POW,I.ScaleType.SQRT,I.ScaleType.LOG,I.ScaleType.TIME,I.ScaleType.UTC,I.ScaleType.QUANTIZE],e.type))return void 0!==e.nice?e.nice:D.contains([I.ScaleType.TIME,I.ScaleType.UTC],e.type)?M.smallestUnit(n.timeUnit):D.contains([T.X,T.Y],t)}function y(e,t,n,i,a){if(e.type===I.ScaleType.ORDINAL&&D.contains([T.X,T.Y],t))return a.points?1:e.padding}function v(e,t,n,i){if(e.type===I.ScaleType.ORDINAL&&D.contains([T.X,T.Y],t))return i.mark()!==b.BAR||e.bandSize!==I.BANDSIZE_FIT||void 0}function O(e,t){if(D.contains([T.X,T.Y,T.ROW,T.COLUMN,T.SIZE],t)&&void 0!==e.round)return e.round}function S(e,t,n){if(!D.contains([I.ScaleType.TIME,I.ScaleType.UTC,I.ScaleType.ORDINAL],e.type))return void 0!==e.zero?e.zero:!e.domain&&!n.bin&&D.contains([T.X,T.Y],t)}var E=e("../aggregate"),T=e("../channel"),N=e("../config"),A=e("../data"),R=e("../datetime"),L=e("../fielddef"),b=e("../mark"),I=e("../scale"),x=e("../sort"),C=e("../stack"),k=e("../type"),D=e("../util"),M=e("../timeunit");n.COLOR_LEGEND="color_legend",n.COLOR_LEGEND_LABEL="color_legend_label",n.parseScaleComponent=i,n.scaleType=l,n.scaleBandSize=c,n.domain=s,n.domainSort=u,n.rangeMixins=d,n.clamp=m,n.exponent=h,n.nice=g,n.padding=y,n.points=v,n.round=O,n.zero=S},{"../aggregate":8,"../channel":11,"../config":44,"../data":45,"../datetime":46,"../fielddef":49,"../mark":52,"../scale":53,"../sort":55,"../stack":57,"../timeunit":58,"../type":60,"../util":61}],43:[function(e,t,n){"use strict";var i=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},a=e("../aggregate"),r=e("../channel"),o=e("../config"),l=e("../data"),c=e("../encoding"),s=e("../fielddef"),u=e("../mark"),f=e("../scale"),d=e("../type"),p=e("../util"),m=e("./axis"),h=e("./common"),g=e("./config"),y=e("./data/data"),v=e("./legend"),O=e("./layout"),S=e("./model"),E=e("./mark/mark"),T=e("./scale"),N=e("../stack"),A=function(e){function t(t,n,i){var a=e.call(this,t,n,i)||this,r=void 0!==t.width?t.width:n?n.width:void 0,o=void 0!==t.height?t.height:n?n.height:void 0,l=a._mark=t.mark,c=a._encoding=a._initEncoding(l,t.encoding||{});a._stack=N.stack(l,c,((t.config||{}).mark||{}).stacked);var s=a._config=a._initConfig(t.config,n,l,c,a._stack);return a._scale=a._initScale(l,c,s,r,o),a._axis=a._initAxis(c,s),a._legend=a._initLegend(c,s),a._initSize(l,a._scale,r,o,s.cell,s.scale),a}return i(t,e),t.prototype._initEncoding=function(e,t){return t=p.duplicate(t),c.forEach(t,function(t,n){return r.supportMark(n,e)?(t.type&&(t.type=d.getFullName(t.type)),void(n!==r.PATH&&n!==r.ORDER||t.aggregate||t.type!==d.QUANTITATIVE||(t.aggregate=a.AggregateOp.MIN))):(console.warn(n,"dropped as it is incompatible with",e),void delete t.field)}),t},t.prototype._initConfig=function(e,t,n,i,a){for(var r=p.mergeDeep(p.duplicate(o.defaultConfig),t?t.config():{},e),l=!1;null!==t;){if(t.isFacet()){l=!0;break}t=t.parent()}return l&&(r.cell=p.extend({},r.cell,r.facet.cell)),r.mark=g.initMarkConfig(n,i,a,r),r},t.prototype._initScale=function(e,t,n,i,a){return r.UNIT_SCALE_CHANNELS.reduce(function(o,l){if(c.has(t,l)||l===r.X&&c.has(t,r.X2)||l===r.Y&&c.has(t,r.Y2)){var s=t[l],u=(s||{}).scale||{},f=T.scaleType(u,s,l,e),d=o[l]=p.extend({type:f,round:n.scale.round,padding:n.scale.padding,useRawDomain:n.scale.useRawDomain},u);d.bandSize=T.scaleBandSize(d.type,d.bandSize,n.scale,l===r.X?i:a,e,l)}return o},{})},t.prototype._initSize=function(e,t,n,i,a,o){void 0!==n?this._width=n:t[r.X]?t[r.X].type===f.ScaleType.ORDINAL&&t[r.X].bandSize!==f.BANDSIZE_FIT||(this._width=a.width):e===u.TEXT?this._width=o.textBandWidth:this._width=o.bandSize,void 0!==i?this._height=i:t[r.Y]?t[r.Y].type===f.ScaleType.ORDINAL&&t[r.Y].bandSize!==f.BANDSIZE_FIT||(this._height=a.height):this._height=o.bandSize},t.prototype._initAxis=function(e,t){return[r.X,r.Y].reduce(function(n,i){if(c.has(e,i)||i===r.X&&c.has(e,r.X2)||i===r.Y&&c.has(e,r.Y2)){var a=(e[i]||{}).axis;null!==a&&a!==!1&&(n[i]=p.extend({},t.axis,a===!0?{}:a||{}))}return n},{})},t.prototype._initLegend=function(e,t){return r.NONSPATIAL_SCALE_CHANNELS.reduce(function(n,i){if(c.has(e,i)){var a=e[i].legend;null!==a&&a!==!1&&(n[i]=p.extend({},t.legend,a===!0?{}:a||{}))}return n},{})},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.parseData=function(){this.component.data=y.parseUnitData(this)},t.prototype.parseSelectionData=function(){},t.prototype.parseLayoutData=function(){this.component.layout=O.parseUnitLayout(this)},t.prototype.parseScale=function(){this.component.scale=T.parseScaleComponent(this)},t.prototype.parseMark=function(){this.component.mark=E.parseMark(this)},t.prototype.parseAxis=function(){this.component.axis=m.parseAxisComponent(this,[r.X,r.Y])},t.prototype.parseAxisGroup=function(){return null},t.prototype.parseGridGroup=function(){return null},t.prototype.parseLegend=function(){this.component.legend=v.parseLegendComponent(this)},t.prototype.assembleData=function(e){return y.assembleData(this,e)},t.prototype.assembleLayout=function(e){return O.assembleLayout(this,e)},t.prototype.assembleMarks=function(){return this.component.mark},t.prototype.assembleParentGroupProperties=function(e){return h.applyConfig({},e,h.FILL_STROKE_CONFIG.concat(["clip"]))},t.prototype.channels=function(){return r.UNIT_CHANNELS},t.prototype.mapping=function(){return this.encoding()},t.prototype.stack=function(){return this._stack},t.prototype.toSpec=function(e,t){var n,i=p.duplicate(this._encoding);return n={mark:this._mark,encoding:i},e||(n.config=p.duplicate(this._config)),t||(n.data=p.duplicate(this._data)),n},t.prototype.mark=function(){return this._mark},t.prototype.has=function(e){return c.has(this._encoding,e)},t.prototype.encoding=function(){return this._encoding},t.prototype.fieldDef=function(e){return this._encoding[e]||{}},t.prototype.field=function(e,t){void 0===t&&(t={});var n=this.fieldDef(e);return n.bin&&(t=p.extend({binSuffix:this.scale(e).type===f.ScaleType.ORDINAL?"range":"start"},t)),s.field(n,t)},t.prototype.dataTable=function(){return this.dataName(c.isAggregate(this._encoding)?l.SUMMARY:l.SOURCE)},t.prototype.isUnit=function(){return!0},t}(S.Model);n.UnitModel=A},{"../aggregate":8,"../channel":11,"../config":44,"../data":45,"../encoding":47,"../fielddef":49,"../mark":52,"../scale":53,"../stack":57,"../type":60,"../util":61,"./axis":12,"./common":13,"./config":15,"./data/data":18,"./layout":31,"./legend":32,"./mark/mark":36,"./model":41,"./scale":42}],44:[function(e,t,n){"use strict";var i=e("./scale"),a=e("./axis"),r=e("./legend");n.defaultCellConfig={width:200,height:200},n.defaultFacetCellConfig={stroke:"#ccc",strokeWidth:1};var o={color:"#000000",opacity:.4,offset:0};n.defaultFacetConfig={scale:i.defaultFacetScaleConfig,axis:a.defaultFacetAxisConfig,grid:o,cell:n.defaultFacetCellConfig};var l;!function(e){e[e.NORMAL="normal"]="NORMAL",e[e.BOLD="bold"]="BOLD"}(l=n.FontWeight||(n.FontWeight={}));var c;!function(e){e[e.CIRCLE="circle"]="CIRCLE",e[e.SQUARE="square"]="SQUARE",e[e.CROSS="cross"]="CROSS",e[e.DIAMOND="diamond"]="DIAMOND",e[e.TRIANGLEUP="triangle-up"]="TRIANGLEUP",e[e.TRIANGLEDOWN="triangle-down"]="TRIANGLEDOWN"}(c=n.Shape||(n.Shape={}));var s;!function(e){e[e.HORIZONTAL="horizontal"]="HORIZONTAL",e[e.VERTICAL="vertical"]="VERTICAL"}(s=n.Orient||(n.Orient={}));var u;!function(e){e[e.LEFT="left"]="LEFT",e[e.RIGHT="right"]="RIGHT",e[e.CENTER="center"]="CENTER"}(u=n.HorizontalAlign||(n.HorizontalAlign={}));var f;!function(e){e[e.TOP="top"]="TOP",e[e.MIDDLE="middle"]="MIDDLE",e[e.BOTTOM="bottom"]="BOTTOM"}(f=n.VerticalAlign||(n.VerticalAlign={}));var d;!function(e){e[e.NORMAL="normal"]="NORMAL",e[e.ITALIC="italic"]="ITALIC"}(d=n.FontStyle||(n.FontStyle={}));var p;!function(e){e[e.LINEAR="linear"]="LINEAR",e[e.LINEAR_CLOSED="linear-closed"]="LINEAR_CLOSED",e[e.STEP="step"]="STEP",e[e.STEP_BEFORE="step-before"]="STEP_BEFORE",e[e.STEP_AFTER="step-after"]="STEP_AFTER",e[e.BASIS="basis"]="BASIS",e[e.BASIS_OPEN="basis-open"]="BASIS_OPEN",e[e.BASIS_CLOSED="basis-closed"]="BASIS_CLOSED",e[e.CARDINAL="cardinal"]="CARDINAL",e[e.CARDINAL_OPEN="cardinal-open"]="CARDINAL_OPEN",e[e.CARDINAL_CLOSED="cardinal-closed"]="CARDINAL_CLOSED",e[e.BUNDLE="bundle"]="BUNDLE",e[e.MONOTONE="monotone"]="MONOTONE"}(p=n.Interpolate||(n.Interpolate={}));var m;!function(e){e[e.LINE="line"]="LINE",e[e.LINEPOINT="linepoint"]="LINEPOINT",e[e.NONE="none"]="NONE"}(m=n.AreaOverlay||(n.AreaOverlay={})),n.defaultOverlayConfig={line:!1,pointStyle:{filled:!0},lineStyle:{}},n.defaultMarkConfig={color:"#4682b4",shape:c.CIRCLE,strokeWidth:2,size:30,barThinSize:2,ruleSize:1,tickThickness:1,fontSize:10,baseline:f.MIDDLE,text:"Abc",applyColorToBackground:!1},n.defaultConfig={numberFormat:"s",timeFormat:"%b %d, %Y",countTitle:"Number of Records",cell:n.defaultCellConfig,mark:n.defaultMarkConfig,overlay:n.defaultOverlayConfig,scale:i.defaultScaleConfig,axis:a.defaultAxisConfig,legend:r.defaultLegendConfig,facet:n.defaultFacetConfig}},{"./axis":9,"./legend":51,"./scale":53}],45:[function(e,t,n){"use strict";var i,a=e("./type");!function(e){e[e.JSON="json"]="JSON",e[e.CSV="csv"]="CSV",e[e.TSV="tsv"]="TSV",e[e.TOPOJSON="topojson"]="TOPOJSON"}(i=n.DataFormatType||(n.DataFormatType={}));var r;!function(e){e[e.SOURCE="source"]="SOURCE",e[e.SUMMARY="summary"]="SUMMARY",e[e.STACKED_SCALE="stacked_scale"]="STACKED_SCALE",e[e.LAYOUT="layout"]="LAYOUT"}(r=n.DataTable||(n.DataTable={})),n.SUMMARY=r.SUMMARY,n.SOURCE=r.SOURCE,n.STACKED_SCALE=r.STACKED_SCALE,n.LAYOUT=r.LAYOUT,n.types={boolean:a.Type.NOMINAL,number:a.Type.QUANTITATIVE,integer:a.Type.QUANTITATIVE,date:a.Type.TEMPORAL,string:a.Type.NOMINAL}},{"./type":60}],46:[function(e,t,n){"use strict";function i(e){return!!(e&&(e.year||e.quarter||e.month||e.date||e.day||e.hours||e.minutes||e.seconds||e.milliseconds))}function a(e){return s.isNumber(e)?e-1+"":(console.warn("Potentially invalid quarter",e),e)}function r(e){if(s.isNumber(e))return e-1+"";var t=e.toLowerCase(),i=n.MONTHS.indexOf(t);if(i!==-1)return i+"";var a=t.substr(0,3),r=n.SHORT_MONTHS.indexOf(a);return r!==-1?r+"":(console.warn("Potentially invalid month",e),
e)}function o(e){if(s.isNumber(e))return e%7+"";var t=e.toLowerCase(),i=n.DAYS.indexOf(t);if(i!==-1)return i+"";var a=t.substr(0,3),r=n.SHORT_DAYS.indexOf(a);return r!==-1?r+"":(console.warn("Potentially invalid day",e),e)}function l(e,t){var n=new Date(0,0,1,0,0,0,0);if(void 0!==e.day)if(s.keys(e).length>1)console.warn("Dropping day from datetime",JSON.stringify(e),"as day cannot be combined with other units."),e=s.duplicate(e),delete e.day;else{n.setFullYear(u);var i=t?o(e.day):e.day;n.setDate(+i+1)}if(void 0!==e.year&&n.setFullYear(e.year),void 0!==e.quarter){var l=t?a(e.quarter):e.quarter;n.setMonth(3*+l)}if(void 0!==e.month){var c=t?r(e.month):e.month;n.setMonth(+c)}return void 0!==e.date&&n.setDate(e.date),void 0!==e.hours&&n.setHours(e.hours),void 0!==e.minutes&&n.setMinutes(e.minutes),void 0!==e.seconds&&n.setSeconds(e.seconds),void 0!==e.milliseconds&&n.setMilliseconds(e.milliseconds),n.getTime()}function c(e,t){void 0===t&&(t=!1);var n=[];if(t&&void 0!==e.day&&s.keys(e).length>1&&(console.warn("Dropping day from datetime",JSON.stringify(e),"as day cannot be combined with other units."),e=s.duplicate(e),delete e.day),void 0!==e.year?n.push(e.year):void 0!==e.day?n.push(u):n.push(0),void 0!==e.month){var i=t?r(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){var l=t?a(e.quarter):e.quarter;n.push(l+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){var c=t?o(e.day):e.day;n.push(c+"+1")}else n.push(1);for(var f=0,d=["hours","minutes","seconds","milliseconds"];f<d.length;f++){var p=d[f];void 0!==e[p]?n.push(e[p]):n.push(0)}return"datetime("+n.join(", ")+")"}var s=e("./util"),u=2006;n.isDateTime=i,n.MONTHS=["january","february","march","april","may","june","july","august","september","october","november","december"],n.SHORT_MONTHS=n.MONTHS.map(function(e){return e.substr(0,3)}),n.DAYS=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],n.SHORT_DAYS=n.DAYS.map(function(e){return e.substr(0,3)}),n.timestamp=l,n.dateTimeExpr=c},{"./util":61}],47:[function(e,t,n){"use strict";function i(e){var t=0;return e.color&&t++,e.opacity&&t++,e.size&&t++,e.shape&&t++,t}function a(e){return h.CHANNELS.filter(function(t){return r(e,t)})}function r(e,t){var n=e&&e[t];return n&&(void 0!==n.field||g.isArray(n)&&n.length>0)}function o(e){return g.some(h.CHANNELS,function(t){return!(!r(e,t)||!e[t].aggregate)})}function l(e){return e&&(!!e.x&&!!e.x2||!!e.y&&!!e.y2)}function c(e){var t=[];return h.CHANNELS.forEach(function(n){r(e,n)&&(g.isArray(e[n])?e[n].forEach(function(e){t.push(e)}):t.push(e[n]))}),t}function s(e,t,n){u(h.CHANNELS,e,t,n)}function u(e,t,n,i){var a=0;e.forEach(function(e){r(t,e)&&(g.isArray(t[e])?t[e].forEach(function(t){n.call(i,t,e,a++)}):n.call(i,t[e],e,a++))})}function f(e,t,n){return d(h.CHANNELS,e,t,n)}function d(e,t,n,i){var a=[];return e.forEach(function(e){r(t,e)&&(g.isArray(t[e])?t[e].forEach(function(t){a.push(n.call(i,t,e))}):a.push(n.call(i,t[e],e)))}),a}function p(e,t,n,i){return m(h.CHANNELS,e,t,n,i)}function m(e,t,n,i,a){var o=i;return h.CHANNELS.forEach(function(e){r(t,e)&&(g.isArray(t[e])?t[e].forEach(function(t){o=n.call(a,o,t,e)}):o=n.call(a,o,t[e],e))}),o}var h=e("./channel"),g=e("./util");n.countRetinal=i,n.channels=a,n.has=r,n.isAggregate=o,n.isRanged=l,n.fieldDefs=c,n.forEach=s,n.channelMappingForEach=u,n.map=f,n.channelMappingMap=d,n.reduce=p,n.channelMappingReduce=m},{"./channel":11,"./util":61}],48:[function(e,t,n){"use strict"},{}],49:[function(e,t,n){"use strict";function i(e,t){void 0===t&&(t={});var n=e.field,i=t.prefix,a=t.suffix;if(c(e))n="count";else{var r=t.fn;t.nofn||(e.bin?(r="bin",a=t.binSuffix||(t.scaleType===f.ScaleType.ORDINAL?"range":"start")):!t.noAggregate&&e.aggregate?r=String(e.aggregate):e.timeUnit&&(r=String(e.timeUnit))),r&&(n=r+"_"+n)}return a&&(n=n+"_"+a),i&&(n=i+"_"+n),t.datum&&(n='datum["'+n+'"]'),n}function a(e){return!!p.contains([d.NOMINAL,d.ORDINAL],e.type)||(!!e.bin||e.type===d.TEMPORAL&&!!e.timeUnit)}function r(e){return e&&e.field&&a(e)}function o(e){return e&&e.field&&!a(e)}function l(){return{field:"*",aggregate:u.AggregateOp.COUNT,type:d.QUANTITATIVE}}function c(e){return e.aggregate===u.AggregateOp.COUNT}function s(e,t){if(null!=e.title)return e.title;if(c(e))return t.countTitle;var n=e.aggregate||e.timeUnit||e.bin&&"bin";return n?n.toString().toUpperCase()+"("+e.field+")":e.field}var u=e("./aggregate"),f=e("./scale"),d=e("./type"),p=e("./util");n.field=i,n.isDimension=r,n.isMeasure=o,n.count=l,n.isCount=c,n.title=s},{"./aggregate":8,"./scale":53,"./type":60,"./util":61}],50:[function(e,t,n){"use strict";function i(e){return e&&!!e.field&&void 0!==e.equal}function a(e){return!!(e&&e.field&&f.isArray(e.range)&&2===e.range.length)}function r(e){return e&&!!e.field&&(f.isArray(e.oneOf)||f.isArray(e.in))}function o(e){if(f.isString(e))return e;var t=e.timeUnit?"time("+u.fieldExpr(e.timeUnit,e.field)+")":s.field(e,{datum:!0});if(i(e))return t+"==="+l(e.equal,e.timeUnit);if(r(e)){var n=e.oneOf||e.in;return"indexof(["+n.map(function(t){return l(t,e.timeUnit)}).join(",")+"], "+t+") !== -1"}if(a(e)){var o=e.range[0],c=e.range[1];if(null!==o&&null!==c)return"inrange("+t+", "+l(o,e.timeUnit)+", "+l(c,e.timeUnit)+")";if(null!==o)return t+" >= "+o;if(null!==c)return t+" <= "+c}}function l(e,t){if(c.isDateTime(e)){var n=c.dateTimeExpr(e,!0);return"time("+n+")"}if(u.isSingleTimeUnit(t)){var i={};i[t]=e;var n=c.dateTimeExpr(i,!0);return"time("+n+")"}return JSON.stringify(e)}var c=e("./datetime"),s=e("./fielddef"),u=e("./timeunit"),f=e("./util");n.isEqualFilter=i,n.isRangeFilter=a,n.isOneOfFilter=r,n.expression=o},{"./datetime":46,"./fielddef":49,"./timeunit":58,"./util":61}],51:[function(e,t,n){"use strict";n.defaultLegendConfig={orient:void 0}},{}],52:[function(e,t,n){"use strict";var i;!function(e){e[e.AREA="area"]="AREA",e[e.BAR="bar"]="BAR",e[e.LINE="line"]="LINE",e[e.POINT="point"]="POINT",e[e.TEXT="text"]="TEXT",e[e.TICK="tick"]="TICK",e[e.RULE="rule"]="RULE",e[e.CIRCLE="circle"]="CIRCLE",e[e.SQUARE="square"]="SQUARE",e[e.ERRORBAR="errorBar"]="ERRORBAR"}(i=n.Mark||(n.Mark={})),n.AREA=i.AREA,n.BAR=i.BAR,n.LINE=i.LINE,n.POINT=i.POINT,n.TEXT=i.TEXT,n.TICK=i.TICK,n.RULE=i.RULE,n.CIRCLE=i.CIRCLE,n.SQUARE=i.SQUARE,n.ERRORBAR=i.ERRORBAR,n.PRIMITIVE_MARKS=[n.AREA,n.BAR,n.LINE,n.POINT,n.TEXT,n.TICK,n.RULE,n.CIRCLE,n.SQUARE]},{}],53:[function(e,t,n){"use strict";var i;!function(e){e[e.LINEAR="linear"]="LINEAR",e[e.LOG="log"]="LOG",e[e.POW="pow"]="POW",e[e.SQRT="sqrt"]="SQRT",e[e.QUANTILE="quantile"]="QUANTILE",e[e.QUANTIZE="quantize"]="QUANTIZE",e[e.ORDINAL="ordinal"]="ORDINAL",e[e.TIME="time"]="TIME",e[e.UTC="utc"]="UTC"}(i=n.ScaleType||(n.ScaleType={}));var a;!function(e){e[e.SECOND="second"]="SECOND",e[e.MINUTE="minute"]="MINUTE",e[e.HOUR="hour"]="HOUR",e[e.DAY="day"]="DAY",e[e.WEEK="week"]="WEEK",e[e.MONTH="month"]="MONTH",e[e.YEAR="year"]="YEAR"}(a=n.NiceTime||(n.NiceTime={}));var r;!function(e){e[e.FIT="fit"]="FIT"}(r=n.BandSize||(n.BandSize={})),n.BANDSIZE_FIT=r.FIT,n.defaultScaleConfig={round:!0,textBandWidth:90,bandSize:21,padding:.1,useRawDomain:!1,opacity:[.3,.8],nominalColorRange:"category10",sequentialColorRange:["#AFC6A3","#09622A"],shapeRange:"shapes",fontSizeRange:[8,40],ruleSizeRange:[1,5],tickSizeRange:[1,20]},n.defaultFacetScaleConfig={round:!0,padding:16}},{}],54:[function(e,t,n){"use strict";function i(e){return"mark"+n.ASSIGN+e.mark+n.DELIM+r(e.encoding)}function a(e,t,i){var a=e.split(n.DELIM),r=a.shift().split(n.ASSIGN)[1].trim(),l=o(a.join(n.DELIM)),c={mark:m.Mark[r],encoding:l};return void 0!==t&&(c.data=t),void 0!==i&&(c.config=i),c}function r(e){return p.map(e,function(e,t){return t+n.ASSIGN+l(e)}).join(n.DELIM)}function o(e){return e.split(n.DELIM).reduce(function(e,t){var i=t.split(n.ASSIGN),a=i[0].trim(),r=i[1];return e[a]=s(r),e},{})}function l(e){return(e.aggregate?e.aggregate+n.FUNC:"")+(e.timeUnit?e.timeUnit+n.FUNC:"")+(e.bin?"bin"+n.FUNC:"")+(e.field||"")+n.TYPE+d.SHORT_TYPE[e.type]}function c(e,t){return void 0===t&&(t=n.DELIM),e.map(l).join(t)}function s(e){for(var t=e.split(n.TYPE),i={field:t[0].trim(),type:d.TYPE_FROM_SHORT_TYPE[t[1].trim()]},a=0;a<u.AGGREGATE_OPS.length;a++){var r=u.AGGREGATE_OPS[a];if(0===i.field.indexOf(r+"_")){i.field=i.field.substr(r.toString().length+1),r===u.AggregateOp.COUNT&&0===i.field.length&&(i.field="*"),i.aggregate=r;break}}for(var a=0;a<f.TIMEUNITS.length;a++){var o=f.TIMEUNITS[a];if(i.field&&0===i.field.indexOf(o+"_")){i.field=i.field.substr(i.field.length+1),i.timeUnit=o;break}}return i.field&&0===i.field.indexOf("bin_")&&(i.field=i.field.substr(4),i.bin=!0),i}var u=e("./aggregate"),f=e("./timeunit"),d=e("./type"),p=e("./encoding"),m=e("./mark");n.DELIM="|",n.ASSIGN="=",n.TYPE=",",n.FUNC="_",n.shorten=i,n.parse=a,n.shortenEncoding=r,n.parseEncoding=o,n.shortenFieldDef=l,n.shortenFieldDefs=c,n.parseFieldDef=s},{"./aggregate":8,"./encoding":47,"./mark":52,"./timeunit":58,"./type":60}],55:[function(e,t,n){"use strict";function i(e){return!!e&&!!e.field&&!!e.op}var a;!function(e){e[e.ASCENDING="ascending"]="ASCENDING",e[e.DESCENDING="descending"]="DESCENDING",e[e.NONE="none"]="NONE"}(a=n.SortOrder||(n.SortOrder={})),n.isSortField=i},{}],56:[function(e,t,n){"use strict";function i(e){return void 0!==e.facet}function a(e){if(o(e)){var t=O.has(e.encoding,T.ROW),n=O.has(e.encoding,T.COLUMN);return t||n}return!1}function r(e){return!!o(e)&&!a(e)}function o(e){return void 0!==e.mark}function l(e){return void 0!==e.layers}function c(e){return a(e)?s(e):r(e)?u(e):e}function s(e){var t=O.has(e.encoding,T.ROW),n=O.has(e.encoding,T.COLUMN),i=A.duplicate(e.encoding);return delete i.column,delete i.row,A.extend(e.name?{name:e.name}:{},e.description?{description:e.description}:{},{data:e.data},e.transform?{transform:e.transform}:{},{facet:A.extend(t?{row:e.encoding.row}:{},n?{column:e.encoding.column}:{}),spec:u(A.extend(e.width?{width:e.width}:{},e.height?{height:e.height}:{},{mark:e.mark,encoding:i},e.config?{config:e.config}:{}))},e.config?{config:e.config}:{})}function u(e){var t=e.config,n=t&&t.overlay,i=n&&e.mark===S.AREA&&A.contains([v.AreaOverlay.LINEPOINT,v.AreaOverlay.LINE],n.area),a=n&&(n.line&&e.mark===S.LINE||n.area===v.AreaOverlay.LINEPOINT&&e.mark===S.AREA);return e.mark===S.ERRORBAR?d(e):O.isRanged(e.encoding)?f(e):a||i?p(e,a,i):e}function f(e){if(e.encoding){var t=O.has(e.encoding,T.X),n=O.has(e.encoding,T.Y),i=O.has(e.encoding,T.X2),a=O.has(e.encoding,T.Y2);if(i&&!t||a&&!n){var r=A.duplicate(e);return i&&!t&&(r.encoding.x=r.encoding.x2,delete r.encoding.x2),a&&!n&&(r.encoding.y=r.encoding.y2,delete r.encoding.y2),r}}return e}function d(e){var t=A.extend(e.name?{name:e.name}:{},e.description?{description:e.description}:{},e.data?{data:e.data}:{},e.transform?{transform:e.transform}:{},e.config?{config:e.config}:{},{layers:[]});if(!e.encoding)return t;if(e.mark===S.ERRORBAR){var n={mark:S.RULE,encoding:A.extend(e.encoding.x?{x:A.duplicate(e.encoding.x)}:{},e.encoding.y?{y:A.duplicate(e.encoding.y)}:{},e.encoding.x2?{x2:A.duplicate(e.encoding.x2)}:{},e.encoding.y2?{y2:A.duplicate(e.encoding.y2)}:{},{})},i={mark:S.TICK,encoding:A.extend(e.encoding.x?{x:A.duplicate(e.encoding.x)}:{},e.encoding.y?{y:A.duplicate(e.encoding.y)}:{},e.encoding.size?{size:A.duplicate(e.encoding.size)}:{},{})},a={mark:S.TICK,encoding:A.extend({x:e.encoding.x2?A.duplicate(e.encoding.x2):A.duplicate(e.encoding.x),y:e.encoding.y2?A.duplicate(e.encoding.y2):A.duplicate(e.encoding.y)},e.encoding.size?{size:A.duplicate(e.encoding.size)}:{})};t.layers.push(u(n)),t.layers.push(u(i)),t.layers.push(u(a))}return t}function p(e,t,n){var i=["name","description","data","transform"],a=A.omit(e,i.concat("config")),r=A.duplicate(e.config);delete r.overlay;var o=E.stack(e.mark,e.encoding,e.config&&e.config.mark?e.config.mark.stacked:void 0),l=A.extend(A.pick(e,i),{layers:[a]},A.keys(r).length>0?{config:r}:{});if(n){var c=A.duplicate(a);c.mark=S.LINE;var s=A.extend({},v.defaultOverlayConfig.lineStyle,e.config.overlay.lineStyle,o?{stacked:o.offset}:null);A.keys(s).length>0&&(c.config={mark:s}),l.layers.push(c)}if(t){var u=A.duplicate(a);u.mark=S.POINT;var s=A.extend({},v.defaultOverlayConfig.pointStyle,e.config.overlay.pointStyle,o?{stacked:o.offset}:null);A.keys(s).length>0&&(u.config={mark:s}),l.layers.push(u)}return l}function m(e,t){return t.forEach(function(t){var n=["field","type","value","timeUnit","bin","aggregate"].reduce(function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e},{}),i=A.hash(n);e[i]=e[i]||t}),e}function h(e,t){return void 0===t&&(t={}),l(e)?e.layers.forEach(function(e){m(t,N.fieldDefs(e.encoding))}):i(e)?(m(t,N.fieldDefs(e.facet)),h(e.spec,t)):m(t,N.fieldDefs(e.encoding)),t}function g(e){return A.vals(h(e))}function y(e){return null!==E.stack(e.mark,e.encoding,e.config&&e.config.mark?e.config.mark.stacked:void 0)}var v=e("./config"),O=e("./encoding"),S=e("./mark"),E=e("./stack"),T=e("./channel"),N=e("./encoding"),A=e("./util");n.isSomeFacetSpec=i,n.isExtendedUnitSpec=a,n.isUnitSpec=r,n.isSomeUnitSpec=o,n.isLayerSpec=l,n.normalize=c,n.normalizeExtendedUnitSpec=s,n.normalizeUnitSpec=u,n.normalizeRangedUnitSpec=f,n.normalizeErrorBarUnitSpec=d,n.normalizeOverlay=p,n.fieldDefs=g,n.isStacked=y},{"./channel":11,"./config":44,"./encoding":47,"./mark":52,"./stack":57,"./util":61}],57:[function(e,t,n){"use strict";function i(e,t,n){if(u.contains([a.NONE,null,!1],n))return null;if(!u.contains([c.BAR,c.AREA,c.POINT,c.CIRCLE,c.SQUARE,c.LINE,c.TEXT,c.TICK],e))return null;if(!l.isAggregate(t))return null;var i=o.STACK_GROUP_CHANNELS.reduce(function(e,n){return l.has(t,n)&&!t[n].aggregate&&e.push(n),e},[]);if(0===i.length)return null;var f=l.has(t,o.X),d=l.has(t,o.Y),p=f&&!!t.x.aggregate,m=d&&!!t.y.aggregate;if(p!==m){var h=p?o.X:o.Y,g=t[h].aggregate,y=t[h].scale;return y&&y.type&&y.type!==s.ScaleType.LINEAR?(console.warn("Cannot stack non-linear ("+y.type+") scale"),null):u.contains(r.SUM_OPS,g)?(u.contains([c.BAR,c.AREA],e)&&(n=void 0===n?a.ZERO:n),n?{groupbyChannel:p?d?o.Y:null:f?o.X:null,fieldChannel:h,stackByChannels:i,offset:n}:null):(console.warn("Cannot stack when the aggregate function is "+g+"(non-summative)."),null)}return null}var a,r=e("./aggregate"),o=e("./channel"),l=e("./encoding"),c=e("./mark"),s=e("./scale"),u=e("./util");!function(e){e[e.ZERO="zero"]="ZERO",e[e.CENTER="center"]="CENTER",e[e.NORMALIZE="normalize"]="NORMALIZE",e[e.NONE="none"]="NONE"}(a=n.StackOffset||(n.StackOffset={})),n.stack=i},{"./aggregate":8,"./channel":11,"./encoding":47,"./mark":52,"./scale":53,"./util":61}],58:[function(e,t,n){"use strict";function i(e){return!!y[e]}function a(e,t){var i=new Date(0,0,1,0,0,0,0);return n.SINGLE_TIMEUNITS.forEach(function(n){if(o(e,n))switch(n){case d.DAY:throw new Error("Cannot convert to TimeUnits containing 'day'");case d.YEAR:i.setFullYear(t.getFullYear());break;case d.QUARTER:i.setMonth(3*Math.floor(t.getMonth()/3));break;case d.MONTH:i.setMonth(t.getMonth());break;case d.DATE:i.setDate(t.getDate());break;case d.HOURS:i.setHours(t.getHours());break;case d.MINUTES:i.setMinutes(t.getMinutes());break;case d.SECONDS:i.setSeconds(t.getSeconds());break;case d.MILLISECONDS:i.setMilliseconds(t.getMilliseconds())}}),i}function r(e){return!!v[e]}function o(e,t){var n=e.toString(),i=t.toString(),a=n.indexOf(i);return a>-1&&(t!==d.SECONDS||0===a||"i"!==n.charAt(a-1))}function l(e){switch(e){case d.HOURS:case d.DAY:case d.MONTH:case d.QUARTER:return h.ScaleType.ORDINAL}return h.ScaleType.TIME}function c(e,t){function i(e){return e===d.QUARTER?"floor(month("+a+")/3)":e+"("+a+")"}var a='datum["'+t+'"]',r=n.SINGLE_TIMEUNITS.reduce(function(t,n){return o(e,n)&&(t[n]=i(n)),t},{});return r.day&&g.keys(r).length>1&&(console.warn('Time unit "'+e+'" is not supported. We are replacing it with ',(e+"").replace("day","date")+"."),delete r.day,r.date=i(d.DATE)),m.dateTimeExpr(r)}function s(e,t){if(g.contains([p.ROW,p.COLUMN,p.SHAPE,p.COLOR],t))return null;switch(e){case d.SECONDS:return g.range(0,60);case d.MINUTES:return g.range(0,60);case d.HOURS:return g.range(0,24);case d.DAY:return g.range(0,7);case d.DATE:return g.range(1,32);case d.MONTH:return g.range(0,12);case d.QUARTER:return[0,1,2,3]}return null}function u(e){if(e)return o(e,d.SECONDS)?"second":o(e,d.MINUTES)?"minute":o(e,d.HOURS)?"hour":o(e,d.DAY)||o(e,d.DATE)?"day":o(e,d.MONTH)?"month":o(e,d.YEAR)?"year":void 0}function f(e,t,n){if(e){var i=[],a="",r=o(e,d.YEAR);o(e,d.QUARTER)&&(a="Q{{"+t+" | quarter}}"),o(e,d.MONTH)&&i.push(n!==!1?"%b":"%B"),o(e,d.DAY)?i.push(n?"%a":"%A"):o(e,d.DATE)&&i.push("%d"+(r?",":"")),r&&i.push(n?"%y":"%Y");var l=[];o(e,d.HOURS)&&l.push("%H"),o(e,d.MINUTES)&&l.push("%M"),o(e,d.SECONDS)&&l.push("%S"),o(e,d.MILLISECONDS)&&l.push("%L");var c=[];return i.length>0&&c.push(i.join(" ")),l.length>0&&c.push(l.join(":")),c.length>0&&(a&&(a+=" "),a+="{{"+t+" | time:'"+c.join(" ")+"'}}"),a||void 0}}var d,p=e("./channel"),m=e("./datetime"),h=e("./scale"),g=e("./util");!function(e){e[e.YEAR="year"]="YEAR",e[e.MONTH="month"]="MONTH",e[e.DAY="day"]="DAY",e[e.DATE="date"]="DATE",e[e.HOURS="hours"]="HOURS",e[e.MINUTES="minutes"]="MINUTES",e[e.SECONDS="seconds"]="SECONDS",e[e.MILLISECONDS="milliseconds"]="MILLISECONDS",e[e.YEARMONTH="yearmonth"]="YEARMONTH",e[e.YEARMONTHDATE="yearmonthdate"]="YEARMONTHDATE",e[e.YEARMONTHDATEHOURS="yearmonthdatehours"]="YEARMONTHDATEHOURS",e[e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes"]="YEARMONTHDATEHOURSMINUTES",e[e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds"]="YEARMONTHDATEHOURSMINUTESSECONDS",e[e.MONTHDATE="monthdate"]="MONTHDATE",e[e.HOURSMINUTES="hoursminutes"]="HOURSMINUTES",e[e.HOURSMINUTESSECONDS="hoursminutesseconds"]="HOURSMINUTESSECONDS",e[e.MINUTESSECONDS="minutesseconds"]="MINUTESSECONDS",e[e.SECONDSMILLISECONDS="secondsmilliseconds"]="SECONDSMILLISECONDS",e[e.QUARTER="quarter"]="QUARTER",e[e.YEARQUARTER="yearquarter"]="YEARQUARTER",e[e.QUARTERMONTH="quartermonth"]="QUARTERMONTH",e[e.YEARQUARTERMONTH="yearquartermonth"]="YEARQUARTERMONTH"}(d=n.TimeUnit||(n.TimeUnit={})),n.SINGLE_TIMEUNITS=[d.YEAR,d.QUARTER,d.MONTH,d.DAY,d.DATE,d.HOURS,d.MINUTES,d.SECONDS,d.MILLISECONDS];var y=n.SINGLE_TIMEUNITS.reduce(function(e,t){return e[t]=!0,e},{});n.isSingleTimeUnit=i,n.convert=a,n.MULTI_TIMEUNITS=[d.YEARQUARTER,d.YEARQUARTERMONTH,d.YEARMONTH,d.YEARMONTHDATE,d.YEARMONTHDATEHOURS,d.YEARMONTHDATEHOURSMINUTES,d.YEARMONTHDATEHOURSMINUTESSECONDS,d.QUARTERMONTH,d.HOURSMINUTES,d.HOURSMINUTESSECONDS,d.MINUTESSECONDS,d.SECONDSMILLISECONDS];var v=n.MULTI_TIMEUNITS.reduce(function(e,t){return e[t]=!0,e},{});n.isMultiTimeUnit=r,n.TIMEUNITS=n.SINGLE_TIMEUNITS.concat(n.MULTI_TIMEUNITS),n.containsTimeUnit=o,n.defaultScaleType=l,n.fieldExpr=c,n.imputedDomain=s,n.smallestUnit=u,n.template=f},{"./channel":11,"./datetime":46,"./scale":53,"./util":61}],59:[function(e,t,n){"use strict"},{}],60:[function(e,t,n){"use strict";function i(e){var t=e;return n.TYPE_FROM_SHORT_TYPE[t.toUpperCase()]||t.toLowerCase()}var a;!function(e){e[e.QUANTITATIVE="quantitative"]="QUANTITATIVE",e[e.ORDINAL="ordinal"]="ORDINAL",e[e.TEMPORAL="temporal"]="TEMPORAL",e[e.NOMINAL="nominal"]="NOMINAL"}(a=n.Type||(n.Type={})),n.QUANTITATIVE=a.QUANTITATIVE,n.ORDINAL=a.ORDINAL,n.TEMPORAL=a.TEMPORAL,n.NOMINAL=a.NOMINAL,n.SHORT_TYPE={quantitative:"Q",temporal:"T",nominal:"N",ordinal:"O"},n.TYPE_FROM_SHORT_TYPE={Q:n.QUANTITATIVE,T:n.TEMPORAL,O:n.ORDINAL,N:n.NOMINAL},n.getFullName=i},{}],61:[function(e,t,n){"use strict";function i(e,t){var n={};return t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n}function a(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n===1/0)throw new Error("Infinite range");var i,a=[],r=-1;if(n<0)for(;(i=e+n*++r)>t;)a.push(i);else for(;(i=e+n*++r)<t;)a.push(i);return a}function r(e,t){var n=A.duplicate(e);return t.forEach(function(e){delete n[e]}),n}function o(e){return R.isString(e)||R.isNumber(e)||R.isBoolean(e)?String(e):T(e)}function l(e,t){return e.indexOf(t)>-1}function c(e,t){return e.filter(function(e){return!l(t,e)})}function s(e,t){return e.concat(c(t,e))}function u(e,t,n){if(e.forEach)e.forEach.call(n,t);else for(var i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function f(e,t,n,i){if(e.reduce)return e.reduce.call(i,t,n);for(var a in e)e.hasOwnProperty(a)&&(n=t.call(i,n,e[a],a,e));return n}function d(e,t,n){if(e.map)return e.map.call(n,t);var i=[];for(var a in e)e.hasOwnProperty(a)&&i.push(t.call(n,e[a],a,e));return i}function p(e,t){for(var n=0,i=0;i<e.length;i++)if(t(e[i],i,n++))return!0;return!1}function m(e,t){for(var n=0,i=0;i<e.length;i++)if(!t(e[i],i,n++))return!1;return!0}function h(e){return[].concat.apply([],e)}function g(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0;i<t.length;i++)e=y(e,t[i]);return e}function y(e,t){if("object"!=typeof t||null===t)return e;for(var n in t)t.hasOwnProperty(n)&&void 0!==t[n]&&("object"!=typeof t[n]||null===t[n]?e[n]=t[n]:"object"!=typeof e[n]||null===e[n]?e[n]=g(t[n].constructor===Array?[]:{},t[n]):g(e[n],t[n]));return e}function v(e,t){var n,i,a,r=[],o={};for(i=0,a=e.length;i<a;++i)n=t?t(e[i]):e[i],n in o||(o[n]=1,r.push(e[i]));return r}function O(e){console.warn("[VL Warning]",e)}function S(e){console.error("[VL Error]",e)}function E(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t[n]&&e[n]&&t[n]!==e[n])return!0;return!1}var T=e("json-stable-stringify"),N=e("datalib/src/util");n.keys=N.keys,n.extend=N.extend,n.duplicate=N.duplicate,n.isArray=N.isArray,n.vals=N.vals,n.truncate=N.truncate,n.toMap=N.toMap,n.isObject=N.isObject,n.isString=N.isString,n.isNumber=N.isNumber,n.isBoolean=N.isBoolean;var A=e("datalib/src/util"),R=e("datalib/src/util");n.pick=i,n.range=a,n.omit=r,n.hash=o,n.contains=l,n.without=c,n.union=s,n.forEach=u,n.reduce=f,n.map=d,n.some=p,n.every=m,n.flatten=h,n.mergeDeep=g,n.unique=v,n.warning=O,n.error=S,n.differ=E},{"datalib/src/util":2,"json-stable-stringify":3}],62:[function(e,t,n){"use strict";function i(e,t,i){void 0===t&&(t=n.DEFAULT_REQUIRED_CHANNEL_MAP),void 0===i&&(i=n.DEFAULT_SUPPORTED_CHANNEL_TYPE);var a=e.mark,o=e.encoding,l=t[a],c=i[a];for(var s in l)if(!(l[s]in o))return'Missing encoding channel "'+l[s]+'" for mark "'+a+'"';for(var u in o)if(!c[u])return'Encoding channel "'+u+'" is not supported by mark type "'+a+'"';return a!==r.BAR||o.x||o.y?null:"Missing both x and y for bar"}var a=e("./util"),r=e("./mark");n.DEFAULT_REQUIRED_CHANNEL_MAP={text:["text"],line:["x","y"],area:["x","y"]},n.DEFAULT_SUPPORTED_CHANNEL_TYPE={bar:a.toMap(["row","column","x","y","size","color","detail"]),line:a.toMap(["row","column","x","y","color","detail"]),area:a.toMap(["row","column","x","y","color","detail"]),tick:a.toMap(["row","column","x","y","color","detail"]),circle:a.toMap(["row","column","x","y","color","size","detail"]),square:a.toMap(["row","column","x","y","color","size","detail"]),point:a.toMap(["row","column","x","y","color","size","detail","shape"]),text:a.toMap(["row","column","size","color","text"])},n.getEncodingMappingError=i},{"./mark":52,"./util":61}],63:[function(e,t,n){"use strict";function i(e){return!r.isArray(e)&&"fields"in e}function a(e){return!r.isArray(e)&&"data"in e}var r=e("./util");n.isUnionedDomain=i,n.isDataRefDomain=a},{"./util":61}],64:[function(e,t,n){"use strict";n.axis=e("./axis"),n.aggregate=e("./aggregate"),n.bin=e("./bin"),n.channel=e("./channel"),n.compile=e("./compile/compile").compile,n.config=e("./config"),n.data=e("./data"),n.datetime=e("./datetime"),n.encoding=e("./encoding"),n.facet=e("./facet"),n.fieldDef=e("./fielddef"),n.legend=e("./legend"),n.mark=e("./mark"),n.scale=e("./scale"),n.shorthand=e("./shorthand"),n.sort=e("./sort"),n.spec=e("./spec"),n.stack=e("./stack"),n.timeUnit=e("./timeunit"),n.transform=e("./transform"),n.type=e("./type"),n.util=e("./util"),n.validate=e("./validate"),n.version=e("../package.json").version},{"../package.json":7,"./aggregate":8,"./axis":9,"./bin":10,"./channel":11,"./compile/compile":14,"./config":44,"./data":45,"./datetime":46,"./encoding":47,"./facet":48,"./fielddef":49,"./legend":51,"./mark":52,"./scale":53,"./shorthand":54,"./sort":55,"./spec":56,"./stack":57,"./timeunit":58,"./transform":59,"./type":60,"./util":61,"./validate":62}]},{},[64])(64)});
//# sourceMappingURL=vega-lite.min.js.map