@plotdb/chart 3.5.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/bundle.css +59 -0
- package/bundle.js +5644 -0
- package/bundle.min.css +1 -0
- package/bundle.min.js +1 -0
- package/index.js +32 -10
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/utils/anim.js +483 -0
- package/utils/anim.min.js +1 -0
- package/utils/brush.js +306 -0
- package/utils/brush.min.js +1 -0
- package/utils/color.js +37 -0
- package/utils/color.min.js +1 -0
- package/utils/debounce.js +86 -0
- package/utils/debounce.min.js +1 -0
- package/utils/format.js +266 -5
- package/utils/format.min.js +1 -1
- package/utils/scale.js +434 -0
- package/utils/scale.min.js +1 -0
- package/utils/shape.js +799 -0
- package/utils/shape.min.js +1 -0
package/bundle.min.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
div[plug=layout]{width:100%;height:100%}div[plug=layout] .pdl-layout{width:100%;height:100%}.pdlg{height:100%;width:100%;display:flex;align-items:start;justify-content:center;flex-wrap:wrap}.pdlg>div{display:flex;align-items:center;line-height:1em}.pdlg>div [ld=shape]{display:inline-block;width:1em;height:1em;margin-right:.5em;background:#999;flex:0 0 auto;line-height:1em}.pdlg>div [ld=text]{color:#999;padding-right:.25em;line-height:1.2em;white-space:pre}.pdlg.vertical{flex-direction:column;align-items:start}.pdlg.vertical>div{margin-bottom:.5em}.pdlg.vertical{flex-direction:row;writing-mode:vertical-lr;text-orientation:upright;height:100%}.pdlg.vertical>div{writing-mode:horizontal-tb}.pdlg.horizontal>div{margin-right:.5em}g.pdlg-g{cursor:pointer;transition:opacity .15s ease-in-out}
|
package/bundle.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){var _=function(a,l){var t,h,c;return"number"==typeof a&&null==l?new Promise(function(t){return setTimeout(t,a)}):("function"==typeof l&&(a=(t=[l,a])[0],l=t[1]),l=l||{},t="object"==typeof a?[a.func,a]:[a,{delay:"object"==typeof l?l.delay||750:l}],a=t[0],l=t[1],h={},(c=function(){for(var e,n,i,t,o=this,r=[],s=0,u=arguments.length;s<u;++s)r.push(arguments[s]);return e=r,n=!1,i=c.delay.value||l.delay||750,c.delay.value=0,(t=new Promise(function(r,t){if(!n)return h.h&&c.clear(),h.res=r,h.rej=t,h.h=setTimeout(function(){var t=a.apply(o,e);return t&&"function"==typeof t.then?t.then(function(){for(var t,e=[],n=0,i=arguments.length;n<i;++n)e.push(arguments[n]);return t=e,r.apply(null,t)}):r(t),h.res=null,h.rej=null,h.h=0,h},i)})).now=function(){return n=!0,c.clear(),a.apply(o,e)},t.cancel=function(){return c.clear()},t}).clear=function(){return clearTimeout(h.h),h.res&&h.res(null),h.h=0,h.res=null,h.rej=null,h},c.delay=function(t){return c.delay.value=t,c},c)},g={exports:{}},k=(!function(){var e,c,f,d,t,n,i,o,s,r,u,a,l,h,p;function m(t,e,f){function d(t,e){return n.call(t,e)}var p={}.toString,n={}.hasOwnProperty,m=!0;return function t(e,n,i){var r,o,s,u,a,l,h,c;if(null==e||null==n)return e===n;if(e.__placeholder__||n.__placeholder__)return!0;if(e===n)return 0!==e||1/e==1/n;r=p.call(e);if(p.call(n)!=r)return!1;switch(r){case"[object String]":return e==String(n);case"[object Number]":return e!=+e?n!=+n:0==e?1/e==1/n:e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object RegExp]":return e.source==n.source&&e.global==n.global&&e.multiline==n.multiline&&e.ignoreCase==n.ignoreCase}if("object"!=typeof e||"object"!=typeof n)return!1;o=i.length;for(;o--;)if(i[o]==e)return!0;i.push(e);s=0;u=!0;if("[object Array]"==r){if(a=e.length,l=n.length,m){switch(f){case"===":u=a===l;break;case"<==":u=a<=l;break;case"<<=":u=a<l}s=a,m=!1}else u=a===l,s=a;if(u)for(;s--&&(u=s in e==s in n&&t(e[s],n[s],i)););}else{if("constructor"in e!="constructor"in n||e.constructor!=n.constructor)return!1;for(h in e)if(d(e,h)&&(s++,!(u=d(n,h)&&t(e[h],n[h],i))))break;if(u){for(h in c=0,n)d(n,h)&&++c;u=m?"<<="===f?s<c:"<=="===f?s<=c:s===c:(m=!1,s===c)}}i.pop();return u}(t,e,[])}function y(t,e){var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t}e=new function(t){var n=new Intl.NumberFormat(t),t=n.formatToParts(12345.6),e=Array.from({length:10}).map(function(t,e){return n.format(e)}),i=new Map(e.map(function(t,e){return[t,e]}));return this._group=new RegExp("["+t.find(function(t){return m(t.type,"group","===")}).value+"]","g"),this._decimal=new RegExp("["+t.find(function(t){return m(t.type,"decimal","===")}).value+"]"),this._numeral=new RegExp("["+e.join("")+"]","g"),this._index=function(t){return i.get(t)},this}("en-US"),c=function(t){return(t=((t=null==t?"":t)+"").trim().replace(e._group,"").replace(e._decimal,".").replace(e._numeral,e._index))?+t:NaN},f=function(t){return"number"==typeof t?t:!t&&0!==t||isNaN(+t)?0:+t},d=function(t){return!(!/[RIT]/.exec((t=null==t?{}:t).type||"")||/[CN]/.exec(t.type||""))},t=function(e){var t,n,i,r,o,s=[];for(n in e=null==e?{}:e)s.push(n);for(t=s,i=0,o=(r=["name","order"]).length;i<o;++i)if(e[n=r[i]]&&!d(e[n]))return n;return t.filter(function(t){return!d(e[t])})[0]},n=function(){var a,l,h,u=this,c=(this.mod||{}).dimension||{};if(this._subset)return a=t(c),l=this._subset.map(function(e){var t,n,i,r,o={};for(t in n=c)i=n[t],(r=u.binding[t])&&(o[t]=i.multiple?(r.map?r:[r]).map(s):e[r.key],d(i))&&(o[t]=Array.isArray(o[t])?o[t].map(f):f(o[t]));return o;function s(t){return e[t.key]}}),h={},a&&l.map(function(t){return h[t[a]+""]=t}),this.data.map(function(t,e){var n,i,r,o=a?h[t[a]+""]:l[e],s={};for(n in i=c)r=i[n],d(r)&&(s[n]=r.multiple?(t[n]||[]).map(u):o?f(o[n]):0);return t.subset=s;function u(t,e){return o?f((o[n]||[])[e]):0}}),"shrink"===(((this.cfg||{}).common||{}).subset||{}).mode?this.data.map(function(t){var e,n,i,r=[];for(e in n=c)i=n[e],d(i)&&r.push(t[e]=t.subset[e]);return r}):void 0;this.data.map(function(t){var e=t.subset;return delete t.subset,e})},i=function(t){var e,n;if("string"!=typeof t)return null;if(t=t.trim(),e=/^#([0-9a-f]{3})$/i.exec(t)){for(var i,r=[],o=0,s=(i=e[1].split("")).length;o<s;++o)n=i[o],r.push(parseInt(n+n,16));return r}return(e=/^#([0-9a-f]{6})$/i.exec(t))?[0,1,2].map(function(t){return parseInt(e[1].substr(2*t,2),16)}):(e=/^rgba?\(([^)]+)\)$/i.exec(t))&&3===(t=e[1].split(",").slice(0,3).map(function(t){return parseFloat(t.trim())})).length&&t.every(function(t){return!isNaN(t)})?t:null},o=function(t,e,n){var i,r,o,s;for(r in null==n&&(n={}),i={},o=y(y({},e=null==e?{}:e),n||{}))s=o[r],i[r]="function"==typeof s?s.bind(t):s;return i},s=function(t,e,n){for(var i=t;t&&t!==n;)t=t.parentNode;if(t!==n)return null;if(!e)return t;for(t=i;t&&t!==n&&(!t.matches||(t.matches,!t.matches(e)));)t=t.parentNode;return t!==n||n.matches&&n.matches(e)?t:null},(r=function(){return this.running=!1,this.time={now:0,last:0},this.fps(60),this.evtHandler={},this}).prototype=y(Object.create(Object.prototype),{on:function(t,n){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=i.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,i=(n=this.evtHandler[t]||[]).length;u<i;++u)r=n[u],o.push(r.apply(this,e));return o},reset:function(){return this.time={now:0}},setTime:function(t){return this.time.now=t},getTime:function(){return this.time.now},isRunning:function(){return this.running},toggle:function(t){return null!=t&&(this.running=!t),this.running?this.pause():this.run()},pause:function(){return this.running=!1},render:function(t){return this.fire("tick",this.time.now,t=null==t?0:t)},run:function(t){var e=this;if(null!=t&&this.fps(t),!this.running)return this.running=!0,requestAnimationFrame(function(t){return e.handler(e.time.last=t,!0)})},throttle:function(t){return this.isThrottled=t=null==t?!0:t},fps:function(t){return null==t?this._fps_val:(this._fps_val=.01<t?t:.01,this._fps_delay=1e3/this._fps_val)},handler:function(t,e){var n,i,r=this;if(null==e&&(e=!1),this.running)return this.external&&this.external()?(this.time.last=t,requestAnimationFrame(function(t){return r.handler(t,!1)})):(this.time.now=t,n=this.isThrottled?1e3<(n=this._fps_delay)?n:1e3:this._fps_delay,(e||(i=this.time.now-this.time.last)>=n)&&(this.time.last=t,this.render(e?0:i)),requestAnimationFrame(function(t){return r.handler(t,!1)}))}}),u={list:[],init:function(){var t,n,i=this;return this.inited=!0,t=null==document.hidden&&null==document.msHidden&&null!=document.webkiHidden?["webkitHidden","webkitvisibilitychange"]:["hidden","visibilitychange"],n=t[0],document.addEventListener(t[1],_(150,function(){var e=!!document[n];return i.list.map(function(t){return t.throttle(e)})}))},add:function(t){return this.inited||this.init(),this.list.push(t)}},a={wm:new WeakMap,ro:new ResizeObserver(function(t){return t.map(function(t){return a.wm.get(t.target)._resize()})}),add:function(t,e){return this.wm.set(t,e),this.ro.observe(t)},delete:function(t){return this.ro.unobserve(t),this.wm.delete(t)}},l=function(t,e,n){return null==e&&(e={}),null==n&&(n={}),function(t,e,n){var i,r;for(i in e)r=e[i],null==t[i]?t[i]=r:"object"!=typeof t[i]||"object"!=typeof r||n[i]&&n[i].type||l(t[i],e[i],n[i]);return t}(t=null==t?{}:t,e=JSON.parse(JSON.stringify(e)),n)},h=function(t){var r=function(t,e){var n,i;for(n in null==e&&(e={}),t.child,t)(i=t[n]).type?i.default&&(e[n]=i.default):r(i,e[n]||(e[n]={}));return e};return r(t)},(p=function(t){var e,n,i,r=this;for(e in this.root="string"==typeof(t=null==t?{}:t).root?document.querySelector(t.root):t.root,this.useSample=null==t.useSample||t.useSample,this.autoSelect=null==t.autoSelect||t.autoSelect,this.forceInit=t.forceInit||!1,this.prepareSvg=null==t.prepareSvg||t.prepareSvg,this.layoutOpt=null==t.layout||t.layout,this.delayRender=t.delayRender||!1,this.dataAccessor=null!=t.dataAccessor?t.dataAccessor:function(t){return t?t.data._raw:null},this.data=[],this.raw=t.raw||null,this.mod=t.mod||{},this.cfg=t.config||{},this.seed=t.seed||Math.random(),this.binding=t.binding||{},this._normalizeBinding(),this.evtHandler={},this._subset=t.subset||null,n=p.scopes){if(i=n[e],null!=this[e])throw new Error("[@plotdb/chart] scope name `"+e+"` is already taken.");this[e]=o(this,i,this.mod[e])}if(null!=this.local)throw new Error("[@plotdb/chart] scope name `local` is already taken.");return this.local=o(this,{},this.mod.local),(p.utils||(p.utils={})).anim&&null==this.anim&&(this.anim=new p.utils.anim),this.init=proxise.once(function(){return r._init()}),this._resize=null,this._inited=!1,this.autoSelect&&(this.root.addEventListener("click",this._select=function(t){if(t=s(t.target,".data",r.root))return r.fire("select",[{data:r.dataAccessor(t),node:t}])}),this.root.addEventListener("mouseover",this._hover=function(t){if(t=s(t.target,".data",r.root))return r.fire("hover",[{data:r.dataAccessor(t),node:t}])})),this}).prototype=y(Object.create(Object.prototype),{_init:function(){var n,t,e,i=this;return"static"===window.getComputedStyle(this.root).position&&(this.root.style.position="relative"),n=this.layoutOpt?"object"!=typeof this.layoutOpt?this.root.querySelector(".pdl-layout"):"string"==typeof this.layoutOpt.root?this.root.querySelector(this.layoutOpt.root):this.layoutOpt.root||null:null,this.prepareSvg&&!(this.svg=this.root.querySelector("svg"))&&(this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),(t=this.svg.style).width="100%",t.height="100%",!this.layoutOpt||(n||console.error("[@plotdb/chart] layout enabled yet layout root isn't configured properly. "),e=n.querySelector("[data-type=render]"))||console.warn("[@plotdb/chart] prepareSvg and layout is configured at the same time,\nyet render container for layout is not found. svg is thus appended in the root."),(e||this.root).appendChild(this.svg)),this._aniloop=new r,u.add(this._aniloop),this._aniloop.on("tick",function(t,e){return i.tick(t,e)}),this.anim&&(this._aniloop.external=function(){return i.anim.manual()},this.anim.on("step",function(t,e){if(i._aniloop.isRunning())return i._aniloop.setTime(t),i._aniloop.render(e)})),Promise.resolve().then(function(){var t;return i.mod.config=l(i.mod.config||{},p.commonConfig),i._defcfg=t=h(i.mod.config),l(i.cfg,t),i.raw&&Array.isArray(i.raw)?{raw:i.raw,binding:i.binding}:i.useSample&&i.mod.sample?(t=i.mod.sample.apply(i)).then?t.then():Promise.resolve(t):void 0}).then(function(t){return i.raw=(t=t||{}).raw,i.binding=t.binding,i}).then(function(){var t,e;return i.raw||(i.raw=[]),i.layoutOpt&&("undefined"==typeof layout||null===layout?console.warn("[@plotdb/chart] layout-opt is set yet @plotdb/layout is not found."):(n||(console.error("[@plotdb/chart] cannot determine root node for @plotdb/layout."),console.error("[@plotdb/chart] config layout properly or disable layout by setting layout to false")),i.layout=new layout("object"==typeof i.layoutOpt?((e=y({},i.layoutOpt)).watchResize=!1,e):{root:n,watchResize:!1}))),t=proxise(function(){return a.add(i.root,i),null}),i._resize=function(){return t.resolve()},e=t(),(i.forceInit||!i.root.offsetParent||"none"===window.getComputedStyle(i.root).display||i.root.offsetWidth&&i.root.offsetHeight)&&t.resolve(),e}).then(function(){return i._resize=function(){}}).then(function(){var t,e=function(){if(i.mod.init)return i.mod.init.apply(i)};return(i.layout?(t=proxise(function(){return Promise.resolve(i.layout.init(e)),null}),i._layout=function(){return t.resolve()},i.layout.on("render",function(){return i._layout()}),t):e)()}).then(function(){i._layout=function(){},Promise.resolve().then(function(){if(i.delayRender&&!i._pendingRaw)return i.renderLock=proxise(function(){}),i.renderLock()}).then(function(){return i._inited=!0,i._resize=function(){return i.resize(),i.render()},i._layout=function(){return i.parse(),i.bind(),i.resize(),i.render()},i.parse(),i.bind(),i.resize(),i.render()})})},parse:function(){var t,l=(t=this.mod).dimension||(t.dimension={}),h=this.binding;if(this.data=this.raw.map(function(e,t){var n,i,r,o,s={};for(n in i=l)r=i[n],(o=h[n])?(s[n]=r.multiple?(o.map?o:[o]).map(u):e[o.key],/[RIT]/.exec(r.type)&&!/[CN]/.exec(r.type)&&(s[n]=Array.isArray(s[n])?s[n].map(a):c(s[n]))):r.multiple&&(s[n]=[]);return s._raw=e,s._idx=t,s;function u(t){return e[t.key]}function a(t){return c(t)}}),n.apply(this),this.mod.parse)return this.mod.parse.apply(this)},bind:function(){if(this.mod.bind)return this.mod.bind.apply(this)},start:function(){if(this._aniloop.run(),this.mod.start)return this.mod.start.apply(this)},stop:function(){if(this._aniloop.pause(),this.mod.stop)return this.mod.stop.apply(this)},resize:function(){if(this._inited)return this.layout&&this.layout.update(!1),this.box=this.root.getBoundingClientRect(),this.mod.resize?this.mod.resize.apply(this):void 0},tick:function(t,e){if(this.mod.tick)return this.mod.tick.apply(this,[t,e])},render:function(){return this._inited&&this.mod.render?this.mod.render.apply(this):void 0},destroy:function(){var t=this;return Promise.resolve().then(function(){if(t._select&&t.root.removeEventListener("click",t._select),t._hover&&t.root.removeEventListener("mouseover",t._hover),a.delete(t.root),t.layout&&t.layout.destroy(),t.stop(),t.mod.destroy)return t.mod.destroy.apply(t)})},config:function(){var t,e,n;if(!arguments.length)return this.cfg;for(t={},e=0,n=arguments.length;e<n;++e)l(t,arguments[e],this.mod.config);return l(t,this.cfg,this.mod.config),l(t,this._defcfg,this.mod.config),y(this.cfg,t)},_normalizeBinding:function(t){var e,n,i,r,o,s,u,a=[];if(null==t){for(t in e=[],this.mod.dimension||{})e.push(t);t=e}for(n=0,i=(t=Array.isArray(t)?t:[t]).length;n<i;++n)r=t[n],o=(this.mod.dimension||{})[r]||{},s=this.binding[r],u=Array.isArray(s),!o.multiple!=!u&&(o.multiple||u)&&a.push(this.binding[r]=u?s[0]:s?[s]:[]);return a},setBind:function(t,e){if(this.binding[t]=e,this._normalizeBinding([t]),this._inited)return this.parse(),this.bind(),this.resize(),this.render()},setRaw:function(t,e,n){var i;return null==n&&(n=!1),Array.isArray(t)||(t&&"subset"in t&&(this._subset=t.subset||null),t=(i=t).raw,e=i.binding,n=i.reinit),null!=t&&(this.raw=t),null!=e&&(this.binding=e,this._normalizeBinding()),this.renderLock?(this.renderLock.resolve(),this.renderLock=null):this._inited?(n&&this.mod.init&&this.mod.init.apply(this),this.parse(),this.bind(),this.resize(),this.render()):this._pendingRaw=!0},on:function(t,n){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=i.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,i=(n=this.evtHandler[t]||[]).length;u<i;++u)r=n[u],o.push(r.apply(this,e));return o},filter:function(t,e){var n,i,r,o,s;for(i in null==t&&(t={}),null==e&&(e=!1),n=[],r=this.binding)o=r[i],s=(s=Array.isArray(o)?o:[o]).map(u),n=n.concat(s);for(i in t)o=t[i],n.filter(a).map(l);return e&&this.fire("filter",t),this.mod.filter&&this.mod.filter.apply(this,[t,e]),this.parse(),this.bind(),this.resize(),this.render();function u(t){return{k:i,v:t}}function a(t){return t.k===i}function l(t){return t.v.filter=o}},sample:function(){return this.mod.sample?this.mod.sample.apply(this):{raw:[],binding:{}}},filterDims:function(){var t;return(t=(this.mod||{}).filterDims)?t.call(this):(this.mod||{}).filter?["name"]:[]},canFilter:function(){return!!this.filterDims().length}}),p.commonConfig={common:{subset:{mode:{type:"choice",values:["dim","partial","shrink"],default:"dim"},opacity:{type:"number",default:.2,min:0,max:1,step:.05},fade:{type:"number",default:.72,min:0,max:1,step:.01}}}},p.scopes={subset:{set:function(t){if(this._subset=t||null,this._inited)return this.parse(),this.bind(),this.resize(),this.render()},mode:function(){return(((this.cfg||{}).common||{}).subset||{}).mode||"dim"},ratio:function(t,e,n){return t&&t.subset?!(t=(n=null!=n?[(t[e]||[])[n],(t.subset[e]||[])[n]]:[t[e],t.subset[e]])[0])||(e=n[1]/t)<0?0:1<e?1:e:null},color:function(t,e){var n;return(n=i(t))?(n=.3*n[0]+.59*n[1]+.11*n[2],e=null!=e?e:(((this.cfg||{}).common||{}).subset||{}).fade,"rgb("+(n=Math.round(n+(255-n)*(null!=e?e:.72)))+","+n+","+n+")"):t}}},null!=g?g.exports=p:"undefined"!=typeof window&&null!==window&&(window.chart=p)}.call(this),g.exports);!function(){var A={re:/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i,prefixes:["y","z","a","f","p","n","µ","m"].concat([""],["k","M","G","T","P","E","Z","Y"]),locale:{decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"−",percent:"%",nan:"NaN"},parts:function(t,e){var n;return!isFinite(t)||0===t||(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]},rounded:function(t,e){var n;return(e=A.parts(t,e))?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""},prefixAuto:function(t,e){var n,i,r;return(i=A.parts(t,e))?(n=i[0],i=i[1],A._pe=3*Math.max(-8,Math.min(8,Math.floor(i/3))),(i=i-A._pe+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+A.parts(t,Math.max(0,e+i-1))[0]):(A._pe=void 0,t.toPrecision(e))},decimal:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},types:{"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return A.decimal(t)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return A.rounded(100*t,e)},r:function(t,e){return A.rounded(t,e)},s:function(t,e){return A.prefixAuto(t,e)},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},trim:function(t){for(var e,n,i=[-1,-1],r=i[0],o=i[1],s=1,u=t.length;s<u;++s)if("."===(n=t[e=s]))r=o=e;else if("0"===n)0===r&&(r=e),o=e;else{if(!+n)break;0<r&&(r=0)}return 0<r?t.slice(0,r)+t.slice(o+1):t},group:function(t,e){for(var n=A.locale,i=n.grouping,r=n.thousands,o=(n=[t.length,[],0,i[0],0])[0],s=n[1],u=n[2],a=n[3],l=n[4];0<o&&0<a&&(e<l+a+1&&(a=Math.max(1,e-l)),s.push(t.substring(o-=a,o+a)),!((l+=a+1)>e));)a=i[u=(u+1)%i.length];return s.reverse().join(r)},format:function(t){var e,h,c,f,d,n,p,m,y,_,g,v,i,b,x,w,k;if(e=A.re.exec(t))return h=A.locale,c=null!=e[1]?e[1]:" ",f=e[2]||">",d=e[3]||"-",n=e[4]||"",p=!!e[5],m=null!=e[6]?+e[6]:void 0,y=!!e[7],_=e[8]?+e[8].slice(1):void 0,g=!!e[9],"n"===(v=e[10]||"")?(y=(i=[!0,"g"])[0],v=i[1]):A.types[v]||(null==_&&(_=12),g=(i=[!0,"g"])[0],v=i[1]),(p||"0"===c&&"="===f)&&(p=(i=[!0,"0","="])[0],c=i[1],f=i[2]),b="$"===n?h.currency[0]:"#"===n&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===n?h.currency[1]:/[%p]/.test(v)?h.percent:"",w=A.types[v],k=/[defgprs%]/.test(v),_=null==_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),function(t){var e,n,i,r,o,s,u=[b,x],a=u[0],l=u[1];if("c"===v)l=w(t)+l,t="";else if(u=(t=+t)<0||1/t<0,t=isNaN(t)?h.nan:w(Math.abs(t),_),g&&(t=A.trim(t)),a=((u=u&&0==+t&&"+"!==d?!1:u)?"("===d?d:h.minus:"-"===d||"("===d?"":d)+a,l=("s"!==v||isNaN(t)||null==A._pe?"":A.prefixes[8+A._pe/3])+l+(u&&"("===d?")":""),k)for(e=0,n=t.length;e<n;++e)if(i=e,(r=t.charCodeAt(i))<48||57<r){l=(46===r?h.decimal+t.slice(i+1):t.slice(i))+l,t=t.slice(0,i);break}switch(y&&!p&&(t=A.group(t,1/0)),o=(u=a.length+t.length+l.length)<m?new Array(m-u+1).join(c):"",y&&p&&(t=A.group(o+t,o.length?m-l.length:1/0),o=""),f){case"<":return a+t+l+o;case"=":return a+o+t+l;case"^":return s=o.length>>1,o.slice(0,s)+a+t+l+o.slice(s);default:return o+a+t+l}};throw new Error("invalid format: "+t)}},e={d3:function(t){return("undefined"!=typeof d3&&null!==d3&&d3.format?d3:A).format(t)},from:function(t){try{return e.d3(t)}catch(t){return function(t){return t}}},auto:function(t){return null==t&&(t=[]),e.d3(".3s")},simple:function(t){return isNaN(t=+t)?t:1e9<=t?(t/1e9).toFixed(0)+"G":1e6<=t?(t/1e6).toFixed(0)+"M":1e3<=t?(t/1e3).toFixed(0)+"K":Math.floor(t)===t?t.toFixed(0):t.toFixed(2)}};e._d3f=A,null!=k&&((k.utils||(k.utils={})).format=e)}.call(this),function(){var a=Math.sqrt(50),l=Math.sqrt(10),h=Math.sqrt(2),f=function(t,e,n){var i,r,o,s=(e-t)/Math.max(0,n),u=Math.floor(Math.log10(s)),s=s/Math.pow(10,u),s=a<=s?10:l<=s?5:h<=s?2:1;return u<0?(i=Math.pow(10,-u)/s,(r=Math.round(t*i))/i<t&&r++,e<(o=Math.round(e*i))/i&&o--,i=-i):(i=Math.pow(10,u)*s,(r=Math.round(t/i))*i<t&&r++,e<(o=Math.round(e/i))*i&&o--),o<r&&.5<=n&&n<2?f(t,e,2*n):[r,o,i]},c=function(t,e,n){var i,r,o,s,u,a,l,h=[],c=[+t,+e,+n];if(!(0<(n=c[2])))return[];if((t=c[0])===(e=c[1]))return[t];if(r=(c=(i=e<t)?f(e,t,n):f(t,e,n))[0],s=c[2],!(r<=(o=c[1])))return[];for(u=o-r+1,a=0;a<u;++a)l=i?o-a:r+a,h.push(s<0?l/-s:l*s);return h},d=function(t){return t},p=function(e,n){var t=[+e,+n];return e=t[0],n=t[1],function(t){return e*(1-t)+n*t}},m=function(t,e){return"number"==typeof e?p(t,e):null!=k&&k.utils&&k.utils.anim?k.utils.anim.interpolate(t,e):function(){return e}},y=function(e,n){return(n-=e=+e)?function(t){return(t-e)/n}:isNaN(n)?function(){return NaN}:function(){return.5}},_=function(t,e,n,i){for(var r;n<i;)e<t[r=n+i>>>1]?i=r:n=1+r;return n},g=function(n,t,e){var i,r,o,s,u,a,l,h,c,f,d,p=Math.min(n.length,t.length)-1;if(p<=1)return s=(i=[n[0],n[1],t[0],t[1]])[2],u=i[3],i=(o=i[1])<(r=i[0])?[y(o,r),e(u,s)]:[y(r,o),e(s,u)],a=i[0],l=i[1],function(t){return l(a(t))};for(n[p]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse()),c=[],f=0;f<p;++f)l=f,c.push(y(n[l],n[l+1]));for(h=c,c=[],f=0;f<p;++f)l=f,c.push(e(t[l],t[l+1]));return d=c,function(t){var e=_(n,t,1,p)-1;return d[e](h[e](t))}},v=function(n,i){var t,r,o,s,e,u,a,l,h;return null==n&&(n=d),null==i&&(i=d),r=(t=[[0,1],[0,1],!1])[0],o=t[1],s=t[2],e=(t=[null,null])[0],u=t[1],a=function(t){var e,n,i;return s?((i=(e=[r[0],r[Math.min(r.length,o.length)-1]])[1])<(n=e[0])&&(n=(e=[i,n])[0],i=e[1]),Math.max(n,Math.min(i,t))):t},l=function(){return u=e=null,h},(h=function(t){if(null!=t&&!isNaN(t=+t))return(e=e||g(r.map(n),o,m))(n(a(t)))}).invert=function(t){return u=u||g(o,r.map(n),p),a(i(u(t)))},h.domain=function(t){return arguments.length?(r=Array.from(t,function(t){return+t}),l()):r.slice()},h.range=function(t){return arguments.length?(o=Array.from(t),l()):o.slice()},h.clamp=function(t){return arguments.length?(s=!!t,l()):s},h.ticks=function(t){return c(r[0],r[r.length-1],t=null==t?10:t)},h._transform=function(t,e){return n=t,i=e,l()},h._copy=function(t){return t.domain(r).range(o).clamp(s)},h.copy=function(){return h._copy(v(n,i))},h},i=function(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}},r=function(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)},o=function(t){return t<0?-t*t:t*t},s=function(){var t=v(),e=1,n=function(){return 1===e?t._transform(d,d):.5===e?t._transform(r,o):t._transform(i(e),i(1/e))};return t.exponent=function(t){return arguments.length?(e=+t,n()):e},t.copy=function(){return t._copy(s().exponent(e))},t},u=function(){var t=v(),e=1,n=function(){return t._transform(function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))},function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e})};return t.constant=function(t){return arguments.length?(e=+t,n()):e},t.copy=function(){return t._copy(u().constant(e))},n()},e=function(){var a,t=[[],new Map,[0,1],0,0,.5],l=t[0],o=t[1],h=t[2],c=t[3],f=t[4],d=t[5],p=(t=[0,0,[]])[0],m=t[1],y=t[2],s=function(){var t,e,n,i=l.length,r=h[0],o=h[1],s=o<r,r=s?[o,r]:[r,o],u=r[0],o=r[1];for(u+=(o-u-(p=(o-u)/Math.max(1,i-c+2*f))*(i-c))*d,m=p*(1-c),t=[],e=0;e<i;++e)n=e,t.push(u+p*n);return y=t,s&&y.reverse(),a};return(a=function(t){if(o.has(t))return y[o.get(t)]}).domain=function(t){var e,n,i,r;if(!arguments.length)return l.slice();for(e=[[],new Map],l=e[0],o=e[1],n=0,i=t.length;n<i;++n)r=t[n],o.has(r)||o.set(r,l.push(r)-1);return s()},a.range=function(t){return arguments.length?(h=Array.from(t,function(t){return+t}),s()):h.slice()},a.bandwidth=function(){return m},a.step=function(){return p},a.paddingInner=function(t){return arguments.length?(c=Math.min(1,t),s()):c},a.paddingOuter=function(t){return arguments.length?(f=t,s()):f},a.padding=function(t){return arguments.length?(c=Math.min(1,f=t),s()):c},a.align=function(t){return arguments.length?(d=Math.max(0,Math.min(1,t)),s()):d},a.copy=function(){return e().domain(l).range(h).paddingInner(c).paddingOuter(f).align(d)},s()},n=function(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return n(e())},t},t={linear:function(){return v()},pow:s,sqrt:function(){return s().exponent(.5)},symlog:u,band:e,point:function(){return n(e().paddingInner(1))},ticks:c};null!=k&&((k.utils||(k.utils={})).scale=t)}.call(this),function(){var P,q,e,i,r,n,o,s,t,u,b,a,B=Math.abs,H=Math.atan2,I=Math.cos,F=Math.sin,W=Math.sqrt,$=Math.min,p=Math.max,D=Math.PI,G=D/2,J=2*D,U=1e-12,c=J-1e-6,V=function(t){return 1<t?0:t<-1?D:Math.acos(t)},X=function(t){return 1<=t?G:t<=-1?-G:Math.asin(t)},x=function(t){return function(){return t}},w=function(t){return"function"==typeof t?t:x(+t)},Z=function(t){return this._x0=this._y0=this._x1=this._y1=null,this._="",this._k=null!=t&&Math.floor(t)<=15?Math.pow(10,Math.floor(t)):null,this};Z.prototype={_a:function(t){for(var e,n,i=[],r=1,o=arguments.length;r<o;++r)i.push(arguments[r]);return e=i,n=this._k,this._+=t+(null!=n?e.map(function(t){return Math.round(t*n)/n}):e).join(",")},moveTo:function(t,e){return this._x0=this._x1=+t,this._y0=this._y1=+e,this._a("M",this._x0,this._y0)},closePath:function(){if(null!==this._x1)return this._x1=this._x0,this._y1=this._y0,this._+="Z"},lineTo:function(t,e){return this._x1=+t,this._y1=+e,this._a("L",this._x1,this._y1)},bezierCurveTo:function(t,e,n,i,r,o){return this._x1=+r,this._y1=+o,this._a("C",+t,+e,+n,+i,this._x1,this._y1)},arc:function(t,e,n,i,r,o){var s,u,a,l,h=[+t,+e,+n,!!o];if(t=h[0],e=h[1],o=h[3],(n=h[2])<0)throw new Error("negative radius: "+n);if(u=t+(h=n*I(i)),a=e+(s=n*F(i)),l=o?0:1,o=o?i-r:r-i,null===this._x1?this._a("M",u,a):(1e-6<B(this._x1-u)||1e-6<B(this._y1-a))&&this._a("L",u,a),n)return c<(o=o<0?o%J+J:o)?(this._a("A",n,n,0,1,l,t-h,e-s),this._x1=u,this._y1=a,this._a("A",n,n,0,1,l,this._x1,this._y1)):1e-6<o?(this._x1=t+n*I(r),this._y1=e+n*F(r),this._a("A",n,n,0,D<=o?1:0,l,this._x1,this._y1)):void 0},toString:function(){return this._}},P=function(t,e,n,i,r,o,s,u){var n=[n-t,i-e,s-r,u-o],i=n[0],s=n[1],u=n[2],n=n[3],a=n*i-u*s;if(!(a*a<U))return[t+(a=(u*(e-o)-n*(t-r))/a)*i,e+a*s]},q=function(t,e,n,i,r,o,s){var u=t-n,a=e-i,s=(s?o:-o)/W(u*u+a*a),a=s*a,s=-s*u,u=t+a,t=e+s,e=n+a,n=i+s,i=(u+e)/2,l=(t+n)/2,h=e-u,c=n-t,f=h*h+c*c,o=r-o,u=u*n-e*t,n=(c<0?-1:1)*W(p(0,o*o*f-u*u)),e=(u*c-h*n)/f,t=(-u*h-c*n)/f,d=(u*c+h*n)/f,u=(-u*h+c*n)/f,h=e-i,c=t-l,n=d-i,f=u-l;return n*n+f*f<h*h+c*c&&(e=d,t=u),{cx:e,cy:t,x01:-a,y01:-s,x11:e*(r/o-1),y11:t*(r/o-1)}},a=function(){var z=function(t){return t.innerRadius},C=function(t){return t.outerRadius},E=x(0),O=null,j=function(t){return t.startAngle},R=function(t){return t.endAngle},T=function(t){return t&&t.padAngle},L=3,e=function(){var t,e,n,i,r,o,s,u,a,l,h,c,f,d,p,m,y,_,g,v,b=arguments,x=new Z(L),w=+z.apply(this,b),k=+C.apply(this,b),A=j.apply(this,b)-G,M=R.apply(this,b)-G,N=B(M-A),S=A<M;return k<w&&(w=(o=[k,w])[0],k=o[1]),U<k?J-U<N?(x.moveTo(k*I(A),k*F(A)),x.arc(0,0,k,A,M,!S),U<w&&(x.moveTo(w*I(M),w*F(M)),x.arc(0,0,w,M,A,S))):(t=(o=[A,M,A,M,N,N])[0],e=o[1],n=o[2],i=o[3],r=o[4],o=o[5],a=T.apply(this,b)/2,h=U<a&&(O?+O.apply(this,b):W(w*w+k*k)),u=s=b=$(B(k-w)/2,+E.apply(this,b)),U<h&&(l=X(h/w*F(a)),h=X(h/k*F(a)),(r-=2*l)>U?(n+=l*=S?1:-1,i-=l):(r=0,n=i=(A+M)/2),(o-=2*h)>U?(t+=h*=S?1:-1,e-=h):(o=0,t=e=(A+M)/2)),a=k*I(t),l=k*F(t),h=w*I(i),A=w*F(i),U<b&&(c=k*I(e),f=k*F(e),d=w*I(n),p=w*F(n),N<D)&&((M=P(a,l,d,p,c,f,h,A))?(N=a-M[0],_=l-M[1],m=c-M[0],y=f-M[1],N=1/F(V((N*m+_*y)/(W(N*N+_*_)*W(m*m+y*y)))/2),_=W(M[0]*M[0]+M[1]*M[1]),s=$(b,(w-_)/(N-1)),u=$(b,(k-_)/(1+N))):s=u=0),U<o?U<u?(g=q(d,p,a,l,k,u,S),v=q(c,f,h,A,k,u,S),x.moveTo(g.cx+g.x01,g.cy+g.y01),u<b?x.arc(g.cx,g.cy,u,H(g.y01,g.x01),H(v.y01,v.x01),!S):(x.arc(g.cx,g.cy,u,H(g.y01,g.x01),H(g.y11,g.x11),!S),x.arc(0,0,k,H(g.cy+g.y11,g.cx+g.x11),H(v.cy+v.y11,v.cx+v.x11),!S),x.arc(v.cx,v.cy,u,H(v.y11,v.x11),H(v.y01,v.x01),!S))):(x.moveTo(a,l),x.arc(0,0,k,t,e,!S)):x.moveTo(a,l),U<w&&U<r?U<s?(g=q(h,A,c,f,w,-s,S),v=q(a,l,d,p,w,-s,S),x.lineTo(g.cx+g.x01,g.cy+g.y01),s<b?x.arc(g.cx,g.cy,s,H(g.y01,g.x01),H(v.y01,v.x01),!S):(x.arc(g.cx,g.cy,s,H(g.y01,g.x01),H(g.y11,g.x11),!S),x.arc(0,0,w,H(g.cy+g.y11,g.cx+g.x11),H(v.cy+v.y11,v.cx+v.x11),S),x.arc(v.cx,v.cy,s,H(v.y11,v.x11),H(v.y01,v.x01),!S))):x.arc(0,0,w,i,n,S):x.lineTo(h,A)):x.moveTo(0,0),x.closePath(),x.toString()||null};return e.centroid=function(){var t=(+z.apply(this,arguments)+ +C.apply(this,arguments))/2,e=(+j.apply(this,arguments)+ +R.apply(this,arguments))/2-D/2;return[I(e)*t,F(e)*t]},e.innerRadius=function(t){return arguments.length?(z=w(t),e):z},e.outerRadius=function(t){return arguments.length?(C=w(t),e):C},e.cornerRadius=function(t){return arguments.length?(E=w(t),e):E},e.padRadius=function(t){return arguments.length?(O=null!=t?w(t):null,e):O},e.startAngle=function(t){return arguments.length?(j=w(t),e):j},e.endAngle=function(t){return arguments.length?(R=w(t),e):R},e.padAngle=function(t){return arguments.length?(T=w(t),e):T},e.digits=function(t){return arguments.length?(L=null!=t?Math.floor(t):null,e):L},e},(e=function(t){return this._context=t,this}).prototype={areaStart:function(){return this._line=0},areaEnd:function(){return this._line=NaN},lineStart:function(){return this._point=0},lineEnd:function(){return(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=[+t,+e];return t=n[0],e=n[1],0===this._point?(this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e)):(this._point=2,this._context.lineTo(t,e))}},i=function(t){return new e(t)},r=function(t,e,n){var i=t._k;return t._context.bezierCurveTo(t._x1+i*(t._x2-t._x0),t._y1+i*(t._y2-t._y0),t._x2+i*(t._x1-e),t._y2+i*(t._y1-n),t._x2,t._y2)},(n=function(t,e){return this._context=t,this._k=(1-e)/6,this}).prototype={areaStart:function(){return this._line=0},areaEnd:function(){return this._line=NaN},lineStart:function(){return this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){return 2===this._point?this._context.lineTo(this._x2,this._y2):3===this._point&&r(this,this._x1,this._y1),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=[+t,+e];return t=n[0],e=n[1],0===this._point?(this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e)):1===this._point?(this._point=2,this._x1=t,this._y1=e):(this._point=3,r(this,t,e)),n=[this._x1,this._x2,t],this._x0=n[0],this._x1=n[1],this._x2=n[2],n=[this._y1,this._y2,e],this._y0=n[0],this._y1=n[1],this._y2=n[2],n}},o=function(t,e,n){var i,r,o=[t._x1,t._y1,t._x2,t._y2],s=o[0],u=o[1],a=o[2],o=o[3];return U<t._l01_a&&(s=(s*(i=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a)-t._x0*t._l12_2a+t._x2*t._l01_2a)/(r=3*t._l01_a*(t._l01_a+t._l12_a)),u=(u*i-t._y0*t._l12_2a+t._y2*t._l01_2a)/r),U<t._l23_a&&(a=(a*(i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a)+t._x1*t._l23_2a-e*t._l12_2a)/(r=3*t._l23_a*(t._l23_a+t._l12_a)),o=(o*i+t._y1*t._l23_2a-n*t._l12_2a)/r),t._context.bezierCurveTo(s,u,a,o,t._x2,t._y2)},(s=function(t,e){return this._context=t,this._alpha=e,this}).prototype={areaStart:function(){return this._line=0},areaEnd:function(){return this._line=NaN},lineStart:function(){return this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){return 2===this._point?this._context.lineTo(this._x2,this._y2):3===this._point&&this.point(this._x2,this._y2),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n,i,r=[+t,+e];return t=r[0],e=r[1],this._point&&(n=this._x2-t,i=this._y2-e,this._l23_a=W(this._l23_2a=Math.pow(n*n+i*i,this._alpha))),0===this._point?(this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e)):1===this._point?this._point=2:(this._point=3,o(this,t,e)),r=[this._l12_a,this._l23_a],this._l01_a=r[0],this._l12_a=r[1],r=[this._l12_2a,this._l23_2a],this._l01_2a=r[0],this._l12_2a=r[1],r=[this._x1,this._x2,t],this._x0=r[0],this._x1=r[1],this._x2=r[2],r=[this._y1,this._y2,e],this._y0=r[0],this._y1=r[1],this._y2=r[2],r}},t=(u=function(e){var t=function(t){return e?new s(t,e):new n(t,0)};return t.alpha=function(t){return u(+t)},t})(.5),b=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)},a={arc:a,line:function(t,e){var l=x(!0),h=i,c=3,f="function"==typeof t?t:void 0===t?function(t){return t[0]}:x(t),d="function"==typeof e?e:void 0===e?function(t){return t[1]}:x(e),n=function(t){for(var e,n,i,r,o=(t=b(t)).length,s=!1,u=h(e=new Z(c)),a=0;a<=o;++a)i=!1,(n=a)<o&&(r=t[n],i=!!l(r,n,t)),!i===s&&((s=!s)?u.lineStart():u.lineEnd()),s&&u.point(+f(r,n,t),+d(r,n,t));return e.toString()||null};return n.x=function(t){return arguments.length?(f=w(t),n):f},n.y=function(t){return arguments.length?(d=w(t),n):d},n.defined=function(t){return arguments.length?(l="function"==typeof t?t:x(!!t),n):l},n.curve=function(t){return arguments.length?(h=t,n):h},n.digits=function(t){return arguments.length?(c=null!=t?Math.floor(t):null,n):c},n},area:function(d,p,m){var e,y=null,_=x(!0),g=i,v=3;return d="function"==typeof d?d:void 0===d?function(t){return t[0]}:x(+d),p="function"==typeof p?p:x(void 0===p?0:+p),m="function"==typeof m?m:void 0===m?function(t){return t[1]}:x(+m),(e=function(t){for(var e,n,i,r,o,s=(t=b(t)).length,u=!1,a=new Array(s),l=new Array(s),h=0,c=g(e=new Z(v)),f=0;f<=s;++f){if(i=!1,(n=f)<s&&(r=t[n],i=!!_(r,n,t)),!i===u)if(u=!u)h=n,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),o=n-1;h<=o;)c.point(a[o],l[o]),o--;c.lineEnd(),c.areaEnd()}u&&(a[n]=+d(r,n,t),l[n]=+p(r,n,t),c.point(y?+y(r,n,t):a[n],m?+m(r,n,t):l[n]))}return e.toString()||null}).x=function(t){return arguments.length?(d=w(t),y=null,e):d},e.x0=function(t){return arguments.length?(d=w(t),e):d},e.x1=function(t){return arguments.length?(y=null!=t?w(t):null,e):y},e.y=function(t){return arguments.length?(p=w(t),m=null,e):p},e.y0=function(t){return arguments.length?(p=w(t),e):p},e.y1=function(t){return arguments.length?(m=null!=t?w(t):null,e):m},e.defined=function(t){return arguments.length?(_="function"==typeof t?t:x(!!t),e):_},e.curve=function(t){return arguments.length?(g=t,e):g},e.digits=function(t){return arguments.length?(v=null!=t?Math.floor(t):null,e):v},e},curve:{linear:i,catmullRom:t},path:function(t){return new Z(t)}},null!=k&&((k.utils||(k.utils={})).shape=a)}.call(this),function(){var e=function(t){return Math.max(0,Math.min(255,Math.round(t)))},t={turbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+e(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))+", "+e(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))+", "+e(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))+")"},discrete:function(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}},quantize:function(t,e){for(var n,i=[],r=0;r<e;++r)n=r,i.push(t(n/(e-1)));return i}};null!=k&&((k.utils||(k.utils={})).color=t)}.call(this),function(){var e,c,l,r,o,s,f,d,p,m,t,n;e=function(){return("undefined"!=typeof performance&&null!==performance?performance:Date).now()},c={linear:function(t){return t},cubicInOut:function(t){return(t*=2)<=1?t*t*t/2:((t-=2)*t*t+2)/2},cubicOut:function(t){return--t*t*t+1},quadInOut:function(t){return(t*=2)<=1?t*t/2:(--t*(2-t)+1)/2}},l=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,r=function(t){var e,n;return"string"!=typeof t?null:(t=t.trim(),(e=/^#([0-9a-f]{3,4})$/i.exec(t))?[(n=e[1].split("").map(function(t){return parseInt(t+t,16)}))[0],n[1],n[2],null!=n[3]?n[3]/255:1]:(e=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t))?(n=[0,1,2].map(function(t){return parseInt(e[1].substr(2*t,2),16)})).concat([e[2]?parseInt(e[2],16)/255:1]):!(e=/^rgba?\(([^)]+)\)$/i.exec(t))||(n=e[1].split(/[\s,\/]+/).filter(function(t){return t}).map(function(t){return parseFloat(t)})).length<3||n.slice(0,3).some(function(t){return isNaN(t)})?null:[n[0],n[1],n[2],null==n[3]||isNaN(n[3])?1:n[3]])},o=function(s,u){return function(e){var t=[0,1,2,3].map(function(t){return s[t]+(u[t]-s[t])*e}),n=t[0],i=t[1],r=t[2],o=t[3];return n=(t=[n,i,r].map(function(t){return(t=0<(t=Math.round(t))?t:0)<255?t:255}))[0],i=t[1],r=t[2],1===(o=!isNaN(o)&&(t=0<o?o:0)<1?t:1)?"rgb("+n+", "+i+", "+r+")":"rgba("+n+", "+i+", "+r+", "+o+")"}},s=function(t,e){var n,i,r,o,s,u,a;for(e+="",n=(t+="").match(l)||[],i=[],l.lastIndex=o=r=0;s=l.exec(e);)s.index>r&&i.push(e.slice(r,s.index)),u=+s[0],a=null!=n[o]?+n[o]:null,i.push(null!=a&&a!==u?{a:a,b:u}:s[0]),r=l.lastIndex,o++;return r<e.length&&i.push(e.slice(r)),i.some(function(t){return"object"==typeof t})?function(e){return i.map(function(t){return"object"==typeof t?t.a+(t.b-t.a)*e:t}).join("")}:function(){return e}},f=function(e,n){var t,i;return"number"==typeof n?(e=parseFloat(e),isNaN(e)&&(e=0),function(t){return e+(n-e)*t}):null==e?function(){return n}:(t=r(n))?(i=r(e))?o(i,t):function(){return n}:s(e,n)},d=function(t,e){return e.startsWith("style:")?t.style.getPropertyValue(e.slice(6)):t.getAttribute(e)},p=function(t,e,n){return e.startsWith("style:")?t.style.setProperty(e.slice(6),n):t.setAttribute(e,n)},m=function(t,e){return e.startsWith("style:")?t.style.removeProperty(e.slice(6)):t.removeAttribute(e)},(t=function(t){var e=this;return this._manual=!!(t=null==t?{}:t).manual,this._now=0,this._offset=0,this._raf=null,this._list=new Map,this.evtHandler={},this._tick=function(t){if(e._raf=null,!e._manual)return e._apply(e.time()),e._list.size?e._kick():void 0},this}).prototype=((t,e)=>{var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t})(Object.create(Object.prototype),{on:function(t,n){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=i.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,i=(n=this.evtHandler[t]||[]).length;u<i;++u)r=n[u],o.push(r.apply(this,e));return o},time:function(){return this._manual?this._now:e()-this._offset},manual:function(t){return arguments.length?((t=!!t)!==this._manual&&(t?(this._now=this.time(),this._manual=!0,this._raf&&cancelAnimationFrame(this._raf),this._raf=null):(this._offset=e()-this._now,this._manual=!1,this._list.size&&this._kick())),this):this._manual},step:function(t){return null==t&&(t=1e3/60),this._manual||this.manual(!0),this._now+=t,this._apply(this._now),this.fire("step",this._now,t),this},seek:function(t){return this._manual||this.manual(!0),this._now=t,this._apply(this._now),this.fire("step",this._now,0),this},busy:function(){return 0<this._list.size},flush:function(){return this._apply(1/0),this},interrupt:function(t){return this._list.delete(t)},_kick:function(){var t=this;if(!this._manual&&!this._raf)return"undefined"==typeof requestAnimationFrame||null===requestAnimationFrame?setTimeout(function(){return t._tick()},16):this._raf=requestAnimationFrame(this._tick)},tween:function(t,e,n){var i,r,o,s,u,a,l,h;for(l in null==e&&(e={}),i=null!=(n=null==n?{}:n).duration?n.duration:350,r=n.delay||0,o="function"==typeof n.ease?n.ease:c[n.ease||"cubic-in-out"]||c.cubicInOut,s=i<=0&&r<=0||!this._manual&&"undefined"!=typeof document&&null!==document&&document.hidden,(u=this._list.get(t)||{attr:{},cb:[]}).remove=!!n.remove,n.end&&u.cb.push(n.end),a=this.time()+r,e)null==(h=e[l])?(m(t,l),delete u.attr[l]):s?(p(t,l,"function"==typeof h?h(1):h),delete u.attr[l]):l.startsWith("style:")&&!t.style.getPropertyValue(l.slice(6))&&window.getComputedStyle(t).getPropertyValue(l.slice(6))===h+""?delete u.attr[l]:u.attr[l]="function"==typeof h?{fn:h,start:a,dur:0<i?i:0,ease:o}:{to:h,start:a,dur:0<i?i:0,ease:o};return this._list.set(t,u),s&&!(()=>{var t=[];for(l in u.attr)t.push(l);return t})().length?this._done(t,u):this._manual||this._kick(),this},_done:function(e,t){return this._list.delete(e),t.remove&&e.parentNode&&e.parentNode.removeChild(e),t.cb.map(function(t){return t.call(e)})},_apply:function(t){for(var e,n,i,r,o,s,u,a,l=[],h=0,c=(e=Array.from(this._list)).length;h<c;++h)if(i=(n=e[h])[0],r=n[1],this._list.get(i)===r){for(o in n=r.attr)t<(s=n[o]).start||(s.fn?(u=s.dur&&(a=(t-s.start)/s.dur)<1?a:1,p(i,o,s.fn(1<=u?1:s.ease(u))),1<=u&&delete r.attr[o]):(s.interp||(s.interp=f(d(i,o),s.to)),1<=(u=s.dur&&(a=(t-s.start)/s.dur)<1?a:1)?(p(i,o,s.to),delete r.attr[o]):p(i,o,s.interp(s.ease(u)))));(()=>{var t=[];for(o in r.attr)t.push(o);return t})().length||l.push(this._done(i,r))}return l}}),n=function(t){var e,i,r,o,s,n,u,a,l,h=t.root,c=null!=(e=t.tag)?e:"g",f=t.cls,d=null!=(e=t.data)?e:[],p=t.key;for(p=p||function(t,e){return e},t=Array.from(h.childNodes).filter(function(t){return 1===t.nodeType&&t.tagName===c&&(!f||t.classList.contains(f))}),i=new Map,r=(e=[[],[],[],[]])[0],o=e[1],s=e[2],n=e[3],t.map(function(t,e){e=p(t.__data__,e);return i.has(e)?n.push(t):i.set(e,t)}),d.map(function(t,e){var n,e=p(t,e);return((n=i.get(e))?(i.delete(e),o):(n=document.createElementNS("http://www.w3.org/2000/svg",c),f&&n.setAttribute("class",f),n._entering=!0,r)).push(n),n.__data__=t,s.push(n)}),u=null,a=s.length-1;0<=a;--a)u=((l=s[a])._entering&&(delete l._entering,h.insertBefore(l,u)),l);return n=n.concat(Array.from(i.values())),{enter:r,update:o,exit:n,nodes:s}},t.ease=c,t.interpolate=f,t.join=n,null!=k&&((k.utils||(k.utils={})).anim=t)}.call(this),function(){var t;(t=function(t){return this.dir="y"===(t=null==t?{}:t).dir?"y":"x",this._extent=[[0,0],[1,1]],this._sel=null,this._g=null,this.evtHandler={},this}).prototype=((t,e)=>{var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t})(Object.create(Object.prototype),{on:function(t,n){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=i.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,i=(n=this.evtHandler[t]||[]).length;u<i;++u)r=n[u],o.push(r.apply(this,e));return o},extent:function(t){return arguments.length?(this._extent=t,this._render(),this):this._extent},selection:function(){return this._sel?this._sel.slice():null},attached:function(){return!!this._g},_span:function(){var t="x"===this.dir?0:1;return[this._extent[0][t],this._extent[1][t]]},_emit:function(t,e){return this.fire(t,{type:t,selection:this.selection(),sourceEvent:e||null,target:this})},move:function(t,e){var n=this;return this._sel=null!=t?[+t[0],+t[1]]:null,this._render(),["start","brush","end"].map(function(t){return n._emit(t,e)}),this},clear:function(t){return this.move(null,t)},attach:function(s){var e,t,n,i=this;return this._g!==s&&(this._g&&this.detach(),s.__brush&&s.__brush!==this&&s.__brush.detach(),((s.__brush=this)._g=s).setAttribute("fill","none"),s.setAttribute("pointer-events","all"),("undefined"!=typeof navigator&&null!==navigator&&navigator.maxTouchPoints||"ontouchstart"in s)&&(s.style.touchAction="none",s.style.setProperty("-webkit-tap-highlight-color","rgba(0,0,0,0)")),t="x"===this.dir?["w","e"]:["n","s"],n="x"===this.dir?"ew-resize":"ns-resize",this._n={overlay:(e=function(t,e,n){var i,r,o;for(r in null==n&&(n={}),(i=s.querySelector(":scope > rect."+t.split(" ").join("."))||s.appendChild(document.createElementNS("http://www.w3.org/2000/svg","rect"))).setAttribute("class",t),i.__data__={type:e},n)o=n[r],i.setAttribute(r,o);return i})("overlay","overlay",{"pointer-events":"all",cursor:"crosshair"}),selection:e("selection","selection",{cursor:"move",fill:"#777","fill-opacity":.3,stroke:"#fff","shape-rendering":"crispEdges"}),handle:t.map(function(t){return e("handle handle--"+t,t,{cursor:n})})},s.addEventListener("pointerdown",this._down=function(t){return i._start(t)})),this._render(),this},detach:function(){var t,e,n,i;if(this._g){for(this._g.removeEventListener("pointerdown",this._down),t=0,n=(e=[this._n.overlay,this._n.selection].concat(this._n.handle)).length;t<n;++t)(i=e[t]).parentNode&&i.parentNode.removeChild(i);return this._g.__brush===this&&(this._g.__brush=null),this._g=null}},_render:function(){var t,e,n,i,r,o,s,u,a,l,h,c,f,d,p=this;if(this._g){if(e=(i=(t=this._extent)[0])[0],d=i[1],n=(i=t[1])[0],i=i[1],(u=this._n.overlay).setAttribute("x",e),u.setAttribute("y",d),u.setAttribute("width",n-e),u.setAttribute("height",i-d),this._sel)return u=(t=this._sel)[0],a=t[1],t="x"===this.dir?[u,d,a,i]:[e,u,n,a],l=t[0],h=t[1],c=t[2],f=t[3],(d=this._n.selection).style.display="",d.setAttribute("x",l),d.setAttribute("y",h),d.setAttribute("width",c-l),d.setAttribute("height",f-h),this._n.handle.map(function(t,e){return t.style.display="","x"===p.dir?(t.setAttribute("x",(e?c:l)-3),t.setAttribute("y",h-3),t.setAttribute("width",6),t.setAttribute("height",f-h+6)):(t.setAttribute("x",l-3),t.setAttribute("y",(e?f:h)-3),t.setAttribute("width",c-l+6),t.setAttribute("height",6))});for(r=0,o=(t=[this._n.selection].concat(this._n.handle)).length;r<o;++r)(s=t[r]).style.display="none",["x","y","width","height"].map(m)}function m(t){return s.removeAttribute(t)}},_pos:function(t){var e=this._g.getScreenCTM();return e?(t=new DOMPoint(t.clientX,t.clientY).matrixTransform(e.inverse()),"x"===this.dir?t.x:t.y):0},_start:function(t){var e,n,o,s,u,a,l,h,i,r,c,f,d=this;if((null==t.button||0===t.button)&&(e=(t.target.__data__||{}).type))return t.stopImmediatePropagation(),t.preventDefault(),n=this._span(),o=n[0],s=n[1],u=function(t){return(t=o<t?t:o)<s?t:s},a=this._pos(t),l=this._sel?this._sel.slice():null,"new"===(h="selection"===e?"move":"w"!==e&&"n"!==e||!l?"e"!==e&&"s"!==e||!l?"new":"hi":"lo")&&(a=u(a)),i=!1,this._emit("start",t),r=function(t){var e,n,i,r=d._pos(t);return"move"===h?(e=(i=(e=r-a)>(i=o-l[0])?e:i)<(n=s-l[1])?i:n,d._sel=[l[0]+e,l[1]+e]):(i="new"===h?a:"lo"===h?l[1]:l[0],r=u(r),d._sel=[Math.min(i,r),Math.max(i,r)]),d._render(),d._emit("brush",t)},c=function(t){return i=!0,r(t)},f=function(t){var e;return window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),i||"move"===h||(d._sel=null),d._sel&&d._sel[0]===d._sel[1]&&(d._sel=null),d._render(),i&&(e=function(t){return t.stopImmediatePropagation(),t.preventDefault()},window.addEventListener("click",e,!0),setTimeout(function(){return window.removeEventListener("click",e,!0)},0)),d._emit("end",t)},window.addEventListener("pointermove",c),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)}}),null!=k&&((k.utils||(k.utils={})).brush=t)}.call(this),function(){var r;(r=function(t){return this.isUnique=null==(t=null==t?{}:t).unique||t.unique,this.map={},this.nmap=[],this.wm=new WeakMap,this.count=0,this._ext=t.extent||[0,1],this.set(t.palette)||t.colors,this.mode(t.mode),this}).default=["#e15c64","#f7b26a","#f3ed9d","#a4bd81","#a0d7d2","#8db1da","#daaedb"],r.prototype=((t,e)=>{var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t})(Object.create(Object.prototype),{set:function(t){var e,n=this,i=(t=null==t?[]:t).key||t.name;return null==e&&(e=null!=i&&this.key!==i),this.key=i,this.colors=Array.isArray(t)&&t.length?t:t.colors&&Array.isArray(t.colors)?t.colors:r.default,this.nmap=t.maps||[],this.tags=this.colors.map(function(t){return t.tag||[]}),this.colors=this.colors.map(function(t){return t.value||t}),1===this.colors.length&&this.colors.push(ldcolor.complement(this.colors[0])),this.colors=this.colors.map(function(t){return ldcolor.hsl(t)}),this.len=2<(i=this.colors.length)?i:2,e?this.reset():this.nmap.map(function(t,e){return(Array.isArray(t)?t:[t]).map(function(t){return n.get(t,0,e)})}),this.tags.map(function(t,e){return t.map(function(t){return n.get(t,0,e)})})},unique:function(t){return null!=t?this.isUnique=!!t:this.isUnique},reset:function(){var n=this;return this.map={},this.wm=new WeakMap,this.count=0,(this.nmap||[]).map(function(t,e){return(Array.isArray(t)?t:[t]).map(function(t){return n.get(t,0,e)})})},mode:function(t){return 0===arguments.length?this._m:this._m=t},extent:function(t){return 0===arguments.length?this._ext:(this._ext=t.map(function(t){return null!=t?t:0}),this._ext.sort(function(t,e){return t-e}))},get:function(t,e,n){switch(null==e&&(e=0),this._m){case 1:return this._vd(t,e);case 2:return this._vc(t,e);case 3:return this._vs(t,e);default:return this._d(t,e,n)}},_v:function(t,e){return 0<e?t=ldcolor.lighter(t,e):e<0&&(t=ldcolor.darker(t,-e)),ldcolor.web(t)},_d:function(t,e,n){var i,r,o,s,u,a,l,h;if(null==e&&(e=0),null!=n?(this.count<n&&(this.count=n+1),i=n%this.len,"object"==typeof t?this.wm.set(t,i):this.map[t]=i):("object"==typeof t?null==(i=this.wm.get(t))&&this.wm.set(t,i=this.count++):null==(i=this.map[t])&&(this.map[t]=i=this.count++),this.isUnique||(i%=this.len)),i>=this.len){for(n=i%(this.len-1),r=Math.floor(i/(this.len-1)),s=(o=[0,1])[0],u=o[1];0<r;)s=(o=[2*s,2*u])[0],u=o[1],r%2&&(s+=1),r>>=1;r=s/u,o=[this.colors[n],this.colors[1+n]],a=o[0],l=o[1],h={h:(o=["h","s","l"].map(function(t){return r*(l[t]-a[t])+a[t]}))[0],s:o[1],l:o[2]}}else h=this.colors[i];return this._v(h,e)},_vs:function(t,e){for(var n,i,r,o=this._ext||[0,1],s=-1,u=0,a=o.length-1;u<a;++u)if(!(t>=o[(n=u)+1])){s=n;break}return-1===s&&(s=o.length),this._v(this.colors[(i=0<s?s:0)<(r=this.colors.length-1)?i:r],e)},_vd:function(t,e){var n=this._ext||[0,1],i=(n=0<(t=(t-n[0])/(n[1]-n[0]||1))?t:0)<1?n:1;return this._v(this.colors[Math.floor((n=i*(this.len||1))<(t=this.len-1)?n:t)],e)},_vc:function(t,e){var n,i,r,o=this._ext||[0,1],t=((o=0<(t=(t-o[0])/(o[1]-o[0]||1))?t:0)<1?o:1)*(0<(o=this.len-1)?o:0),o=t==this.len-1?[0<(o=this.len-2)?o:0,0<(o=this.len-1)?o:0]:[Math.floor(t),Math.floor(t)+1],s=o[0];return o=[this.colors[s],this.colors[o[1]]],n=o[0],i=o[1],r=t-s,t=(o=["h","s","l"].map(function(t){return r*(i[t]-n[t])+n[t]}))[0],this._v({h:t,s:o[1],l:o[2]},e)},text:function(t,e){return null==e&&(e={}),t=ldcolor.hcl(this.get(t)),ldcolor.web(50<t.l?e.textDark||"#000":e.textLight||"#fff")}}),r.mode={ordinal:0,discrete:1,continuous:2,ranges:3},null!=k&&((k.utils||(k.utils={})).tint=r)}.call(this),function(){var t=function(t){var i,e,n,r,o,s,u,a,l,h,c,f,d,p,m,y,_,g,v,b,x,w,k,A=(t=null==t?{}:t).extent||[0,1],M=t.len||3,N=A=(A=A.map(function(t){return isNaN(t)?0:t}))[0]>A[1]?[A[1],A[0]]:A;if(null!=t.exp){if(i=[10,15,20,25,30,40,50,75,100],e=[],n=[],r=Math.pow(10,t.exp),null==t.pretty||t.pretty){for(A=[[A[0],"floor"],[A[1],"ceil"]].map(function(t){var e=t[0],n=t[1],t=i.map(function(t){return[t,Math.abs(e-Math[n](e/t)*t)]});return t.sort(function(t,e){return t[1]-e[1]}),t[0][0]*Math[n](e/t[0][0])}),o=A[1]-A[0],s=1;s<=M;++s){for(u=s,a=+(o*(Math.pow(u/M,r)-Math.pow((u-1)/M,r))).toFixed(2),l=Math.floor(Math.log(a)/Math.LN10),h=0,c=i.length;h<c&&!((f=i[h]*Math.pow(10,l-1).toFixed(2))>=a);++h);n.push(f)}for(o=n.reduce(function(t,e){return t+e},0),p=(A=[[(A=[A[0],(d=A[0]+o)>(m=A[1])?d:m])[0],"floor"],[A[1],"ceil"]].map(function(t){var e=t[0],n=t[1],t=i.map(function(t){return[t,Math.abs(e-Math[n](e/t)*t)]});return t.sort(function(t,e){return t[1]-e[1]}),t[0][0]*Math[n](e/t[0][0])}))[0],s=0;s<M&&(u=s,e.push(p),!((p+=n[u])>=N[1]));++s);e.push(p)}else o=A[1]-A[0],e=(()=>{for(var t=[],e=0,n=M;e<=n;++e)t.push(e);return t})().map(function(t){return o*Math.pow(t/M,r)+A[0]});e.sort(function(t,e){return t-e}),m=[e[0],e[M-1]]}else if(null==t.pretty||t.pretty){for(a=(A[1]-A[0])/(M+1),l=Math.floor(Math.log((A[1]-A[0]||1)/(M+1))/Math.LN10),s=0,c=(d=[10,20,25,50,100]).length;s<c&&(u=d[s],!((f=u*Math.pow(10,l-1))>a));++s);y=f*Math.floor(A[0]/f),m=[(e=(()=>{for(var t=[],e=0,n=M;e<=n;++e)t.push(e);return t})().map(function(t){return y+f*t}))[0],e[M]]}else m=[(e=(()=>{for(var t=[],e=0,n=M;e<n;++e)t.push(e);return t})().map(function(t){return A[0]+(A[1]-A[0])*t/(1<(t=M-1)?t:1)}))[0],e[M-1]];if(_=t.legend){if(g=_.format||function(t){return t},v=_.unit||"",_.range)for(b=[],s=0,x=e.length-1;s<x;++s)w=(d=[e[u=s],e[u+1]])[0],b.push({ext:[w,k=d[1]],key:(w+k)/2,text:_.text?_.text(w,k):g(w)+" - "+g(k)+v});else b=e.map(function(t){return{key:t,text:_.text?_.text(t):g(t)+""+v}});b.sort(function(t,e){return t.key<e.key?1:t.key>e.key?-1:0})}return{ticks:e,extent:m,labels:b}};null!=k&&((k.utils||(k.utils={})).tick=t)}.call(this),function(){var t;t={from:function(t){var a=this,l=function(t,e){var n,i;if(e.preset){var r,o=t,s=JSON.parse(JSON.stringify(a.preset[e.preset])),u={}.hasOwnProperty;for(r in s)u.call(s,r)&&(o[r]=s[r])}for(n in e)i=e[n],"preset"!==n&&("string"==typeof i?t[n]=JSON.parse(JSON.stringify(a.preset[i]))||{}:l(t[n]||(t[n]={}),i));return t};return l({},t)},preset:{default:{margin:{type:"number"},font:t={family:{type:"font"},size:{type:"quantity",default:"1em",units:[{name:"em",max:10,step:.01,default:1},{name:"px",max:256,step:1,default:16}]}},color:{type:"color",default:"currentColor"},palette:{type:"palette"},background:{type:"color",default:"transparent"}},font:t,tip:{enabled:{type:"boolean",default:!0},format:{type:"format",default:".3s"}},label:{format:{type:"format",default:".3s"}},legend:{selectable:{type:"boolean",default:!0},enabled:{type:"boolean",default:!0},position:{type:"choice",values:["bottom","right"],default:"right"},sort:{direction:{type:"choice",values:["asc","desc"],default:"desc"},mode:{type:"choice",values:["label","value","none"],default:"value"}},subset:{mode:{type:"choice",values:["shrink","dim","partial"],default:"shrink"},opacity:{type:"number",default:.2,min:0,max:1,step:.05}},crossfilter:{type:"boolean",default:!1}},axis:{enabled:{type:"boolean",default:!0},center:{type:"boolean",default:!1},tick:{inner:{type:"number",name:"Inner Tick Size",default:8,min:0,max:40,step:.1},color:{type:"color",default:"currentColor"},count:{type:"number",default:4,min:1,max:40},boundaryOffset:{type:"boolean",default:!0}},baseline:{show:{type:"boolean",default:!0},color:{type:"color",default:"currentColor"}},label:{color:{type:"color",default:"currentColor"},format:{type:"format",default:".3s"},direction:{type:"choice",default:"horizontal",values:["horizontal","vertical"]},gap:{type:"number",default:1.5,min:0,max:10,step:.1},strategy:{type:"choice",default:"stride",values:["stride","ends"]},tolerance:{type:"number",default:.2,min:0,max:1,step:.05},padding:{type:"number",default:1,min:0,max:100,step:.5},font:t},caption:{color:{type:"color",default:"currentColor"},text:{type:"text",default:""},show:{type:"boolean",default:!0},padding:{type:"number",default:1,min:0,max:100,step:.5},position:{type:"choice",default:4,values:[{name:"in / start",value:0},{name:"in / middle",value:1},{name:"in / end",value:2},{name:"out / start",value:3},{name:"out / middle",value:4},{name:"out / end",value:5}]},font:t},sideNoteStart:{show:{type:"boolean",default:!1},text:{type:"text",default:""},position:{type:"choice",default:0,values:[{name:"in",value:0},{name:"out",value:1}]},font:t,color:{type:"color",default:"currentColor"},padding:{type:"number",default:1,min:0,max:100,step:.5}},sideNoteEnd:{show:{type:"boolean",default:!1},text:{type:"text",default:""},position:{type:"choice",default:0,values:[{name:"in",value:0},{name:"out",value:1}]},font:t,color:{type:"color",default:"currentColor"},padding:{type:"number",default:1,min:0,max:100,step:.5}}}}},null!=k&&((k.utils||(k.utils={})).config=t)}.call(this),function(){var d={number:function(t){return(t=(t=null==t?{}:t).data.filter(function(t){return!(!t||""===(t+"").trim())})).filter(function(t){return!isNaN(parseFloat(t))}).length/t.length},serial:function(t){var e,n,i,r,o,s,u;for((e=[].concat((t=null==t?{}:t).data)).sort(function(t,e){return e-t}),n={},i=1,r=e.length;i<r;++i)o=i,isNaN(e[o])||isNaN(e[o-1])?n[e[o]>e[o-1]?e[o]+":"+e[o-1]:e[o-1]+":"+e[o]]=!0:s=e[o]-e[o-1],n[s]=!0;return 1/((()=>{var t=[];for(u in n)t.push(u);return t})().filter(function(t){return"0"!==t}).length||2)},text:function(t){return 1-this.number(t=null==t?{}:t)},category:function(t){var e;return null==t&&(t={}),e=(e=0<(e=1-(0<(e=Array.from(new Set(t.data)).length-2)?e:0)/(e=t.data.length)-1/e)?e:0)<1?e:1,this.number(t)&&(e*=.9),e},parse:function(t){var e,n;return Array.isArray(t)?(e=t.slice(0,1)[0],n=(n=t.slice(1)).map(function(n,t){var i={};return e.map(function(t,e){return i[t]=n[e]}),i}),{head:e,body:n}):t},autotype:function(t){var e,n,i,r,o,s,u,a,l=[];for(n in(t=null==t?[]:t)[0]||{})l.push(n);for(i=[],r=0,o=(e=l).length;r<o;++r)s=e[r],a=t.map(h),u={key:s,types:{R:d.number({data:a}),O:d.serial({data:a}),N:d.text({data:a}),C:d.category({data:a})}},(a=["R","O","N","C"].map(c)).sort(f),u.type=a[0][0],i.push(u);return i;function h(t){return t[s]}function c(t){return[t,u.types[t]]}function f(t,e){return e[1]-t[1]}},autobind:function(t,n){var e,i,r,o,s,u,a,l,h,c,f,d,p,m,y;for(null==n&&(n={}),e=this.autotype(t=null==t?[]:t),(i=(()=>{var t,e=[];for(r in t=n)o=t[r],e.push({k:r,v:o});return e})().filter(function(t){return!t.v.passive})).sort(function(t,e){var n=(t.v.priority||100)-(e.v.priority||100);return 0!=n?n:(n=[t.v.type||"R",e.v.type||"R"].map(function(i){return Math.min.apply(Math,(()=>{for(var t=[],e=0,n=i.length;e<n;++e)t.push(e);return t})().map(function(t){return"CONR".indexOf(i[t])}))}))[0]-n[1]}),s=0,u=i.length;s<u;++s)for((a=i[s]).bind=null,h=0,c=(l=a.v.type||"RNOC").length;h<c;++h)for(f=l[h],e.sort(_),d=0,p=e.length;d<p;++d)if(!((m=e[d]).types[f]<.5||m.used||"C"===f&&.5<m.types.R)){a.bind=a.v.multiple?[m]:m,m.used=!0;break}for(s=0,u=i.length;s<u;++s)if((a=i[s]).v.multiple)for(h=0,c=(l=a.v.type||"RNOC").length;h<c;++h)for(f=l[h],e.sort(g),d=0,p=e.length;d<p;++d)(m=e[d]).types[f]<.5||m.used||"C"===f&&.5<m.types.R||(a.bind.push(m),m.used=!0);for(y={},s=0,u=i.length;s<u;++s)(a=i[s]).bind&&(y[a.k]=a.bind,(Array.isArray(a.bind)?a.bind:[a.bind]).map(v));return y;function _(t,e){var n=(e.types[f]||0)-(t.types[f]||0);return e.types[f]===t.types[f]&&"R"===f?(t.types.O||0)-(e.types.O||0):n}function g(t,e){var n=(e[f]||0)-(t[f]||0);return e[f]===t[f]&&"R"===f?(t.O||0)-(e.O||0):n}function v(t){var e=t.used;return delete t.used,e}}};null!=k&&((k.utils||(k.utils={})).data=d)}.call(this),function(){var h,c;h="http://www.w3.org/2000/svg",(c=function(o){var t,e,n,i,r,s,u,a,l=this;if(null==o&&(o={}),this._data=o.data||[],this.name=o.name||"legend",this.cfg=o.cfg||{},this.root="string"==typeof o.root?document.querySelector(o.root):o.root,this.dir=o.direction||"vertical",this.evtHandler={},this._picked=Object.fromEntries(this._data.map(function(t){return[t.key,!0]})),this.layout=o.layout||new layout({root:this.root}),(e=this.layout).on("update",function(){return l.update()}),e.on("render",function(){return l.render()}),this.id=Math.random().toString(36).substring(2),e=this.layout.getNode(this.name),t=this.layout.getGroup(this.name),e.querySelector("[ld-each=legend]")||(e.innerHTML='<div class="pdlg '+this.dir+'">\n <div ld-each="legend">\n <div class="pdl-cell" ld="shape" data-only></div>\n <div class="pdl-cell" ld="text" data-only></div>\n </div>\n</div>'),t.querySelector("[ld-each=legend]")||(e=document.createElementNS(h,"g"),n=document.createElementNS(h,"g"),i=document.createElementNS(h,"g"),e.classList.add("pdlg-g"),e.setAttribute("ld-each","legend"),n.setAttribute("ld","shape"),i.setAttribute("ld","text"),e.appendChild(n),e.appendChild(i),t.appendChild(e)),this._i18n=o.i18n||("undefined"!=typeof block&&null!==block&&block.i18n&&block.i18n.module?block.i18n.module:null),this._t=o.t||null,this._i18n){if(r=this._i18n.addResourceBundle)for(s in u=c.i18n){a=u[s];try{r.call(this._i18n,s,c.i18nNs,a,!0,!1)}catch(t){}}this._i18n.on&&this._i18n.on("languageChanged",this._lngHandler=function(){return l._relocalize()})}return this._func=[{key:"all",type:"func",text:this._text("all")},{key:"none",type:"func",text:this._text("none")}],this.view={layout:new ldview({root:this.layout.getNode(this.name),initRender:!1,handler:{legend:{list:function(){var n,t=l._data.map(function(t){return t}),i=l.cfg.sort||{};return"none"!==i.mode&&(n="desc"===i.direction?1:-1,t.sort(function(t,e){return"value"===i.mode?n*(e.value-t.value):n*(t.text<e.text?1:t.text>e.text?-1:0)})),t.concat(l.cfg.selectable?l._func:[])},key:function(t){return t.key},view:{handler:{shape:function(t){return t.node.setAttribute("data-name",l._name(t.ctx,"shape"))},text:function(t){var e=t.node,t=t.ctx;return e.setAttribute("data-name",l._name(t,"text")),e.innerText=t.text}}}}}}),render:new ldview({root:this.layout.getGroup(this.name),initRender:!1,handler:{legend:{list:function(){return l._data.concat(l.cfg.selectable?l._func:[])},key:function(t){return t.key},view:{action:{click:{"@":function(t){t.node;var e,n=t.ctx;if(l.cfg.selectable){if("func"===n.type)for(e in l._picked)l._picked[e]="all"===n.key;else l._picked[n.key]=!l._picked[n.key];return l.view.render.render("legend"),l.fire("select",l._picked)}}}},handler:{"@":function(t){var e=t.node,t=t.ctx;return e.style.opacity=!l.cfg.selectable||"func"===t.type||l._picked[t.key]?1:.3},shape:function(t){var e,n,i,r=t.node,t=t.ctx;if("func"!==t.type)return r.querySelector("circle")||r.appendChild(document.createElementNS(h,"circle")),e=r.querySelector("circle"),n=l.layout.getBox(l._name(t,"shape")),i=l.layout.getBox(l.name),e.setAttribute("cx",".5em"),e.setAttribute("cy",".5em"),e.setAttribute("r",".5em"),e.setAttribute("transform","translate("+(n.x-i.x)+", "+(n.y-i.y)+")"),"function"==typeof o.shape?o.shape.call(e,t):void 0;r.style.display="none"},text:function(t){var e=t.node,t=t.ctx,n=l.layout.getNode(l._name(t,"text")),t=l.layout.getBox(l._name(t,"text")),i=l.layout.getBox(l.name);return e.setAttribute("transform","translate("+(t.x-i.x)+", "+(t.y-i.y)+")"),e.textContent="",t=wrapSvgText({node:n,useRange:!0}),e.appendChild(t)}}}}}})},this.update(),this}).i18nNs="@plotdb/chart.legend",c.i18n={en:{all:"Select All",none:"Select None"},"zh-TW":{all:"全選",none:"全不選"},"zh-CN":{all:"全选",none:"全不选"},ja:{all:"すべて選択",none:"すべて解除"}},c.prototype=((t,e)=>{var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t})(Object.create(Object.prototype),{_text:function(t){var e,n;return this._t&&(e=this._t("legend."+t))&&e!=="legend."+t||(n=c.i18nNs+":"+t,this._i18n&&this._i18n.t&&(e=this._i18n.t(n))&&e!==n&&e!==t)?e:(n=(n=this._i18n?this._i18n.language||this._i18n.lng:null)||("undefined"!=typeof document&&null!==document?document.documentElement.lang:"")||"en",(c.i18n[n]||c.i18n[n.split("-")[0]]||(/^zh/i.exec(n)?c.i18n[/cn|hans|sg/i.exec(n)?"zh-CN":"zh-TW"]:void 0)||c.i18n.en)[t])},_relocalize:function(){var e=this;if(this._func.map(function(t){return t.text=e._text(t.key)}),this.cfg.selectable)return this.view.layout.render("legend"),this.layout.update(!1),this.view.render.render()},destroy:function(){return this._i18n&&this._lngHandler&&this._i18n.off&&this._i18n.off("languageChanged",this._lngHandler),this._lngHandler=null},_name:function(t,e){return"pdlg-"+(e=null==e?"s":e)+"-"+this.id+"-"+(t.type||"")+"-"+t.key},enabled:function(){return this._data&&this._data.length&&(!(null!=this.cfg.enabled)||this.cfg.enabled)},update:function(){var t=this.enabled()?"":"0px",e=this.layout.getNode(this.name).style;return e.width=t,e.height=t,e.padding=t,e.margin=t,(e=this.layout.getNode(this.name).querySelector(".pdlg"))&&("vertical"===this.dir?(e.style.height="fit-content",e.style.height=getComputedStyle(e.parentNode).height):e.style.height=""),this.view.layout.render()},render:function(){var t=this.enabled();if(this.layout.getGroup(this.name).style.display=t?"":"none",t)return this.view.render.render()},config:function(t){var e,n=this;return null==t?this.cfg:(this.cfg.selectable!==t.selectable&&(this._picked=null,this._updatePicked()),this.cfg=t,this.dir="bottom"===this.cfg.position?"horizontal":"vertical",e=this.layout.getNode(this.name).querySelector(".pdlg"),["horizontal","vertical"].map(function(t){return e.classList.toggle(t,n.dir===t)}))},_updatePicked:function(){var e=this;return null==this._picked&&(this._picked=Object.fromEntries(this._data.map(function(t){return[t.key,!0]}))),this._data.map(function(t){if(null==e._picked[t.key])return e._picked[t.key]=!0})},data:function(t){var n;return arguments.length?(n={},t.map(function(t,e){return n[t.key]=e}),this._data=t.filter(function(t,e){return n[t.key]===e}),this._range=this._data.filter(function(t){return t.ext}),this._updatePicked(),this.update(),this.layout.update(!1),this.view.render.render()):this._data},on:function(t,n){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=i.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,i=(n=this.evtHandler[t]||[]).length;u<i;++u)r=n[u],o.push(r.apply(this,e));return o},isSelected:function(e){var n=this;return this._range&&this._range.length?!!this._range.filter(function(t){return e>=t.ext[0]&&e<t.ext[1]&&n._picked[t.key]}).length:!!this._picked[e]},mode:function(){return"shrink"===((this.cfg.subset||{}).mode||"shrink")?"shrink":"dim"},opacity:function(){var t;return null!=(t=(this.cfg.subset||{}).opacity)?t:.2},isVisible:function(t){return"shrink"!==this.mode()||this.isSelected(t)},select:function(t){var e;return null==t?this._picked=Object.fromEntries(this._data.map(function(t){return[t.key,!0]})):(e=Object.fromEntries(t.map(function(t){return[t,!0]})),this._picked=Object.fromEntries(this._data.map(function(t){return[t.key,!!e[t.key]]}))),this.view.render.render("legend"),this},selected:function(){var e=this,t=this._data.filter(function(t){return!!e._picked[t.key]}).map(function(t){return t.key});return t.length===this._data.length?null:t}}),null!=k&&((k.utils||(k.utils={})).legend=c)}.call(this),function(){var h,t;function c(t,e){var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t}h=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},(t=function(t){var i,e=this;return this.dir={bottom:0,left:2}[(t=null==t?{}:t).direction||"bottom"],this.name=t.name||"axis",this.layout=t.layout||new layout({root:this.root}),this._ticks=[],this._scale=t.scale||function(t){return t},this._format=k.utils.format.simple,this._config(t.cfg),this._map={},this._n=i={root:h("g"),layout:this.layout.getNode(this.name),render:this.layout.getGroup(this.name),wrap:null,domain:h("path")},i.render.appendChild(i.root),i.root.appendChild(i.domain),i.label=h("text"),i.label.textContent="",(t=i.label).setAttribute("dominant-baseline","hanging"),t.setAttribute("text-anchor","middle"),i.root.appendChild(i.label),i.sideNote=[0,1].map(function(t){var e,n=h("text");return n.textContent="",(e=n).setAttribute("dominant-baseline","hanging"),e.setAttribute("text-anchor",["start","end"][t]),i.root.appendChild(n)}),this.wrapper(),(t=this.layout).on("update",function(){return e.update()}),t.on("render",function(){return e.render()}),this}).prototype=c(Object.create(Object.prototype),{wrapper:function(){var t,e=this._n;return e.wrap&&e.wrap.parentNode&&e.wrap.parentNode.removeChild(e.wrap),e.wrap=document.createElement("div"),c(((t=e.wrap.style).visibility="hidden",t.position="absolute",t.top=0,t.left=0,t.pointerEvents="none",t.userSelect="none",t.zIndex=0,t.wordBreak="break-all",t.lineHeight=".95em",t),this.dir<2&&null!=this.cfg.textWidth?{whiteSpace:"wrap",width:(1<(t=this.cfg.textWidth)?t:1)+"em"}:{whiteSpace:"pre",width:"4em"}),e.layout.appendChild(e.wrap)},_config:function(e){var t,n=this;return null==e&&(e={}),this.cfg={tick:{inner:8},baseline:{},label:{padding:1,direction:"horizontal",gap:1.5,strategy:"stride",tolerance:.2},caption:{padding:1},enabled:e.enabled,sideNoteStart:{padding:1},sideNoteEnd:{padding:1}},["tick","baseline","label","caption","sideNoteStart","sideNoteEnd"].map(function(t){return c(n.cfg[t],e[t]||{})}),(t=this.cfg.label).font||(t.font={}),(t=this.cfg.caption).font||(t.font={}),(t=this.cfg.sideNoteStart).font||(t.font={}),(t=this.cfg.sideNoteEnd).font||(t.font={}),this.format(this.cfg.label.format)},config:function(t){return null==t?this.cfg:(this._config(t),this.wrapper())},format:function(t){return null==t?this._format:this._format="string"==typeof t?k.utils.format.from(t):t||k.utils.format.simple},scale:function(t){return null!=t?this._scale=t:this._scale},caption:function(t){return arguments.length&&(this._caption=t),!this.cfg.enabled||null!=this.cfg.caption.show&&!this.cfg.caption.show?this._n.label.textContent="":this._n.label.textContent=this.cfg.caption.text||this._caption||""},update:function(){},ticks:function(n){var t,e,i,r=this,o={},s=this._n.layout.getBoundingClientRect()[this.dir<2?"width":"height"],u=this.dir<2&&"vertical"===this.cfg.label.direction?12:25,s=Math.round(s/u),a=1<(t=Math.round(n.length/(1<s?s:1)))?t:1,l="ends"===this.cfg.label.strategy;for(e in this._ticks=n.filter(function(t,e){return!(e%a)||l&&e===n.length-1}).map(function(t){var e,n;return o[(t="object"!=typeof t?{v:t}:t).v]=c((e=r._map)[n=t.v]||(e[n]={}),t)}),t=this._map)i=t[e],o[e]||i.n.g.parentNode.removeChild(i.n.g);return this._map=o,this._ticks.filter(function(t){return!t.n}).map(function(t){if(t.n={g:h("g"),p:h("path"),t:h("g")},t.n.g.appendChild(t.n.p),t.n.g.appendChild(t.n.t),r._n.root.appendChild(t.n.g),isNaN(+t.v))return t.t=t.v})},render:function(){var i,t,r,e,n,o,s,u=this,a=this._n,l=this.dir<2,h=a.wrap;if(h.style.fontSize=this.cfg.label.font.size?this.cfg.label.font.size+""||"":void 0,h.setAttribute("class",(this.cfg.label.font.family||{}).className||""),i=this._ticks,null==this.cfg.enabled||this.cfg.enabled)return l?((t=a.layout.style).height="",t.paddingTop="",t.paddingBottom=""):((t=a.layout.style).width="",t.paddingLeft="",t.paddingRight=""),a.domain.style.display="",i.map(function(t){return t.n.g.style.display=""}),r=getComputedStyle(h).fontSize,e=a.layout.getBoundingClientRect(),(t=a.domain.style).strokeWidth=1,t.stroke="currentColor",t.fill="none",i.map(function(t,e){var n,e=e?e===i.length-1?2:1:0;return t._c=null!=t.c?t.c:u._scale(t.v)+(u._scale.bandwidth?u._scale.bandwidth()/2:0),t._t=null!=t.t?t.t:u._format(t.v),(n=t.n.p.style).strokeWidth=1,n.stroke="currentColor",n.fill="none",h.textContent=t._t,h.style.textAlign=l?["left","center","right"][e]:["right","left"][u.dir-2],t.n.tt=wrapSvgText({node:h}),t.n.t.style.fontSize=r,t.n.t.style.fill=u.cfg.label.color,t.n.t.textContent="",t.n.t.appendChild(t.n.tt),t.n.t.setAttribute("class",(u.cfg.label.font||{}).className||"")}),i.sort(function(t,e){return t._c-e._c}),a.domain.style.stroke=this.cfg.baseline.show?this.cfg.baseline.color:"none",n=(this.cfg.caption.position||0)%3,o=Math.floor((this.cfg.caption.position||0)/3),(s=a.label).setAttribute("text-anchor",["start","middle","end"][n]),s.setAttribute("dominant-baseline",["baseline","hanging"][o]),a.sideNote.map(function(t,e){e=(u.cfg[["sideNoteStart","sideNoteEnd"][e]]||{}).position||0;return t.setAttribute("dominant-baseline",["baseline","hanging"][e])}),l?(a.domain.setAttribute("d","M0 0L"+e.width+" 0Z"),a.label.setAttribute("x",e.width/2),a.label.setAttribute("x",[2,e.width/2,e.width-2][n])):(a.domain.setAttribute("d","M0 0L0 "+e.height+"Z"),s=[2,e.height/2,e.height-2][n],a.label.setAttribute("transform","translate(0,"+s+") rotate(90)")),i.map(function(t){return t.box=t.n.t.getBBox()}),this.adjust();l?((t=a.layout.style).height="0px",t.paddingTop="0",t.paddingBottom="0"):((t=a.layout.style).width="0px",t.paddingLeft="0",t.paddingRight="0"),a.domain.style.display="none",i.map(function(t){return t.n.g.style.display="none"})},adjust:function(){var o,t,e,r,s,n,i,u,a,l,h,c,f,d,p,m,y,_,g,v=this,b=this._ticks,x=this.dir<2,w=x&&"vertical"===this.cfg.label.direction,k=parseFloat(getComputedStyle(this._n.wrap).fontSize)||16;if(b.map(function(t,e){var e=e?e===b.length-1?2:1:0,n=t._c,i=t.box,r={x:-i.x,y:-i.y},o=!v._scale.bandwidth&&(null!=v.cfg.tick.boundaryOffset?!!v.cfg.tick.boundaryOffset:v.dir<2),o=!w&&o?e/2:.5;return w?(r.x-=i.width,r.y-=i.height*o):x?r.x-=i.width*o:r.y-=i.height*o,t.n.tt.setAttribute("transform","translate("+r.x+","+r.y+")"),t._size=w?i.height:i[x?"width":"height"],t._sizeAlt=w?i.width:i[x?"height":"width"],t._start=n-t._size*o,x?(t.n.g.setAttribute("transform","translate("+n+",0)"),t.n.p.setAttribute("d","M0 0L0 "+v.cfg.tick.inner),e=v.cfg.tick.inner+v.cfg.label.padding,t.n.t.setAttribute("transform","translate(0,"+e+")"+(w?" rotate(-90)":""))):(t.n.g.setAttribute("transform","translate(0,"+n+")"),t.n.p.setAttribute("d","M0 0L-"+v.cfg.tick.inner+" 0"),t.n.t.setAttribute("transform","translate("+(-v.cfg.tick.inner-t._sizeAlt-1-v.cfg.label.padding)+",0)")),t.n.p.style.stroke=v.cfg.tick.color||""}),o=k*(null!=this.cfg.label.gap?this.cfg.label.gap:1.5),t=function(t){for(var e,n=null,i=0,r=t.length;i<r;++i){if(e=t[i],e=b[e],null!=n&&e._start-(n._start+n._size)<o)return!1;n=e}return!0},e=[0],1<b.length)if("ends"!==this.cfg.label.strategy){for(r=1;r<b.length&&!t((()=>{var t,e,n,i=[];for(t=0,n=b.length,e=r;e<0?n<t:t<n;t+=e)s=t,i.push(s);return i})());)r++;for(n=[],i=0,u=b.length;r<0?u<i:i<u;i+=r)s=i,n.push(s);e=n}else for(a=null!=this.cfg.label.tolerance?this.cfg.label.tolerance:.2,k=[b[0]._c,b[b.length-1]._c],l=k[0],h=k[1],c=function(t){for(var e,n,i,r,o,s=[],u=0;u<=t;++u){for(e=l+(h-l)*u/t,n=0,i=1,r=b.length;i<r;++i)o=i,Math.abs(b[o]._c-e)<Math.abs(b[n]._c-e)&&(n=o);s[s.length-1]!==n&&s.push(n)}return s},f=function(t){var e,n,i,r;if(!(t.length<3)&&(e=(b[t[t.length-1]]._c-b[t[0]]._c)/(t.length-1)))for(n=0,i=t.length-1;n<i;++n)if(r=b[t[(r=n)+1]]._c-b[t[r]]._c,Math.abs(r-e)>e*a+.5)return!1;return!0},i=b.length-1;1<=i;--i)if(1<(d=c(i)).length&&f(d)&&t(d)){e=d;break}return p={},e.map(function(t){return p[t]=!0}),b.map(function(t,e){return t.n.t.style.opacity=p[e]?1:0}),k=b.filter(function(t,e){return p[e]}),this._n.label.style.fill=this.cfg.caption.color,this._n.label.style.fontSize=this.cfg.caption.font.size?this.cfg.caption.font.size+""||"":void 0,this._n.label.setAttribute("class",(this.cfg.caption.font.family||{}).className||""),this.caption(),this._n.sideNote.map(function(t,e){var e=v.cfg[["sideNoteStart","sideNoteEnd"][e]]||{},n=e.font||{};return t.textContent=e.show&&e.text||"",t.style.fill=e.color,t.style.fontSize=n.size?n.size+""||"":void 0,t.setAttribute("class",(n.family||{}).className||"")}),m=(this.cfg.caption.position||0)%3,y=Math.floor((this.cfg.caption.position||0)/3),k=Math.max.apply(Math,[0].concat(k.map(function(t){return t._sizeAlt}))),_=this.cfg.tick.inner+this.cfg.label.padding+this.cfg.caption.padding+k,this.dir<2?(this._n.label.setAttribute("y",[-2,_][y]),this._n.layout.style.height=_+this._n.label.getBoundingClientRect().height+"px",g=this._n.layout.getBoundingClientRect(),this._n.sideNote.map(function(t,e){var n=v.cfg[["sideNoteStart","sideNoteEnd"][e]]||{},i=n.position||0;return t.setAttribute("x",[2,g.width-2][e]),t.setAttribute("y",[-2-n.padding,_+n.padding][i])})):(this._n.label.setAttribute("x",0),this._n.label.setAttribute("y",0),this._n.layout.style.width=_+this._n.label.getBoundingClientRect().width+"px",k=[2,(g=this._n.layout.getBoundingClientRect()).height/2,g.height-2][m],this._n.label.setAttribute("transform","translate("+[2,-_-2][y]+","+k+") rotate(90)"),this._n.root.setAttribute("transform","translate("+(g.width-1)+",0)"),this._n.sideNote.map(function(t,e){var n=v.cfg[["sideNoteStart","sideNoteEnd"][e]]||{},i=n.position||0,e=[2,g.height-2][e];return t.setAttribute("transform","translate("+[2+n.padding,-_-2-n.padding][i]+","+e+") rotate(90)")}))}}),null!=k&&((k.utils||(k.utils={})).axis=t)}.call(this),function(){var t,e=function(t){var e,n=this;return this.root="string"==typeof(t=null==t?{}:t).root?document.querySelector(t.root):t.root,this.tip="string"==typeof t.node?this.root.querySelector(t.node):t.node,this.margin=null!=t.margin?t.margin:10,this.type="over"===t.type?"over":"move",this.accessor=t.accessor,this.range=t.range,this.zmgr=t.zmgr,this._z=0,this.enabled=!0,this.tip||(this.tip=document.createElement("div"),this.tip.innerHTML='<div ld="group" style="font-size:.75em"></div>\n<div ld="name" style="font-size:.85em"></div>\n<div ld="value" style="font-weight:bold;font-size:1.1em;line-height:1.2em"></div>\n<div ld="value-alt" style="font-size:0.9em;line-height:1em"></div>',this.root.appendChild(this.tip),(e=this.tip.style).padding=".4em .5em",e.background="#13171a",e.color="#fff",e.borderRadius="3px",e.boxShadow="0 2px 4px rgba(0,0,0,.3)",e.lineHeight="1.2em",e.fontSize=".9em",e.maxWidth="10em",e.wordBreak="break-all"),(e=this.tip.style).position="absolute",e.zIndex=1,e.top=0,e.left=0,e.pointerEvents="none",e.userSelect="none",e.opacity=0,e.transition="opacity .15s ease-in-out"+("over"===this.type?", transform .15s ease-in-out":""),this.view=new ldview({root:this.tip,text:t.view||{group:function(t){t=t.ctx;return t?t.group:""},name:function(t){t=t.ctx;return t?t.name:""},value:function(t){t=t.ctx;return t?t.value:""},"value-alt":function(t){t=t.ctx;return t?t.valueAlt:""}}}),this.hide=_(3e3,function(){if(this.tip.style.opacity=0,this.zmgr)return this.zmgr.remove(this._z)}),this._evthdr={},this.accessor&&(this.root.addEventListener("over"===this.type?"mouseover":"mousemove",this._evthdr.over=function(t){var e;if(t.target&&(e=n.accessor({evt:t})))return n.render({data:e,node:t.target,evt:t})}),this.root.addEventListener("mouseout",this._evthdr.out=function(){return n.hide().now()})),this};e.prototype=((t=Object.create(Object.prototype)).destroy=function(){if(this._evthdr.over&&this.root.removeEventListener("over"===this.type?"mouseover":"mousemove",this._evthdr.over),this._evthdr.out)return this.root.removeEventListener("mouseout",this._evthdr.out)},t.toggle=function(t){return null==t?this.enabled:this.enabled=t},t.render=function(t){var e,n,i,r,o,s,u;if(null==t&&(t={}),this.enabled)return this.view.ctx(t.data),this.view.render(),e=this.root.getBoundingClientRect(),i=null!=t.node?((i=t.node.getBoundingClientRect()).x=i.x-e.x,i.y=i.y-e.y,i):null!=t.box?t.box:{x:t.x,y:t.y,width:t.width,height:t.height},n=this.tip.getBoundingClientRect(),r=(t=[t.evt.clientX-e.x,t.evt.clientY-e.y])[0],u=t[1],s=this.margin,i=(t=[i.x+(null!=i.width?i.width/2:0),i.y+(null!=i.height?i.height/2:0)])[0],o=t[1],i=(t=[(t=[r-n.width/2,u-n.height/2])[0]+(i<r?1:-1)*(s+n.width/2),t[1]+(o<u?1:-1)*(s+n.height/2)])[0],r=t[1],i=(t=[((t=(i>(u=(o=this.range?this.range():e).x-e.x)?i:u)+n.width)<(s=o.width+o.x-e.x)?t:s)-n.width,((t=(r>(u=o.y-e.y)?r:u)+n.height)<(s=o.height+o.y-e.y)?t:s)-n.height])[0],r=t[1],(t=this.tip.style).transform="translate("+i+"px,"+r+"px)",t.opacity=1,t.zIndex=this._z=this.zmgr?this.zmgr.add(10):10,this.hide()},t),null!=k&&((k.utils||(k.utils={})).tip=e)}.call(this),k.utils.debounce=_,"undefined"!=typeof window&&null!==window&&(window.chart=k)}();
|
package/index.js
CHANGED
|
@@ -269,8 +269,9 @@
|
|
|
269
269
|
pause: function(){
|
|
270
270
|
return this.running = false;
|
|
271
271
|
},
|
|
272
|
-
render: function(){
|
|
273
|
-
|
|
272
|
+
render: function(dt){
|
|
273
|
+
dt == null && (dt = 0);
|
|
274
|
+
return this.fire('tick', this.time.now, dt);
|
|
274
275
|
},
|
|
275
276
|
run: function(fps){
|
|
276
277
|
var this$ = this;
|
|
@@ -297,18 +298,24 @@
|
|
|
297
298
|
return this._fps_delay = 1000 / this._fps_val;
|
|
298
299
|
},
|
|
299
300
|
handler: function(t, force){
|
|
300
|
-
var delay, ref$, this$ = this;
|
|
301
|
+
var delay, ref$, dt, this$ = this;
|
|
301
302
|
force == null && (force = false);
|
|
302
303
|
if (!this.running) {
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
306
|
+
if (this.external && this.external()) {
|
|
307
|
+
this.time.last = t;
|
|
308
|
+
return requestAnimationFrame(function(t){
|
|
309
|
+
return this$.handler(t, false);
|
|
310
|
+
});
|
|
311
|
+
}
|
|
305
312
|
this.time.now = t;
|
|
306
313
|
delay = this.isThrottled
|
|
307
314
|
? (ref$ = this._fps_delay) > 1000 ? ref$ : 1000
|
|
308
315
|
: this._fps_delay;
|
|
309
|
-
if (force || this.time.now - this.time.last >= delay) {
|
|
316
|
+
if (force || (dt = this.time.now - this.time.last) >= delay) {
|
|
310
317
|
this.time.last = t;
|
|
311
|
-
this.render();
|
|
318
|
+
this.render(force ? 0 : dt);
|
|
312
319
|
}
|
|
313
320
|
return requestAnimationFrame(function(t){
|
|
314
321
|
return this$.handler(t, false);
|
|
@@ -439,6 +446,9 @@
|
|
|
439
446
|
throw new Error("[@plotdb/chart] scope name `local` is already taken.");
|
|
440
447
|
}
|
|
441
448
|
this.local = bindScope(this, {}, this.mod.local);
|
|
449
|
+
if ((chart.utils || (chart.utils = {})).anim && !(this.anim != null)) {
|
|
450
|
+
this.anim = new chart.utils.anim();
|
|
451
|
+
}
|
|
442
452
|
this.init = proxise.once(function(){
|
|
443
453
|
return this$._init();
|
|
444
454
|
});
|
|
@@ -457,7 +467,7 @@
|
|
|
457
467
|
});
|
|
458
468
|
this.root.addEventListener('mouseover', this._hover = function(e){
|
|
459
469
|
var p;
|
|
460
|
-
if (!(p =
|
|
470
|
+
if (!(p = parent(e.target, '.data', this$.root))) {
|
|
461
471
|
return;
|
|
462
472
|
}
|
|
463
473
|
return this$.fire('hover', [{
|
|
@@ -497,9 +507,21 @@
|
|
|
497
507
|
}
|
|
498
508
|
this._aniloop = new aniloop();
|
|
499
509
|
visibilityObserver.add(this._aniloop);
|
|
500
|
-
this._aniloop.on('tick', function(){
|
|
501
|
-
return this$.tick();
|
|
510
|
+
this._aniloop.on('tick', function(t, dt){
|
|
511
|
+
return this$.tick(t, dt);
|
|
502
512
|
});
|
|
513
|
+
if (this.anim) {
|
|
514
|
+
this._aniloop.external = function(){
|
|
515
|
+
return this$.anim.manual();
|
|
516
|
+
};
|
|
517
|
+
this.anim.on('step', function(t, dt){
|
|
518
|
+
if (!this$._aniloop.isRunning()) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
this$._aniloop.setTime(t);
|
|
522
|
+
return this$._aniloop.render(dt);
|
|
523
|
+
});
|
|
524
|
+
}
|
|
503
525
|
return p = Promise.resolve().then(function(){
|
|
504
526
|
var defcfg, ret;
|
|
505
527
|
this$.mod.config = withDefault(this$.mod.config || {}, chart.commonConfig);
|
|
@@ -674,9 +696,9 @@
|
|
|
674
696
|
return this.mod.resize.apply(this);
|
|
675
697
|
}
|
|
676
698
|
},
|
|
677
|
-
tick: function(){
|
|
699
|
+
tick: function(t, dt){
|
|
678
700
|
if (this.mod.tick) {
|
|
679
|
-
return this.mod.tick.apply(this);
|
|
701
|
+
return this.mod.tick.apply(this, [t, dt]);
|
|
680
702
|
}
|
|
681
703
|
},
|
|
682
704
|
render: function(){
|
package/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var e,c,f,d,t,n,r,o,s,i,u,a,l,h,p;function m(t,e,f){function d(t,e){return n.call(t,e)}var p={}.toString,n={}.hasOwnProperty,m=!0;return function t(e,n,r){var i,o,s,u,a,l,h,c;if(null==e||null==n)return e===n;if(e.__placeholder__||n.__placeholder__)return!0;if(e===n)return 0!==e||1/e==1/n;i=p.call(e);if(p.call(n)!=i)return!1;switch(i){case"[object String]":return e==String(n);case"[object Number]":return e!=+e?n!=+n:0==e?1/e==1/n:e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object RegExp]":return e.source==n.source&&e.global==n.global&&e.multiline==n.multiline&&e.ignoreCase==n.ignoreCase}if("object"!=typeof e||"object"!=typeof n)return!1;o=r.length;for(;o--;)if(r[o]==e)return!0;r.push(e);s=0;u=!0;if("[object Array]"==i){if(a=e.length,l=n.length,m){switch(f){case"===":u=a===l;break;case"<==":u=a<=l;break;case"<<=":u=a<l}s=a,m=!1}else u=a===l,s=a;if(u)for(;s--&&(u=s in e==s in n&&t(e[s],n[s],r)););}else{if("constructor"in e!="constructor"in n||e.constructor!=n.constructor)return!1;for(h in e)if(d(e,h)&&(s++,!(u=d(n,h)&&t(e[h],n[h],r))))break;if(u){for(h in c=0,n)d(n,h)&&++c;u=m?"<<="===f?s<c:"<=="===f?s<=c:s===c:(m=!1,s===c)}}r.pop();return u}(t,e,[])}function y(t,e){var n,r={}.hasOwnProperty;for(n in e)r.call(e,n)&&(t[n]=e[n]);return t}e=new function(t){var n=new Intl.NumberFormat(t),t=n.formatToParts(12345.6),e=Array.from({length:10}).map(function(t,e){return n.format(e)}),r=new Map(e.map(function(t,e){return[t,e]}));return this._group=new RegExp("["+t.find(function(t){return m(t.type,"group","===")}).value+"]","g"),this._decimal=new RegExp("["+t.find(function(t){return m(t.type,"decimal","===")}).value+"]"),this._numeral=new RegExp("["+e.join("")+"]","g"),this._index=function(t){return r.get(t)},this}("en-US"),c=function(t){return(t=((t=null==t?"":t)+"").trim().replace(e._group,"").replace(e._decimal,".").replace(e._numeral,e._index))?+t:NaN},f=function(t){return"number"==typeof t?t:!t&&0!==t||isNaN(+t)?0:+t},d=function(t){return!(!/[RIT]/.exec((t=null==t?{}:t).type||"")||/[CN]/.exec(t.type||""))},t=function(e){var t,n,r,i,o,s=[];for(n in e=null==e?{}:e)s.push(n);for(t=s,r=0,o=(i=["name","order"]).length;r<o;++r)if(e[n=i[r]]&&!d(e[n]))return n;return t.filter(function(t){return!d(e[t])})[0]},n=function(){var a,l,h,u=this,c=(this.mod||{}).dimension||{};if(this._subset)return a=t(c),l=this._subset.map(function(e){var t,n,r,i,o={};for(t in n=c)r=n[t],(i=u.binding[t])&&(o[t]=r.multiple?(i.map?i:[i]).map(s):e[i.key],d(r))&&(o[t]=Array.isArray(o[t])?o[t].map(f):f(o[t]));return o;function s(t){return e[t.key]}}),h={},a&&l.map(function(t){return h[t[a]+""]=t}),this.data.map(function(t,e){var n,r,i,o=a?h[t[a]+""]:l[e],s={};for(n in r=c)i=r[n],d(i)&&(s[n]=i.multiple?(t[n]||[]).map(u):o?f(o[n]):0);return t.subset=s;function u(t,e){return o?f((o[n]||[])[e]):0}}),"shrink"===(((this.cfg||{}).common||{}).subset||{}).mode?this.data.map(function(t){var e,n,r,i=[];for(e in n=c)r=n[e],d(r)&&i.push(t[e]=t.subset[e]);return i}):void 0;this.data.map(function(t){var e=t.subset;return delete t.subset,e})},r=function(t){var e,n;if("string"!=typeof t)return null;if(t=t.trim(),e=/^#([0-9a-f]{3})$/i.exec(t)){for(var r,i=[],o=0,s=(r=e[1].split("")).length;o<s;++o)n=r[o],i.push(parseInt(n+n,16));return i}return(e=/^#([0-9a-f]{6})$/i.exec(t))?[0,1,2].map(function(t){return parseInt(e[1].substr(2*t,2),16)}):(e=/^rgba?\(([^)]+)\)$/i.exec(t))&&3===(t=e[1].split(",").slice(0,3).map(function(t){return parseFloat(t.trim())})).length&&t.every(function(t){return!isNaN(t)})?t:null},o=function(t,e,n){var r,i,o,s;for(i in null==n&&(n={}),r={},o=y(y({},e=null==e?{}:e),n||{}))s=o[i],r[i]="function"==typeof s?s.bind(t):s;return r},s=function(t,e,n){for(var r=t;t&&t!==n;)t=t.parentNode;if(t!==n)return null;if(!e)return t;for(t=r;t&&t!==n&&(!t.matches||(t.matches,!t.matches(e)));)t=t.parentNode;return t!==n||n.matches&&n.matches(e)?t:null},(i=function(){return this.running=!1,this.time={now:0,last:0},this.fps(60),this.evtHandler={},this}).prototype=y(Object.create(Object.prototype),{on:function(t,n){var r=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=r.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,r,i,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,r=(n=this.evtHandler[t]||[]).length;u<r;++u)i=n[u],o.push(i.apply(this,e));return o},reset:function(){return this.time={now:0}},setTime:function(t){return this.time.now=t},getTime:function(){return this.time.now},isRunning:function(){return this.running},toggle:function(t){return null!=t&&(this.running=!t),this.running?this.pause():this.run()},pause:function(){return this.running=!1},render:function(){return this.fire("tick",this.time.now)},run:function(t){var e=this;if(null!=t&&this.fps(t),!this.running)return this.running=!0,requestAnimationFrame(function(t){return e.handler(e.time.last=t,!0)})},throttle:function(t){return this.isThrottled=t=null==t?!0:t},fps:function(t){return null==t?this._fps_val:(this._fps_val=.01<t?t:.01,this._fps_delay=1e3/this._fps_val)},handler:function(t,e){var n,r=this;if(null==e&&(e=!1),this.running)return this.time.now=t,n=this.isThrottled?1e3<(n=this._fps_delay)?n:1e3:this._fps_delay,(e||this.time.now-this.time.last>=n)&&(this.time.last=t,this.render()),requestAnimationFrame(function(t){return r.handler(t,!1)})}}),u={list:[],init:function(){var t,n,r=this;return this.inited=!0,t=null==document.hidden&&null==document.msHidden&&null!=document.webkiHidden?["webkitHidden","webkitvisibilitychange"]:["hidden","visibilitychange"],n=t[0],document.addEventListener(t[1],debounce(150,function(){var e=!!document[n];return r.list.map(function(t){return t.throttle(e)})},!1))},add:function(t){return this.inited||this.init(),this.list.push(t)}},a={wm:new WeakMap,ro:new ResizeObserver(function(t){return t.map(function(t){return a.wm.get(t.target)._resize()})}),add:function(t,e){return this.wm.set(t,e),this.ro.observe(t)},delete:function(t){return this.ro.unobserve(t),this.wm.delete(t)}},l=function(t,e,n){return null==e&&(e={}),null==n&&(n={}),function(t,e,n){var r,i;for(r in e)i=e[r],null==t[r]?t[r]=i:"object"!=typeof t[r]||"object"!=typeof i||n[r]&&n[r].type||l(t[r],e[r],n[r]);return t}(t=null==t?{}:t,e=JSON.parse(JSON.stringify(e)),n)},h=function(t){var i=function(t,e){var n,r;for(n in null==e&&(e={}),t.child,t)(r=t[n]).type?r.default&&(e[n]=r.default):i(r,e[n]||(e[n]={}));return e};return i(t)},(p=function(t){var e,n,r,i=this;for(e in this.root="string"==typeof(t=null==t?{}:t).root?document.querySelector(t.root):t.root,this.useSample=null==t.useSample||t.useSample,this.autoSelect=null==t.autoSelect||t.autoSelect,this.forceInit=t.forceInit||!1,this.prepareSvg=null==t.prepareSvg||t.prepareSvg,this.layoutOpt=null==t.layout||t.layout,this.delayRender=t.delayRender||!1,this.dataAccessor=null!=t.dataAccessor?t.dataAccessor:function(t){return t?t.data._raw:null},this.data=[],this.raw=t.raw||null,this.mod=t.mod||{},this.cfg=t.config||{},this.seed=t.seed||Math.random(),this.binding=t.binding||{},this._normalizeBinding(),this.evtHandler={},this._subset=t.subset||null,n=p.scopes){if(r=n[e],null!=this[e])throw new Error("[@plotdb/chart] scope name `"+e+"` is already taken.");this[e]=o(this,r,this.mod[e])}if(null!=this.local)throw new Error("[@plotdb/chart] scope name `local` is already taken.");return this.local=o(this,{},this.mod.local),this.init=proxise.once(function(){return i._init()}),this._resize=null,this._inited=!1,this.autoSelect&&(this.root.addEventListener("click",this._select=function(t){if(t=s(t.target,".data",i.root))return i.fire("select",[{data:i.dataAccessor(t),node:t}])}),this.root.addEventListener("mouseover",this._hover=function(t){if(t=ld$.parent(t.target,".data",i.root))return i.fire("hover",[{data:i.dataAccessor(t),node:t}])})),this}).prototype=y(Object.create(Object.prototype),{_init:function(){var n,t,e,r=this;return"static"===window.getComputedStyle(this.root).position&&(this.root.style.position="relative"),n=this.layoutOpt?"object"!=typeof this.layoutOpt?this.root.querySelector(".pdl-layout"):"string"==typeof this.layoutOpt.root?this.root.querySelector(this.layoutOpt.root):this.layoutOpt.root||null:null,this.prepareSvg&&!(this.svg=this.root.querySelector("svg"))&&(this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),(t=this.svg.style).width="100%",t.height="100%",!this.layoutOpt||(n||console.error("[@plotdb/chart] layout enabled yet layout root isn't configured properly. "),e=n.querySelector("[data-type=render]"))||console.warn("[@plotdb/chart] prepareSvg and layout is configured at the same time,\nyet render container for layout is not found. svg is thus appended in the root."),(e||this.root).appendChild(this.svg)),this._aniloop=new i,u.add(this._aniloop),this._aniloop.on("tick",function(){return r.tick()}),Promise.resolve().then(function(){var t;return r.mod.config=l(r.mod.config||{},p.commonConfig),r._defcfg=t=h(r.mod.config),l(r.cfg,t),r.raw&&Array.isArray(r.raw)?{raw:r.raw,binding:r.binding}:r.useSample&&r.mod.sample?(t=r.mod.sample.apply(r)).then?t.then():Promise.resolve(t):void 0}).then(function(t){return r.raw=(t=t||{}).raw,r.binding=t.binding,r}).then(function(){var t,e;return r.raw||(r.raw=[]),r.layoutOpt&&("undefined"==typeof layout||null===layout?console.warn("[@plotdb/chart] layout-opt is set yet @plotdb/layout is not found."):(n||(console.error("[@plotdb/chart] cannot determine root node for @plotdb/layout."),console.error("[@plotdb/chart] config layout properly or disable layout by setting layout to false")),r.layout=new layout("object"==typeof r.layoutOpt?((e=y({},r.layoutOpt)).watchResize=!1,e):{root:n,watchResize:!1}))),t=proxise(function(){return a.add(r.root,r),null}),r._resize=function(){return t.resolve()},e=t(),(r.forceInit||!r.root.offsetParent||"none"===window.getComputedStyle(r.root).display||r.root.offsetWidth&&r.root.offsetHeight)&&t.resolve(),e}).then(function(){return r._resize=function(){}}).then(function(){var t,e=function(){if(r.mod.init)return r.mod.init.apply(r)};return(r.layout?(t=proxise(function(){return Promise.resolve(r.layout.init(e)),null}),r._layout=function(){return t.resolve()},r.layout.on("render",function(){return r._layout()}),t):e)()}).then(function(){r._layout=function(){},Promise.resolve().then(function(){if(r.delayRender&&!r._pendingRaw)return r.renderLock=proxise(function(){}),r.renderLock()}).then(function(){return r._inited=!0,r._resize=function(){return r.resize(),r.render()},r._layout=function(){return r.parse(),r.bind(),r.resize(),r.render()},r.parse(),r.bind(),r.resize(),r.render()})})},parse:function(){var t,l=(t=this.mod).dimension||(t.dimension={}),h=this.binding;if(this.data=this.raw.map(function(e,t){var n,r,i,o,s={};for(n in r=l)i=r[n],(o=h[n])?(s[n]=i.multiple?(o.map?o:[o]).map(u):e[o.key],/[RIT]/.exec(i.type)&&!/[CN]/.exec(i.type)&&(s[n]=Array.isArray(s[n])?s[n].map(a):c(s[n]))):i.multiple&&(s[n]=[]);return s._raw=e,s._idx=t,s;function u(t){return e[t.key]}function a(t){return c(t)}}),n.apply(this),this.mod.parse)return this.mod.parse.apply(this)},bind:function(){if(this.mod.bind)return this.mod.bind.apply(this)},start:function(){if(this._aniloop.run(),this.mod.start)return this.mod.start.apply(this)},stop:function(){if(this._aniloop.pause(),this.mod.stop)return this.mod.stop.apply(this)},resize:function(){if(this._inited)return this.layout&&this.layout.update(!1),this.box=this.root.getBoundingClientRect(),this.mod.resize?this.mod.resize.apply(this):void 0},tick:function(){if(this.mod.tick)return this.mod.tick.apply(this)},render:function(){return this._inited&&this.mod.render?this.mod.render.apply(this):void 0},destroy:function(){var t=this;return Promise.resolve().then(function(){if(t._select&&t.root.removeEventListener("click",t._select),t._hover&&t.root.removeEventListener("mouseover",t._hover),a.delete(t.root),t.layout&&t.layout.destroy(),t.stop(),t.mod.destroy)return t.mod.destroy.apply(t)})},config:function(){var t,e,n;if(!arguments.length)return this.cfg;for(t={},e=0,n=arguments.length;e<n;++e)l(t,arguments[e],this.mod.config);return l(t,this.cfg,this.mod.config),l(t,this._defcfg,this.mod.config),y(this.cfg,t)},_normalizeBinding:function(t){var e,n,r,i,o,s,u,a=[];if(null==t){for(t in e=[],this.mod.dimension||{})e.push(t);t=e}for(n=0,r=(t=Array.isArray(t)?t:[t]).length;n<r;++n)i=t[n],o=(this.mod.dimension||{})[i]||{},s=this.binding[i],u=Array.isArray(s),!o.multiple!=!u&&(o.multiple||u)&&a.push(this.binding[i]=u?s[0]:s?[s]:[]);return a},setBind:function(t,e){if(this.binding[t]=e,this._normalizeBinding([t]),this._inited)return this.parse(),this.bind(),this.resize(),this.render()},setRaw:function(t,e,n){var r;return null==n&&(n=!1),Array.isArray(t)||(t&&"subset"in t&&(this._subset=t.subset||null),t=(r=t).raw,e=r.binding,n=r.reinit),null!=t&&(this.raw=t),null!=e&&(this.binding=e,this._normalizeBinding()),this.renderLock?(this.renderLock.resolve(),this.renderLock=null):this._inited?(n&&this.mod.init&&this.mod.init.apply(this),this.parse(),this.bind(),this.resize(),this.render()):this._pendingRaw=!0},on:function(t,n){var r=this;return(Array.isArray(t)?t:[t]).map(function(t){var e;return((e=r.evtHandler)[t]||(e[t]=[])).push(n)})},fire:function(t){for(var e,n,r,i,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(e=s,u=0,r=(n=this.evtHandler[t]||[]).length;u<r;++u)i=n[u],o.push(i.apply(this,e));return o},filter:function(t,e){var n,r,i,o,s;for(r in null==t&&(t={}),null==e&&(e=!1),n=[],i=this.binding)o=i[r],s=(s=Array.isArray(o)?o:[o]).map(u),n=n.concat(s);for(r in t)o=t[r],n.filter(a).map(l);return e&&this.fire("filter",t),this.mod.filter&&this.mod.filter.apply(this,[t,e]),this.parse(),this.bind(),this.resize(),this.render();function u(t){return{k:r,v:t}}function a(t){return t.k===r}function l(t){return t.v.filter=o}},sample:function(){return this.mod.sample?this.mod.sample.apply(this):{raw:[],binding:{}}},filterDims:function(){var t;return(t=(this.mod||{}).filterDims)?t.call(this):(this.mod||{}).filter?["name"]:[]},canFilter:function(){return!!this.filterDims().length}}),p.commonConfig={common:{subset:{mode:{type:"choice",values:["dim","partial","shrink"],default:"dim"},opacity:{type:"number",default:.2,min:0,max:1,step:.05},fade:{type:"number",default:.72,min:0,max:1,step:.01}}}},p.scopes={subset:{set:function(t){if(this._subset=t||null,this._inited)return this.parse(),this.bind(),this.resize(),this.render()},mode:function(){return(((this.cfg||{}).common||{}).subset||{}).mode||"dim"},ratio:function(t,e,n){return t&&t.subset?!(t=(n=null!=n?[(t[e]||[])[n],(t.subset[e]||[])[n]]:[t[e],t.subset[e]])[0])||(e=n[1]/t)<0?0:1<e?1:e:null},color:function(t,e){var n;return(n=r(t))?(n=.3*n[0]+.59*n[1]+.11*n[2],e=null!=e?e:(((this.cfg||{}).common||{}).subset||{}).fade,"rgb("+(n=Math.round(n+(255-n)*(null!=e?e:.72)))+","+n+","+n+")"):t}}},"undefined"!=typeof module&&null!==module?module.exports=p:"undefined"!=typeof window&&null!==window&&(window.chart=p)}.call(this);
|
|
1
|
+
!function(){var n,c,f,d,t,e,i,o,s,r,u,a,l,h,p;function m(t,n,f){function d(t,n){return e.call(t,n)}var p={}.toString,e={}.hasOwnProperty,m=!0;return function t(n,e,i){var r,o,s,u,a,l,h,c;if(null==n||null==e)return n===e;if(n.__placeholder__||e.__placeholder__)return!0;if(n===e)return 0!==n||1/n==1/e;r=p.call(n);if(p.call(e)!=r)return!1;switch(r){case"[object String]":return n==String(e);case"[object Number]":return n!=+n?e!=+e:0==n?1/n==1/e:n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object RegExp]":return n.source==e.source&&n.global==e.global&&n.multiline==e.multiline&&n.ignoreCase==e.ignoreCase}if("object"!=typeof n||"object"!=typeof e)return!1;o=i.length;for(;o--;)if(i[o]==n)return!0;i.push(n);s=0;u=!0;if("[object Array]"==r){if(a=n.length,l=e.length,m){switch(f){case"===":u=a===l;break;case"<==":u=a<=l;break;case"<<=":u=a<l}s=a,m=!1}else u=a===l,s=a;if(u)for(;s--&&(u=s in n==s in e&&t(n[s],e[s],i)););}else{if("constructor"in n!="constructor"in e||n.constructor!=e.constructor)return!1;for(h in n)if(d(n,h)&&(s++,!(u=d(e,h)&&t(n[h],e[h],i))))break;if(u){for(h in c=0,e)d(e,h)&&++c;u=m?"<<="===f?s<c:"<=="===f?s<=c:s===c:(m=!1,s===c)}}i.pop();return u}(t,n,[])}function y(t,n){var e,i={}.hasOwnProperty;for(e in n)i.call(n,e)&&(t[e]=n[e]);return t}n=new function(t){var e=new Intl.NumberFormat(t),t=e.formatToParts(12345.6),n=Array.from({length:10}).map(function(t,n){return e.format(n)}),i=new Map(n.map(function(t,n){return[t,n]}));return this._group=new RegExp("["+t.find(function(t){return m(t.type,"group","===")}).value+"]","g"),this._decimal=new RegExp("["+t.find(function(t){return m(t.type,"decimal","===")}).value+"]"),this._numeral=new RegExp("["+n.join("")+"]","g"),this._index=function(t){return i.get(t)},this}("en-US"),c=function(t){return(t=((t=null==t?"":t)+"").trim().replace(n._group,"").replace(n._decimal,".").replace(n._numeral,n._index))?+t:NaN},f=function(t){return"number"==typeof t?t:!t&&0!==t||isNaN(+t)?0:+t},d=function(t){return!(!/[RIT]/.exec((t=null==t?{}:t).type||"")||/[CN]/.exec(t.type||""))},t=function(n){var t,e,i,r,o,s=[];for(e in n=null==n?{}:n)s.push(e);for(t=s,i=0,o=(r=["name","order"]).length;i<o;++i)if(n[e=r[i]]&&!d(n[e]))return e;return t.filter(function(t){return!d(n[t])})[0]},e=function(){var a,l,h,u=this,c=(this.mod||{}).dimension||{};if(this._subset)return a=t(c),l=this._subset.map(function(n){var t,e,i,r,o={};for(t in e=c)i=e[t],(r=u.binding[t])&&(o[t]=i.multiple?(r.map?r:[r]).map(s):n[r.key],d(i))&&(o[t]=Array.isArray(o[t])?o[t].map(f):f(o[t]));return o;function s(t){return n[t.key]}}),h={},a&&l.map(function(t){return h[t[a]+""]=t}),this.data.map(function(t,n){var e,i,r,o=a?h[t[a]+""]:l[n],s={};for(e in i=c)r=i[e],d(r)&&(s[e]=r.multiple?(t[e]||[]).map(u):o?f(o[e]):0);return t.subset=s;function u(t,n){return o?f((o[e]||[])[n]):0}}),"shrink"===(((this.cfg||{}).common||{}).subset||{}).mode?this.data.map(function(t){var n,e,i,r=[];for(n in e=c)i=e[n],d(i)&&r.push(t[n]=t.subset[n]);return r}):void 0;this.data.map(function(t){var n=t.subset;return delete t.subset,n})},i=function(t){var n,e;if("string"!=typeof t)return null;if(t=t.trim(),n=/^#([0-9a-f]{3})$/i.exec(t)){for(var i,r=[],o=0,s=(i=n[1].split("")).length;o<s;++o)e=i[o],r.push(parseInt(e+e,16));return r}return(n=/^#([0-9a-f]{6})$/i.exec(t))?[0,1,2].map(function(t){return parseInt(n[1].substr(2*t,2),16)}):(n=/^rgba?\(([^)]+)\)$/i.exec(t))&&3===(t=n[1].split(",").slice(0,3).map(function(t){return parseFloat(t.trim())})).length&&t.every(function(t){return!isNaN(t)})?t:null},o=function(t,n,e){var i,r,o,s;for(r in null==e&&(e={}),i={},o=y(y({},n=null==n?{}:n),e||{}))s=o[r],i[r]="function"==typeof s?s.bind(t):s;return i},s=function(t,n,e){for(var i=t;t&&t!==e;)t=t.parentNode;if(t!==e)return null;if(!n)return t;for(t=i;t&&t!==e&&(!t.matches||(t.matches,!t.matches(n)));)t=t.parentNode;return t!==e||e.matches&&e.matches(n)?t:null},(r=function(){return this.running=!1,this.time={now:0,last:0},this.fps(60),this.evtHandler={},this}).prototype=y(Object.create(Object.prototype),{on:function(t,e){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var n;return((n=i.evtHandler)[t]||(n[t]=[])).push(e)})},fire:function(t){for(var n,e,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(n=s,u=0,i=(e=this.evtHandler[t]||[]).length;u<i;++u)r=e[u],o.push(r.apply(this,n));return o},reset:function(){return this.time={now:0}},setTime:function(t){return this.time.now=t},getTime:function(){return this.time.now},isRunning:function(){return this.running},toggle:function(t){return null!=t&&(this.running=!t),this.running?this.pause():this.run()},pause:function(){return this.running=!1},render:function(t){return this.fire("tick",this.time.now,t=null==t?0:t)},run:function(t){var n=this;if(null!=t&&this.fps(t),!this.running)return this.running=!0,requestAnimationFrame(function(t){return n.handler(n.time.last=t,!0)})},throttle:function(t){return this.isThrottled=t=null==t?!0:t},fps:function(t){return null==t?this._fps_val:(this._fps_val=.01<t?t:.01,this._fps_delay=1e3/this._fps_val)},handler:function(t,n){var e,i,r=this;if(null==n&&(n=!1),this.running)return this.external&&this.external()?(this.time.last=t,requestAnimationFrame(function(t){return r.handler(t,!1)})):(this.time.now=t,e=this.isThrottled?1e3<(e=this._fps_delay)?e:1e3:this._fps_delay,(n||(i=this.time.now-this.time.last)>=e)&&(this.time.last=t,this.render(n?0:i)),requestAnimationFrame(function(t){return r.handler(t,!1)}))}}),u={list:[],init:function(){var t,e,i=this;return this.inited=!0,t=null==document.hidden&&null==document.msHidden&&null!=document.webkiHidden?["webkitHidden","webkitvisibilitychange"]:["hidden","visibilitychange"],e=t[0],document.addEventListener(t[1],debounce(150,function(){var n=!!document[e];return i.list.map(function(t){return t.throttle(n)})},!1))},add:function(t){return this.inited||this.init(),this.list.push(t)}},a={wm:new WeakMap,ro:new ResizeObserver(function(t){return t.map(function(t){return a.wm.get(t.target)._resize()})}),add:function(t,n){return this.wm.set(t,n),this.ro.observe(t)},delete:function(t){return this.ro.unobserve(t),this.wm.delete(t)}},l=function(t,n,e){return null==n&&(n={}),null==e&&(e={}),function(t,n,e){var i,r;for(i in n)r=n[i],null==t[i]?t[i]=r:"object"!=typeof t[i]||"object"!=typeof r||e[i]&&e[i].type||l(t[i],n[i],e[i]);return t}(t=null==t?{}:t,n=JSON.parse(JSON.stringify(n)),e)},h=function(t){var r=function(t,n){var e,i;for(e in null==n&&(n={}),t.child,t)(i=t[e]).type?i.default&&(n[e]=i.default):r(i,n[e]||(n[e]={}));return n};return r(t)},(p=function(t){var n,e,i,r=this;for(n in this.root="string"==typeof(t=null==t?{}:t).root?document.querySelector(t.root):t.root,this.useSample=null==t.useSample||t.useSample,this.autoSelect=null==t.autoSelect||t.autoSelect,this.forceInit=t.forceInit||!1,this.prepareSvg=null==t.prepareSvg||t.prepareSvg,this.layoutOpt=null==t.layout||t.layout,this.delayRender=t.delayRender||!1,this.dataAccessor=null!=t.dataAccessor?t.dataAccessor:function(t){return t?t.data._raw:null},this.data=[],this.raw=t.raw||null,this.mod=t.mod||{},this.cfg=t.config||{},this.seed=t.seed||Math.random(),this.binding=t.binding||{},this._normalizeBinding(),this.evtHandler={},this._subset=t.subset||null,e=p.scopes){if(i=e[n],null!=this[n])throw new Error("[@plotdb/chart] scope name `"+n+"` is already taken.");this[n]=o(this,i,this.mod[n])}if(null!=this.local)throw new Error("[@plotdb/chart] scope name `local` is already taken.");return this.local=o(this,{},this.mod.local),(p.utils||(p.utils={})).anim&&null==this.anim&&(this.anim=new p.utils.anim),this.init=proxise.once(function(){return r._init()}),this._resize=null,this._inited=!1,this.autoSelect&&(this.root.addEventListener("click",this._select=function(t){if(t=s(t.target,".data",r.root))return r.fire("select",[{data:r.dataAccessor(t),node:t}])}),this.root.addEventListener("mouseover",this._hover=function(t){if(t=s(t.target,".data",r.root))return r.fire("hover",[{data:r.dataAccessor(t),node:t}])})),this}).prototype=y(Object.create(Object.prototype),{_init:function(){var e,t,n,i=this;return"static"===window.getComputedStyle(this.root).position&&(this.root.style.position="relative"),e=this.layoutOpt?"object"!=typeof this.layoutOpt?this.root.querySelector(".pdl-layout"):"string"==typeof this.layoutOpt.root?this.root.querySelector(this.layoutOpt.root):this.layoutOpt.root||null:null,this.prepareSvg&&!(this.svg=this.root.querySelector("svg"))&&(this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),(t=this.svg.style).width="100%",t.height="100%",!this.layoutOpt||(e||console.error("[@plotdb/chart] layout enabled yet layout root isn't configured properly. "),n=e.querySelector("[data-type=render]"))||console.warn("[@plotdb/chart] prepareSvg and layout is configured at the same time,\nyet render container for layout is not found. svg is thus appended in the root."),(n||this.root).appendChild(this.svg)),this._aniloop=new r,u.add(this._aniloop),this._aniloop.on("tick",function(t,n){return i.tick(t,n)}),this.anim&&(this._aniloop.external=function(){return i.anim.manual()},this.anim.on("step",function(t,n){if(i._aniloop.isRunning())return i._aniloop.setTime(t),i._aniloop.render(n)})),Promise.resolve().then(function(){var t;return i.mod.config=l(i.mod.config||{},p.commonConfig),i._defcfg=t=h(i.mod.config),l(i.cfg,t),i.raw&&Array.isArray(i.raw)?{raw:i.raw,binding:i.binding}:i.useSample&&i.mod.sample?(t=i.mod.sample.apply(i)).then?t.then():Promise.resolve(t):void 0}).then(function(t){return i.raw=(t=t||{}).raw,i.binding=t.binding,i}).then(function(){var t,n;return i.raw||(i.raw=[]),i.layoutOpt&&("undefined"==typeof layout||null===layout?console.warn("[@plotdb/chart] layout-opt is set yet @plotdb/layout is not found."):(e||(console.error("[@plotdb/chart] cannot determine root node for @plotdb/layout."),console.error("[@plotdb/chart] config layout properly or disable layout by setting layout to false")),i.layout=new layout("object"==typeof i.layoutOpt?((n=y({},i.layoutOpt)).watchResize=!1,n):{root:e,watchResize:!1}))),t=proxise(function(){return a.add(i.root,i),null}),i._resize=function(){return t.resolve()},n=t(),(i.forceInit||!i.root.offsetParent||"none"===window.getComputedStyle(i.root).display||i.root.offsetWidth&&i.root.offsetHeight)&&t.resolve(),n}).then(function(){return i._resize=function(){}}).then(function(){var t,n=function(){if(i.mod.init)return i.mod.init.apply(i)};return(i.layout?(t=proxise(function(){return Promise.resolve(i.layout.init(n)),null}),i._layout=function(){return t.resolve()},i.layout.on("render",function(){return i._layout()}),t):n)()}).then(function(){i._layout=function(){},Promise.resolve().then(function(){if(i.delayRender&&!i._pendingRaw)return i.renderLock=proxise(function(){}),i.renderLock()}).then(function(){return i._inited=!0,i._resize=function(){return i.resize(),i.render()},i._layout=function(){return i.parse(),i.bind(),i.resize(),i.render()},i.parse(),i.bind(),i.resize(),i.render()})})},parse:function(){var t,l=(t=this.mod).dimension||(t.dimension={}),h=this.binding;if(this.data=this.raw.map(function(n,t){var e,i,r,o,s={};for(e in i=l)r=i[e],(o=h[e])?(s[e]=r.multiple?(o.map?o:[o]).map(u):n[o.key],/[RIT]/.exec(r.type)&&!/[CN]/.exec(r.type)&&(s[e]=Array.isArray(s[e])?s[e].map(a):c(s[e]))):r.multiple&&(s[e]=[]);return s._raw=n,s._idx=t,s;function u(t){return n[t.key]}function a(t){return c(t)}}),e.apply(this),this.mod.parse)return this.mod.parse.apply(this)},bind:function(){if(this.mod.bind)return this.mod.bind.apply(this)},start:function(){if(this._aniloop.run(),this.mod.start)return this.mod.start.apply(this)},stop:function(){if(this._aniloop.pause(),this.mod.stop)return this.mod.stop.apply(this)},resize:function(){if(this._inited)return this.layout&&this.layout.update(!1),this.box=this.root.getBoundingClientRect(),this.mod.resize?this.mod.resize.apply(this):void 0},tick:function(t,n){if(this.mod.tick)return this.mod.tick.apply(this,[t,n])},render:function(){return this._inited&&this.mod.render?this.mod.render.apply(this):void 0},destroy:function(){var t=this;return Promise.resolve().then(function(){if(t._select&&t.root.removeEventListener("click",t._select),t._hover&&t.root.removeEventListener("mouseover",t._hover),a.delete(t.root),t.layout&&t.layout.destroy(),t.stop(),t.mod.destroy)return t.mod.destroy.apply(t)})},config:function(){var t,n,e;if(!arguments.length)return this.cfg;for(t={},n=0,e=arguments.length;n<e;++n)l(t,arguments[n],this.mod.config);return l(t,this.cfg,this.mod.config),l(t,this._defcfg,this.mod.config),y(this.cfg,t)},_normalizeBinding:function(t){var n,e,i,r,o,s,u,a=[];if(null==t){for(t in n=[],this.mod.dimension||{})n.push(t);t=n}for(e=0,i=(t=Array.isArray(t)?t:[t]).length;e<i;++e)r=t[e],o=(this.mod.dimension||{})[r]||{},s=this.binding[r],u=Array.isArray(s),!o.multiple!=!u&&(o.multiple||u)&&a.push(this.binding[r]=u?s[0]:s?[s]:[]);return a},setBind:function(t,n){if(this.binding[t]=n,this._normalizeBinding([t]),this._inited)return this.parse(),this.bind(),this.resize(),this.render()},setRaw:function(t,n,e){var i;return null==e&&(e=!1),Array.isArray(t)||(t&&"subset"in t&&(this._subset=t.subset||null),t=(i=t).raw,n=i.binding,e=i.reinit),null!=t&&(this.raw=t),null!=n&&(this.binding=n,this._normalizeBinding()),this.renderLock?(this.renderLock.resolve(),this.renderLock=null):this._inited?(e&&this.mod.init&&this.mod.init.apply(this),this.parse(),this.bind(),this.resize(),this.render()):this._pendingRaw=!0},on:function(t,e){var i=this;return(Array.isArray(t)?t:[t]).map(function(t){var n;return((n=i.evtHandler)[t]||(n[t]=[])).push(e)})},fire:function(t){for(var n,e,i,r,o=[],s=[],u=1,a=arguments.length;u<a;++u)s.push(arguments[u]);for(n=s,u=0,i=(e=this.evtHandler[t]||[]).length;u<i;++u)r=e[u],o.push(r.apply(this,n));return o},filter:function(t,n){var e,i,r,o,s;for(i in null==t&&(t={}),null==n&&(n=!1),e=[],r=this.binding)o=r[i],s=(s=Array.isArray(o)?o:[o]).map(u),e=e.concat(s);for(i in t)o=t[i],e.filter(a).map(l);return n&&this.fire("filter",t),this.mod.filter&&this.mod.filter.apply(this,[t,n]),this.parse(),this.bind(),this.resize(),this.render();function u(t){return{k:i,v:t}}function a(t){return t.k===i}function l(t){return t.v.filter=o}},sample:function(){return this.mod.sample?this.mod.sample.apply(this):{raw:[],binding:{}}},filterDims:function(){var t;return(t=(this.mod||{}).filterDims)?t.call(this):(this.mod||{}).filter?["name"]:[]},canFilter:function(){return!!this.filterDims().length}}),p.commonConfig={common:{subset:{mode:{type:"choice",values:["dim","partial","shrink"],default:"dim"},opacity:{type:"number",default:.2,min:0,max:1,step:.05},fade:{type:"number",default:.72,min:0,max:1,step:.01}}}},p.scopes={subset:{set:function(t){if(this._subset=t||null,this._inited)return this.parse(),this.bind(),this.resize(),this.render()},mode:function(){return(((this.cfg||{}).common||{}).subset||{}).mode||"dim"},ratio:function(t,n,e){return t&&t.subset?!(t=(e=null!=e?[(t[n]||[])[e],(t.subset[n]||[])[e]]:[t[n],t.subset[n]])[0])||(n=e[1]/t)<0?0:1<n?1:n:null},color:function(t,n){var e;return(e=i(t))?(e=.3*e[0]+.59*e[1]+.11*e[2],n=null!=n?n:(((this.cfg||{}).common||{}).subset||{}).fade,"rgb("+(e=Math.round(e+(255-e)*(null!=n?n:.72)))+","+e+","+e+")"):t}}},"undefined"!=typeof module&&null!==module?module.exports=p:"undefined"!=typeof window&&null!==window&&(window.chart=p)}.call(this);
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"author":"zbryikt","name":"@plotdb/chart","license":"MIT","description":"plotdb charts","style":"index.min.css","browser":"index.min.js","main":"index.min.js","version":"3.
|
|
1
|
+
{"author":"zbryikt","name":"@plotdb/chart","license":"MIT","description":"plotdb charts","style":"index.min.css","browser":"index.min.js","main":"index.min.js","version":"3.7.0","homepage":"https://github.com/plotdb/chart","repository":{"type":"git","url":"https://github.com/plotdb/chart"},"engines":{"node":">=10.14.1","npm":">=6.4.1"},"scripts":{"start":"npx server -r web -o true -p 3457","verify":"node tools/verify/shape-test.js && node tools/verify/scale-test.js"},"devDependencies":{"@loadingio/bootstrap.ext":"^0.0.12","@loadingio/ldquery":"^3.0.6","@loadingio/loading.css":"^3.2.1","@loadingio/vscroll":"^0.0.11","@plotdb/layout":"^0.0.12","@plotdb/pdmap-world":"^0.0.5","@plotdb/semver":"^0.0.3","@plotdb/sheet":"^0.7.0","@xlfont/choose":"^0.0.32","@xlfont/load":"^2.1.5","@zbryikt/template":"^2.4.3","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","fedep":"^1.9.0","jsdom":"^22.1.0","ldbutton":"^2.0.5","ldfile":"^2.0.1","ldiconfont":"^0.2.8","ldloader":"^3.0.3","ldview":"^1.5.1","livescript":"^1.6.0","pdmaptw":"2.2.1","uglify-js":"^3.13.1","uglifycss":"^0.0.29","zmgr":"^2.2.3"},"frontendDependencies":{"root":"web/static/assets/lib","modules":["bootstrap","bootstrap.native","@loadingio/bootstrap.ext","@loadingio/ldquery","@loadingio/loading.css","@loadingio/ldcolorpicker","@loadingio/debounce.js","@loadingio/vscroll","@plotdb/pdmap-world","@plotdb/block","@plotdb/csscope","@plotdb/rescope","@plotdb/layout","@plotdb/sheet","@plotdb/konfig","@plotdb/semver","@xlfont/choose","@xlfont/load","@zbryikt/voronoijs","d3","d3-array","d3-axis","d3-brush","d3-color","d3-dispatch","d3-drag","d3-ease","d3-force","d3-force-boundary","d3-format","d3-hierarchy","d3-interpolate","d3-path","d3-quadtree","d3-random","d3-scale-chromatic","d3-selection","d3-shape","d3-timer","d3-transition","choosefont.js","pdmaptw","proxise","ldiconfont","ldloader","ldbutton","ldcover","ldcolor","ldfile","ldslider","wrap-svg-text","ldpalettepicker","zmgr","ldview"]},"dependencies":{"@loadingio/debounce.js":"^1.0.1","@loadingio/ldcolorpicker":"^3.0.5","@plotdb/block":"^5.2.2","@plotdb/csscope":"^5.0.3","@plotdb/konfig":"^4.8.12","@plotdb/rescope":"^5.0.9","@zbryikt/voronoijs":"^1.0.0","choosefont.js":"^0.0.1","d3":"^7.9.0","d3-force-boundary":"^0.0.2","ldcolor":"^1.1.3","ldcover":"^3.5.1","ldpalettepicker":"^4.0.4","ldslider":"^3.1.1","proxise":"^1.0.1","wrap-svg-text":"^0.0.7"}}
|