billboard.js 3.11.3 → 3.12.0-next.2
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/README.md +1 -5
- package/dist/billboard.css +13 -1
- package/dist/billboard.js +19672 -24210
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +26 -3
- package/dist/billboard.pkgd.js +24515 -30430
- package/dist/billboard.pkgd.min.js +33 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +77 -175
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -3
- package/dist/plugin/billboardjs-plugin-sparkline.js +429 -1134
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +666 -1524
- package/dist/plugin/billboardjs-plugin-stanford.min.js +15 -3
- package/dist/plugin/billboardjs-plugin-tableview.js +503 -1175
- package/dist/plugin/billboardjs-plugin-tableview.min.js +30 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.js +351 -1055
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +1387 -1854
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2760 -3959
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +3504 -5057
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2906 -4072
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +3076 -4506
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
- package/dist/theme/dark.css +12 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +12 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +12 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +12 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +12 -1
- package/dist/theme/modern.min.css +3 -4
- package/dist-esm/billboard.js +9297 -8527
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +20 -27
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +155 -149
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +302 -289
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +236 -236
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +41 -43
- package/package.json +29 -49
- package/src/Chart/api/axis.ts +6 -13
- package/src/Chart/api/chart.ts +12 -11
- package/src/Chart/api/data.ts +8 -7
- package/src/Chart/api/export.ts +28 -21
- package/src/Chart/api/flow.ts +4 -2
- package/src/Chart/api/grid.ts +1 -5
- package/src/Chart/api/load.ts +2 -2
- package/src/Chart/api/regions.ts +29 -5
- package/src/Chart/api/selection.ts +2 -2
- package/src/Chart/api/show.ts +2 -3
- package/src/Chart/api/subchart.ts +2 -2
- package/src/Chart/api/tooltip.ts +8 -9
- package/src/Chart/api/x.ts +2 -2
- package/src/Chart/api/zoom.ts +2 -2
- package/src/ChartInternal/Axis/Axis.ts +119 -44
- package/src/ChartInternal/Axis/AxisRenderer.ts +53 -38
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +87 -55
- package/src/ChartInternal/data/IData.ts +31 -31
- package/src/ChartInternal/data/convert.helper.ts +66 -68
- package/src/ChartInternal/data/convert.ts +11 -11
- package/src/ChartInternal/data/data.ts +51 -27
- package/src/ChartInternal/data/load.ts +7 -6
- package/src/ChartInternal/interactions/drag.ts +2 -1
- package/src/ChartInternal/interactions/eventrect.ts +84 -32
- package/src/ChartInternal/interactions/flow.ts +14 -4
- package/src/ChartInternal/interactions/interaction.ts +51 -22
- package/src/ChartInternal/interactions/subchart.ts +27 -25
- package/src/ChartInternal/interactions/zoom.ts +29 -18
- package/src/ChartInternal/internals/category.ts +1 -1
- package/src/ChartInternal/internals/class.ts +6 -6
- package/src/ChartInternal/internals/clip.ts +8 -4
- package/src/ChartInternal/internals/color.ts +70 -42
- package/src/ChartInternal/internals/domain.ts +59 -28
- package/src/ChartInternal/internals/format.ts +5 -5
- package/src/ChartInternal/internals/grid.ts +131 -47
- package/src/ChartInternal/internals/legend.ts +93 -61
- package/src/ChartInternal/internals/redraw.ts +6 -2
- package/src/ChartInternal/internals/region.ts +5 -3
- package/src/ChartInternal/internals/scale.ts +28 -15
- package/src/ChartInternal/internals/selection.ts +14 -13
- package/src/ChartInternal/internals/size.axis.ts +18 -10
- package/src/ChartInternal/internals/size.ts +98 -67
- package/src/ChartInternal/internals/style.ts +21 -19
- package/src/ChartInternal/internals/text.ts +79 -43
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +78 -32
- package/src/ChartInternal/internals/transform.ts +4 -4
- package/src/ChartInternal/internals/type.ts +17 -12
- package/src/ChartInternal/shape/arc.ts +78 -44
- package/src/ChartInternal/shape/area.ts +19 -22
- package/src/ChartInternal/shape/bar.ts +41 -31
- package/src/ChartInternal/shape/bubble.ts +5 -5
- package/src/ChartInternal/shape/candlestick.ts +15 -13
- package/src/ChartInternal/shape/funnel.ts +317 -0
- package/src/ChartInternal/shape/gauge.ts +16 -9
- package/src/ChartInternal/shape/line.ts +62 -46
- package/src/ChartInternal/shape/point.common.ts +1 -4
- package/src/ChartInternal/shape/point.ts +54 -34
- package/src/ChartInternal/shape/polar.ts +4 -2
- package/src/ChartInternal/shape/radar.ts +40 -22
- package/src/ChartInternal/shape/shape.ts +84 -58
- package/src/ChartInternal/shape/treemap.ts +31 -20
- package/src/Plugin/bubblecompare/index.ts +1 -3
- package/src/Plugin/sparkline/index.ts +3 -4
- package/src/Plugin/stanford/ColorScale.ts +3 -2
- package/src/Plugin/stanford/Elements.ts +15 -6
- package/src/Plugin/stanford/Options.ts +5 -5
- package/src/Plugin/stanford/index.ts +13 -9
- package/src/Plugin/tableview/Options.ts +1 -1
- package/src/Plugin/tableview/const.ts +1 -4
- package/src/Plugin/tableview/index.ts +11 -9
- package/src/Plugin/textoverlap/index.ts +4 -6
- package/src/config/Options/Options.ts +3 -3
- package/src/config/Options/axis/axis.ts +36 -0
- package/src/config/Options/axis/x.ts +34 -14
- package/src/config/Options/axis/y.ts +13 -13
- package/src/config/Options/axis/y2.ts +23 -10
- package/src/config/Options/common/color.ts +4 -4
- package/src/config/Options/common/grid.ts +4 -4
- package/src/config/Options/common/legend.ts +12 -13
- package/src/config/Options/common/main.ts +23 -23
- package/src/config/Options/common/point.ts +17 -18
- package/src/config/Options/common/title.ts +2 -2
- package/src/config/Options/common/tooltip.ts +13 -11
- package/src/config/Options/data/axis.ts +2 -2
- package/src/config/Options/data/data.ts +48 -45
- package/src/config/Options/interaction/interaction.ts +1 -1
- package/src/config/Options/interaction/subchart.ts +2 -2
- package/src/config/Options/interaction/zoom.ts +9 -9
- package/src/config/Options/shape/arc.ts +10 -13
- package/src/config/Options/shape/area.ts +5 -7
- package/src/config/Options/shape/bar.ts +8 -10
- package/src/config/Options/shape/bubble.ts +1 -1
- package/src/config/Options/shape/candlestick.ts +2 -2
- package/src/config/Options/shape/donut.ts +4 -4
- package/src/config/Options/shape/funnel.ts +38 -0
- package/src/config/Options/shape/gauge.ts +6 -6
- package/src/config/Options/shape/line.ts +3 -3
- package/src/config/Options/shape/pie.ts +5 -5
- package/src/config/Options/shape/polar.ts +3 -3
- package/src/config/Options/shape/radar.ts +2 -2
- package/src/config/Options/shape/scatter.ts +1 -1
- package/src/config/Options/shape/treemap.ts +1 -1
- package/src/config/Store/Element.ts +8 -5
- package/src/config/Store/State.ts +20 -13
- package/src/config/classes.ts +14 -4
- package/src/config/config.ts +1 -1
- package/src/config/const.ts +2 -0
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/interaction.ts +3 -7
- package/src/config/resolver/shape.ts +17 -12
- package/src/core.ts +2 -3
- package/src/index.esm.ts +3 -6
- package/src/index.ts +2 -2
- package/src/module/Cache.ts +2 -3
- package/src/module/browser.ts +15 -10
- package/src/module/error.ts +9 -8
- package/src/module/generator.ts +3 -5
- package/src/module/util.ts +62 -39
- package/src/module/worker.ts +14 -11
- package/src/scss/billboard.scss +18 -0
- package/src/scss/theme/dark.scss +17 -0
- package/src/scss/theme/datalab.scss +17 -0
- package/src/scss/theme/graph.scss +17 -0
- package/src/scss/theme/insight.scss +17 -0
- package/src/scss/theme/modern.scss +17 -0
- package/types/axis.d.ts +17 -0
- package/types/bb.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/options.d.ts +9 -0
- package/types/options.shape.d.ts +26 -1
- package/types/types.d.ts +1 -0
|
@@ -5,8 +5,35 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.12.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/
|
|
12
|
-
|
|
11
|
+
*/(function(u,b){typeof exports=="object"&&typeof module=="object"?module.exports=b(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],b):typeof exports=="object"?exports.bb=b(require("d3-brush"),require("d3-selection")):(u.bb=u.bb||{},u.bb.plugin=u.bb.plugin||{},u.bb.plugin.tableview=b(u.d3,u.d3))})(this,function(M,u){return function(){"use strict";var b={853:function(c){c.exports=M},747:function(c){c.exports=u}},D={};function d(c){var f=D[c];if(f!==void 0)return f.exports;var a=D[c]={exports:{}};return b[c](a,a.exports,d),a.exports}(function(){d.d=function(c,f){for(var a in f)d.o(f,a)&&!d.o(c,a)&&Object.defineProperty(c,a,{enumerable:!0,get:f[a]})}})(),function(){d.o=function(c,f){return Object.prototype.hasOwnProperty.call(c,f)}}();var _={};return function(){d.d(_,{default:function(){return be}});var c=d(853),f=d(747);function a(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function L(e){const n=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",t=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=r=>setTimeout(r,1),i=r=>clearTimeout(r);return[n?e.requestAnimationFrame:o,n?e.cancelAnimationFrame:i,t?e.requestIdleCallback:o,t?e.cancelIdleCallback:i]}const y=a(),U=y==null?void 0:y.document,[pe,me,ge,_e]=L(y);var z=Object.defineProperty,A=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,N=(e,n,t)=>n in e?z(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,I=(e,n)=>{for(var t in n||(n={}))X.call(n,t)&&N(e,t,n[t]);if(A)for(var t of A(n))Y.call(n,t)&&N(e,t,n[t]);return e};const ye=e=>e||e===0,H=e=>typeof e=="function",v=e=>typeof e=="string",w=e=>typeof e=="number",k=e=>typeof e=="undefined",F=e=>typeof e!="undefined",ve=e=>typeof e=="boolean",we=e=>Math.ceil(e/10)*10,Oe=e=>Math.ceil(e)+.5,xe=e=>e[1]-e[0],P=e=>typeof e=="object",G=e=>k(e)||e===null||v(e)&&e.length===0||P(e)&&!(e instanceof Date)&&Object.keys(e).length===0||w(e)&&isNaN(e),K=e=>!G(e),$=e=>Array.isArray(e),O=e=>e&&!(e!=null&&e.nodeType)&&P(e)&&!$(e);function Ee(e,n,t){return F(e[n])?e[n]:t}function Pe(e,n){let t=!1;return Object.keys(e).forEach(o=>e[o]===n&&(t=!0)),t}function $e(e,n,...t){const o=H(e);return o&&e.call(n,...t),o}function Te(e,n){let t=0;const o=function(...i){!--t&&n.apply(this,...i)};"duration"in e?e.each(()=>++t).on("end",o):(++t,e.call(o))}function je(e){return v(e)?e.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):e}function Ce(e,n,t=[-1,1],o=!1){if(!(!e||!v(n)))if(n.indexOf(`
|
|
12
|
+
`)===-1)e.text(n);else{const i=[e.text(),n].map(r=>r.replace(/[\s\n]/g,""));if(i[0]!==i[1]){const r=n.split(`
|
|
13
|
+
`),l=o?r.length-1:1;e.html(""),r.forEach((s,S)=>{e.append("tspan").attr("x",0).attr("dy",`${S===0?t[0]*l:t[1]}em`).text(s)})}}}function W(e){const{x:n,y:t,width:o,height:i}=e.getBBox();return[{x:n,y:t+i},{x:n,y:t},{x:n+o,y:t},{x:n+o,y:t+i}]}function Se(e){const{width:n,height:t}=e.getBoundingClientRect(),o=W(e),i=o[0].x,r=Math.min(o[0].y,o[1].y);return{x:i,y:r,width:n,height:t}}function Me(e,n){var t;const o=e&&((t=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:t[0]);let i=[0,0];try{i=d3Pointer(o||e,n)}catch(r){}return i.map(r=>isNaN(r)?0:r)}function J(e){const{event:n,$el:t}=e,o=t.subchart.main||t.main;let i;return n&&n.type==="brush"?i=n.selection:o&&(i=o.select(".bb-brush").node())&&(i=d3BrushSelection(i)),i}function De(e){return!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+e.getAttribute("width")?e.rect=e.getBoundingClientRect():e.rect}function Ae(e=!0,n=0,t=1e4){const o=window.crypto||window.msCrypto,i=o?n+o.getRandomValues(new Uint32Array(1))[0]%(t-n+1):Math.floor(Math.random()*(t-n)+n);return e?String(i):i}function B(e,n,t,o,i){if(t>o)return-1;const r=Math.floor((t+o)/2);let{x:l,w:s=0}=e[r];return i&&(l=e[r].y,s=e[r].h),n>=l&&n<=l+s?r:n<l?B(e,n,t,r-1,i):B(e,n,r+1,o,i)}function Ne(e){const n=J(e);return n?n[0]===n[1]:!0}function Ie(...e){const n=t=>{if(O(t)&&t.constructor){const o=new t.constructor;for(const i in t)o[i]=n(t[i]);return o}return t};return e.map(t=>n(t)).reduce((t,o)=>I(I({},t),o))}function Q(e={},n){$(n)&&n.forEach(t=>Q(e,t));for(const t in n)/^\d+$/.test(t)||t in e||(e[t]=n[t]);return e}const Fe=e=>e.charAt(0).toUpperCase()+e.slice(1);function Be(e,n="-"){return e.split(n).map((t,o)=>o?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()).join("")}const Z=e=>[].slice.call(e);function Re(e,n,t){const{rootSelector:o="",sheet:i}=e,l=`${o} ${(s=>s.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(n)} {${t.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](l,i.cssRules.length)}function qe(e){let n=[];return e.forEach(t=>{var o;try{t.cssRules&&t.cssRules.length&&(n=n.concat(Z(t.cssRules)))}catch(i){(o=window.console)==null||o.warn(`Error while reading rules from ${t.href}: ${i.toString()}`)}}),n}function Ve(e){var n,t,o,i;return{x:((t=(n=window.pageXOffset)!=null?n:window.scrollX)!=null?t:0)+e.scrollLeft,y:((i=(o=window.pageYOffset)!=null?o:window.scrollY)!=null?i:0)+e.scrollTop}}function Le(e){const n=e?e.transform:null,t=n&&n.baseVal;return t&&t.numberOfItems?t.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ue(e){const n=e[0]instanceof Date,t=(n?e.map(Number):e).filter((o,i,r)=>r.indexOf(o)===i);return n?t.map(o=>new Date(o)):t}function ze(e){return e&&e.length?e.reduce((n,t)=>n.concat(t)):[]}function T(e,...n){if(!n.length||n.length===1&&!n[0])return e;const t=n.shift();return O(e)&&O(t)&&Object.keys(t).forEach(o=>{const i=t[o];O(i)?(!e[o]&&(e[o]={}),e[o]=T(e[o],i)):e[o]=$(i)?i.concat():i}),T(e,...n)}function ee(e,n=!0){let t;return e[0]instanceof Date?t=n?(o,i)=>o-i:(o,i)=>i-o:n&&!e.every(isNaN)?t=(o,i)=>o-i:n||(t=(o,i)=>o>i&&-1||o<i&&1||o===i&&0),e.concat().sort(t)}function Xe(e,n){let t=n.filter(o=>K(o));return t.length?w(t[0])?t=Math[e](...t):t[0]instanceof Date&&(t=ee(t,e==="min")[0]):t=void 0,t}const Ye=(e,n,t=1)=>{const o=[],i=Math.max(0,Math.ceil((n-e)/t))|0;for(let r=e;r<i;r++)o.push(e+r*t);return o},He={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(n,t,o=e())=>{n.dispatchEvent(new MouseEvent(t,o))}}catch(n){return(t,o,i=e())=>{const r=U.createEvent("MouseEvent");r.initMouseEvent(o,i.bubbles,i.cancelable,y,0,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}})(),touch:(e,n,t)=>{const o=new Touch(T({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},t));e.dispatchEvent(new TouchEvent(n,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function x(e,n){let t=e;for(const o in n)t=t.replace(new RegExp(`{=${o}}`,"g"),n[o]);return t}function ke(e){var n;let t;if(e instanceof Date)t=e;else if(v(e)){const{config:o,format:i}=this;t=(n=i.dataTime(o.data_xFormat)(e))!=null?n:new Date(e)}else w(e)&&!isNaN(e)&&(t=new Date(+e));return(!t||isNaN(+t))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),t}function Ge(){var e,n;return((e=document)==null?void 0:e.hidden)===!1||((n=document)==null?void 0:n.visibilityState)==="visible"}function Ke(e,n){const{DocumentTouch:t,matchMedia:o,navigator:i}=window;let r=!1;if(n)if(i&&"maxTouchPoints"in i)r=i.maxTouchPoints>0;else if("ontouchmove"in window||t&&document instanceof t)r=!0;else if(o!=null&&o("(pointer:coarse)").matches)r=!0;else{const s=i.userAgent;r=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(s)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(s)}return e&&["any-hover:hover","any-pointer:fine"].some(s=>o==null?void 0:o(`(${s})`).matches)&&"mouse"||r&&"touch"||"mouse"}function te(e,n){n()===!1?requestAnimationFrame(()=>te(e,n)):e()}function ne(e){const n=this.config;let t,o,i;const r=()=>{const l=o.shift();if(l&&t&&P(t)&&l in t)return t=t[l],r();if(!l)return t};Object.keys(n).forEach(l=>{t=e,o=l.split("_"),i=r(),F(i)&&(n[l]=i)}),this.api&&(this.state.orgConfig=e)}var oe=Object.defineProperty,ie=(e,n,t)=>n in e?oe(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,j=(e,n,t)=>(ie(e,typeof n!="symbol"?n+"":n,t),t);class R{constructor(n={}){j(this,"$$"),j(this,"options"),this.options=n}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(n=>{this[n]=null,delete this[n]})}}j(R,"version","3.12.0-next.2");const h={id:"__tableview-style__",class:"bb-tableview",rule:`.bb-tableview {
|
|
14
|
+
border-collapse:collapse;
|
|
15
|
+
border-spacing:0;
|
|
16
|
+
background:#fff;
|
|
17
|
+
min-width:100%;
|
|
18
|
+
margin-top:10px;
|
|
19
|
+
font-family:sans-serif;
|
|
20
|
+
font-size:.9em;
|
|
21
|
+
}
|
|
22
|
+
.bb-tableview tr:hover {
|
|
23
|
+
background:#eef7ff;
|
|
24
|
+
}
|
|
25
|
+
.bb-tableview thead tr {
|
|
26
|
+
background:#f8f8f8;
|
|
27
|
+
}
|
|
28
|
+
.bb-tableview caption,.bb-tableview td,.bb-tableview th {
|
|
29
|
+
text-align: center;
|
|
30
|
+
border:1px solid silver;
|
|
31
|
+
padding:.5em;
|
|
32
|
+
}
|
|
33
|
+
.bb-tableview caption {
|
|
34
|
+
font-size:1.1em;
|
|
35
|
+
font-weight:700;
|
|
36
|
+
margin-bottom: -1px;
|
|
37
|
+
}`},g={body:`<caption>{=title}</caption>
|
|
38
|
+
<thead><tr>{=thead}</tr></thead>
|
|
39
|
+
<tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class re{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(n){let t=n;return this.$$.axis.isCategorized()?t=this.$$.categoryName(n):this.$$.axis.isTimeSeries()&&(t=n.toLocaleDateString()),t},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var le=Object.defineProperty,se=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,C=(e,n,t)=>n in e?le(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,fe=(e,n)=>{for(var t in n||(n={}))ae.call(n,t)&&C(e,t,n[t]);if(q)for(var t of q(n))ue.call(n,t)&&C(e,t,n[t]);return e},de=(e,n)=>se(e,ce(n)),V=(e,n,t)=>(C(e,typeof n!="symbol"?n+"":n,t),t);class be extends R{constructor(n){return super(n),V(this,"config"),V(this,"element"),this.config=new re,this}$beforeInit(){ne.call(this,this.options)}$init(){const{class:n,selector:t,style:o}=this.config;let i=document.querySelector(t||`.${n||h.class}`);if(!i){const r=this.$$.$el.chart.node();i=document.createElement("table"),r.parentNode.insertBefore(i,r.nextSibling)}if(i.tagName!=="TABLE"){const r=document.createElement("table");i.appendChild(r),i=r}if(o&&!document.getElementById(h.id)){const r=document.createElement("style");r.id=h.id,r.innerHTML=h.rule,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)}i.classList.add(...[o&&h.class,n].filter(Boolean)),this.element=i}generateTable(){const{$$:n,config:t,element:o}=this,i=n.filterTargetsToShow(n.data.targets);let r=x(g.thead,{title:i.length?this.config.categoryTitle:""}),l="";const s=[];i.forEach(E=>{r+=x(g.thead,{title:E.id}),E.values.forEach((p,m)=>{s[m]||(s[m]=[p.x]),s[m].push(p.value)})}),s.forEach(E=>{l+=`<tr>${E.map((p,m)=>x(m?g.tbody:g.tbodyHeader,{value:m===0?t.categoryFormat.bind(this)(p):w(p)?p.toLocaleString():t.nullString})).join("")}</tr>`});const S=/(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig,he=x(g.body,de(fe({},t),{title:t.title||n.config.title_text||"",thead:r,tbody:l})).replace(S,"");o.innerHTML=he}$redraw(){const{state:n}=this.$$;!(n.resizing||!this.config.updateOnToggle&&n.toggling)&&this.generateTable()}$willDestroy(){var n,t;if((n=this.element.parentNode)==null||n.removeChild(this.element),this.$$.charts.length===1){const o=document.getElementById(h.id);(t=o==null?void 0:o.parentNode)==null||t.removeChild(o)}}}}(),_=_.default,_}()});
|