@plotdb/chart 3.16.0 → 3.16.1
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 +8 -0
- package/bundle.js +299 -59
- package/bundle.min.js +1 -1
- package/index.js +75 -15
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/utils/config.js +224 -44
- package/utils/config.min.js +1 -1
package/index.js
CHANGED
|
@@ -1476,64 +1476,108 @@
|
|
|
1476
1476
|
'default': 350,
|
|
1477
1477
|
min: 0,
|
|
1478
1478
|
max: 5000,
|
|
1479
|
-
step: 10
|
|
1479
|
+
step: 10,
|
|
1480
|
+
desc: {
|
|
1481
|
+
en: "duration of the transition when data changes, in ms",
|
|
1482
|
+
"zh-TW": "資料更換時轉場動畫的長度 ( 毫秒 )"
|
|
1483
|
+
}
|
|
1480
1484
|
},
|
|
1481
1485
|
interval: {
|
|
1482
1486
|
type: 'number',
|
|
1483
1487
|
'default': 1000,
|
|
1484
1488
|
min: 100,
|
|
1485
1489
|
max: 20000,
|
|
1486
|
-
step: 50
|
|
1490
|
+
step: 50,
|
|
1491
|
+
desc: {
|
|
1492
|
+
en: "how long each frame stays when playing frames ( dataframe ), in ms",
|
|
1493
|
+
"zh-TW": "播放多個畫面 ( dataframe ) 時每格停留的時間 ( 毫秒 )"
|
|
1494
|
+
}
|
|
1487
1495
|
},
|
|
1488
1496
|
speed: {
|
|
1489
1497
|
type: 'number',
|
|
1490
1498
|
'default': 1,
|
|
1491
1499
|
min: 0.1,
|
|
1492
1500
|
max: 10,
|
|
1493
|
-
step: 0.1
|
|
1501
|
+
step: 0.1,
|
|
1502
|
+
desc: {
|
|
1503
|
+
en: "playback speed; scales both transitions and frame time",
|
|
1504
|
+
"zh-TW": "播放速度倍率,轉場與每格停留的時間一起縮放"
|
|
1505
|
+
}
|
|
1494
1506
|
},
|
|
1495
1507
|
loop: {
|
|
1496
1508
|
type: 'boolean',
|
|
1497
|
-
'default': true
|
|
1509
|
+
'default': true,
|
|
1510
|
+
desc: {
|
|
1511
|
+
en: "start over after the last frame",
|
|
1512
|
+
"zh-TW": "播完最後一格後從頭再播"
|
|
1513
|
+
}
|
|
1498
1514
|
},
|
|
1499
1515
|
autoplay: {
|
|
1500
1516
|
type: 'boolean',
|
|
1501
|
-
'default': true
|
|
1517
|
+
'default': true,
|
|
1518
|
+
desc: {
|
|
1519
|
+
en: "start playing frames when the chart loads",
|
|
1520
|
+
"zh-TW": "圖表載入後自動開始播放"
|
|
1521
|
+
}
|
|
1502
1522
|
}
|
|
1503
1523
|
},
|
|
1504
1524
|
subset: {
|
|
1505
1525
|
mode: {
|
|
1506
1526
|
type: 'choice',
|
|
1507
1527
|
values: ['dim', 'partial', 'shrink'],
|
|
1508
|
-
'default': 'dim'
|
|
1528
|
+
'default': 'dim',
|
|
1529
|
+
desc: {
|
|
1530
|
+
en: "how filtered-out data looks: dim lowers its opacity, partial greys out the unselected part of each mark, shrink draws only the selected part",
|
|
1531
|
+
"zh-TW": "被篩掉的資料怎麼呈現:dim 變淡,partial 把每個圖形未選的部分變灰,shrink 只畫選中的部分"
|
|
1532
|
+
}
|
|
1509
1533
|
},
|
|
1510
1534
|
opacity: {
|
|
1511
1535
|
type: 'number',
|
|
1512
1536
|
'default': 0.2,
|
|
1513
1537
|
min: 0,
|
|
1514
1538
|
max: 1,
|
|
1515
|
-
step: 0.05
|
|
1539
|
+
step: 0.05,
|
|
1540
|
+
desc: {
|
|
1541
|
+
en: "opacity of filtered-out data in dim mode",
|
|
1542
|
+
"zh-TW": "dim 模式下被篩掉的資料的透明度"
|
|
1543
|
+
}
|
|
1516
1544
|
},
|
|
1517
1545
|
fade: {
|
|
1518
1546
|
type: 'number',
|
|
1519
1547
|
'default': 0.72,
|
|
1520
1548
|
min: 0,
|
|
1521
1549
|
max: 1,
|
|
1522
|
-
step: 0.01
|
|
1550
|
+
step: 0.01,
|
|
1551
|
+
desc: {
|
|
1552
|
+
en: "in partial mode, how far the unselected part fades toward the background ( 0 to 1 )",
|
|
1553
|
+
"zh-TW": "partial 模式下未選部分往背景色淡化的程度 ( 0 到 1 )"
|
|
1554
|
+
}
|
|
1523
1555
|
},
|
|
1524
1556
|
background: {
|
|
1525
1557
|
type: 'color',
|
|
1526
|
-
'default': 'transparent'
|
|
1558
|
+
'default': 'transparent',
|
|
1559
|
+
desc: {
|
|
1560
|
+
en: "color the unselected part fades toward; set it on a dark background, or it turns light grey",
|
|
1561
|
+
"zh-TW": "未選部分往哪個顏色淡化;深色底的圖要設定,否則會是亮灰色"
|
|
1562
|
+
}
|
|
1527
1563
|
}
|
|
1528
1564
|
},
|
|
1529
1565
|
empty: {
|
|
1530
1566
|
enabled: {
|
|
1531
1567
|
type: 'boolean',
|
|
1532
|
-
'default': true
|
|
1568
|
+
'default': true,
|
|
1569
|
+
desc: {
|
|
1570
|
+
en: "show a message in the middle when there is no data",
|
|
1571
|
+
"zh-TW": "沒有資料時在繪圖區中間顯示一行字"
|
|
1572
|
+
}
|
|
1533
1573
|
},
|
|
1534
1574
|
text: {
|
|
1535
1575
|
type: 'text',
|
|
1536
|
-
'default': ''
|
|
1576
|
+
'default': '',
|
|
1577
|
+
desc: {
|
|
1578
|
+
en: "the message; empty uses the default, No data to show",
|
|
1579
|
+
"zh-TW": "要顯示的文字;空白用預設的「沒有可顯示的資料」"
|
|
1580
|
+
}
|
|
1537
1581
|
},
|
|
1538
1582
|
color: {
|
|
1539
1583
|
type: 'color',
|
|
@@ -1562,7 +1606,11 @@
|
|
|
1562
1606
|
brush: {
|
|
1563
1607
|
fill: {
|
|
1564
1608
|
type: 'color',
|
|
1565
|
-
'default': ''
|
|
1609
|
+
'default': '',
|
|
1610
|
+
desc: {
|
|
1611
|
+
en: "fill color of the brush selection; empty uses the chart's default",
|
|
1612
|
+
"zh-TW": "刷選框的填色;空白用圖表預設"
|
|
1613
|
+
}
|
|
1566
1614
|
},
|
|
1567
1615
|
fillOpacity: {
|
|
1568
1616
|
type: 'number',
|
|
@@ -1573,7 +1621,11 @@
|
|
|
1573
1621
|
},
|
|
1574
1622
|
stroke: {
|
|
1575
1623
|
type: 'color',
|
|
1576
|
-
'default': ''
|
|
1624
|
+
'default': '',
|
|
1625
|
+
desc: {
|
|
1626
|
+
en: "outline color of the brush selection; empty uses the chart's default",
|
|
1627
|
+
"zh-TW": "刷選框的外框顏色;空白用圖表預設"
|
|
1628
|
+
}
|
|
1577
1629
|
},
|
|
1578
1630
|
strokeOpacity: {
|
|
1579
1631
|
type: 'number',
|
|
@@ -1591,7 +1643,11 @@
|
|
|
1591
1643
|
},
|
|
1592
1644
|
handleFill: {
|
|
1593
1645
|
type: 'color',
|
|
1594
|
-
'default': ''
|
|
1646
|
+
'default': '',
|
|
1647
|
+
desc: {
|
|
1648
|
+
en: "color of the handles at both ends of the brush",
|
|
1649
|
+
"zh-TW": "刷選框兩端握把的顏色"
|
|
1650
|
+
}
|
|
1595
1651
|
},
|
|
1596
1652
|
handleOpacity: {
|
|
1597
1653
|
type: 'number',
|
|
@@ -1604,7 +1660,11 @@
|
|
|
1604
1660
|
annotation: {
|
|
1605
1661
|
enabled: {
|
|
1606
1662
|
type: 'boolean',
|
|
1607
|
-
'default': true
|
|
1663
|
+
'default': true,
|
|
1664
|
+
desc: {
|
|
1665
|
+
en: "show annotations ( notes and reference lines ) on the chart",
|
|
1666
|
+
"zh-TW": "顯示圖上的標記 ( 註記與參考線 )"
|
|
1667
|
+
}
|
|
1608
1668
|
},
|
|
1609
1669
|
color: {
|
|
1610
1670
|
type: 'color',
|
package/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var w,e,f,c,p,t,n,o,r,s,i,a,u,l,h,d,m,y,g,_;function b(t,e,c){function p(t,e){return n.call(t,e)}var d={}.toString,n={}.hasOwnProperty,m=!0;return function t(e,n,i){var r,o,s,a,u,l,h,f;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=d.call(e);if(d.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;a=!0;if("[object Array]"==r){if(u=e.length,l=n.length,m){switch(c){case"===":a=u===l;break;case"<==":a=u<=l;break;case"<<=":a=u<l}s=u,m=!1}else a=u===l,s=u;if(a)for(;s--&&(a=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(p(e,h)&&(s++,!(a=p(n,h)&&t(e[h],n[h],i))))break;if(a){for(h in f=0,n)p(n,h)&&++f;a=m?"<<="===c?s<f:"<=="===c?s<=f:s===f:(m=!1,s===f)}}i.pop();return a}(t,e,[])}function x(t,e){var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t}w="http://www.w3.org/2000/svg",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 b(t.type,"group","===")}).value+"]","g"),this._decimal=new RegExp("["+t.find(function(t){return b(t.type,"decimal","===")}).value+"]"),this._numeral=new RegExp("["+e.join("")+"]","g"),this._index=function(t){return i.get(t)},this}("en-US"),f=function(t){return(t=((t=null==t?"":t)+"").trim().replace(e._group,"").replace(e._decimal,".").replace(e._numeral,e._index))?+t:NaN},c=function(t){return"number"==typeof t?t:!t&&0!==t||isNaN(+t)?0:+t},p=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]]&&!p(e[n]))return n;return t.filter(function(t){return!p(e[t])})[0]},n=function(){var u,l,h,a=this,f=(this.mod||{}).dimension||{};if(this._subset)return u=t(f),l=this._subset.map(function(e){var t,n,i,r,o={};for(t in n=f)i=n[t],(r=a.binding[t])&&(o[t]=i.multiple?(r.map?r:[r]).map(s):e[r.key],p(i))&&(o[t]=Array.isArray(o[t])?o[t].map(c):c(o[t]));return o;function s(t){return e[t.key]}}),h={},u&&l.map(function(t){return h[t[u]+""]=t}),this.data.map(function(t,e){var n,i,r,o=u?h[t[u]+""]:l[e],s={};for(n in i=f)r=i[n],p(r)&&(s[n]=r.multiple?(t[n]||[]).map(a):o?c(o[n]):0);return t.subset=s;function a(t,e){return o?c((o[n]||[])[e]):0}}),"shrink"===(((this.cfg||{}).common||{}).subset||{}).mode?this.data.map(function(t){var e,n,i,r=[];for(e in n=f)i=n[e],p(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})},o=function(t){return!(!t||Array.isArray(t)||!Array.isArray(t.frames))},r=function(t){return"number"==typeof t||"string"==typeof t&&t.trim()&&!isNaN(+t)},s=function(t){return t instanceof Date||"string"==typeof t&&!isNaN(Date.parse(t))},i=function(t){var e,n,o,i;return e=((t=null==t?{}:t).frames||[]).map(function(t,e){return{id:null!=t.id?t.id:e,raw:t.raw||[]}}),t=t.frameOrder,Array.isArray(t)&&t.length?(n={},e.map(function(t){return n[t.id+""]=t}),(o=t.map(function(t){return n[t+""]}).filter(function(t){return t})).concat(e.filter(function(t){for(var e=t,n=o,i=-1,r=n.length>>>0;++i<r;)if(e===n[i])return!1;return!0}))):(t=e.map(function(t){return t.id})).length&&t.every(r)?e.map(function(t,e){return{f:t,i:e}}).sort(function(t,e){return+t.f.id-+e.f.id||t.i-e.i}).map(function(t){return t.f}):t.length&&t.every(s)?(i=function(t){return t instanceof Date?t.getTime():Date.parse(t)},e.map(function(t,e){return{f:t,i:e}}).sort(function(t,e){return i(t.f.id)-i(e.f.id)||t.i-e.i}).map(function(t){return t.f})):e},a=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},u=function(t,e,n){var i,r,o,s;for(r in null==n&&(n={}),i={},o=x(x({},e=null==e?{}:e),n||{}))s=o[r],i[r]="function"==typeof s?s.bind(t):s;return i},l=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},(h=function(){return this.running=!1,this.time={now:0,last:0},this.fps(60),this.evtHandler={},this}).prototype=x(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=[],a=1,u=arguments.length;a<u;++a)s.push(arguments[a]);for(e=s,a=0,i=(n=this.evtHandler[t]||[]).length;a<i;++a)r=n[a],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)}))}}),d={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],debounce(150,function(){var e=!!document[n];return i.list.map(function(t){return t.throttle(e)})},!1))},add:function(t){return this.inited||this.init(),this.list.push(t)}},m={wm:new WeakMap,ro:new ResizeObserver(function(t){return t.map(function(t){return m.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)}},y=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||y(t[i],e[i],n[i]);return t}(t=null==t?{}:t,e=JSON.parse(JSON.stringify(e)),n)},g=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)},(_=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,this._frames=null,this._player={playing:!1,pos:0,origin:0,raf:null},o(this.raw)&&(this._setFrames(this.raw),this.raw=(null!=(t=this._frames.list[this._frames.index])?t.raw:void 0)||[]),n=_.scopes){if(i=n[e],null!=this[e])throw new Error("[@plotdb/chart] scope name `"+e+"` is already taken.");this[e]=u(this,i,this.mod[e])}if(null!=this.local)throw new Error("[@plotdb/chart] scope name `local` is already taken.");return this.local=u(this,{},this.mod.local),(_.utils||(_.utils={})).anim&&null==this.anim&&(this.anim=new _.utils.anim),this.anim&&this.anim.on("step",function(){if(r._player.playing)return r._playerTick()}),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=l(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=l(t.target,".data",r.root))return r.fire("hover",[{data:r.dataAccessor(t),node:t}])})),this}).prototype=x(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(w,"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 h,d.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=y(i.mod.config||{},_.commonConfig),i._defcfg=t=g(i.mod.config),y(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=x({},i.layoutOpt)).watchResize=!1,e):{root:n,watchResize:!1}))),t=proxise(function(){return m.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(){if(i._inited=!0,i._resize=function(){i.anim&&i.anim.immediate(!0);try{return i.resize(),i.render()}finally{i.anim&&i.anim.immediate(!1)}},i._layout=function(){return i.parse(),i.bind(),i.resize(),i.render()},i.parse(),i.bind(),i.resize(),i.render(),i._frames)return i._framesStart()})})},parse:function(){if(this.data=this._parseRows(this.raw),this._frames&&(this._frames.all=null),n.apply(this),this.mod.parse)return this.mod.parse.apply(this)},_parseRows:function(t){var l,e,h;return null==t&&(t=[]),l=(e=this.mod).dimension||(e.dimension={}),h=this.binding,t.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(a):e[o.key],/[RIT]/.exec(r.type)&&!/[CN]/.exec(r.type)&&(s[n]=Array.isArray(s[n])?s[n].map(u):f(s[n]))):r.multiple&&(s[n]=[]);return s._raw=e,s._idx=t,s;function a(t){return e[t.key]}function u(t){return f(t)}})},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(){if(this._inited)return this._syncAnim(),this.mod.render&&this.mod.render.apply(this),this._brushStyle(),this._empty(),this._anno()},_emptyText:function(){var t,e,n=((this.cfg||{}).common||{}).empty||{};return n.text||(n=_.i18nNs+":text",(t="undefined"!=typeof block&&null!==block&&block.i18n&&block.i18n.module?block.i18n.module:null)&&t.t&&(e=t.t(n))&&e!==n&&"text"!==e?e:(n=(t?t.language||t.lng:null)||("undefined"!=typeof document&&null!==document?document.documentElement.lang:"")||"en",(_.i18n[n]||_.i18n[n.split("-")[0]]||(/^zh/i.exec(n)?_.i18n[/cn|hans|sg/i.exec(n)?"zh-CN":"zh-TW"]:void 0)||_.i18n.en).text))},_empty:function(){var t,e=((this.cfg||{}).common||{}).empty||{},n=!(null!=e.enabled&&!e.enabled||(this.data||[]).length);if(this.svg){if(n)return this._emptyG||(this._emptyG=document.createElementNS(w,"g"),this._emptyG.setAttribute("data-type","empty"),this._emptyG.style.pointerEvents="none"),this.svg.appendChild(this._emptyG),this._emptyG.textContent="",n=this._annoBox(),(t=document.createElementNS(w,"text")).setAttribute("x",n.x+n.width/2),t.setAttribute("y",n.y+n.height/2),t.setAttribute("text-anchor","middle"),t.setAttribute("dominant-baseline","middle"),t.style.fill=e.color||"currentColor",t.style.opacity=null!=e.opacity?e.opacity:.45,(e.font||{}).size&&(t.style.fontSize=e.font.size+""),t.textContent=this._emptyText(),this._emptyG.appendChild(t);this._emptyG&&this._emptyG.parentNode&&this._emptyG.parentNode.removeChild(this._emptyG)}},_brushStyle:function(){var t,e,n,i,r,o=[],s=((this.cfg||{}).common||{}).brush||{};if(this.svg){for(t=function(t,e,n){if(null!=n&&""!==n)return t.setAttribute(e,n)},e=0,i=(n=this.svg.querySelectorAll("rect.selection")).length;e<i;++e)t(r=n[e],"fill",s.fill),t(r,"fill-opacity",s.fillOpacity),t(r,"stroke",s.stroke),t(r,"stroke-opacity",s.strokeOpacity),t(r,"stroke-width",s.strokeWidth);for(e=0,i=(n=this.svg.querySelectorAll("rect.handle")).length;e<i;++e)t(r=n[e],"fill",s.handleFill),o.push(t(r,"fill-opacity",s.handleOpacity));return o}},_annoBox:function(){var t;if(this.layout)try{if((t=this.layout.getBox("view"))&&t.width&&t.height)return t}catch(t){}return{x:0,y:0,width:(this.box||{}).width||0,height:(this.box||{}).height||0}},_anno:function(){var t,s,e,n,i,r,o,a,u,l,h,f,c,p,d=this,m=[],y=((this.cfg||{}).common||{}).annotation||{},g=null==y.enabled||!!y.enabled,_=g&&y.notes||[],b=g&&y.reference||[];if(this.svg){if(_.length||b.length){for(this._annoG||(this._annoG=document.createElementNS(w,"g"),this._annoG.setAttribute("data-type","annotation"),this._annoG.style.pointerEvents="none"),this.svg.appendChild(this._annoG),this._annoG.textContent="",t=this._annoBox(),s=y.font||{},e=function(t,e,n,i,r){var o=document.createElementNS(w,"text");return o.setAttribute("x",e),o.setAttribute("y",n),o.setAttribute("text-anchor",i),o.setAttribute("dominant-baseline",r),o.style.fill=t.color||y.color||"currentColor",(t.size||s.size)&&(o.style.fontSize=(t.size||s.size)+""),o.style.opacity=null!=t.opacity?t.opacity:null!=y.opacity?y.opacity:1,o.textContent=t.text+"",d._annoG.appendChild(o),o},n=0,i=_.length;n<i;++n)(r=_[n])&&null!=r.text&&e(r,t.x+t.width*(null!=r.x?r.x:.5),t.y+t.height*(null!=r.y?r.y:.5),r.align||"middle",r.baseline||"middle");for(n=0,i=b.length;n<i;++n)(o=b[n])&&(a="x"===o.axis?"x":"y",null==(u=v.call(this))||isNaN(u)||u<0||u>("y"===a?t.height:t.width)||(l=document.createElementNS(w,"line"),f=(h="y"===a?[t.x,t.y+u,t.x+t.width,t.y+u]:[t.x+u,t.y,t.x+u,t.y+t.height])[1],c=h[2],p=h[3],l.setAttribute("x1",h[0]),l.setAttribute("y1",f),l.setAttribute("x2",c),l.setAttribute("y2",p),x(l.style,{stroke:o.color||y.color||"currentColor",strokeWidth:null!=o.width?o.width:1,strokeDasharray:null!=o.dash?o.dash:"4 3",opacity:null!=o.opacity?o.opacity:null!=y.opacity?y.opacity:.6}),this._annoG.appendChild(l),null!=o.label&&(h="y"===a?[t.x+t.width-2,t.y+u-3,"end","auto"]:[t.x+u+3,t.y+2,"start","hanging"],m.push(e({text:o.label,color:o.color,size:o.size,opacity:o.opacity},h[0],h[1],h[2],h[3])))));return m}this._annoG&&this._annoG.parentNode&&this._annoG.parentNode.removeChild(this._annoG)}function v(){try{return this.space[a](o.value)}catch(t){return null}}},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),m.delete(t.root),t.layout&&t.layout.destroy(),t.pause(),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)y(t,arguments[e],this.mod.config);return y(t,this.cfg,this.mod.config),y(t,this._defcfg,this.mod.config),x(this.cfg,t)},_normalizeBinding:function(t){var e,n,i,r,o,s,a,u=[];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],a=Array.isArray(s),!o.multiple!=!a&&(o.multiple||a)&&u.push(this.binding[r]=a?s[0]:s?[s]:[]);return u},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),!t||Array.isArray(t)||o(t)||("subset"in t&&(this._subset=t.subset||null),t=(i=t).raw,e=i.binding,n=i.reinit),o(t)?(this._setFrames(t),t=(null!=(i=this._frames.list[this._frames.index])?i.raw:void 0)||[]):null!=t&&this._frames&&(this.pause(),this._frames=null,this._player.pos=0,this.anim)&&this.anim.resume(),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._frames?this._framesStart():void 0):this._pendingRaw=!0},_animCfg:function(){return((this.cfg||{}).common||{}).animation||{}},_syncAnim:function(){var t;if(this.anim)return null!=(t=this._animCfg()).transition&&this.anim.duration(t.transition),this.anim.speed(null!=t.speed?t.speed:1)},_setFrames:function(t){var e,t=i(t);return this._frames={list:t,index:0,all:null},this._frames.index=this._frameAt((t=this._player.pos)<(e=this.duration())?t:e)},_interval:function(){return+this._animCfg().interval||1e3},_clock:function(){return this.anim?this.anim.time():("undefined"!=typeof performance&&null!==performance?performance:Date).now()},_frameAt:function(t){var e=this._frames?this._frames.list.length:0;return e?(t=0<(t=Math.floor(t/this._interval()))?t:0)<(e=e-1)?t:e:0},_framesStart:function(){if(this.fire("frame",{index:this._frames.index,id:this.frame.id()}),this._animCfg().autoplay&&!this._player.playing)return this.play()},_goto:function(t,e){var n,i,r,o=this;if(null==e&&(e=0),(n=this._frames)&&n.list.length&&(t=(i=0<t?t:0)<(r=n.list.length-1)?i:r,n.index=t,this.raw=n.list[t].raw,this._inited))return this.parse(),this.bind(),this.resize(),this.anim&&0<e?this.anim.ago(e,function(){return o.render()}):this.render(),this.fire("frame",{index:t,id:n.list[t].id})},duration:function(){return this._frames?this._frames.list.length*this._interval():0},position:function(){var t=this._player;return t.playing?this._clock()-t.origin:t.pos},playing:function(){return this._player.playing},play:function(){var t=this._player;if(this._frames&&!t.playing&&this._frames.list.length)return t.pos>=this.duration()&&(t.pos=0),this._syncAnim(),this.anim&&this.anim.resume(),t.origin=this._clock()-t.pos,t.playing=!0,this.fire("play"),this._playerLoop()},pause:function(){var t=this._player;if(t.playing)return t.pos=this.position(),t.playing=!1,t.raf&&cancelAnimationFrame(t.raf),t.raf=null,this.anim&&this.anim.pause(),this.fire("pause")},seek:function(t){var e,n,i,r;if(this._frames&&this._frames.list.length)return r=this._interval(),n=(t=(i=0<(i=+(t=t&&"object"==typeof t?((t.frame||0)+(t.progress||0))*r:t)||0)?i:0)<(e=this.duration())?i:e)-(e=this._frameAt(t))*r,i=(i=+this._animCfg().transition||0)<r?i:r,0<e&&n<i?(this._goto(e-1),this.anim&&this.anim.flush(),this._goto(e,n)):(this._goto(e),this.anim&&this.anim.flush()),(r=this._player).pos=t,r.playing&&(r.origin=this._clock()-t),this.fire("progress",{time:t,duration:this.duration(),index:e})},_playerLoop:function(){var t,e=this,n=this._player;if(!n.raf&&"undefined"!=typeof requestAnimationFrame&&null!==requestAnimationFrame)return n.raf=requestAnimationFrame(t=function(){if(n.raf=null,n.playing)return e.anim&&e.anim.manual()||e._playerTick(),n.playing?n.raf=requestAnimationFrame(t):void 0})},_playerTick:function(){var t,e,n=this._player,i=this._frames;if(i&&i.list.length){if((t=this.duration())<=(e=this.position())){if(!this._animCfg().loop)return n.pos=t,n.playing=!1,this.fire("progress",{time:t,duration:t,index:i.index}),void this.fire("end");e%=t,n.origin=this._clock()-e}return(n=this._frameAt(e))!==i.index&&this._goto(n,e-n*this._interval()),this.fire("progress",{time:e,duration:t,index:n})}},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=[],a=1,u=arguments.length;a<u;++a)s.push(arguments[a]);for(e=s,a=0,i=(n=this.evtHandler[t]||[]).length;a<i;++a)r=n[a],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(a),n=n.concat(s);for(i in t)o=t[i],n.filter(u).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 a(t){return{k:i,v:t}}function u(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},interactions:function(){var n,i,r;return(this.mod||{}).interactions?(n=this.mod.interactions.call(this)||{},Object.fromEntries((()=>{var t,e=[];for(i in t=n)(r=t[i])&&r.length&&e.push([i,r]);return e})())):null}}),_.commonConfig={common:{animation:{transition:{type:"number",default:350,min:0,max:5e3,step:10},interval:{type:"number",default:1e3,min:100,max:2e4,step:50},speed:{type:"number",default:1,min:.1,max:10,step:.1},loop:{type:"boolean",default:!0},autoplay:{type:"boolean",default:!0}},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},background:{type:"color",default:"transparent"}},empty:{enabled:{type:"boolean",default:!0},text:{type:"text",default:""},color:{type:"color",default:"currentColor"},opacity:{type:"number",default:.45,min:0,max:1,step:.05},font:{size:{type:"quantity",default:"",units:[{name:"em",max:10,step:.01,default:1}]}}},brush:{fill:{type:"color",default:""},fillOpacity:{type:"number",default:"",min:0,max:1,step:.05},stroke:{type:"color",default:""},strokeOpacity:{type:"number",default:"",min:0,max:1,step:.05},strokeWidth:{type:"number",default:"",min:0,max:20,step:.5},handleFill:{type:"color",default:""},handleOpacity:{type:"number",default:"",min:0,max:1,step:.05}},annotation:{enabled:{type:"boolean",default:!0},color:{type:"color",default:"currentColor"},opacity:{type:"number",default:1,min:0,max:1,step:.05},font:{size:{type:"quantity",default:".8em",units:[{name:"em",max:10,step:.01,default:.8}]}}}}},_.i18nNs="@plotdb/chart",_.i18n={en:{text:"No data to show"},"zh-TW":{text:"沒有可顯示的資料"},"zh-CN":{text:"没有可显示的数据"},ja:{text:"表示するデータがありません"}},_.scopes={space:{x:function(t){return null},y:function(t){return null}},frame:{active:function(){return!!this._frames},count:function(){return this._frames?this._frames.list.length:0},index:function(){return this._frames?this._frames.index:-1},id:function(t){return this._frames?(this._frames.list[null!=t?t:this._frames.index]||{}).id:null},ids:function(){return this._frames?this._frames.list.map(function(t){return t.id}):[]},all:function(){var t,e;return this._frames?null!=(e=(t=this._frames).all)?e:t.all=this._parseRows([].concat.apply([],this._frames.list.map(function(t){return t.raw}))):this._parseRows(this.raw)}},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,i,r,o;return(i=a(t))?(n=.3*i[0]+.59*i[1]+.11*i[2],i=((this.cfg||{}).common||{}).subset||{},r=null!=(r=null!=e?e:i.fade)?r:.72,o=a(i.background)||a((this.cfg||{}).background)||[255,255,255],"rgb("+[0,1,2].map(function(t){return Math.round(n+(o[t]-n)*r)}).join(",")+")"):t}}},_.dataframe={is:o,split:function(t,n){var i={},r=[];return(t=null==t?[]:t).map(function(t){var e=t[n]+"";return i[e]||r.push(i[e]={id:t[n],raw:[]}),i[e].raw.push(t)}),{frames:r}}},"undefined"!=typeof module&&null!==module?module.exports=_:"undefined"!=typeof window&&null!==window&&(window.chart=_)}.call(this);
|
|
1
|
+
!function(){var w,e,f,c,d,t,n,s,r,o,i,a,u,l,h,p,m,y,g,_;function b(t,e,c){function d(t,e){return n.call(t,e)}var p={}.toString,n={}.hasOwnProperty,m=!0;return function t(e,n,i){var r,s,o,a,u,l,h,f;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;s=i.length;for(;s--;)if(i[s]==e)return!0;i.push(e);o=0;a=!0;if("[object Array]"==r){if(u=e.length,l=n.length,m){switch(c){case"===":a=u===l;break;case"<==":a=u<=l;break;case"<<=":a=u<l}o=u,m=!1}else a=u===l,o=u;if(a)for(;o--&&(a=o in e==o in n&&t(e[o],n[o],i)););}else{if("constructor"in e!="constructor"in n||e.constructor!=n.constructor)return!1;for(h in e)if(d(e,h)&&(o++,!(a=d(n,h)&&t(e[h],n[h],i))))break;if(a){for(h in f=0,n)d(n,h)&&++f;a=m?"<<="===c?o<f:"<=="===c?o<=f:o===f:(m=!1,o===f)}}i.pop();return a}(t,e,[])}function x(t,e){var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t}w="http://www.w3.org/2000/svg",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 b(t.type,"group","===")}).value+"]","g"),this._decimal=new RegExp("["+t.find(function(t){return b(t.type,"decimal","===")}).value+"]"),this._numeral=new RegExp("["+e.join("")+"]","g"),this._index=function(t){return i.get(t)},this}("en-US"),f=function(t){return(t=((t=null==t?"":t)+"").trim().replace(e._group,"").replace(e._decimal,".").replace(e._numeral,e._index))?+t:NaN},c=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,s,o=[];for(n in e=null==e?{}:e)o.push(n);for(t=o,i=0,s=(r=["name","order"]).length;i<s;++i)if(e[n=r[i]]&&!d(e[n]))return n;return t.filter(function(t){return!d(e[t])})[0]},n=function(){var u,l,h,a=this,f=(this.mod||{}).dimension||{};if(this._subset)return u=t(f),l=this._subset.map(function(e){var t,n,i,r,s={};for(t in n=f)i=n[t],(r=a.binding[t])&&(s[t]=i.multiple?(r.map?r:[r]).map(o):e[r.key],d(i))&&(s[t]=Array.isArray(s[t])?s[t].map(c):c(s[t]));return s;function o(t){return e[t.key]}}),h={},u&&l.map(function(t){return h[t[u]+""]=t}),this.data.map(function(t,e){var n,i,r,s=u?h[t[u]+""]:l[e],o={};for(n in i=f)r=i[n],d(r)&&(o[n]=r.multiple?(t[n]||[]).map(a):s?c(s[n]):0);return t.subset=o;function a(t,e){return s?c((s[n]||[])[e]):0}}),"shrink"===(((this.cfg||{}).common||{}).subset||{}).mode?this.data.map(function(t){var e,n,i,r=[];for(e in n=f)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})},s=function(t){return!(!t||Array.isArray(t)||!Array.isArray(t.frames))},r=function(t){return"number"==typeof t||"string"==typeof t&&t.trim()&&!isNaN(+t)},o=function(t){return t instanceof Date||"string"==typeof t&&!isNaN(Date.parse(t))},i=function(t){var e,n,s,i;return e=((t=null==t?{}:t).frames||[]).map(function(t,e){return{id:null!=t.id?t.id:e,raw:t.raw||[]}}),t=t.frameOrder,Array.isArray(t)&&t.length?(n={},e.map(function(t){return n[t.id+""]=t}),(s=t.map(function(t){return n[t+""]}).filter(function(t){return t})).concat(e.filter(function(t){for(var e=t,n=s,i=-1,r=n.length>>>0;++i<r;)if(e===n[i])return!1;return!0}))):(t=e.map(function(t){return t.id})).length&&t.every(r)?e.map(function(t,e){return{f:t,i:e}}).sort(function(t,e){return+t.f.id-+e.f.id||t.i-e.i}).map(function(t){return t.f}):t.length&&t.every(o)?(i=function(t){return t instanceof Date?t.getTime():Date.parse(t)},e.map(function(t,e){return{f:t,i:e}}).sort(function(t,e){return i(t.f.id)-i(e.f.id)||t.i-e.i}).map(function(t){return t.f})):e},a=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=[],s=0,o=(i=e[1].split("")).length;s<o;++s)n=i[s],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},u=function(t,e,n){var i,r,s,o;for(r in null==n&&(n={}),i={},s=x(x({},e=null==e?{}:e),n||{}))o=s[r],i[r]="function"==typeof o?o.bind(t):o;return i},l=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},(h=function(){return this.running=!1,this.time={now:0,last:0},this.fps(60),this.evtHandler={},this}).prototype=x(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,s=[],o=[],a=1,u=arguments.length;a<u;++a)o.push(arguments[a]);for(e=o,a=0,i=(n=this.evtHandler[t]||[]).length;a<i;++a)r=n[a],s.push(r.apply(this,e));return s},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)}))}}),p={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],debounce(150,function(){var e=!!document[n];return i.list.map(function(t){return t.throttle(e)})},!1))},add:function(t){return this.inited||this.init(),this.list.push(t)}},m={wm:new WeakMap,ro:new ResizeObserver(function(t){return t.map(function(t){return m.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)}},y=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||y(t[i],e[i],n[i]);return t}(t=null==t?{}:t,e=JSON.parse(JSON.stringify(e)),n)},g=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)},(_=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,this._frames=null,this._player={playing:!1,pos:0,origin:0,raf:null},s(this.raw)&&(this._setFrames(this.raw),this.raw=(null!=(t=this._frames.list[this._frames.index])?t.raw:void 0)||[]),n=_.scopes){if(i=n[e],null!=this[e])throw new Error("[@plotdb/chart] scope name `"+e+"` is already taken.");this[e]=u(this,i,this.mod[e])}if(null!=this.local)throw new Error("[@plotdb/chart] scope name `local` is already taken.");return this.local=u(this,{},this.mod.local),(_.utils||(_.utils={})).anim&&null==this.anim&&(this.anim=new _.utils.anim),this.anim&&this.anim.on("step",function(){if(r._player.playing)return r._playerTick()}),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=l(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=l(t.target,".data",r.root))return r.fire("hover",[{data:r.dataAccessor(t),node:t}])})),this}).prototype=x(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(w,"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 h,p.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=y(i.mod.config||{},_.commonConfig),i._defcfg=t=g(i.mod.config),y(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=x({},i.layoutOpt)).watchResize=!1,e):{root:n,watchResize:!1}))),t=proxise(function(){return m.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(){if(i._inited=!0,i._resize=function(){i.anim&&i.anim.immediate(!0);try{return i.resize(),i.render()}finally{i.anim&&i.anim.immediate(!1)}},i._layout=function(){return i.parse(),i.bind(),i.resize(),i.render()},i.parse(),i.bind(),i.resize(),i.render(),i._frames)return i._framesStart()})})},parse:function(){if(this.data=this._parseRows(this.raw),this._frames&&(this._frames.all=null),n.apply(this),this.mod.parse)return this.mod.parse.apply(this)},_parseRows:function(t){var l,e,h;return null==t&&(t=[]),l=(e=this.mod).dimension||(e.dimension={}),h=this.binding,t.map(function(e,t){var n,i,r,s,o={};for(n in i=l)r=i[n],(s=h[n])?(o[n]=r.multiple?(s.map?s:[s]).map(a):e[s.key],/[RIT]/.exec(r.type)&&!/[CN]/.exec(r.type)&&(o[n]=Array.isArray(o[n])?o[n].map(u):f(o[n]))):r.multiple&&(o[n]=[]);return o._raw=e,o._idx=t,o;function a(t){return e[t.key]}function u(t){return f(t)}})},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(){if(this._inited)return this._syncAnim(),this.mod.render&&this.mod.render.apply(this),this._brushStyle(),this._empty(),this._anno()},_emptyText:function(){var t,e,n=((this.cfg||{}).common||{}).empty||{};return n.text||(n=_.i18nNs+":text",(t="undefined"!=typeof block&&null!==block&&block.i18n&&block.i18n.module?block.i18n.module:null)&&t.t&&(e=t.t(n))&&e!==n&&"text"!==e?e:(n=(t?t.language||t.lng:null)||("undefined"!=typeof document&&null!==document?document.documentElement.lang:"")||"en",(_.i18n[n]||_.i18n[n.split("-")[0]]||(/^zh/i.exec(n)?_.i18n[/cn|hans|sg/i.exec(n)?"zh-CN":"zh-TW"]:void 0)||_.i18n.en).text))},_empty:function(){var t,e=((this.cfg||{}).common||{}).empty||{},n=!(null!=e.enabled&&!e.enabled||(this.data||[]).length);if(this.svg){if(n)return this._emptyG||(this._emptyG=document.createElementNS(w,"g"),this._emptyG.setAttribute("data-type","empty"),this._emptyG.style.pointerEvents="none"),this.svg.appendChild(this._emptyG),this._emptyG.textContent="",n=this._annoBox(),(t=document.createElementNS(w,"text")).setAttribute("x",n.x+n.width/2),t.setAttribute("y",n.y+n.height/2),t.setAttribute("text-anchor","middle"),t.setAttribute("dominant-baseline","middle"),t.style.fill=e.color||"currentColor",t.style.opacity=null!=e.opacity?e.opacity:.45,(e.font||{}).size&&(t.style.fontSize=e.font.size+""),t.textContent=this._emptyText(),this._emptyG.appendChild(t);this._emptyG&&this._emptyG.parentNode&&this._emptyG.parentNode.removeChild(this._emptyG)}},_brushStyle:function(){var t,e,n,i,r,s=[],o=((this.cfg||{}).common||{}).brush||{};if(this.svg){for(t=function(t,e,n){if(null!=n&&""!==n)return t.setAttribute(e,n)},e=0,i=(n=this.svg.querySelectorAll("rect.selection")).length;e<i;++e)t(r=n[e],"fill",o.fill),t(r,"fill-opacity",o.fillOpacity),t(r,"stroke",o.stroke),t(r,"stroke-opacity",o.strokeOpacity),t(r,"stroke-width",o.strokeWidth);for(e=0,i=(n=this.svg.querySelectorAll("rect.handle")).length;e<i;++e)t(r=n[e],"fill",o.handleFill),s.push(t(r,"fill-opacity",o.handleOpacity));return s}},_annoBox:function(){var t;if(this.layout)try{if((t=this.layout.getBox("view"))&&t.width&&t.height)return t}catch(t){}return{x:0,y:0,width:(this.box||{}).width||0,height:(this.box||{}).height||0}},_anno:function(){var t,o,e,n,i,r,s,a,u,l,h,f,c,d,p=this,m=[],y=((this.cfg||{}).common||{}).annotation||{},g=null==y.enabled||!!y.enabled,_=g&&y.notes||[],b=g&&y.reference||[];if(this.svg){if(_.length||b.length){for(this._annoG||(this._annoG=document.createElementNS(w,"g"),this._annoG.setAttribute("data-type","annotation"),this._annoG.style.pointerEvents="none"),this.svg.appendChild(this._annoG),this._annoG.textContent="",t=this._annoBox(),o=y.font||{},e=function(t,e,n,i,r){var s=document.createElementNS(w,"text");return s.setAttribute("x",e),s.setAttribute("y",n),s.setAttribute("text-anchor",i),s.setAttribute("dominant-baseline",r),s.style.fill=t.color||y.color||"currentColor",(t.size||o.size)&&(s.style.fontSize=(t.size||o.size)+""),s.style.opacity=null!=t.opacity?t.opacity:null!=y.opacity?y.opacity:1,s.textContent=t.text+"",p._annoG.appendChild(s),s},n=0,i=_.length;n<i;++n)(r=_[n])&&null!=r.text&&e(r,t.x+t.width*(null!=r.x?r.x:.5),t.y+t.height*(null!=r.y?r.y:.5),r.align||"middle",r.baseline||"middle");for(n=0,i=b.length;n<i;++n)(s=b[n])&&(a="x"===s.axis?"x":"y",null==(u=v.call(this))||isNaN(u)||u<0||u>("y"===a?t.height:t.width)||(l=document.createElementNS(w,"line"),f=(h="y"===a?[t.x,t.y+u,t.x+t.width,t.y+u]:[t.x+u,t.y,t.x+u,t.y+t.height])[1],c=h[2],d=h[3],l.setAttribute("x1",h[0]),l.setAttribute("y1",f),l.setAttribute("x2",c),l.setAttribute("y2",d),x(l.style,{stroke:s.color||y.color||"currentColor",strokeWidth:null!=s.width?s.width:1,strokeDasharray:null!=s.dash?s.dash:"4 3",opacity:null!=s.opacity?s.opacity:null!=y.opacity?y.opacity:.6}),this._annoG.appendChild(l),null!=s.label&&(h="y"===a?[t.x+t.width-2,t.y+u-3,"end","auto"]:[t.x+u+3,t.y+2,"start","hanging"],m.push(e({text:s.label,color:s.color,size:s.size,opacity:s.opacity},h[0],h[1],h[2],h[3])))));return m}this._annoG&&this._annoG.parentNode&&this._annoG.parentNode.removeChild(this._annoG)}function v(){try{return this.space[a](s.value)}catch(t){return null}}},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),m.delete(t.root),t.layout&&t.layout.destroy(),t.pause(),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)y(t,arguments[e],this.mod.config);return y(t,this.cfg,this.mod.config),y(t,this._defcfg,this.mod.config),x(this.cfg,t)},_normalizeBinding:function(t){var e,n,i,r,s,o,a,u=[];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],s=(this.mod.dimension||{})[r]||{},o=this.binding[r],a=Array.isArray(o),!s.multiple!=!a&&(s.multiple||a)&&u.push(this.binding[r]=a?o[0]:o?[o]:[]);return u},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),!t||Array.isArray(t)||s(t)||("subset"in t&&(this._subset=t.subset||null),t=(i=t).raw,e=i.binding,n=i.reinit),s(t)?(this._setFrames(t),t=(null!=(i=this._frames.list[this._frames.index])?i.raw:void 0)||[]):null!=t&&this._frames&&(this.pause(),this._frames=null,this._player.pos=0,this.anim)&&this.anim.resume(),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._frames?this._framesStart():void 0):this._pendingRaw=!0},_animCfg:function(){return((this.cfg||{}).common||{}).animation||{}},_syncAnim:function(){var t;if(this.anim)return null!=(t=this._animCfg()).transition&&this.anim.duration(t.transition),this.anim.speed(null!=t.speed?t.speed:1)},_setFrames:function(t){var e,t=i(t);return this._frames={list:t,index:0,all:null},this._frames.index=this._frameAt((t=this._player.pos)<(e=this.duration())?t:e)},_interval:function(){return+this._animCfg().interval||1e3},_clock:function(){return this.anim?this.anim.time():("undefined"!=typeof performance&&null!==performance?performance:Date).now()},_frameAt:function(t){var e=this._frames?this._frames.list.length:0;return e?(t=0<(t=Math.floor(t/this._interval()))?t:0)<(e=e-1)?t:e:0},_framesStart:function(){if(this.fire("frame",{index:this._frames.index,id:this.frame.id()}),this._animCfg().autoplay&&!this._player.playing)return this.play()},_goto:function(t,e){var n,i,r,s=this;if(null==e&&(e=0),(n=this._frames)&&n.list.length&&(t=(i=0<t?t:0)<(r=n.list.length-1)?i:r,n.index=t,this.raw=n.list[t].raw,this._inited))return this.parse(),this.bind(),this.resize(),this.anim&&0<e?this.anim.ago(e,function(){return s.render()}):this.render(),this.fire("frame",{index:t,id:n.list[t].id})},duration:function(){return this._frames?this._frames.list.length*this._interval():0},position:function(){var t=this._player;return t.playing?this._clock()-t.origin:t.pos},playing:function(){return this._player.playing},play:function(){var t=this._player;if(this._frames&&!t.playing&&this._frames.list.length)return t.pos>=this.duration()&&(t.pos=0),this._syncAnim(),this.anim&&this.anim.resume(),t.origin=this._clock()-t.pos,t.playing=!0,this.fire("play"),this._playerLoop()},pause:function(){var t=this._player;if(t.playing)return t.pos=this.position(),t.playing=!1,t.raf&&cancelAnimationFrame(t.raf),t.raf=null,this.anim&&this.anim.pause(),this.fire("pause")},seek:function(t){var e,n,i,r;if(this._frames&&this._frames.list.length)return r=this._interval(),n=(t=(i=0<(i=+(t=t&&"object"==typeof t?((t.frame||0)+(t.progress||0))*r:t)||0)?i:0)<(e=this.duration())?i:e)-(e=this._frameAt(t))*r,i=(i=+this._animCfg().transition||0)<r?i:r,0<e&&n<i?(this._goto(e-1),this.anim&&this.anim.flush(),this._goto(e,n)):(this._goto(e),this.anim&&this.anim.flush()),(r=this._player).pos=t,r.playing&&(r.origin=this._clock()-t),this.fire("progress",{time:t,duration:this.duration(),index:e})},_playerLoop:function(){var t,e=this,n=this._player;if(!n.raf&&"undefined"!=typeof requestAnimationFrame&&null!==requestAnimationFrame)return n.raf=requestAnimationFrame(t=function(){if(n.raf=null,n.playing)return e.anim&&e.anim.manual()||e._playerTick(),n.playing?n.raf=requestAnimationFrame(t):void 0})},_playerTick:function(){var t,e,n=this._player,i=this._frames;if(i&&i.list.length){if((t=this.duration())<=(e=this.position())){if(!this._animCfg().loop)return n.pos=t,n.playing=!1,this.fire("progress",{time:t,duration:t,index:i.index}),void this.fire("end");e%=t,n.origin=this._clock()-e}return(n=this._frameAt(e))!==i.index&&this._goto(n,e-n*this._interval()),this.fire("progress",{time:e,duration:t,index:n})}},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,s=[],o=[],a=1,u=arguments.length;a<u;++a)o.push(arguments[a]);for(e=o,a=0,i=(n=this.evtHandler[t]||[]).length;a<i;++a)r=n[a],s.push(r.apply(this,e));return s},filter:function(t,e){var n,i,r,s,o;for(i in null==t&&(t={}),null==e&&(e=!1),n=[],r=this.binding)s=r[i],o=(o=Array.isArray(s)?s:[s]).map(a),n=n.concat(o);for(i in t)s=t[i],n.filter(u).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 a(t){return{k:i,v:t}}function u(t){return t.k===i}function l(t){return t.v.filter=s}},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},interactions:function(){var n,i,r;return(this.mod||{}).interactions?(n=this.mod.interactions.call(this)||{},Object.fromEntries((()=>{var t,e=[];for(i in t=n)(r=t[i])&&r.length&&e.push([i,r]);return e})())):null}}),_.commonConfig={common:{animation:{transition:{type:"number",default:350,min:0,max:5e3,step:10,desc:{en:"duration of the transition when data changes, in ms","zh-TW":"資料更換時轉場動畫的長度 ( 毫秒 )"}},interval:{type:"number",default:1e3,min:100,max:2e4,step:50,desc:{en:"how long each frame stays when playing frames ( dataframe ), in ms","zh-TW":"播放多個畫面 ( dataframe ) 時每格停留的時間 ( 毫秒 )"}},speed:{type:"number",default:1,min:.1,max:10,step:.1,desc:{en:"playback speed; scales both transitions and frame time","zh-TW":"播放速度倍率,轉場與每格停留的時間一起縮放"}},loop:{type:"boolean",default:!0,desc:{en:"start over after the last frame","zh-TW":"播完最後一格後從頭再播"}},autoplay:{type:"boolean",default:!0,desc:{en:"start playing frames when the chart loads","zh-TW":"圖表載入後自動開始播放"}}},subset:{mode:{type:"choice",values:["dim","partial","shrink"],default:"dim",desc:{en:"how filtered-out data looks: dim lowers its opacity, partial greys out the unselected part of each mark, shrink draws only the selected part","zh-TW":"被篩掉的資料怎麼呈現:dim 變淡,partial 把每個圖形未選的部分變灰,shrink 只畫選中的部分"}},opacity:{type:"number",default:.2,min:0,max:1,step:.05,desc:{en:"opacity of filtered-out data in dim mode","zh-TW":"dim 模式下被篩掉的資料的透明度"}},fade:{type:"number",default:.72,min:0,max:1,step:.01,desc:{en:"in partial mode, how far the unselected part fades toward the background ( 0 to 1 )","zh-TW":"partial 模式下未選部分往背景色淡化的程度 ( 0 到 1 )"}},background:{type:"color",default:"transparent",desc:{en:"color the unselected part fades toward; set it on a dark background, or it turns light grey","zh-TW":"未選部分往哪個顏色淡化;深色底的圖要設定,否則會是亮灰色"}}},empty:{enabled:{type:"boolean",default:!0,desc:{en:"show a message in the middle when there is no data","zh-TW":"沒有資料時在繪圖區中間顯示一行字"}},text:{type:"text",default:"",desc:{en:"the message; empty uses the default, No data to show","zh-TW":"要顯示的文字;空白用預設的「沒有可顯示的資料」"}},color:{type:"color",default:"currentColor"},opacity:{type:"number",default:.45,min:0,max:1,step:.05},font:{size:{type:"quantity",default:"",units:[{name:"em",max:10,step:.01,default:1}]}}},brush:{fill:{type:"color",default:"",desc:{en:"fill color of the brush selection; empty uses the chart's default","zh-TW":"刷選框的填色;空白用圖表預設"}},fillOpacity:{type:"number",default:"",min:0,max:1,step:.05},stroke:{type:"color",default:"",desc:{en:"outline color of the brush selection; empty uses the chart's default","zh-TW":"刷選框的外框顏色;空白用圖表預設"}},strokeOpacity:{type:"number",default:"",min:0,max:1,step:.05},strokeWidth:{type:"number",default:"",min:0,max:20,step:.5},handleFill:{type:"color",default:"",desc:{en:"color of the handles at both ends of the brush","zh-TW":"刷選框兩端握把的顏色"}},handleOpacity:{type:"number",default:"",min:0,max:1,step:.05}},annotation:{enabled:{type:"boolean",default:!0,desc:{en:"show annotations ( notes and reference lines ) on the chart","zh-TW":"顯示圖上的標記 ( 註記與參考線 )"}},color:{type:"color",default:"currentColor"},opacity:{type:"number",default:1,min:0,max:1,step:.05},font:{size:{type:"quantity",default:".8em",units:[{name:"em",max:10,step:.01,default:.8}]}}}}},_.i18nNs="@plotdb/chart",_.i18n={en:{text:"No data to show"},"zh-TW":{text:"沒有可顯示的資料"},"zh-CN":{text:"没有可显示的数据"},ja:{text:"表示するデータがありません"}},_.scopes={space:{x:function(t){return null},y:function(t){return null}},frame:{active:function(){return!!this._frames},count:function(){return this._frames?this._frames.list.length:0},index:function(){return this._frames?this._frames.index:-1},id:function(t){return this._frames?(this._frames.list[null!=t?t:this._frames.index]||{}).id:null},ids:function(){return this._frames?this._frames.list.map(function(t){return t.id}):[]},all:function(){var t,e;return this._frames?null!=(e=(t=this._frames).all)?e:t.all=this._parseRows([].concat.apply([],this._frames.list.map(function(t){return t.raw}))):this._parseRows(this.raw)}},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,i,r,s;return(i=a(t))?(n=.3*i[0]+.59*i[1]+.11*i[2],i=((this.cfg||{}).common||{}).subset||{},r=null!=(r=null!=e?e:i.fade)?r:.72,s=a(i.background)||a((this.cfg||{}).background)||[255,255,255],"rgb("+[0,1,2].map(function(t){return Math.round(n+(s[t]-n)*r)}).join(",")+")"):t}}},_.dataframe={is:s,split:function(t,n){var i={},r=[];return(t=null==t?[]:t).map(function(t){var e=t[n]+"";return i[e]||r.push(i[e]={id:t[n],raw:[]}),i[e].raw.push(t)}),{frames:r}}},"undefined"!=typeof module&&null!==module?module.exports=_:"undefined"!=typeof window&&null!==window&&(window.chart=_)}.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.16.
|
|
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.16.1","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/ldcolorpicker":"^3.0.6","@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","@zbryikt/voronoijs":"^1.0.0","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","choosefont.js":"^0.0.1","d3":"^7.9.2","d3-force-boundary":"^0.0.2","fedep":"^1.9.0","jsdom":"^22.1.0","ldbutton":"^2.0.5","ldcover":"^3.6.1","ldfile":"^2.0.1","ldiconfont":"^0.2.8","ldloader":"^3.0.3","ldpalettepicker":"^4.1.4","ldslider":"^3.2.0","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","@plotdb/block":"^5.2.2","@plotdb/csscope":"^5.0.3","@plotdb/konfig":"^4.8.12","@plotdb/rescope":"^5.0.9","ldcolor":"^1.1.3","proxise":"^1.0.1","wrap-svg-text":"^0.0.7"}}
|