@bino-bi/bn-template-engine 1.0.0-next.19 → 1.0.0-next.21
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/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/{p-7bdc0e28.entry.js → p-28d5c266.entry.js} +1 -1
- package/dist/bn-template-engine/{p-2e6dc267.entry.js → p-2d3ea756.entry.js} +1 -1
- package/dist/bn-template-engine/{p-9879c9b2.entry.js → p-2fba7c99.entry.js} +1 -1
- package/dist/bn-template-engine/{p-eca8e2e2.entry.js → p-6077155f.entry.js} +1 -1
- package/dist/bn-template-engine/{p-74c5a95d.entry.js → p-687032d5.entry.js} +1 -1
- package/dist/bn-template-engine/{p-22d0fb7a.entry.js → p-6c7f0076.entry.js} +1 -1
- package/dist/bn-template-engine/{p-Dg9OcXAO.js → p-6lOdN-fB.js} +1 -1
- package/dist/bn-template-engine/{p-83c71b16.entry.js → p-7e9dbc93.entry.js} +1 -1
- package/dist/bn-template-engine/{p-b25455a7.entry.js → p-99477a27.entry.js} +1 -1
- package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
- package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
- package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
- package/dist/bn-template-engine/{p-Bdfxd_Ke.js → p-C5uvAEKI.js} +1 -1
- package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
- package/dist/bn-template-engine/{p-DY7YYmpa.js → p-C9i1Xsib.js} +1 -1
- package/dist/bn-template-engine/{p-BWKdb9ym.js → p-CJThzFZm.js} +1 -1
- package/dist/bn-template-engine/{p-rdqTC0_5.js → p-CYE0I1Mx.js} +1 -1
- package/dist/bn-template-engine/{p-X6CxL6W-.js → p-DwYUTvvI.js} +1 -1
- package/dist/bn-template-engine/{p-19bbac66.entry.js → p-a1380d7c.entry.js} +1 -1
- package/dist/bn-template-engine/{p-485d23d7.entry.js → p-a4ea9a79.entry.js} +1 -1
- package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
- package/dist/bn-template-engine/{p-e96da91f.entry.js → p-b9e94127.entry.js} +1 -1
- package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
- package/dist/bn-template-engine/{p-f9dfd120.entry.js → p-de29986f.entry.js} +1 -1
- package/dist/bn-template-engine/{p-BZV1b5VH.js → p-eEfqksk-.js} +1 -1
- package/dist/bn-template-engine/{p-aakBGfzL.js → p-fFtEvsY-.js} +1 -1
- package/dist/cjs/{AxisConfig-VnVelfSV.js → AxisConfig-D7CAyPLO.js} +1 -1
- package/dist/cjs/{LabelCollisionManager-nfD5P__k.js → LabelCollisionManager-DkdQ9Xdg.js} +2 -2
- package/dist/cjs/{Order-DobBozQC.js → Order-IPfAP0q8.js} +1 -1
- package/dist/cjs/{SVGStyle-BQOmGWLX.js → SVGStyle-BD8jApd4.js} +2 -2
- package/dist/cjs/{SVGVariancesStyleGroup-DCGfHrqh.js → SVGVariancesStyleGroup-BaWzR951.js} +1 -1
- package/dist/cjs/{VarianceMeasure-NY9yhiNV.js → VarianceMeasure-BBWTgv2e.js} +1 -1
- package/dist/cjs/{XYChartDataRow-B7OKrAcC.js → XYChartDataRow-BoR0CTfl.js} +4 -4
- package/dist/cjs/bn-asset_21.cjs.entry.js +93 -35
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +8 -8
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +7 -7
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +7 -7
- package/dist/cjs/bn-grid.cjs.entry.js +5 -5
- package/dist/cjs/bn-image.cjs.entry.js +4 -4
- package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
- package/dist/cjs/bn-ruleset.cjs.entry.js +1 -1
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +5 -5
- package/dist/cjs/bn-tree.cjs.entry.js +4 -4
- package/dist/cjs/{context-protocol-BDrMkhc4.js → context-protocol-BBhT9B52.js} +9 -3
- package/dist/cjs/editor-companion.cjs.entry.js +1 -1
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +5 -5
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +5 -5
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +5 -5
- package/dist/cjs/{layoutObserver-o03YUfn_.js → layoutObserver-DUYYkDMQ.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-DKZyjWj5.js → scaling-BIJQ2NV1.js} +4 -2
- package/dist/cjs/{withScalingGroup-BmcRlWBs.js → withScalingGroup-D5clRvRe.js} +1 -1
- package/dist/cjs/{withStyled-CRiC9fzc.js → withStyled-Cm9dWQhu.js} +34 -3
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +2 -2
- package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +1 -1
- package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +19 -2
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +2 -2
- package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +3 -1
- package/dist/collection/components/bn-chart-time/utils/TimeChart.js +19 -1
- package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -0
- package/dist/collection/components/bn-context/bn-context.js +20 -1
- package/dist/collection/components/bn-grid/bn-grid.js +20 -1
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +3 -3
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +3 -3
- package/dist/collection/components/bn-table/bn-table.js +2 -2
- package/dist/collection/components/bn-table/ibcs-table.js +1 -1
- package/dist/collection/components/bn-table/utils/Table.js +0 -1
- package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +3 -1
- package/dist/collection/components/bn-title/bn-title.js +5 -1
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +25 -2
- package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +4 -4
- package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
- package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
- package/dist/collection/components/bn-tree/bn-tree.js +19 -0
- package/dist/collection/stores/internationalization.js +9 -3
- package/dist/collection/utils/DateStringFactory.js +31 -0
- package/dist/collection/utils/withTranslation.js +3 -1
- package/dist/components/DateStringFactory.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/esm/{AxisConfig-C_zWCKlL.js → AxisConfig-ByIP5J-9.js} +1 -1
- package/dist/esm/{LabelCollisionManager-8swVQHKA.js → LabelCollisionManager-DaNiDiM9.js} +2 -2
- package/dist/esm/{Order-BPeWfygb.js → Order-BQeJE_yi.js} +1 -1
- package/dist/esm/{SVGStyle-BxEDw9zh.js → SVGStyle-BwBlY3Km.js} +2 -2
- package/dist/esm/{SVGVariancesStyleGroup-DRQYvSDD.js → SVGVariancesStyleGroup-BpGW4CvN.js} +1 -1
- package/dist/esm/{VarianceMeasure-DnwNKspZ.js → VarianceMeasure-CE3N8Bea.js} +1 -1
- package/dist/esm/{XYChartDataRow-DeV4r-Wm.js → XYChartDataRow-DeMI1JKU.js} +4 -4
- package/dist/esm/bn-asset_21.entry.js +93 -35
- package/dist/esm/bn-chart-bubble.entry.js +8 -8
- package/dist/esm/bn-chart-bullet.entry.js +7 -7
- package/dist/esm/bn-chart-scatter.entry.js +7 -7
- package/dist/esm/bn-grid.entry.js +5 -5
- package/dist/esm/bn-image.entry.js +4 -4
- package/dist/esm/bn-internationalization.entry.js +1 -1
- package/dist/esm/bn-ruleset.entry.js +1 -1
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-text.entry.js +5 -5
- package/dist/esm/bn-tree.entry.js +4 -4
- package/dist/esm/{context-protocol-1Yj1uKvh.js → context-protocol-d8MHrEo8.js} +9 -3
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/ibcs-chart-bubble.entry.js +5 -5
- package/dist/esm/ibcs-chart-bullet.entry.js +5 -5
- package/dist/esm/ibcs-chart-scatter.entry.js +5 -5
- package/dist/esm/{layoutObserver-BG5dOBYH.js → layoutObserver-BJBEyhNf.js} +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-CeSRcRl1.js → scaling-BGnpSN1j.js} +4 -2
- package/dist/esm/{withScalingGroup-Br70pAv9.js → withScalingGroup-CC3UcvC5.js} +1 -1
- package/dist/esm/{withStyled-Br2DGTPs.js → withStyled-2l5Tx3cf.js} +34 -3
- package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +5 -0
- package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +5 -0
- package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +2 -0
- package/dist/types/components/bn-context/bn-context.d.ts +8 -0
- package/dist/types/components/bn-grid/bn-grid.d.ts +8 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +4 -0
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +4 -0
- package/dist/types/components/bn-title/bn-title.d.ts +1 -0
- package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
- package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
- package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
- package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
- package/dist/types/components.d.ts +42 -4
- package/dist/types/utils/DateStringFactory.d.ts +19 -0
- package/dist/types/utils/withTranslation.d.ts +3 -1
- package/package.json +1 -1
- package/dist/bn-template-engine/p-209351c9.entry.js +0 -1
- package/dist/bn-template-engine/p-90806e7a.entry.js +0 -1
- package/dist/bn-template-engine/p-BqhIhYr1.js +0 -1
- package/dist/bn-template-engine/p-C0Pwqx-O.js +0 -1
- package/dist/bn-template-engine/p-CiudZRQr.js +0 -1
- package/dist/bn-template-engine/p-DTuaq8Pj.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t,f as e}from"./p-B_d-jp99.js";import{g as s,c as r,D as n}from"./p-BgIpdpfH.js";import{r as a}from"./p-B4JfKvVT.js";import{m as i,S as o,b as u,A as c,c as l,T as h,D as d,d as m,M as f,e as y,r as b}from"./p-eEfqksk-.js";import{b as N,O as g}from"./p-C5uvAEKI.js";const p=n=>{let o,u,c,l;const h=()=>{const t=u.componentStyles.state;l=i([t._system||{},t._default||{},t[c]||{}],{arrayMergeType:"overwrite"})},d=new MutationObserver((s=>{s.forEach((s=>{"selected-style"===s.attributeName&&(c=t(n).getAttribute("selected-style"),h(),e(n))}))})),m=n.connectedCallback;n.connectedCallback=()=>{const r=t(n);u=s(r),l=u.componentStyles.state._system,d.observe(r,{attributes:!0,attributeFilter:["selected-style"]}),c=t(n).getAttribute("selected-style"),h(),o=u.componentStyles.on("set",(s=>{s===c&&(c=t(n).getAttribute("selected-style"),h(),e(t(n)))})),a(m,n)};const f=n.disconnectedCallback;return n.disconnectedCallback=()=>{d.disconnect(),a(o),r(t(n)),a(f,n)},t=>t(l)},v=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,S=/^[A-Za-z_][A-Za-z0-9_]*$/,k=["min","max","avg","sum"];class D{constructor(t,e,s,r){this.label=t,this.alias=e,this.fn=s,this.arg=r}get isNumeric(){return k.includes(this.fn)}}function w(t){if("string"!=typeof t)return!1;const e=v.exec(t);if(!e)return!1;const[,s,r]=e;return"lit"===s?r.length>0:S.test(r)}function T(t,e,s){if(!w(s))return null;const[,r,n]=v.exec(s);return new D(t,e,r,n)}var O,A;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(O||(O={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(A||(A={}));class M{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),M.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),M.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case O.DAY:return this.getFormatedDayDate(t);case O.MONTH:return this.getFormatedMonthDate(t);case O.QUARTER:return this.getFormatedQuarterDate(t);case O.WEEK:return this.getFormatedWeekDate(t);case O.HOUR:return this.getFormatedHourDate(t);case O.MINUTE:return this.getFormatedMinuteDate(t);case O.SECOND:return this.getFormatedSecondDate(t);case O.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,s=32){if(null==e)return O.DAY;const r="number"==typeof t?n.fromMillis(t):t,a="number"==typeof e?n.fromMillis(e):e;return 0===a.diff(r).as("milliseconds")?O.DAY:a.diff(r).as("milliseconds")<s?O.MILLISECOND:a.diff(r).as("seconds")<s?O.SECOND:a.diff(r).as("minutes")<s?O.MINUTE:a.diff(r).as("hours")<s?O.HOUR:a.diff(r).as("days")<s?O.DAY:a.diff(r).as("weeks")<s?O.WEEK:a.diff(r).as("months")<s?O.MONTH:a.diff(r).as("quarters")<s?O.QUARTER:O.YEAR}datesBetween(t,e,s,r){const n=this.convertDateDistanceToMomentunitOfTime(s),a=t.startOf(n),i=e.endOf(n);let o=i.diff(a).as(n);const u=[];o>=r&&(o=r);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(n,1))}while(c<=i&&u.length<o);return u}getDateLinkString(t,e,s,r,a){if(null==t&&null==e)return"";if(null==t&&s!==A.END&&s!==A.YTD)return"";if(null==e&&(A.INTERVAL===s||A.CUM===s||A.END===s||A.YTD===s))return"";const i=t||n.now(),o=e;r===O.AUTO&&(r=this.calculateDistanceType(i,o,a));let u=this.getDateString(i,r),c="",l=A.NONE;return null!=o&&(c=this.getDateString(o,r),l=A.INTERVAL,u===c&&s===A.INTERVAL&&(s=A.NONE),u===c&&s===A.AVG&&(l=A.NONE),A.END!==s&&A.YTD!==s||(u=c),(s===A.INTERVAL||s===A.CUM||A.AVG)&&(r===O.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===O.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===O.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,""))))),this.dateLinkFormat[s].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case O.YEAR:e="year";break;case O.MONTH:e="month";break;case O.QUARTER:e="quarter";break;case O.WEEK:e="week";break;case O.DAY:e="day";break;case O.HOUR:e="hour";break;case O.MINUTE:e="minute";break;case O.SECOND:e="second";break;case O.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}function J(t){return null==t||""===t||"null"===t}function F(t){return J(t)||"auto"===t.trim().toLowerCase()?[]:E((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in o)))).toString())}function E(t){return J(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,s,r;const n=t.split("_"),a=null===(e=n[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(s=n[1])||void 0===s?void 0:s.toUpperCase().trim(),c=null===(r=n[2])||void 0===r?void 0:r.toUpperCase().trim();return 3!==n.length||!(a in o)||!(i in o)||!(c in u)}))}function j(t){return J(t)?[]:E(t.split(",").filter((t=>!(t.toUpperCase().trim()in o))).toString())}function L(t){return J(t)||"auto"===t.trim().toLowerCase()?[]:E(t.split(",").filter((t=>!(t.toUpperCase()in N))).toString())}function W(t){return!J(t)&&Number.isInteger(Number(t))}function $(t){return!J(t)&&!Number.isNaN(Number(t))}function q(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in g}function I(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in c}function _(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function z(t){const e=Date.parse(t);return Number.isInteger(e)}function x(t){return(null==t?void 0:t.toUpperCase())in A}function G(t){return(null==t?void 0:t.toUpperCase())in O}function K(t){return(null==t?void 0:t.toUpperCase())in l}function B(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in d}function C(t){return!J(t)&&["true","false",!0,!1].some((e=>e===t))}function H(t){return!J(t)&&(null==t?void 0:t.toUpperCase())in m}function Q(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function P(t){if(J(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!w(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function Z(t){if(J(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function R(t){return(null==t?void 0:t.trim().toUpperCase())in f}function V(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function Y(t){return(null==t?void 0:t.toUpperCase().trim())in y}function U(t){return(null==t?void 0:t.toUpperCase().trim())in h}function X(t){if(J(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function tt(t){if(J(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const s=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||s.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else s.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||s.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||s.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return s}catch(t){return["stack: invalid JSON"]}}function et(t){return!J(t)&&null!==b(t)}M.LOCALE_DATE_FORMAT={en:{week:"'W'WW yyyy",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},M.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};class st{constructor(){this.cache=new Map,this.tag=st.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const rt=new st;function nt(t){for(var e,s=0,r=0,n=t.length;n>=4;++r,n-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),s=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&s)+(59797*(s>>>16)<<16);switch(n){case 3:s^=(255&t.charCodeAt(r+2))<<16;case 2:s^=(255&t.charCodeAt(r+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(r)))+(59797*(s>>>16)<<16)}return(((s=1540483477*(65535&(s^=s>>>13))+(59797*(s>>>16)<<16))^s>>>15)>>>0).toString(36)}const at=t=>$(t)?`${t}px`:t,it={width:{className:"w",cssName:"width",attrName:"width",transform:at},height:{className:"h",cssName:"height",attrName:"height",transform:at},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:at},right:{className:"rgt",cssName:"right",attrName:"right",transform:at},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:at},left:{className:"lft",cssName:"left",attrName:"left",transform:at},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:at},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},ot=Object.keys(it);function ut(t,e){const s=function(t,e){const s=nt(e);return`bn-c-${t.className}_${s}`}(t,e),r=function(t,e,s){return`.${e} {${t.cssName}: ${s};}`}(t,s,e);return{className:s,style:r}}const ct=t=>{const e=new Map;return ot.forEach((s=>{const r=t.getAttribute(s);r&&(["top","left","right","bottom"].includes(s)&&e.set("position",ut(it.position,"absolute")),e.set(s,ut(it[s],(it[s].transform||function(t){return t})(r))))})),e},lt=new MutationObserver((t=>{for(const s of t){const t=s.target,r=ct(t);rt.apply(r);const n=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...n).join(" "),e(t)}})),ht=e=>{const s=e.connectedCallback,r=e.disconnectedCallback;e.connectedCallback=()=>{const r=t(e);if(!r)throw new Error("Can't find element field in component undefined");(t=>{const e=ct(t);rt.apply(e);const s=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),lt.observe(t,{attributes:!0,attributeFilter:ot,childList:!1,subtree:!1})})(r),a(s,e)},e.disconnectedCallback=()=>{a(r,e)}};export{X as A,P as B,T as C,O as D,_ as E,z as F,x as G,A as H,W as a,p as b,et as c,q as d,C as e,$ as f,F as g,E as h,J as i,I as j,V as k,tt as l,G as m,K as n,nt as o,M as p,j as q,U as r,B as s,H as t,Q as u,L as v,ht as w,Z as x,R as y,Y as z}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as a}from"./p-
|
|
1
|
+
import{C as a}from"./p-eEfqksk-.js";class t{static adaptDefaultString(t){return a.isString(t)?t.trim():""}static adaptArray(t,r){const c=[];return a.isArray(t)&&t.forEach((a=>{c.push(r.adapt(a))})),c}}var r,c;!function(a){a.ASC="asc",a.DESC="desc"}(r||(r={})),function(a){a.ROWGROUP="rowGroup",a.ROWGROUPINDEX="rowGroupIndex",a.CATEGORY="category",a.CATEGORYINDEX="categoryIndex",a.SUBCATEGORY="subCategory",a.SUBCATEGORYINDEX="subCategoryIndex",a.AC1="ac1",a.AC2="ac2",a.AC3="ac3",a.AC4="ac4",a.PP1="pp1",a.PP2="pp2",a.PP3="pp3",a.PP4="pp4",a.FC1="fc1",a.FC2="fc2",a.FC3="fc3",a.FC4="fc4",a.PL1="pl1",a.PL2="pl2",a.PL3="pl3",a.PL4="pl4"}(c||(c={}));class s{constructor(a=["category"],t=r.ASC){this.hierarchy=a,this.direction=t}}class o{constructor(a){this.stringAdapter=a}adapt(a){var o;const e=t.adaptArray(a.hierarchy,this.stringAdapter),p=r[null===(o=a.direction)||void 0===o?void 0:o.toUpperCase()]||r.ASC;return new s(e.map((a=>c[a.toUpperCase()]||c.CATEGORY)),p)}default(){return new s(["category"],r.ASC)}}export{t as A,r as O,s as a,c as b,o as c}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as o,f as t}from"./p-B_d-jp99.js";import{g as s,c as f}from"./p-BgIpdpfH.js";import{r as p}from"./p-B4JfKvVT.js";const n=n=>{let c,r;const i=()=>{"function"==typeof n.validateUnitScaling&&n.validateUnitScaling(n.unitScaling),"function"==typeof n.validatePercentageScaling&&n.validatePercentageScaling(n.percentageScaling),"function"==typeof n.validateSizeScaling&&n.validateSizeScaling()},e=n.connectedCallback;n.connectedCallback=()=>{const f=o(n);r=s(f),(()=>{const o=r.scalingGroups.state;for(const t of Object.keys(o))void 0!==o[t]?n.pixelPerUnitGroupMap.set(t,o[t]):n.pixelPerUnitGroupMap.delete(t)})(),i(),c=r.scalingGroups.on("set",((s,f)=>{void 0!==f?n.pixelPerUnitGroupMap.set(s,f):n.pixelPerUnitGroupMap.delete(s),i(),t(o(n))})),p(e,n)};const a=n.disconnectedCallback;n.disconnectedCallback=()=>{p(c),f(o(n)),p(a,n)}};export{n as w}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t,c as n}from"./p-
|
|
1
|
+
import{g as t,c as n}from"./p-BgIpdpfH.js";import{r as e}from"./p-B4JfKvVT.js";import{g as o,f as a}from"./p-B_d-jp99.js";const s=(t,n)=>{const e=[],o=[];for(const a of n)(t(a)?e:o).push(a);return[e,o]},i="WARN_use_dataset",r=(t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:i,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(i)},l=(a,i,l)=>{let c,u,f=[],d=[],p=[];const m=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=u.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}i(t,o)},v=()=>{f.forEach((t=>t())),f=[],d.forEach((t=>{t&&(f.push(u.db.subscribe(t,(()=>m(t,!1)))),m(t,!1),(t=>{if(l){const n=u.datasetsMeta.get(t);n&&l(t,n)}})(t))})),p.forEach((t=>{t&&(f.push(u.db.subscribe(t.substring(1),(()=>m(t,!0)))),m(t,!0))}))},h=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,d]=s((t=>t.startsWith("$")),o(a).getAttribute("datasets").split(",")),r(a,p),v())}))})),b=a.connectedCallback;a.connectedCallback=()=>{const n=o(a);u=t(n),[p,d]=s((t=>t.startsWith("$")),(n.getAttribute("datasets")||"").split(",")),r(a,p),v(),h.observe(n,{attributes:!0,attributeFilter:["datasets"]}),l&&(c=u.datasetsMeta.on("set",((t,n)=>{d.includes(t)&&l(t,n)}))),e(b,a)};const g=a.disconnectedCallback;return a.disconnectedCallback=()=>{h.disconnect(),f.forEach((t=>t())),f=[],e(c),n(o(a)),e(g,a)},t=>{d=t,v()}},c="inherited-page",u="bn-layout-page";function f(t){return"inherited-closest"===t||t===c}function d(t,n){let e=t.parentNode;for(;e;){if(e instanceof HTMLElement){const t=e.nodeName.toLowerCase();if(n===c){if(t===u)return e}else if("bn-layout-card"===t||t===u)return e}if(e.parentNode)e=e.parentNode;else{if(!(e instanceof ShadowRoot))break;e=e.host}}}const p=(t,n)=>{const s=new Map;let i,r=null;const l=t.connectedCallback;t.connectedCallback=()=>{(()=>{const e=o(t);s.clear();const l=[];for(const o of n){const n=t[o.propName];if("string"!=typeof n||!f(n))continue;if(i||(i=d(e,n)),!i)continue;const a=i.getAttribute(o.ancestorAttr);null!=a&&s.set(o.propName,a),l.push(o.ancestorAttr)}i&&l.length>0&&(r=new MutationObserver((()=>{for(const e of n){if(!f(t[e.propName]))continue;const n=i.getAttribute(e.ancestorAttr);null!=n?s.set(e.propName,n):s.delete(e.propName)}a(t)})),r.observe(i,{attributes:!0,attributeFilter:l}))})(),e(l,t)};const c=t.disconnectedCallback;return t.disconnectedCallback=()=>{r&&(r.disconnect(),r=null),i=void 0,s.clear(),e(c,t)},(t,n)=>{if(f(n))return s.get(t)}},m=s=>{let i,r,l,c=null;const u=()=>{var t;const n=o(s);if(c&&(c.disconnect(),c=null),r=null!==(t=n.getAttribute("i18n-namespace"))&&void 0!==t?t:n.getAttribute("namespace"),null!=r)return;const e=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(n);e&&(r=e.getAttribute("i18n-namespace"),c=new MutationObserver((()=>{u(),a(s)})),c.observe(e,{attributes:!0,attributeFilter:["i18n-namespace"]}))},f=new MutationObserver((t=>{t.forEach((t=>{"i18n-namespace"!==t.attributeName&&"namespace"!==t.attributeName||(u(),a(s))}))})),d=s.connectedCallback;s.connectedCallback=()=>{const n=o(s);l=t(n),f.observe(n,{attributes:!0,attributeFilter:["i18n-namespace","namespace"]}),u(),i=l.internationalization.on("set",(t=>{t!==r&&"_system"!==t||a(s)})),e(d,s)};const p=s.disconnectedCallback;return s.disconnectedCallback=()=>{f.disconnect(),c&&(c.disconnect(),c=null),e(i),n(o(s)),e(p,s)},{t:(t,n)=>{var e,a,i,c,u;t.startsWith(".")&&(t=o(s).localName+t);const f=l.internationalization.state,d=l.context.state.locale,p=null!==(i=null===(a=null===(e=f[r])||void 0===e?void 0:e[d])||void 0===a?void 0:a[t])&&void 0!==i?i:null===(u=null===(c=f._system)||void 0===c?void 0:c[d])||void 0===u?void 0:u[t];return null==p?t:p.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};function v(t,n=!1){const e=h(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),a=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),s=function(t,n=!1){let e=h(t),o=0,a=null,s=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),a=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(s*=t),e=b(e),o++;continue}const t=getComputedStyle(e),i=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${i} clientH=${e.clientHeight} h=${t.height}`),null===a)if("hidden"===i||"scroll"===i||"auto"===i)a=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(a)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(a=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=b(e),o++}return null!==a?a/s:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/s:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(a)}, h=${Math.round(s)}`,"overflow:",o.overflow),{width:Math.max(0,a),height:Math.max(0,s)}}function h(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function b(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function g(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}export{m as a,p as b,d as f,v as g,f as i,g as p,l as w}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as t}from"./p-
|
|
1
|
+
import{F as t}from"./p-DwYUTvvI.js";import"./p-eEfqksk-.js";class s{constructor(t="",s=1){this.prefix=t,this.value=s}}const e=["pl","fc","pp","ac"];function i(t){return t.replace(/\d+$/,"")}function r(t){return.299*parseInt(t.slice(1,3),16)+.587*parseInt(t.slice(3,5),16)+.114*parseInt(t.slice(5,7),16)>128?"#000000":"#ffffff"}var h;!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(h||(h={}));class n{constructor(t,s,e,i,r,n,a,o){this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.isRelativeLabel=!1,this.segmentFillColor=null,this.x=s,this.y=e,this.value=r,this.group=t.group().id(this.createElementID(t.toString(),i)),this.styles=n,this.isVarianceLabel=!1,this.verticalHookLocation=a||h.Top,this.horizontalHookLocation=o||h.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}updateGroup(t){return this.group=t,this}draw(e=!0,i={percent:2,decimal:1},r=new s){if(this.isEmpty())return this;const h=this.group;let n,a="";if(!1===Number.isNaN(Number(this.value))){let s="percent",e=i.percent,h=i.percent,o=1;!1===this.isRelativeLabel&&(e=i.decimal,h=i.decimal,o=r.value,s="decimal"),n=t.number(Number(this.value),s,e,h,o),this.isVarianceLabel&&Number(this.value)>=0&&(a="+")}else n=""+this.value;const o=this.drawLabel(h,a+n);return!1===e&&(o.addClass("hide"),h.addClass("hide")),this}isEmpty(){return null==this.value||""===this.value}setPos(t,s){return this.x=t,this.y=s,this}forceStringTypeDraw(){return this.drawLabel(this.group,""+this.value),this}drawLabel(t,s){const e=this.styles.fontStyles.background||"#ffffff";let i="start";const n=t.text(s);n.move(this.x,this.y);const a=n.bbox().w,o=n.bbox().h;let c=0,l=0;const u=n.x();let f=n.y();return this.horizontalHookLocation===h.Left?(i="left",c=n.x()):this.horizontalHookLocation===h.Center?(i="middle",c=n.x()-(a+2)/2):this.horizontalHookLocation===h.Right&&(i="end",c=n.x()-a),this.verticalHookLocation===h.Center?(f=n.y()-1.2*o/2,l=f+.2*o):this.verticalHookLocation===h.Top?(f-=o/4,l=f+.2*o):this.verticalHookLocation===h.Bottom&&(f-=o,l=f+.2*o),n.move(u,f),n.font({anchor:i}),null!=this.segmentFillColor?n.fill(r(this.segmentFillColor)):t.rect(a+2,.8*o).stroke(e).fill(e).opacity(.9).move(c-1,l).insertBefore(n),n}createElementID(t,s){return t+"_"+s+"_"+this.ID_SCENARIOLABEL}}const a={ac:1,pp:2,fc:3,pl:4};var o;!function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right"}(o||(o={}));class c{constructor(){this.labels=[],this.scenarioLabels=[]}clear(){this.labels=[],this.scenarioLabels=[]}register(t){this.labels.push(t)}hasCollision(t){return this.labels.some((s=>this.intersects(t,s)))}getOptimalPlacement(t,s,e,i,r,h,n,o){const c=a[n]||99,l=h/2;for(const h of o){const n=this.calculatePlacementForDirection(t,s,e,i,r,l,8,h);if(!this.hasCollision(n.bounds))return n}for(const h of o){const n=this.calculatePlacementForDirection(t,s,e,i,r,l,8,h);if(!this.collidesWithHigherPriority(n.bounds,c))return n}return null}calculatePlacementForDirection(t,s,e,i,r,n,a,c){let l,u,f,p,b,d;switch(c){case o.Above:l=t,u=s-n-a,f=h.Bottom,p=h.Center,b=t-e/2,d=s-n-a-i;break;case o.Below:l=t,u=s+n+a,f=h.Top,p=h.Center,b=t-e/2,d=s+n+a-i/4;break;case o.Left:l=t-n-a,u=s,f=h.Center,p=h.Right,b=t-n-a-e,d=s-.6*i;break;case o.Right:l=t+n+a,u=s,f=h.Center,p=h.Left,b=t+n+a,d=s-.6*i}return{labelX:l,labelY:u,verticalHook:f,horizontalHook:p,bounds:{x:b,y:d,width:e,height:i,pointIndex:r,preferredHook:f}}}collidesWithHigherPriority(t,s){return this.labels.some((e=>!!e.scenarioType&&((a[e.scenarioType]||99)<s&&this.intersects(t,e))))}shouldHideScenarioLabel(t,s,e,i=20){const r=a[e]||99;return!(r<=1)&&this.scenarioLabels.some((e=>{if((a[e.scenarioType]||99)>=r)return!1;const h=Math.abs(s-e.y),n=Math.abs(t-e.x);return h<i&&n<i}))}registerScenarioLabel(t,s,e){this.scenarioLabels.push({x:t,y:s,scenarioType:e})}intersects(t,s){return!(t.x+t.width<s.x||s.x+s.width<t.x||t.y+t.height<s.y||s.y+s.height<t.y)}getLabelCount(){return this.labels.length}}export{h as H,e as I,c as L,s as S,i as a,n as b,o as c,a as d,r as g}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as t,a as s}from"./p-BZV1b5VH.js";import{X as i,D as n}from"./p-BqhIhYr1.js";import{L as o,H as e}from"./p-BWKdb9ym.js";import{F as r,C as h}from"./p-X6CxL6W-.js";class l{constructor(t,s,n,o){this.scaleFactors=t,this.fontStyles=s,this.axisStyles=n,this.padding=o,this.seriesColors=[...i]}}class a{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new l(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class c{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=1,this.gridLineWidth=1}}class u{adapt(s){const i=new c;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new c}}class f{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}const d=["n","ne","e","se","s","sw","w","nw"],v=Math.SQRT1_2;class w{constructor(t,s,i=new o){this.frame=t,this.gapPx=s,this.manager=i}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),r=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!r.has(t)))}}place(t){const s=[];for(const i of t)for(const t of d){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*v+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,n){return{x:t,y:s,width:i,height:n,pointIndex:0,preferredHook:e.Center}}}class m{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,r;const h=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(h)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(r=i.to)&&void 0!==r?r:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(h)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:this.styles.scaleFactors.gridLineWidth};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:this.styles.scaleFactors.refLineWidth};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:this.styles.scaleFactors.gridLineWidth})}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const h of s.ticksX){const l=this.xScale.scale(h);t.text(r.number(h,"decimal",s.xDecimals,s.xDecimals)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:l,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const h of s.ticksY){const l=this.yScale.scale(h);t.text(r.number(h,"decimal",s.yDecimals,s.yDecimals)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:l+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class p{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=h(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of t.compareEntries)s.push({text:i.label,bold:!1,treatment:i.treatment});for(const i of t.entries)s.push({text:i.label,bold:!1,treatment:i.treatment});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){const e=this.rows(s),r=this.swatchSize+.4*this.em;let h=i,l=n;for(const s of e){let i=h;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(h,l+(this.rowHeight-this.swatchSize)/2).fill(s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=r}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:l+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?h=i+this.textWidth(s.text,s.bold)+1.5*this.em:l+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class x{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const y=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class b{adapt(s){const i=new x;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=n.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of y){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new x}}const g={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function M(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function N(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function S(t,i){return"scenario"!==t.kind?null:i+s(t.slot)}function k(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,w=0,m=0,p=0,x=0;const y=new Map,b=new Map,k=new Map,j=null!==(i=s.compareFamily)&&void 0!==i?i:null,z=null!==j?S(s.measures.x,j):null,O=null!==j?S(s.measures.y,j):null,B=null!==j&&void 0!==s.measures.size?S(s.measures.size,j):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",S=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",j=`${u}\0${t}`;if(f.has(j)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const C=M(i,s.measures.x),F=M(i,s.measures.y);if(null===C.value||null===F.value){(C.varianceNoData||F.varianceNoData)&&w++;continue}if(N(C.value,null===(e=s.domains)||void 0===e?void 0:e.x)||N(F.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const D={name:t,seriesKey:S,facetKey:u,x:C.value,y:F.value,row:i};if(void 0!==s.measures.size){const t=M(i,s.measures.size).value;if(null===t)continue;if(t<0){p++;continue}D.size=t}if(void 0!==s.measures.share){const t=M(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,D.share=Math.min(1,Math.max(0,t))):D.share=t)}if(null!==z&&null!==O){const t=i.slotValue(z),n=i.slotValue(O),o=null!==B?i.slotValue(B):null;null===t||null===n||null!==B&&null===o?D.compare=null:N(t,null===(h=s.domains)||void 0===h?void 0:h.x)||N(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,D.compare=null):(D.compare={x:t,y:n},null!==o&&(D.compare.size=o))}if(f.add(j),k.has(u)||k.set(u,[]),k.get(u).push(D),null!==s.facetLevel){const t=i[g[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[g[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(S))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(S,t)}}const C=[...k.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),F=C.map((t=>{let i=k.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),D=new Set;for(const t of F)for(const s of t.points)D.add(s.seriesKey);const H=[...D].sort(((t,s)=>{var i,n;return(null!==(i=b.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=b.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let I=null,L=0;for(const t of F)for(const s of t.points){L++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===I&&(I={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)I.xMin=Math.min(I.xMin,s),I.xMax=Math.max(I.xMax,s);for(const t of i)I.yMin=Math.min(I.yMin,t),I.yMax=Math.max(I.yMax,t);for(const t of n)I.sizeMax=Math.max(I.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),w>0&&u.push({code:"xy-variance-nodata",data:{count:String(w)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),p>0&&u.push({code:"bubble-size-negative",data:{count:String(p)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),L>5e3&&u.push({code:"xy-point-budget",data:{count:String(L)}}),{facets:F,series:H,extents:I,warnings:u,totalPoints:L}}export{f as F,w as P,u as S,b as X,p as a,m as b,a as c,k as r}
|
|
1
|
+
import{C as t,a as s}from"./p-eEfqksk-.js";import{X as i,D as n}from"./p-BgIpdpfH.js";import{L as o,H as e}from"./p-CJThzFZm.js";import{F as r,C as h}from"./p-DwYUTvvI.js";class l{constructor(t,s,n,o){this.scaleFactors=t,this.fontStyles=s,this.axisStyles=n,this.padding=o,this.seriesColors=[...i]}}class a{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new l(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class c{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=1,this.gridLineWidth=1}}class u{adapt(s){const i=new c;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new c}}class f{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}const d=["n","ne","e","se","s","sw","w","nw"],v=Math.SQRT1_2;class w{constructor(t,s,i=new o){this.frame=t,this.gapPx=s,this.manager=i}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),r=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!r.has(t)))}}place(t){const s=[];for(const i of t)for(const t of d){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*v+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,n){return{x:t,y:s,width:i,height:n,pointIndex:0,preferredHook:e.Center}}}class m{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,r;const h=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(h)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(r=i.to)&&void 0!==r?r:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(h)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:this.styles.scaleFactors.gridLineWidth};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:this.styles.scaleFactors.refLineWidth};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:this.styles.scaleFactors.gridLineWidth})}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const h of s.ticksX){const l=this.xScale.scale(h);t.text(r.number(h,"decimal",s.xDecimals,s.xDecimals)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:l,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const h of s.ticksY){const l=this.yScale.scale(h);t.text(r.number(h,"decimal",s.yDecimals,s.yDecimals)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:l+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class p{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=h(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of t.compareEntries)s.push({text:i.label,bold:!1,treatment:i.treatment});for(const i of t.entries)s.push({text:i.label,bold:!1,treatment:i.treatment});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){const e=this.rows(s),r=this.swatchSize+.4*this.em;let h=i,l=n;for(const s of e){let i=h;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(h,l+(this.rowHeight-this.swatchSize)/2).fill(s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=r}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:l+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?h=i+this.textWidth(s.text,s.bold)+1.5*this.em:l+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class x{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const y=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class b{adapt(s){const i=new x;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=n.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of y){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new x}}const g={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function M(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function N(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function k(t,i){return"scenario"!==t.kind?null:i+s(t.slot)}function S(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,w=0,m=0,p=0,x=0;const y=new Map,b=new Map,S=new Map,j=null!==(i=s.compareFamily)&&void 0!==i?i:null,z=null!==j?k(s.measures.x,j):null,F=null!==j?k(s.measures.y,j):null,O=null!==j&&void 0!==s.measures.size?k(s.measures.size,j):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",k=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",j=`${u}\0${t}`;if(f.has(j)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const C=M(i,s.measures.x),D=M(i,s.measures.y);if(null===C.value||null===D.value){(C.varianceNoData||D.varianceNoData)&&w++;continue}if(N(C.value,null===(e=s.domains)||void 0===e?void 0:e.x)||N(D.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const I={name:t,seriesKey:k,facetKey:u,x:C.value,y:D.value,row:i};if(void 0!==s.measures.size){const t=M(i,s.measures.size).value;if(null===t)continue;if(t<0){p++;continue}I.size=t}if(void 0!==s.measures.share){const t=M(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,I.share=Math.min(1,Math.max(0,t))):I.share=t)}if(null!==z&&null!==F){const t=i.slotValue(z),n=i.slotValue(F),o=null!==O?i.slotValue(O):null;null===t||null===n||null!==O&&null===o?I.compare=null:N(t,null===(h=s.domains)||void 0===h?void 0:h.x)||N(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,I.compare=null):(I.compare={x:t,y:n},null!==o&&(I.compare.size=o))}if(f.add(j),S.has(u)||S.set(u,[]),S.get(u).push(I),null!==s.facetLevel){const t=i[g[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[g[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(k))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(k,t)}}const C=[...S.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),D=C.map((t=>{let i=S.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),I=new Set;for(const t of D)for(const s of t.points)I.add(s.seriesKey);const H=[...I].sort(((t,s)=>{var i,n;return(null!==(i=b.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=b.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let B=null,L=0;for(const t of D)for(const s of t.points){L++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===B&&(B={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)B.xMin=Math.min(B.xMin,s),B.xMax=Math.max(B.xMax,s);for(const t of i)B.yMin=Math.min(B.yMin,t),B.yMax=Math.max(B.yMax,t);for(const t of n)B.sizeMax=Math.max(B.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),w>0&&u.push({code:"xy-variance-nodata",data:{count:String(w)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),p>0&&u.push({code:"bubble-size-negative",data:{count:String(p)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),L>5e3&&u.push({code:"xy-point-budget",data:{count:String(L)}}),{facets:D,series:H,extents:B,warnings:u,totalPoints:L}}export{f as F,w as P,u as S,b as X,p as a,m as b,a as c,S as r}
|