bezel-charts 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -7
- package/dist/bezel-charts.iife.js +18 -11
- package/dist/bezel-charts.js +367 -22
- package/dist/bezel-charts.min.js +18 -11
- package/dist/charts/area.js +2 -2
- package/dist/charts/bars.js +2 -2
- package/dist/charts/boxplot.js +8 -0
- package/dist/charts/donut.js +2 -2
- package/dist/charts/gauge.js +2 -2
- package/dist/charts/heatmap.js +2 -2
- package/dist/charts/histogram.js +3 -0
- package/dist/charts/line.js +2 -2
- package/dist/charts/progress.js +2 -2
- package/dist/charts/ring.js +2 -2
- package/dist/charts/scatter.js +2 -2
- package/dist/charts/{shared-APAAEWNX.js → shared-56ZZ4O3F.js} +2 -2
- package/dist/charts/{shared-XBZ5QGIC.js → shared-CYFOZG36.js} +2 -2
- package/dist/charts/shared-YIDF72XF.js +2 -0
- package/dist/charts/spark.js +2 -2
- package/package.json +7 -3
- package/src/charts/boxplot.js +134 -0
- package/src/charts/histogram.js +182 -0
- package/src/element.js +1 -1
- package/src/entries/boxplot.js +10 -0
- package/src/entries/histogram.js +10 -0
- package/src/index.js +3 -1
- package/src/render.js +1 -1
- package/dist/charts/shared-4QPUIMAU.js +0 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml)
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
|
|
12
|
-
Bezel Charts is a set of free, open-source web components:
|
|
12
|
+
Bezel Charts is a set of free, open-source web components: thirteen chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
|
|
13
13
|
|
|
14
14
|

|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ Bezel Charts is a set of free, open-source web components: eleven chart tiles dr
|
|
|
20
20
|
- **Made for READMEs.** Every chart exports as a clean static SVG, so a GitHub README can show a real chart.
|
|
21
21
|
- **Data science friendly.** Scatter plots with a least-squares trend line and Pearson's r, grouped series, goal lines and notes on key points.
|
|
22
22
|
- **Speaks your language.** Numbers and dates follow any locale, including Persian.
|
|
23
|
-
- **Light.** About
|
|
23
|
+
- **Light.** About 20 kB gzipped for all thirteen charts, or 7 to 10 kB for a page that loads just one. No dependencies and no build step.
|
|
24
24
|
- **Accessible.** Tab to any chart and step through its values with the arrow keys. Screen readers hear each value and get a hidden table of the data. Dashes, shapes and patterns tell series apart without relying on colour, and animation respects reduced-motion settings.
|
|
25
25
|
- **Python too.** `pip install bezel-charts` draws the same charts straight from a pandas DataFrame, for notebooks, reports and READMEs.
|
|
26
26
|
|
|
@@ -49,7 +49,7 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
|
|
|
49
49
|
<bezel-bars heading="Commits this week" values="4,9,6,3,8,5,3" labels="M,T,W,T,F,S,S" stat="total"></bezel-bars>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
`@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.
|
|
52
|
+
`@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.6.0` instead.
|
|
53
53
|
|
|
54
54
|
That's all. Charts fill the width of whatever they sit in and redraw when it changes, so they work in a sidebar, a card grid or a full-width section without extra CSS.
|
|
55
55
|
|
|
@@ -84,9 +84,9 @@ import { toSVG } from 'bezel-charts/line'; // render and toSVG work for every ch
|
|
|
84
84
|
| Page | Gzipped |
|
|
85
85
|
| --- | --- |
|
|
86
86
|
| One sparkline, ring, donut, gauge, progress bar or heatmap | 7.2 to 7.4 kB |
|
|
87
|
-
| One line, area, scatter or bar chart | 9.
|
|
87
|
+
| One line, area, histogram, box plot, scatter or bar chart | 9.4 to 10.4 kB |
|
|
88
88
|
| A line and a bar chart | 12.6 kB |
|
|
89
|
-
| Every chart: the full bundle |
|
|
89
|
+
| Every chart: the full bundle | 20.4 kB |
|
|
90
90
|
|
|
91
91
|
Once a page needs four or five different charts, load the full bundle instead. `<bezel-chart type="…">` works with whichever charts are loaded, and tells you which file to add if its type isn't one of them. The classic `iife.js` script always has every chart, because a classic script can't load the shared file.
|
|
92
92
|
|
|
@@ -219,6 +219,47 @@ Stacked bars put positive parts above zero and negative parts below it. The tool
|
|
|
219
219
|
|
|
220
220
|
Without `angle-labels`, labels that don't fit take turns, so only every few are shown. With it, they lean at 40 degrees and every one shows, shortened after 24 characters. The tooltip always has the full label.
|
|
221
221
|
|
|
222
|
+
### `<bezel-histogram>`
|
|
223
|
+
|
|
224
|
+
How raw values spread out. Give it the values themselves, such as 500 customers' ages, and it counts how many fall into each range. The ranges get round edges (20, 30, 40, not 19.7, 31.4) and a sensible number for the amount of data.
|
|
225
|
+
|
|
226
|
+
```html
|
|
227
|
+
<bezel-histogram heading="Commute times · minutes" values="34,28,41,22,37,30,45,26,33,52,29,38" mark="median"></bezel-histogram>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
| Attribute | Values | Default |
|
|
231
|
+
| ------------- | ---------------------------------------------------------- | ------- |
|
|
232
|
+
| `values` | raw numbers, series separated by `\|` | |
|
|
233
|
+
| `series` | series names for the legend | |
|
|
234
|
+
| `bins` | roughly how many ranges | about log₂(n) + 1 |
|
|
235
|
+
| `bin-width` | an exact width for each range, such as `5` | automatic |
|
|
236
|
+
| `mark` | `mean`, `median` or `mean,median`: a labelled line for each | none |
|
|
237
|
+
| `percent` | boolean, shares instead of counts, so groups of different sizes compare | off |
|
|
238
|
+
| `patterns` | with several series, a fill each, as on bars | off |
|
|
239
|
+
| `height` | chart height in px | `190` |
|
|
240
|
+
|
|
241
|
+
Each range includes its lower edge but not its upper one, except the last, which includes both, so the largest value always counts. Several series share the same ranges and overlap, so their spreads compare directly. `prefix`, `suffix` and `decimals` format the range edges. If you have already counted, use `<bezel-bars>` instead.
|
|
242
|
+
|
|
243
|
+
### `<bezel-boxplot>`
|
|
244
|
+
|
|
245
|
+
Box plots compare spreads side by side: one box per group of raw values. The box runs from the lower to the upper quartile, so it holds the middle half of the values, with a line at the median. The whiskers reach the furthest values within one and a half box heights, and anything further out is drawn as a dot.
|
|
246
|
+
|
|
247
|
+
```html
|
|
248
|
+
<bezel-boxplot heading="Salaries by team · £k" values="58,62,64,71,66,95|44,47,52,49,22|50,55,61,57" series="Engineering,Marketing,Product" prefix="£" suffix="k" mark="mean"></bezel-boxplot>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
| Attribute | Values | Default |
|
|
252
|
+
| ------------- | -------------------------------------------------------------- | ------- |
|
|
253
|
+
| `values` | raw numbers, one group per series, separated by `\|` | |
|
|
254
|
+
| `series` | a name for each group | |
|
|
255
|
+
| `whiskers` | `range` to reach the lowest and highest values, with no outlier dots | 1.5 × the box |
|
|
256
|
+
| `mark` | `mean` for a diamond at the mean | none |
|
|
257
|
+
| `horizontal` | boolean, lay the boxes on their side | off |
|
|
258
|
+
| `color` | one colour, or one per box | theme |
|
|
259
|
+
| `height` | chart height in px | `200` |
|
|
260
|
+
|
|
261
|
+
Quartiles are calculated the way pandas, NumPy and Excel's `QUARTILE.INC` do, so the numbers match `df.describe()`. The tooltip gives each group's median, middle half, range, outliers and count, and the hidden table lists every figure.
|
|
262
|
+
|
|
222
263
|
### `<bezel-scatter>`
|
|
223
264
|
|
|
224
265
|
How two measures move together. Pass matching `x` and `y` lists; separate groups with `|`.
|
|
@@ -447,7 +488,7 @@ bc.line(df, x="month", y=["sales", "costs"], heading="Sales", prefix="£")
|
|
|
447
488
|
bc.spark(df["signups"], heading="Signups").save("docs/signups.svg")
|
|
448
489
|
```
|
|
449
490
|
|
|
450
|
-
All
|
|
491
|
+
All thirteen charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
|
|
451
492
|
|
|
452
493
|
## Frameworks
|
|
453
494
|
|
|
@@ -492,7 +533,7 @@ docs/ the README image and social preview, with the pages that render t
|
|
|
492
533
|
test/ node:test suites, plus a Playwright browser test
|
|
493
534
|
```
|
|
494
535
|
|
|
495
|
-
Each chart is a pure function that takes its options and a theme and returns an SVG string, which keeps them easy to test and lets the same code run in Node. The full bundle has a
|
|
536
|
+
Each chart is a pure function that takes its options and a theme and returns an SVG string, which keeps them easy to test and lets the same code run in Node. The full bundle has a 22 kB gzip budget and each chart file its own, checked in CI by `npm run size`. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
496
537
|
|
|
497
538
|
## Security
|
|
498
539
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
/*! Bezel Charts v1.
|
|
2
|
-
var BezelCharts=(()=>{var Ge=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var cr=Object.prototype.hasOwnProperty;var ur=(t,e)=>{for(var r in e)Ge(t,r,{get:e[r],enumerable:!0})},hr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fr(e))!cr.call(t,i)&&i!==r&&Ge(t,i,{get:()=>e[i],enumerable:!(l=sr(e,i))||l.enumerable});return t};var mr=t=>hr(Ge({},"__esModule",{value:!0}),t);var Er={};ur(Er,{BezelChart:()=>wt,render:()=>Mt,themes:()=>Kt,toSVG:()=>Ct,types:()=>zr,version:()=>Sr});var ft="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",xt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",pr=0;function Ht(t){return"bzc"+t+(++pr).toString(36)+Math.random().toString(36).slice(2,6)}function ct(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[e]})}function a(t){return Math.round(t*100)/100}function Q(t,e,r){return Math.max(e,Math.min(r,t))}function W(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function A(t){return t!=null&&t!==""}function rt(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):A(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function U(t){return Array.isArray(t)?t.map(String):A(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function zt(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(rt):[rt(t)]:A(t)?String(t).split("|").map(rt).filter(function(e){return e.length}):[]}function Nt(t){return t.reduce(function(e,r){return e+r},0)}function Et(t,e,r){return String(t).length*e*(r?.6:.56)}function Zt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function K(t){return t===!0||t===""||t==="true"||t==="1"}function h(t,e,r){if(!isFinite(t))return"\u2013";var l=Math.abs(t),i;A(e.decimals)?i=Q(parseInt(e.decimals,10)||0,0,6):i=t%1===0?0:l<10?2:l<100?1:0;var n={maximumFractionDigits:i,minimumFractionDigits:A(e.decimals)?i:0};(K(e.compact)||r)&&l>=1e4&&(n={notation:"compact",maximumFractionDigits:1});var s;try{s=new Intl.NumberFormat(e.lang||"en-GB",n).format(l)}catch{s=String(a(l))}return(t<0?"\u2212":"")+(e.prefix||"")+s+(e.suffix||"")}function Ut(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),l=1;l<t.length;l++){var i=t[l-1],n=t[l];if(e)r+="L"+a(n[0])+","+a(n[1]);else{var s=(i[0]+n[0])/2;r+="C"+a(s)+","+a(i[1])+" "+a(s)+","+a(n[1])+" "+a(n[0])+","+a(n[1])}}return r}function O(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+ct(r)+"</text>"}function H(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+xt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function Lt(t,e,r,l,i){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,l))+'" fill="#000" fill-opacity="0" data-tip="'+ct(i)+'"/>'}function ut(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ht(t,e){var r=U(t.color).filter(Boolean);return r.length?r:e.palette}function mt(t,e,r,l,i){return O(e+l/2,r+i/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+ft+'" font-size="13"')}function Yt(t,e){return A(t.notes)?String(t.notes).split(";").map(function(r){var l=r.indexOf(":");if(l<0)return null;var i=r.slice(0,l).trim(),n=r.slice(l+1).trim(),s=e.map(String).indexOf(i);return s<0&&String(parseInt(i,10))===i&&(s=parseInt(i,10)),s>=0&&n?{i:s,text:n}:null}).filter(Boolean):[]}function It(t,e,r,l,i){var n=(A(t.goalLabel)?t.goalLabel:"Goal")+" "+h(W(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(l)+'" y1="'+a(i)+'" y2="'+a(i)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+O(l,i-5,n,H(e,10,'text-anchor="end"'))}function kt(t,e,r){var l=String(A(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var i=Nt(t),n={last:t[t.length-1],total:i,sum:i,average:i/t.length,avg:i/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(l in n))return null;var s=null;return l==="last"&&t.length>1&&e.delta!=="none"&&(s=t[t.length-1]-t[0]),{val:n[l],delta:s}}function qt(t){var e=Math.round(Q(W(t.width,360),160,2400)),r=t.frame==="none"?0:4,l=t.frame==="none"?8:20;return{W:e,b:r,P:l,w:e-2*(r+l)}}var dr=".bzc-a{animation:bzc-in .6s ease both}.bzc-d{animation:bzc-draw 1.1s cubic-bezier(.3,.7,.2,1) both}.bzc-g{transform-box:fill-box;transform-origin:50% 100%;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gn{transform-box:fill-box;transform-origin:50% 0;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gx{transform-box:fill-box;transform-origin:0 50%;animation:bzc-growx .8s cubic-bezier(.2,.8,.2,1) both}.bzc-s{animation:bzc-sweep 1.1s cubic-bezier(.2,.8,.2,1) both}@keyframes bzc-in{from{opacity:0}}@keyframes bzc-draw{from{stroke-dashoffset:1}}@keyframes bzc-grow{from{transform:scaleY(0)}}@keyframes bzc-growx{from{transform:scaleX(0)}}@keyframes bzc-sweep{from{stroke-dasharray:0 100}}@media (prefers-reduced-motion:reduce){[class^=bzc-]{animation:none!important}}";function pt(t,e,r,l,i){var n=qt(t),s=n.W,o=n.b,f=n.P,u=n.w,p=Q(W(t.corners,22),0,60),m=o+f,c="";A(t.heading)&&(c+=O(o+f,m+10,String(t.heading).toUpperCase(),H(e,11,'font-weight="600" letter-spacing="1.3"')),m+=24);var T=i&&i.stat;if(T){if(c+=O(o+f,m+30,h(T.val,t),'fill="'+e.fg+'" font-family="'+ft+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),T.delta!=null){var w=T.delta>0,B=T.delta===0,N=t.delta==="inverse"?!w:w,L=B?e.muted:N?e.up:e.down,z=(B?"\u25CF ":w?"\u25B2 ":"\u25BC ")+h(Math.abs(T.delta),t)+" "+(A(t.deltaLabel)?t.deltaLabel:"since start");c+=O(o+f+u,m+28,z,'text-anchor="end" fill="'+L+'" font-family="'+xt+'" font-size="11" font-weight="600"')}m+=44}var g=l(o+f,m,u,r),V=Math.round(m+r+f+o),k="";t.frame!=="none"?k='<rect width="'+s+'" height="'+V+'" rx="'+p+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(V-2*o)+'" rx="'+Math.max(0,p-o)+'" fill="'+(t.background||e.tile)+'"/>':A(t.background)&&(k='<rect width="'+s+'" height="'+V+'" rx="'+p+'" fill="'+t.background+'"/>');var d=(A(t.heading)?t.heading+": ":"")+(i&&i.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+V+'" width="'+s+'" height="'+V+'" role="img" aria-label="'+ct(d)+'"><title>'+ct(d)+"</title>"+(t.animate?"<style>"+dr+"</style>":"")+k+c+g+"</svg>"}function ue(t,e){var r=rt(t.values),l=ht(t,e)[0],i=W(t.height,64),n=U(t.labels),s=Yt(t,n),o=kt(r,t,"last");return pt(t,e,i,function(f,u,p,m){if(!r.length)return mt(e,f,u,p,m);var c=r.length===1?[r[0],r[0]]:r,T=Math.min.apply(null,c),w=Math.max.apply(null,c);A(t.goal)&&(T=Math.min(T,+t.goal),w=Math.max(w,+t.goal));var B=(w-T||Math.abs(w)||1)*.12;T-=B,w+=B;var N=function(v){return f+v*p/(c.length-1)},L=function(v){return u+m-(v-T)/(w-T)*m},z=c.map(function(v,x){return[N(x),L(v)]}),g=Ut(z,K(t.straight)),V=Ht("g"),k=z[z.length-1],d='<defs><linearGradient id="'+V+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+l+'" stop-opacity=".32"/><stop offset="1" stop-color="'+l+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(v){d+='<line x1="'+f+'" x2="'+(f+p)+'" y1="'+a(u+m*v)+'" y2="'+a(u+m*v)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),d+='<path d="'+g+"L"+a(k[0])+","+(u+m)+"L"+f+","+(u+m)+'Z" fill="url(#'+V+')"'+ut(t,"bzc-a")+"/>",d+='<path d="'+g+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+ut(t,"bzc-d")+"/>",A(t.goal)&&(d+=It(t,e,f,f+p,L(+t.goal))),s.forEach(function(v){if(!(v.i>=r.length)){var x=z[v.i];d+='<circle cx="'+a(x[0])+'" cy="'+a(x[1])+'" r="3.5" fill="'+e.fg+'"/>'+O(Q(x[0],f+30,f+p-30),x[1]-9,v.text,H(e,10,'text-anchor="middle"',e.fg))}}),d+='<circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="4.5" fill="'+l+'"/>',K(t.showValues)&&z.forEach(function(v,x){x<r.length&&(d+=O(v[0],v[1]-8,h(r[x],t,!0),H(e,9,'text-anchor="middle"')))});var b=r.length>1?p/(r.length-1):p;return r.forEach(function(v,x){d+=Lt(N(x)-b/2,u-6,b,m+12,(n[x]||"#"+(x+1))+": "+h(v,t))}),d},{stat:o,summary:r.length?"latest "+h(r[r.length-1],t):"no data"})}ue.table=function(t){var e=U(t.labels);return{head:["Label","Value"],rows:rt(t.values).map(function(r,l){return[e[l]||"#"+(l+1),h(r,t)]})}};var Kt={dark:{tile:"#15151d",bezel:"#000000",fg:"#f2f1f7",muted:"#8c8aa0",grid:"#2a2935",up:"#5EE6C8",down:"#F675A8",palette:["#9FA1FF","#F675A8","#5EE6C8","#FFC857","#7CC4FF","#FF8A5B"]},light:{tile:"#ffffff",bezel:"#000000",fg:"#17161f",muted:"#6b6980",grid:"#e8e6ef",up:"#12a383",down:"#d63f7c",palette:["#6E70F0","#E2508C","#16A884","#D99A0E","#2F8FE0","#EE6431"]}};var he=["spark","line","area","bars","scatter","ring","donut","gauge","progress","heatmap"],me={};function dt(t,e){me[t]=e}var gr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function Ze(t,e){if(!me[t])throw new Error(he.includes(t)?`Bezel Charts: the ${t} chart isn't loaded. Add import 'bezel-charts/${t}', or load dist/charts/${t}.js.`:`Bezel Charts: unknown chart type "${t}". Choose one of: ${he.join(", ")}.`);let r={};for(let[l,i]of Object.entries(e))r[gr(l)]=i;return r}function Mt(t,e={}){let r=Ze(t,e);r.animate=K(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return me[t](r,Kt[l])}function qe(t,e={}){return me[t].table(Ze(t,e))}function He(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function Ct(t,e={}){return He(Mt(t,{...e,animate:!1}))}var Ke=["type","values","labels","series","heading","prefix","suffix","decimals","compact","color","theme","frame","width","height","goal","goal-label","notes","show-values","stat","delta","delta-label","max","min","value","zones","horizontal","straight","zero","start","lang","corners","background","center-label","highlight","x","y","x-label","y-label","trend","static","no-tooltips","stacked","angle-labels","dash","markers","patterns"],vr=`:host{display:block;position:relative;max-width:100%}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto;overflow:visible}.tip{position:absolute;left:0;top:0;pointer-events:none;background:#0b0b10;color:#f2f1f7;font:600 12px/1.5 ${xt};padding:7px 10px;border-radius:10px;white-space:pre;opacity:0;transform:translate(-50%,calc(-100% - 12px));transition:opacity .12s;z-index:3;border:1px solid #2a2935;box-shadow:0 8px 24px rgba(0,0,0,.35)}.tip.on{opacity:1}.c{outline:none}.c:focus-visible{outline:2px solid #fff;outline-offset:3px;box-shadow:0 0 0 7px #000}.k{stroke:currentColor;stroke-width:2;stroke-opacity:1}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (forced-colors:active){.c:focus-visible{outline-color:Highlight}}`,xr={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},yr=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,br=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},Re=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>Re.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var kr=typeof HTMLElement>"u"?class{}:HTMLElement,wt=class extends kr{static get observedAttributes(){return Ke}static get themes(){return Kt}get resolvedTheme(){let e=this.getAttribute("theme");return e==="light"||e==="dark"?e:this.options.autoTheme}get chartType(){return this.getAttribute("type")||"spark"}connectedCallback(){this.shadowRoot||(this.attachShadow({mode:"open"}).innerHTML=`<style>${vr}</style><div class="c" role="group" aria-roledescription="chart"></div><p class="sr" id="h">Use the arrow keys to step through the values.</p><div class="tip" aria-hidden="true"></div><div class="sr" aria-live="polite"></div><div class="sr"></div>`,[,this.#t,,this.#r,this.#o,this.#c]=this.shadowRoot.children,this.shadowRoot.addEventListener("pointermove",e=>this.#h(e)),this.shadowRoot.addEventListener("pointerdown",e=>this.#h(e)),this.addEventListener("pointerleave",()=>this.#r.classList.remove("on")),this.#t.addEventListener("keydown",e=>this.#v(e)),this.#t.addEventListener("blur",()=>this.#g())),Re.add(this),this.#a=yr(),this.#a?.addEventListener?.("change",this.#u),typeof ResizeObserver=="function"?(this.#l=new ResizeObserver(([e])=>{let r=Math.round(e.contentRect.width);(!this.#n||!this.hasAttribute("width")&&r>0&&Math.abs(r-this.#s)>1)&&this.#i()}),this.#l.observe(this)):this.#i()}disconnectedCallback(){Re.delete(this),this.#l?.disconnect(),this.#a?.removeEventListener?.("change",this.#u)}attributeChangedCallback(){!this.#n||this.#f||(this.#f=!0,queueMicrotask(()=>{this.#f=!1,this.#i()}))}get options(){let e={};for(let r of Ke)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=br()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return He(Mt(this.chartType,{...this.options,...e,animate:!1}))}download(e){let r=URL.createObjectURL(new Blob([this.toSVG()],{type:"image/svg+xml"})),l=Object.assign(document.createElement("a"),{href:r,download:`${(e||this.getAttribute("heading")||this.chartType).replace(/[^\w-]+/g,"-").toLowerCase()}.svg`});document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}#l=null;#t=null;#r=null;#o=null;#c=null;#e=-1;#a=null;#s=0;#n=!1;#f=!1;#u=()=>{let e=this.getAttribute("theme");(!e||e==="auto")&&this.refresh()};#i(){if(!this.shadowRoot)return;let e=Math.round(this.getBoundingClientRect?.().width||0);this.#s=e>0?e:360;let r=this.options;r.animate=!this.#n&&!this.hasAttribute("static");let l,i=null;try{l=Mt(this.chartType,r),i=qe(this.chartType,r)}catch(f){l=`<p style="font:13px ${ft};color:#d63f7c">${ct(f.message)}</p>`}let n=this.#t;n.innerHTML=l.replace(/<title>[\s\S]*?<\/title>/,"");let s=n.querySelector("svg");s?(n.setAttribute("aria-label",s.getAttribute("aria-label")),s.removeAttribute("role"),s.removeAttribute("aria-label"),s.setAttribute("aria-hidden","true")):n.removeAttribute("aria-label");let o=!!s&&!this.hasAttribute("no-tooltips");o?(n.setAttribute("tabindex","0"),n.setAttribute("aria-describedby","h")):(n.removeAttribute("tabindex"),n.removeAttribute("aria-describedby")),n.style.color=Kt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,n.style.borderRadius=`${r.frame==="none"?4:Q(+r.corners||22,0,60)}px`,this.#c.innerHTML=i&&i.rows.length?Mr(r.heading,i):"",this.#e>=0&&o&&this.shadowRoot.activeElement===n?this.#d(this.#e):this.#e=-1,this.#n=!0,this.dispatchEvent(new CustomEvent("bezel-render",{bubbles:!0}))}#h(e){if(this.hasAttribute("no-tooltips"))return;let r=e.target?.closest?.("[data-tip]");if(!r){this.#r.classList.remove("on");return}this.#m(r,e.clientX,e.clientY)}#m(e,r,l){let i=this.#r;i.textContent=e.getAttribute("data-tip");let n=this.getBoundingClientRect?.()||{left:0,top:0,width:0},s=i.offsetWidth/2;i.style.left=`${Q(r-n.left,s,Math.max(s,n.width-s))}px`,i.style.top=`${l-n.top}px`,i.classList.add("on")}#p(){return[...this.#t.querySelectorAll("[data-tip]:not([data-skip])")]}#v(e){let r=this.#p(),l=r.length;if(!l)return;let i=this.#e,n=xr[e.key];if(n)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(n*=7),i=i<0?n>0?0:l-1:Q(i+n,0,l-1);else if(e.key==="Home"||e.key==="End")i=e.key==="Home"?0:l-1;else{e.key==="Escape"&&this.#g();return}e.preventDefault(),this.#d(i,!0)}#d(e,r){let l=this.#p();if(!l.length)return;e=Q(e,0,l.length-1),this.#t.querySelector(".k")?.classList.remove("k");let i=l[e],n=i.getBoundingClientRect?.()||{left:0,top:0,width:0};i.classList.add("k"),this.#e=e,this.#m(i,n.left+n.width/2,n.top),r&&(this.#o.textContent=`${i.getAttribute("data-tip").replace(/\n/g,", ")}. ${e+1} of ${l.length}`)}#g(){this.#t.querySelector(".k")?.classList.remove("k"),this.#r.classList.remove("on"),this.#o.textContent="",this.#e=-1}};function Mr(t,{head:e,rows:r}){let l=i=>i.map((n,s)=>s?`<td>${ct(n)}</td>`:`<th scope="row">${ct(n)}</th>`).join("");return`<table><caption>${ct(t||"Chart data")}</caption><thead><tr>${e.map(i=>`<th scope="col">${ct(i)}</th>`).join("")}</tr></thead><tbody>${r.map(i=>`<tr>${l(i)}</tr>`).join("")}</tbody></table>`}function gt(t){typeof customElements>"u"||typeof HTMLElement>"u"||(customElements.get(`bezel-${t}`)||customElements.define(`bezel-${t}`,class extends wt{get chartType(){return t}}),customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends wt{}))}dt("spark",ue);gt("spark");function fe(t,e,r){if(t===e)if(t===0)e=1;else{var l=Math.abs(t)*.1;t-=l,e+=l}for(var i=(e-t)/(r||4),n=Math.pow(10,Math.floor(Math.log10(i))),s=i/n,o=(s<=1?1:s<=2?2:s<=5?5:10)*n,f=Math.floor(t/o)*o,u=Math.ceil(e/o)*o,p=[],m=f;m<=u+o/2;m+=o)p.push(+m.toFixed(10));return{lo:f,hi:u,ticks:p}}function Qt(t,e,r,l,i,n,s,o){var f=l,u=i,p="",m=o||13;return t.forEach(function(c,T){var w=m+Et(c,12)+16;f>l&&f+w-16>l+n&&(f=l,u+=20),p+=(s?s(T,f,u):'<circle cx="'+a(f+4)+'" cy="'+a(u+6)+'" r="4" fill="'+e[T%e.length]+'"/>')+O(f+m,u+10,c,'fill="'+r.fg+'" font-family="'+ft+'" font-size="12"'),f+=w}),{svg:p,height:u-i+24}}var Xt={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},ee=["circle","square","triangle","diamond"],pe=["solid","stripes","dots","grid"];function Vt(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:U(t).map(function(i){return e.indexOf(i)<0?r:i});return l.length?function(i){return l[i%l.length]}:null}function re(t,e,r,l,i){var n=l*1.15,s=l*.85;return t==="square"?'<rect x="'+a(e-s)+'" y="'+a(r-s)+'" width="'+a(2*s)+'" height="'+a(2*s)+'" rx="1"'+i+"/>":t==="triangle"?'<path d="M'+a(e)+","+a(r-n)+"L"+a(e+n)+","+a(r+s)+"L"+a(e-n)+","+a(r+s)+'Z"'+i+"/>":t==="diamond"?'<path d="M'+a(e)+","+a(r-n*1.1)+"L"+a(e+n)+","+a(r)+"L"+a(e)+","+a(r+n*1.1)+"L"+a(e-n)+","+a(r)+'Z"'+i+"/>":'<circle cx="'+a(e)+'" cy="'+a(r)+'" r="'+a(l)+'"'+i+"/>"}function de(t,e,r,l){var i=' stroke="'+l+'" stroke-opacity=".55" stroke-width="1.5"';return'<pattern id="'+t+'" width="6" height="6" patternUnits="userSpaceOnUse"'+(e==="dots"?"":' patternTransform="rotate(45)"')+'><rect width="6" height="6" fill="'+r+'"/>'+(e==="dots"?'<circle cx="3" cy="3" r="1.3" fill="'+l+'" fill-opacity=".55"/>':'<path d="M3,0V6'+(e==="grid"?"M0,3H6":"")+'"'+i+"/>")+"</pattern>"}function Qe(t){return Math.max.apply(null,t.map(function(e){return Et(e,10,!0)}))+10}function ae(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=[],s=Math.max.apply(null,[0].concat(r.map(function(m){return m.length}))),o=0;o<s;o++){var f=[i[o]||"#"+(o+1)],u=0;r.forEach(function(m){f.push(o<m.length?h(m[o],t):""),u+=o<m.length?m[o]:0}),e&&f.push(h(u,t)),n.push(f)}var p=r.length>1||l.length?r.map(function(m,c){return l[c]||"Series "+(c+1)}):["Value"];return{head:["Label"].concat(p,e?["Total"]:[]),rows:n}}function ge(t,e,r,l,i,n,s){var o="",f=i,u=r.n,p=r.labels;if(r.names){var m=Qt(r.names,r.pal,e,l,f,n,r.key,r.kw);o+=m.svg,f+=m.height}var c=r.lo,T=r.hi;A(t.goal)&&(c=Math.min(c,+t.goal),T=Math.max(T,+t.goal)),r.zero&&(c=Math.min(0,c),T=Math.max(0,T));var w=fe(c,T,4),B=w.ticks.map(r.tick),N=Math.max.apply(null,B.map(function(C){return Et(C,10,!0)}))+10,L=p.length?20:4,z=l+N,g=n-N,V=s-(f-i)-L,k=function(C){return u===1?z+g/2:z+C*g/(u-1)},d=function(C){return f+V-(C-w.lo)/(w.hi-w.lo)*V};if(w.ticks.forEach(function(C,y){var M=d(C);o+='<line x1="'+a(z)+'" x2="'+a(z+g)+'" y1="'+a(M)+'" y2="'+a(M)+'" stroke="'+e.grid+'"'+(C===0?"":' stroke-dasharray="2 4"')+"/>"+O(z-8,M+3.5,B[y],H(e,10,'text-anchor="end"'))}),p.length){for(var b=Math.max(1,Math.ceil(u*(Math.max.apply(null,p.map(function(C){return Et(C,10,!0)}))+10)/g)),v=0;v<u;v+=b)if(p[v]!=null){var x=u>1&&v===0?"start":u>1&&v===u-1?"end":"middle";o+=O(k(v),f+V+15,p[v],H(e,10,'text-anchor="'+x+'"'))}}return r.notes.forEach(function(C){if(!(C.i>=u)){var y=k(C.i);o+='<line x1="'+a(y)+'" x2="'+a(y)+'" y1="'+a(f+12)+'" y2="'+a(f+V)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+O(Q(y,z+30,z+g-30),f+8,C.text,H(e,10,'text-anchor="middle"',e.fg))}}),{svg:o,X:k,Y:d,px:z,pw:g,top:f,ph:V}}function ve(t,e,r,l,i){for(var n=A(t.goal)?It(t,e,r.px,r.px+r.pw,r.Y(+t.goal)):"",s=l>1?r.pw/(l-1):r.pw,o=0;o<l;o++)n+=Lt(r.X(o)-s/2,r.top,s,r.ph,i(o));return n}function xe(t,e,r,l){return function(i,n,s){var o=t[i%t.length],f=e?Xt[e(i)]:"",u=r?r(i):"none";return'<line x1="'+a(n)+'" x2="'+a(n+18)+'" y1="'+a(s+6)+'" y2="'+a(s+6)+'" stroke="'+o+'" stroke-width="2.5" stroke-linecap="round"'+(f?' stroke-dasharray="'+f+'"':"")+"/>"+(u!=="none"?re(u,n+9,s+6,3.5,' fill="'+o+'" stroke="'+l+'" stroke-width="1.5"'):"")}}function ye(t,e,r,l,i){return i?'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+i+'"'+ut(t,"bzc-a",l*.15)+"/>":'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+l*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>"}function be(t,e,r,l,i,n,s,o){var f="",u=Math.ceil(r.length/40);return r.forEach(function(p,m){(m%u===0||m===r.length-1)&&(f+=re(e,l(m),i(p),3.5,' fill="'+n+'" stroke="'+s+'" stroke-width="1.5"'+ut(t,"bzc-a",.6+o*.15)))}),f}function ke(t,e){var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=W(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(N){return N.length}))),f=Yt(t,i),u=r.length>1||l.length>0,p=kt(r[0]||[],t,""),m=Vt(t.dash,Object.keys(Xt),"solid"),c=Vt(t.markers,ee,"none"),T=t.background||e.tile,w=(m||c)&&xe(n,m,c,T),B=function(N){return l[N]||"Series "+(N+1)};return pt(t,e,s,function(N,L,z,g){if(!o)return mt(e,N,L,z,g);var V=[].concat.apply([],r),k=ge(t,e,{n:o,names:u?r.map(function(F,P){return B(P)}):null,pal:n,key:w,kw:w&&24,lo:Math.min.apply(null,V),hi:Math.max.apply(null,V),zero:K(t.zero),labels:i,notes:f,tick:function(F){return h(F,t,!0)}},N,L,z,g),d=k.svg,b=k.X,v=k.Y,x=k.px,C=k.pw,y=k.top,M=k.ph;return r.forEach(function(F,P){var _=n[P%n.length],I=F.map(function(lt,at){return[b(at),v(lt)]});I.length===1&&(I=[[x,I[0][1]],[x+C,I[0][1]]]);var J=Ut(I,K(t.straight));if(P===0){var tt=Ht("g"),j=I[I.length-1];d+='<defs><linearGradient id="'+tt+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+_+'" stop-opacity=".26"/><stop offset="1" stop-color="'+_+'" stop-opacity="0"/></linearGradient></defs><path d="'+J+"L"+a(j[0])+","+a(y+M)+"L"+a(I[0][0])+","+a(y+M)+'Z" fill="url(#'+tt+')"'+ut(t,"bzc-a")+"/>"}var G=c?c(P):"none";if(d+=ye(t,J,_,P,m?Xt[m(P)]:""),G!=="none")d+=be(t,G,F,b,v,_,T,P);else{var et=I[I.length-1];d+='<circle cx="'+a(et[0])+'" cy="'+a(et[1])+'" r="4" fill="'+_+'" stroke="'+T+'" stroke-width="2"/>'}K(t.showValues)&&F.forEach(function(lt,at){d+=O(b(at),v(lt)-8,h(lt,t,!0),H(e,9,'text-anchor="middle"'))})}),d+ve(t,e,k,o,function(F){var P=i[F]||"#"+(F+1);return r.forEach(function(_,I){F<_.length&&(P+=`
|
|
3
|
-
`+(
|
|
4
|
-
`+(
|
|
5
|
-
Total: `+
|
|
6
|
-
`+k(
|
|
7
|
-
Total: `+
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/*! Bezel Charts v1.6.0 | MIT | github.com/ShazMoghaddam/bezel-charts */
|
|
2
|
+
var BezelCharts=(()=>{var He=Object.defineProperty;var pr=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var gr=Object.prototype.hasOwnProperty;var vr=(t,e)=>{for(var r in e)He(t,r,{get:e[r],enumerable:!0})},xr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dr(e))!gr.call(t,n)&&n!==r&&He(t,n,{get:()=>e[n],enumerable:!(l=pr(e,n))||l.enumerable});return t};var yr=t=>xr(He({},"__esModule",{value:!0}),t);var Vr={};vr(Vr,{BezelChart:()=>Lt,render:()=>zt,themes:()=>jt,toSVG:()=>Ct,types:()=>Rr,version:()=>Gr});var Mt="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",Ot="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",br=0;function Rt(t){return"bzc"+t+(++br).toString(36)+Math.random().toString(36).slice(2,6)}function kt(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[e]})}function a(t){return Math.round(t*100)/100}function st(t,e,r){return Math.max(e,Math.min(r,t))}function Z(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function G(t){return t!=null&&t!==""}function gt(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):G(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function q(t){return Array.isArray(t)?t.map(String):G(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function wt(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(gt):[gt(t)]:G(t)?String(t).split("|").map(gt).filter(function(e){return e.length}):[]}function Vt(t){return t.reduce(function(e,r){return e+r},0)}function vt(t,e,r){return String(t).length*e*(r?.6:.56)}function qt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function nt(t){return t===!0||t===""||t==="true"||t==="1"}function p(t,e,r){if(!isFinite(t))return"\u2013";var l=Math.abs(t),n;G(e.decimals)?n=st(parseInt(e.decimals,10)||0,0,6):n=t%1===0?0:l<10?2:l<100?1:0;var i={maximumFractionDigits:n,minimumFractionDigits:G(e.decimals)?n:0};(nt(e.compact)||r)&&l>=1e4&&(i={notation:"compact",maximumFractionDigits:1});var o;try{o=new Intl.NumberFormat(e.lang||"en-GB",i).format(l)}catch{o=String(a(l))}return(t<0?"\u2212":"")+(e.prefix||"")+o+(e.suffix||"")}function Yt(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),l=1;l<t.length;l++){var n=t[l-1],i=t[l];if(e)r+="L"+a(i[0])+","+a(i[1]);else{var o=(n[0]+i[0])/2;r+="C"+a(o)+","+a(n[1])+" "+a(o)+","+a(i[1])+" "+a(i[0])+","+a(i[1])}}return r}function F(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+kt(r)+"</text>"}function D(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+Ot+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function St(t,e,r,l,n){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,l))+'" fill="#000" fill-opacity="0" data-tip="'+kt(n)+'"/>'}function ut(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ct(t,e){var r=q(t.color).filter(Boolean);return r.length?r:e.palette}function ht(t,e,r,l,n){return F(e+l/2,r+n/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+Mt+'" font-size="13"')}function Xt(t,e){return G(t.notes)?String(t.notes).split(";").map(function(r){var l=r.indexOf(":");if(l<0)return null;var n=r.slice(0,l).trim(),i=r.slice(l+1).trim(),o=e.map(String).indexOf(n);return o<0&&String(parseInt(n,10))===n&&(o=parseInt(n,10)),o>=0&&i?{i:o,text:i}:null}).filter(Boolean):[]}function Ht(t,e,r,l,n){var i=(G(t.goalLabel)?t.goalLabel:"Goal")+" "+p(Z(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(l)+'" y1="'+a(n)+'" y2="'+a(n)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+F(l,n-5,i,D(e,10,'text-anchor="end"'))}function At(t,e,r){var l=String(G(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var n=Vt(t),i={last:t[t.length-1],total:n,sum:n,average:n/t.length,avg:n/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(l in i))return null;var o=null;return l==="last"&&t.length>1&&e.delta!=="none"&&(o=t[t.length-1]-t[0]),{val:i[l],delta:o}}function Jt(t){var e=Math.round(st(Z(t.width,360),160,2400)),r=t.frame==="none"?0:4,l=t.frame==="none"?8:20;return{W:e,b:r,P:l,w:e-2*(r+l)}}var Mr=".bzc-a{animation:bzc-in .6s ease both}.bzc-d{animation:bzc-draw 1.1s cubic-bezier(.3,.7,.2,1) both}.bzc-g{transform-box:fill-box;transform-origin:50% 100%;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gn{transform-box:fill-box;transform-origin:50% 0;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gx{transform-box:fill-box;transform-origin:0 50%;animation:bzc-growx .8s cubic-bezier(.2,.8,.2,1) both}.bzc-s{animation:bzc-sweep 1.1s cubic-bezier(.2,.8,.2,1) both}@keyframes bzc-in{from{opacity:0}}@keyframes bzc-draw{from{stroke-dashoffset:1}}@keyframes bzc-grow{from{transform:scaleY(0)}}@keyframes bzc-growx{from{transform:scaleX(0)}}@keyframes bzc-sweep{from{stroke-dasharray:0 100}}@media (prefers-reduced-motion:reduce){[class^=bzc-]{animation:none!important}}";function mt(t,e,r,l,n){var i=Jt(t),o=i.W,s=i.b,f=i.P,c=i.w,v=st(Z(t.corners,22),0,60),d=s+f,u="";G(t.heading)&&(u+=F(s+f,d+10,String(t.heading).toUpperCase(),D(e,11,'font-weight="600" letter-spacing="1.3"')),d+=24);var O=n&&n.stat;if(O){if(u+=F(s+f,d+30,p(O.val,t),'fill="'+e.fg+'" font-family="'+Mt+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),O.delta!=null){var T=O.delta>0,R=O.delta===0,A=t.delta==="inverse"?!T:T,C=R?e.muted:A?e.up:e.down,S=(R?"\u25CF ":T?"\u25B2 ":"\u25BC ")+p(Math.abs(O.delta),t)+" "+(G(t.deltaLabel)?t.deltaLabel:"since start");u+=F(s+f+c,d+28,S,'text-anchor="end" fill="'+C+'" font-family="'+Ot+'" font-size="11" font-weight="600"')}d+=44}var g=l(s+f,d,c,r),V=Math.round(d+r+f+s),k="";t.frame!=="none"?k='<rect width="'+o+'" height="'+V+'" rx="'+v+'" fill="'+e.bezel+'"/><rect x="'+s+'" y="'+s+'" width="'+(o-2*s)+'" height="'+(V-2*s)+'" rx="'+Math.max(0,v-s)+'" fill="'+(t.background||e.tile)+'"/>':G(t.background)&&(k='<rect width="'+o+'" height="'+V+'" rx="'+v+'" fill="'+t.background+'"/>');var x=(G(t.heading)?t.heading+": ":"")+(n&&n.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+o+" "+V+'" width="'+o+'" height="'+V+'" role="img" aria-label="'+kt(x)+'"><title>'+kt(x)+"</title>"+(t.animate?"<style>"+Mr+"</style>":"")+k+u+g+"</svg>"}function me(t,e){var r=gt(t.values),l=ct(t,e)[0],n=Z(t.height,64),i=q(t.labels),o=Xt(t,i),s=At(r,t,"last");return mt(t,e,n,function(f,c,v,d){if(!r.length)return ht(e,f,c,v,d);var u=r.length===1?[r[0],r[0]]:r,O=Math.min.apply(null,u),T=Math.max.apply(null,u);G(t.goal)&&(O=Math.min(O,+t.goal),T=Math.max(T,+t.goal));var R=(T-O||Math.abs(T)||1)*.12;O-=R,T+=R;var A=function(y){return f+y*v/(u.length-1)},C=function(y){return c+d-(y-O)/(T-O)*d},S=u.map(function(y,m){return[A(m),C(y)]}),g=Yt(S,nt(t.straight)),V=Rt("g"),k=S[S.length-1],x='<defs><linearGradient id="'+V+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+l+'" stop-opacity=".32"/><stop offset="1" stop-color="'+l+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(y){x+='<line x1="'+f+'" x2="'+(f+v)+'" y1="'+a(c+d*y)+'" y2="'+a(c+d*y)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),x+='<path d="'+g+"L"+a(k[0])+","+(c+d)+"L"+f+","+(c+d)+'Z" fill="url(#'+V+')"'+ut(t,"bzc-a")+"/>",x+='<path d="'+g+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+ut(t,"bzc-d")+"/>",G(t.goal)&&(x+=Ht(t,e,f,f+v,C(+t.goal))),o.forEach(function(y){if(!(y.i>=r.length)){var m=S[y.i];x+='<circle cx="'+a(m[0])+'" cy="'+a(m[1])+'" r="3.5" fill="'+e.fg+'"/>'+F(st(m[0],f+30,f+v-30),m[1]-9,y.text,D(e,10,'text-anchor="middle"',e.fg))}}),x+='<circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="4.5" fill="'+l+'"/>',nt(t.showValues)&&S.forEach(function(y,m){m<r.length&&(x+=F(y[0],y[1]-8,p(r[m],t,!0),D(e,9,'text-anchor="middle"')))});var E=r.length>1?v/(r.length-1):v;return r.forEach(function(y,m){x+=St(A(m)-E/2,c-6,E,d+12,(i[m]||"#"+(m+1))+": "+p(y,t))}),x},{stat:s,summary:r.length?"latest "+p(r[r.length-1],t):"no data"})}me.table=function(t){var e=q(t.labels);return{head:["Label","Value"],rows:gt(t.values).map(function(r,l){return[e[l]||"#"+(l+1),p(r,t)]})}};var jt={dark:{tile:"#15151d",bezel:"#000000",fg:"#f2f1f7",muted:"#8c8aa0",grid:"#2a2935",up:"#5EE6C8",down:"#F675A8",palette:["#9FA1FF","#F675A8","#5EE6C8","#FFC857","#7CC4FF","#FF8A5B"]},light:{tile:"#ffffff",bezel:"#000000",fg:"#17161f",muted:"#6b6980",grid:"#e8e6ef",up:"#12a383",down:"#d63f7c",palette:["#6E70F0","#E2508C","#16A884","#D99A0E","#2F8FE0","#EE6431"]}};var pe=["spark","line","area","bars","histogram","boxplot","scatter","ring","donut","gauge","progress","heatmap"],de={};function pt(t,e){de[t]=e}var kr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function Qe(t,e){if(!de[t])throw new Error(pe.includes(t)?`Bezel Charts: the ${t} chart isn't loaded. Add import 'bezel-charts/${t}', or load dist/charts/${t}.js.`:`Bezel Charts: unknown chart type "${t}". Choose one of: ${pe.join(", ")}.`);let r={};for(let[l,n]of Object.entries(e))r[kr(l)]=n;return r}function zt(t,e={}){let r=Qe(t,e);r.animate=nt(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return de[t](r,jt[l])}function Je(t,e={}){return de[t].table(Qe(t,e))}function Pe(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function Ct(t,e={}){return Pe(zt(t,{...e,animate:!1}))}var je=["type","values","labels","series","heading","prefix","suffix","decimals","compact","color","theme","frame","width","height","goal","goal-label","notes","show-values","stat","delta","delta-label","max","min","value","zones","horizontal","straight","zero","start","lang","corners","background","center-label","highlight","x","y","x-label","y-label","trend","static","no-tooltips","stacked","angle-labels","dash","markers","patterns","bins","bin-width","mark","percent","whiskers"],wr=`:host{display:block;position:relative;max-width:100%}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto;overflow:visible}.tip{position:absolute;left:0;top:0;pointer-events:none;background:#0b0b10;color:#f2f1f7;font:600 12px/1.5 ${Ot};padding:7px 10px;border-radius:10px;white-space:pre;opacity:0;transform:translate(-50%,calc(-100% - 12px));transition:opacity .12s;z-index:3;border:1px solid #2a2935;box-shadow:0 8px 24px rgba(0,0,0,.35)}.tip.on{opacity:1}.c{outline:none}.c:focus-visible{outline:2px solid #fff;outline-offset:3px;box-shadow:0 0 0 7px #000}.k{stroke:currentColor;stroke-width:2;stroke-opacity:1}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (forced-colors:active){.c:focus-visible{outline-color:Highlight}}`,Sr={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},Er=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,zr=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},De=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>De.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var Lr=typeof HTMLElement>"u"?class{}:HTMLElement,Lt=class extends Lr{static get observedAttributes(){return je}static get themes(){return jt}get resolvedTheme(){let e=this.getAttribute("theme");return e==="light"||e==="dark"?e:this.options.autoTheme}get chartType(){return this.getAttribute("type")||"spark"}connectedCallback(){this.shadowRoot||(this.attachShadow({mode:"open"}).innerHTML=`<style>${wr}</style><div class="c" role="group" aria-roledescription="chart"></div><p class="sr" id="h">Use the arrow keys to step through the values.</p><div class="tip" aria-hidden="true"></div><div class="sr" aria-live="polite"></div><div class="sr"></div>`,[,this.#t,,this.#r,this.#o,this.#u]=this.shadowRoot.children,this.shadowRoot.addEventListener("pointermove",e=>this.#h(e)),this.shadowRoot.addEventListener("pointerdown",e=>this.#h(e)),this.addEventListener("pointerleave",()=>this.#r.classList.remove("on")),this.#t.addEventListener("keydown",e=>this.#v(e)),this.#t.addEventListener("blur",()=>this.#g())),De.add(this),this.#a=Er(),this.#a?.addEventListener?.("change",this.#c),typeof ResizeObserver=="function"?(this.#l=new ResizeObserver(([e])=>{let r=Math.round(e.contentRect.width);(!this.#n||!this.hasAttribute("width")&&r>0&&Math.abs(r-this.#s)>1)&&this.#i()}),this.#l.observe(this)):this.#i()}disconnectedCallback(){De.delete(this),this.#l?.disconnect(),this.#a?.removeEventListener?.("change",this.#c)}attributeChangedCallback(){!this.#n||this.#f||(this.#f=!0,queueMicrotask(()=>{this.#f=!1,this.#i()}))}get options(){let e={};for(let r of je)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=zr()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return Pe(zt(this.chartType,{...this.options,...e,animate:!1}))}download(e){let r=URL.createObjectURL(new Blob([this.toSVG()],{type:"image/svg+xml"})),l=Object.assign(document.createElement("a"),{href:r,download:`${(e||this.getAttribute("heading")||this.chartType).replace(/[^\w-]+/g,"-").toLowerCase()}.svg`});document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}#l=null;#t=null;#r=null;#o=null;#u=null;#e=-1;#a=null;#s=0;#n=!1;#f=!1;#c=()=>{let e=this.getAttribute("theme");(!e||e==="auto")&&this.refresh()};#i(){if(!this.shadowRoot)return;let e=Math.round(this.getBoundingClientRect?.().width||0);this.#s=e>0?e:360;let r=this.options;r.animate=!this.#n&&!this.hasAttribute("static");let l,n=null;try{l=zt(this.chartType,r),n=Je(this.chartType,r)}catch(f){l=`<p style="font:13px ${Mt};color:#d63f7c">${kt(f.message)}</p>`}let i=this.#t;i.innerHTML=l.replace(/<title>[\s\S]*?<\/title>/,"");let o=i.querySelector("svg");o?(i.setAttribute("aria-label",o.getAttribute("aria-label")),o.removeAttribute("role"),o.removeAttribute("aria-label"),o.setAttribute("aria-hidden","true")):i.removeAttribute("aria-label");let s=!!o&&!this.hasAttribute("no-tooltips");s?(i.setAttribute("tabindex","0"),i.setAttribute("aria-describedby","h")):(i.removeAttribute("tabindex"),i.removeAttribute("aria-describedby")),i.style.color=jt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,i.style.borderRadius=`${r.frame==="none"?4:st(+r.corners||22,0,60)}px`,this.#u.innerHTML=n&&n.rows.length?Or(r.heading,n):"",this.#e>=0&&s&&this.shadowRoot.activeElement===i?this.#d(this.#e):this.#e=-1,this.#n=!0,this.dispatchEvent(new CustomEvent("bezel-render",{bubbles:!0}))}#h(e){if(this.hasAttribute("no-tooltips"))return;let r=e.target?.closest?.("[data-tip]");if(!r){this.#r.classList.remove("on");return}this.#m(r,e.clientX,e.clientY)}#m(e,r,l){let n=this.#r;n.textContent=e.getAttribute("data-tip");let i=this.getBoundingClientRect?.()||{left:0,top:0,width:0},o=n.offsetWidth/2;n.style.left=`${st(r-i.left,o,Math.max(o,i.width-o))}px`,n.style.top=`${l-i.top}px`,n.classList.add("on")}#p(){return[...this.#t.querySelectorAll("[data-tip]:not([data-skip])")]}#v(e){let r=this.#p(),l=r.length;if(!l)return;let n=this.#e,i=Sr[e.key];if(i)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(i*=7),n=n<0?i>0?0:l-1:st(n+i,0,l-1);else if(e.key==="Home"||e.key==="End")n=e.key==="Home"?0:l-1;else{e.key==="Escape"&&this.#g();return}e.preventDefault(),this.#d(n,!0)}#d(e,r){let l=this.#p();if(!l.length)return;e=st(e,0,l.length-1),this.#t.querySelector(".k")?.classList.remove("k");let n=l[e],i=n.getBoundingClientRect?.()||{left:0,top:0,width:0};n.classList.add("k"),this.#e=e,this.#m(n,i.left+i.width/2,i.top),r&&(this.#o.textContent=`${n.getAttribute("data-tip").replace(/\n/g,", ")}. ${e+1} of ${l.length}`)}#g(){this.#t.querySelector(".k")?.classList.remove("k"),this.#r.classList.remove("on"),this.#o.textContent="",this.#e=-1}};function Or(t,{head:e,rows:r}){let l=n=>n.map((i,o)=>o?`<td>${kt(i)}</td>`:`<th scope="row">${kt(i)}</th>`).join("");return`<table><caption>${kt(t||"Chart data")}</caption><thead><tr>${e.map(n=>`<th scope="col">${kt(n)}</th>`).join("")}</tr></thead><tbody>${r.map(n=>`<tr>${l(n)}</tr>`).join("")}</tbody></table>`}function dt(t){typeof customElements>"u"||typeof HTMLElement>"u"||(customElements.get(`bezel-${t}`)||customElements.define(`bezel-${t}`,class extends Lt{get chartType(){return t}}),customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends Lt{}))}pt("spark",me);dt("spark");function It(t,e,r){if(t===e)if(t===0)e=1;else{var l=Math.abs(t)*.1;t-=l,e+=l}for(var n=(e-t)/(r||4),i=Math.pow(10,Math.floor(Math.log10(n))),o=n/i,s=(o<=1?1:o<=2?2:o<=5?5:10)*i,f=Math.floor(t/s)*s,c=Math.ceil(e/s)*s,v=[],d=f;d<=c+s/2;d+=s)v.push(+d.toFixed(10));return{lo:f,hi:c,ticks:v}}function _t(t,e,r,l,n,i,o,s){var f=l,c=n,v="",d=s||13;return t.forEach(function(u,O){var T=d+vt(u,12)+16;f>l&&f+T-16>l+i&&(f=l,c+=20),v+=(o?o(O,f,c):'<circle cx="'+a(f+4)+'" cy="'+a(c+6)+'" r="4" fill="'+e[O%e.length]+'"/>')+F(f+d,c+10,u,'fill="'+r.fg+'" font-family="'+Mt+'" font-size="12"'),f+=T}),{svg:v,height:c-n+24}}var Wt={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},ae=["circle","square","triangle","diamond"],ne=["solid","stripes","dots","grid"];function Nt(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:q(t).map(function(n){return e.indexOf(n)<0?r:n});return l.length?function(n){return l[n%l.length]}:null}function Zt(t,e,r,l,n){var i=l*1.15,o=l*.85;return t==="square"?'<rect x="'+a(e-o)+'" y="'+a(r-o)+'" width="'+a(2*o)+'" height="'+a(2*o)+'" rx="1"'+n+"/>":t==="triangle"?'<path d="M'+a(e)+","+a(r-i)+"L"+a(e+i)+","+a(r+o)+"L"+a(e-i)+","+a(r+o)+'Z"'+n+"/>":t==="diamond"?'<path d="M'+a(e)+","+a(r-i*1.1)+"L"+a(e+i)+","+a(r)+"L"+a(e)+","+a(r+i*1.1)+"L"+a(e-i)+","+a(r)+'Z"'+n+"/>":'<circle cx="'+a(e)+'" cy="'+a(r)+'" r="'+a(l)+'"'+n+"/>"}function ie(t,e,r,l){var n=' stroke="'+l+'" stroke-opacity=".55" stroke-width="1.5"';return'<pattern id="'+t+'" width="6" height="6" patternUnits="userSpaceOnUse"'+(e==="dots"?"":' patternTransform="rotate(45)"')+'><rect width="6" height="6" fill="'+r+'"/>'+(e==="dots"?'<circle cx="3" cy="3" r="1.3" fill="'+l+'" fill-opacity=".55"/>':'<path d="M3,0V6'+(e==="grid"?"M0,3H6":"")+'"'+n+"/>")+"</pattern>"}function tr(t){return Math.max.apply(null,t.map(function(e){return vt(e,10,!0)}))+10}function le(t,e){for(var r=wt(t.values),l=q(t.series),n=q(t.labels),i=[],o=Math.max.apply(null,[0].concat(r.map(function(d){return d.length}))),s=0;s<o;s++){var f=[n[s]||"#"+(s+1)],c=0;r.forEach(function(d){f.push(s<d.length?p(d[s],t):""),c+=s<d.length?d[s]:0}),e&&f.push(p(c,t)),i.push(f)}var v=r.length>1||l.length?r.map(function(d,u){return l[u]||"Series "+(u+1)}):["Value"];return{head:["Label"].concat(v,e?["Total"]:[]),rows:i}}function ge(t,e,r,l,n,i,o){var s="",f=n,c=r.n,v=r.labels;if(r.names){var d=_t(r.names,r.pal,e,l,f,i,r.key,r.kw);s+=d.svg,f+=d.height}var u=r.lo,O=r.hi;G(t.goal)&&(u=Math.min(u,+t.goal),O=Math.max(O,+t.goal)),r.zero&&(u=Math.min(0,u),O=Math.max(0,O));var T=It(u,O,4),R=T.ticks.map(r.tick),A=Math.max.apply(null,R.map(function(z){return vt(z,10,!0)}))+10,C=v.length?20:4,S=l+A,g=i-A,V=o-(f-n)-C,k=function(z){return c===1?S+g/2:S+z*g/(c-1)},x=function(z){return f+V-(z-T.lo)/(T.hi-T.lo)*V};if(T.ticks.forEach(function(z,b){var w=x(z);s+='<line x1="'+a(S)+'" x2="'+a(S+g)+'" y1="'+a(w)+'" y2="'+a(w)+'" stroke="'+e.grid+'"'+(z===0?"":' stroke-dasharray="2 4"')+"/>"+F(S-8,w+3.5,R[b],D(e,10,'text-anchor="end"'))}),v.length){for(var E=Math.max(1,Math.ceil(c*(Math.max.apply(null,v.map(function(z){return vt(z,10,!0)}))+10)/g)),y=0;y<c;y+=E)if(v[y]!=null){var m=c>1&&y===0?"start":c>1&&y===c-1?"end":"middle";s+=F(k(y),f+V+15,v[y],D(e,10,'text-anchor="'+m+'"'))}}return r.notes.forEach(function(z){if(!(z.i>=c)){var b=k(z.i);s+='<line x1="'+a(b)+'" x2="'+a(b)+'" y1="'+a(f+12)+'" y2="'+a(f+V)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+F(st(b,S+30,S+g-30),f+8,z.text,D(e,10,'text-anchor="middle"',e.fg))}}),{svg:s,X:k,Y:x,px:S,pw:g,top:f,ph:V}}function ve(t,e,r,l,n){for(var i=G(t.goal)?Ht(t,e,r.px,r.px+r.pw,r.Y(+t.goal)):"",o=l>1?r.pw/(l-1):r.pw,s=0;s<l;s++)i+=St(r.X(s)-o/2,r.top,o,r.ph,n(s));return i}function xe(t,e,r,l){return function(n,i,o){var s=t[n%t.length],f=e?Wt[e(n)]:"",c=r?r(n):"none";return'<line x1="'+a(i)+'" x2="'+a(i+18)+'" y1="'+a(o+6)+'" y2="'+a(o+6)+'" stroke="'+s+'" stroke-width="2.5" stroke-linecap="round"'+(f?' stroke-dasharray="'+f+'"':"")+"/>"+(c!=="none"?Zt(c,i+9,o+6,3.5,' fill="'+s+'" stroke="'+l+'" stroke-width="1.5"'):"")}}function ye(t,e,r,l,n){return n?'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+n+'"'+ut(t,"bzc-a",l*.15)+"/>":'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+l*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>"}function be(t,e,r,l,n,i,o,s){var f="",c=Math.ceil(r.length/40);return r.forEach(function(v,d){(d%c===0||d===r.length-1)&&(f+=Zt(e,l(d),n(v),3.5,' fill="'+i+'" stroke="'+o+'" stroke-width="1.5"'+ut(t,"bzc-a",.6+s*.15)))}),f}function Me(t,e){var r=wt(t.values),l=q(t.series),n=q(t.labels),i=ct(t,e),o=Z(t.height,170),s=Math.max.apply(null,[0].concat(r.map(function(A){return A.length}))),f=Xt(t,n),c=r.length>1||l.length>0,v=At(r[0]||[],t,""),d=Nt(t.dash,Object.keys(Wt),"solid"),u=Nt(t.markers,ae,"none"),O=t.background||e.tile,T=(d||u)&&xe(i,d,u,O),R=function(A){return l[A]||"Series "+(A+1)};return mt(t,e,o,function(A,C,S,g){if(!s)return ht(e,A,C,S,g);var V=[].concat.apply([],r),k=ge(t,e,{n:s,names:c?r.map(function(M,B){return R(B)}):null,pal:i,key:T,kw:T&&24,lo:Math.min.apply(null,V),hi:Math.max.apply(null,V),zero:nt(t.zero),labels:n,notes:f,tick:function(M){return p(M,t,!0)}},A,C,S,g),x=k.svg,E=k.X,y=k.Y,m=k.px,z=k.pw,b=k.top,w=k.ph;return r.forEach(function(M,B){var I=i[B%i.length],Y=M.map(function(H,at){return[E(at),y(H)]});Y.length===1&&(Y=[[m,Y[0][1]],[m+z,Y[0][1]]]);var X=Yt(Y,nt(t.straight));if(B===0){var tt=Rt("g"),it=Y[Y.length-1];x+='<defs><linearGradient id="'+tt+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+I+'" stop-opacity=".26"/><stop offset="1" stop-color="'+I+'" stop-opacity="0"/></linearGradient></defs><path d="'+X+"L"+a(it[0])+","+a(b+w)+"L"+a(Y[0][0])+","+a(b+w)+'Z" fill="url(#'+tt+')"'+ut(t,"bzc-a")+"/>"}var h=u?u(B):"none";if(x+=ye(t,X,I,B,d?Wt[d(B)]:""),h!=="none")x+=be(t,h,M,E,y,I,O,B);else{var U=Y[Y.length-1];x+='<circle cx="'+a(U[0])+'" cy="'+a(U[1])+'" r="4" fill="'+I+'" stroke="'+O+'" stroke-width="2"/>'}nt(t.showValues)&&M.forEach(function(H,at){x+=F(E(at),y(H)-8,p(H,t,!0),D(e,9,'text-anchor="middle"'))})}),x+ve(t,e,k,s,function(M){var B=n[M]||"#"+(M+1);return r.forEach(function(I,Y){M<I.length&&(B+=`
|
|
3
|
+
`+(c?R(Y)+": ":"")+p(I[M],t))}),B})},{stat:v,summary:r.length+" series over "+s+" points"})}Me.table=function(t){return le(t)};pt("line",Me);dt("line");function ke(t,e){for(var r=wt(t.values),l=q(t.series),n=q(t.labels),i=ct(t,e),o=Z(t.height,170),s=r.length,f=Math.max.apply(null,[0].concat(r.map(function(h){return h.length}))),c=s>1?t.stacked==="percent"?"percent":nt(t.stacked)?"stack":"":"",v=Xt(t,n),d=s>1||l.length>0,u=function(h){return l[h]||"Series "+(h+1)},O=function(h,U){return U<r[h].length?r[h][U]:0},T=r.map(function(){return[]}),R=r.map(function(){return[]}),A=[],C=[],S=0;S<f;S++){for(var g=0,V=0,k=0,x=0,E=0;E<s;E++)k+=O(E,S),x+=Math.max(0,O(E,S));for(A.push(k),C.push(x),E=0;E<s;E++){var y=c==="percent"?x?Math.max(0,O(E,S))/x*100:0:O(E,S);c?y>=0?(T[E].push(g),g+=y,R[E].push(g)):(T[E].push(V),V+=y,R[E].push(V)):(T[E].push(0),R[E].push(y))}}for(var m=[].concat.apply([],T.concat(R)),z=Nt(t.dash,Object.keys(Wt),"solid"),b=Nt(t.markers,ae,"none"),w=s>1?Nt(t.patterns,ne,"solid"):null,M=t.background||e.tile,B="",I=[],Y=0;w&&Y<s;Y++)if(w(Y)!=="solid"){var X=Rt("g");B+=ie(X,w(Y),i[Y%i.length],M),I[Y]="url(#"+X+")"}var tt=w?function(h,U,H){return'<rect x="'+a(U)+'" y="'+a(H+1)+'" width="10" height="10" rx="2" fill="'+(I[h]||i[h%i.length])+'"/>'}:(z||b)&&xe(i,z,b,M),it=function(h,U){return C[U]?Math.round(Math.max(0,O(h,U))/C[U]*100):0};return mt(t,e,o,function(h,U,H,at){if(!f)return ht(e,h,U,H,at);var j=ge(t,e,{n:f,names:d?r.map(function(J,N){return u(N)}):null,pal:i,key:tt,kw:tt&&(w?15:24),lo:Math.min.apply(null,m),hi:Math.max.apply(null,m),zero:!0,labels:n,notes:v,tick:c==="percent"?function(J){return p(J,{lang:t.lang},!0)+"%"}:function(J){return p(J,t,!0)}},h,U,H,at),L=(B?"<defs>"+B+"</defs>":"")+j.svg,$=j.X,P=j.Y,ft=function(J){var N=J.map(function(W,K){return[$(K),P(W)]});return N.length===1?[[j.px,N[0][1]],[j.px+j.pw,N[0][1]]]:N},et=nt(t.straight),xt=c?".8":".22",yt=function(J){return c?R[J]:r[J]};return r.forEach(function(J,N){var W=ft(yt(N)),K=ft(c?T[N]:yt(N).map(function(){return 0})).reverse();L+='<path d="'+Yt(W,et)+Yt(K,et).replace(/^M/,"L")+'Z" fill="'+(I[N]||i[N%i.length])+'" fill-opacity="'+xt+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(N*.1)+'s"':"")+"/>"}),r.forEach(function(J,N){var W=i[N%i.length],K=yt(N),_=ft(K),rt=b?b(N):"none";L+=ye(t,Yt(_,et),W,N,z?Wt[z(N)]:""),rt!=="none"?L+=be(t,rt,K,$,P,W,M,N):c||(L+='<circle cx="'+a(_[_.length-1][0])+'" cy="'+a(_[_.length-1][1])+'" r="4" fill="'+W+'" stroke="'+M+'" stroke-width="2"/>'),nt(t.showValues)&&!c&&K.forEach(function(lt,ot){L+=F($(ot),P(lt)-8,p(lt,t,!0),D(e,9,'text-anchor="middle"'))})}),nt(t.showValues)&&c==="stack"&&A.forEach(function(J,N){var W=Math.max.apply(null,R.map(function(K){return K[N]}).concat([0]));L+=F($(N),P(W)-8,p(J,t,!0),D(e,9,'text-anchor="middle"'))}),L+ve(t,e,j,f,function(J){var N=n[J]||"#"+(J+1);return r.forEach(function(W,K){J<W.length&&(N+=`
|
|
4
|
+
`+(d?u(K)+": ":"")+p(W[J],t)+(c==="percent"?" ("+it(K,J)+"%)":""))}),N+(c?`
|
|
5
|
+
Total: `+p(A[J],t):"")})},{stat:At(c?A:r[0]||[],t,""),summary:s+" series "+(c==="percent"?"as shares of each total":c?"stacked":"filled")+" over "+f+" points"})}ke.table=function(t){var e=wt(t.values);return le(t,e.length>1&&(t.stacked==="percent"||nt(t.stacked)))};pt("area",ke);dt("area");var er=40,rr=24;function we(t,e){for(var r=wt(t.values),l=q(t.series),n=q(t.labels),i=ct(t,e),o=r.length,s=Math.max.apply(null,[0].concat(r.map(function(L){return L.length}))),f=o>1,c=nt(t.horizontal),v=f&&nt(t.stacked),d=!f&&q(t.color).filter(Boolean).length>1,u=r[0]||[],O=[].concat.apply([],r),T=function(L,$){return r.reduce(function(P,ft){return L<ft.length&&ft[L]*$>0?P+ft[L]:P},0)},R=[],A=[],C=[],S=0;v&&S<s;S++)A.push(T(S,1)),C.push(T(S,-1)),R.push(A[S]+C[S]);for(var g=v?A.concat(C):O,V=g.length?Math.max.apply(null,g):0,k=function(L){return l[L]||"Series "+(L+1)},x=f?Nt(t.patterns,ne,"solid"):null,E="",y=[],m=0;x&&m<o;m++)if(x(m)!=="solid"){var z=Rt("g");E+=ie(z,x(m),i[m%i.length],t.background||e.tile),y[m]="url(#"+z+")"}var b=function(L,$){return f?y[L]||i[L%i.length]:d?i[$%i.length]:i[0]},w=x&&function(L,$,P){return'<rect x="'+a($)+'" y="'+a(P+1)+'" width="10" height="10" rx="2" fill="'+b(L)+'"/>'},M=function(L){return f||d||t.highlight==="none"||L===V?1:.5},B=function(L){return n[L]||"#"+(L+1)},I=function(L){return f?B(L)+r.map(function($,P){return L<$.length?`
|
|
6
|
+
`+k(P)+": "+p($[L],t):""}).join("")+(v?`
|
|
7
|
+
Total: `+p(R[L],t):""):B(L)+": "+p(u[L],t)},Y=Jt(t),X=f||l.length?_t(r.map(function(L,$){return k($)}),i,e,0,0,Y.w,w,w&&15).height:0,tt=v?1:o,it=f&&!v,h=it?10:14,U=3,H=c?tt*h+(tt-1)*U+(it?14:16):0,at=c?X+Math.max(1,s)*H-6:Z(t.height,140)+X,j=u.indexOf(Math.max.apply(null,u.length?u:[0]));return mt(t,e,at,function(L,$,P,ft){if(!s)return ht(e,L,$,P,ft);var et=E?"<defs>"+E+"</defs>":"",xt=$;X&&(et+=_t(r.map(function(Q,bt){return k(bt)}),i,e,L,$,P,w,w&&15).svg,xt+=X);var yt=Math.min(0,Math.min.apply(null,g)),J=Math.max(0,V);if(G(t.goal)&&(yt=Math.min(yt,+t.goal),J=Math.max(J,+t.goal)),J===yt&&(J=yt+1),c){for(var N=n.length?Math.min(P*.4,Math.max.apply(null,n.map(function(Q){return vt(Q,12)}))+10):0,W=v?[R.map(function(Q){return p(Q,t)})]:r.map(function(Q){return Q.map(function(bt){return p(bt,t)})}),K=Math.max.apply(null,[].concat.apply([],W).map(function(Q){return vt(Q,it?10:11,!0)}))+10,_=L+N,rt=P-N-K,lt=Math.max(J,0)||1,ot=0;ot<s;ot++){var Ft=xt+ot*H;n[ot]!=null&&(et+=F(L,Ft+(H-6)/2+4,qt(n[ot],Math.floor(N/6.7)),'fill="'+e.fg+'" font-family="'+Mt+'" font-size="12"')),v?(et+=fr(ot,_,Ft+5,rt,lt),et+=F(L+P,Ft+5+h/2+3.8,W[0][ot],'text-anchor="end" fill="'+e.fg+'" font-family="'+Ot+'" font-size="11" font-weight="600"')):r.forEach(function(Q,bt){if(!(ot>=Q.length)){var Et=Q[ot],Gt=Ft+(f?2:5)+bt*(h+U),Pt=Math.max(0,Et)/lt*rt;f||(et+='<rect x="'+a(_)+'" y="'+a(Gt)+'" width="'+a(rt)+'" height="'+h+'" rx="'+h/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),Pt>0&&(et+='<rect x="'+a(_)+'" y="'+a(Gt)+'" width="'+a(Math.max(h,Pt))+'" height="'+h+'" rx="'+h/2+'" fill="'+b(bt,ot)+'" fill-opacity="'+M(Et)+'"'+ut(t,"bzc-gx",ot*.06+bt*.03)+"/>"),et+=F(L+P,Gt+h/2+3.8,W[bt][ot],'text-anchor="end" fill="'+e.fg+'" font-family="'+Ot+'" font-size="'+(f?10:11)+'" font-weight="600"')}}),et+=St(L,Ft,P,H-6,I(ot))}if(G(t.goal)&&+t.goal>0){var Ue=_+ +t.goal/lt*rt;et+='<line x1="'+a(Ue)+'" x2="'+a(Ue)+'" y1="'+a(xt-2)+'" y2="'+a($+ft+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return et}function fr(Q,bt,Et,Gt,Pt){var Dt='<rect x="'+a(bt)+'" y="'+a(Et)+'" width="'+a(Gt)+'" height="'+h+'" rx="'+h/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',ee=0;return r.forEach(function(ue,$t){var re=Q<ue.length?ue[Q]:0,Ut=Math.max(0,re)/Pt*Gt;if(!(Ut<=0)){var Qt=ee>0?1.5:0;Dt+='<rect x="'+a(bt+ee+Qt)+'" y="'+a(Et)+'" width="'+a(Math.max(2,Ut-Qt))+'" height="'+h+'" rx="'+a(Math.min(3,Ut/2))+'" fill="'+b($t,Q)+'"'+ut(t,"bzc-gx",Q*.06+$t*.03)+"/>",ee+=Ut}}),Dt}var qe=n.length?Math.max.apply(null,n.map(function(Q){return vt(Q,10,!0)})):0,Fe=n.length?Math.max(1,Math.ceil(s*(qe+8)/P)):1,oe=nt(t.angleLabels)&&Fe>1,Ie=er*Math.PI/180,_e=function(Q){return oe?qt(Q,rr):Q};if(oe){var ur=P/s,te=0;n.forEach(function(Q,bt){te=Math.max(te,Math.cos(Ie)*vt(_e(Q),10,!0)+4-(bt+.5)*ur)}),te=Math.min(te,P*.25),L+=te,P-=te,Fe=1}var Ye=nt(t.showValues)&&yt<0?14:0,cr=oe?Math.ceil(Math.sin(Ie)*Math.min(qe,vt("x".repeat(rr),10,!0)))+18:20,hr=(n.length?cr:2)+Ye,Xe=nt(t.showValues)?16:4,Ne=ft-(xt-$)-hr-Xe,We=xt+Xe,Bt=function(Q){return We+Ne-(Q-yt)/(J-yt)*Ne},se=P/s,fe=Math.min(se*(it?.78:.62),it?o*30:56),Ze=it?Math.min(3,fe/o*.15):0,Kt=v?fe:(fe-Ze*(o-1))/o,he=Bt(0);et+='<line x1="'+L+'" x2="'+(L+P)+'" y1="'+a(he)+'" y2="'+a(he)+'" stroke="'+e.grid+'"/>';for(var Tt=0;Tt<s;Tt++){var Ge=L+Tt*se+(se-fe)/2;if(v?et+=mr(Tt,Ge):r.forEach(function(Q,bt){if(!(Tt>=Q.length)){var Et=Q[Tt],Gt=Ge+bt*(Kt+Ze),Pt=Math.min(Bt(Et),he),Dt=Math.abs(Bt(Et)-he);Dt>.5&&(et+='<rect x="'+a(Gt)+'" y="'+a(Pt)+'" width="'+a(Kt)+'" height="'+a(Dt)+'" rx="'+a(Math.min(6,Kt/2,Dt/2))+'" fill="'+b(bt,Tt)+'" fill-opacity="'+M(Et)+'"'+ut(t,Et<0?"bzc-gn":"bzc-g",Tt*.05+bt*.03)+"/>"),nt(t.showValues)&&(et+=F(Gt+Kt/2,Et<0?Bt(Et)+12:Bt(Et)-5,p(Et,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+Ot+'" font-size="'+(f?9:10)+'" font-weight="600"'))}}),n[Tt]!=null&&Tt%Fe===0){var Re=Ge+fe/2,Ve=We+Ne+Ye+(oe?12:15);et+=oe?F(Re,Ve,_e(n[Tt]),D(e,10,'text-anchor="end" transform="rotate(-'+er+" "+a(Re)+" "+a(Ve)+')"')):F(Re,Ve,n[Tt],D(e,10,'text-anchor="middle"'))}et+=St(L+Tt*se,xt,se,ft-(xt-$),I(Tt))}return G(t.goal)&&(et+=Ht(t,e,L,L+P,Bt(+t.goal))),et;function mr(Q,bt){var Et="",Gt=0,Pt=0;if(r.forEach(function(ee,ue){var $t=Q<ee.length?ee[Q]:0;if($t){var re=$t>0?Gt:Pt,Ut=re+$t;$t>0?Gt=Ut:Pt=Ut;var Qt=Bt(Math.max(re,Ut)),Be=Bt(Math.min(re,Ut)),ce=Be-Qt,Ke=re!==0?Math.min(1.5,ce/2):0;$t>0?Be-=Ke:Qt+=Ke,ce=Be-Qt,ce>.5&&(Et+='<rect x="'+a(bt)+'" y="'+a(Qt)+'" width="'+a(Kt)+'" height="'+a(ce)+'" rx="'+a(Math.min(3,Kt/2,ce/2))+'" fill="'+b(ue,Q)+'"'+ut(t,$t<0?"bzc-gn":"bzc-g",Q*.05+ue*.03)+"/>")}}),nt(t.showValues)){var Dt=R[Q];Et+=F(bt+Kt/2,Dt<0?Bt(C[Q])+12:Bt(A[Q])-5,p(Dt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+Ot+'" font-size="10" font-weight="600"')}return Et}},{stat:At(u,t,""),summary:s?v?o+" series stacked across "+s+" groups":f?o+" series across "+s+" groups":"highest "+(n[j]||"")+" "+p(u[j],t):"no data"})}we.table=function(t){return le(t,wt(t.values).length>1&&nt(t.stacked))};pt("bars",we);dt("bars");function Se(t,e){for(var r=nr(t),l=q(t.series),n=ct(t,e),i=Z(t.height,190),o=r?r.S:[],s=o.length,f=s>1||l.length>0,c=nt(t.percent),v=function(m){return l[m]||"Series "+(m+1)},d=Object.assign({},t,{decimals:G(t.decimals)?t.decimals:r?r.dp:0}),u=function(m){return p(r.edge(m),d)+" to "+p(r.edge(m+1),d)},O=function(m,z){return Math.round(r.counts[m][z]/o[m].length*100)},T=function(m,z){return c?r.counts[m][z]/o[m].length*100:r.counts[m][z]},R=q(t.mark).filter(function(m){return m==="mean"||m==="median"}),A=s>1?Nt(t.patterns,ne,"solid"):null,C="",S=[],g=0;A&&g<s;g++)if(A(g)!=="solid"){var V=Rt("g");C+=ie(V,A(g),n[g%n.length],t.background||e.tile),S[g]="url(#"+V+")"}var k=A&&function(m,z,b){return'<rect x="'+a(z)+'" y="'+a(b+1)+'" width="10" height="10" rx="2" fill="'+(S[m]||n[m%n.length])+'"/>'},x=0,E=0;if(r){for(var y=0;y<r.count;y++)ar(r,y)>ar(r,x)&&(x=y);o.forEach(function(m){E+=m.length})}return mt(t,e,i,function(m,z,b,w){if(!r)return ht(e,m,z,b,w);var M=C?"<defs>"+C+"</defs>":"",B=z;if(f){var I=_t(o.map(function(_,rt){return v(rt)}),n,e,m,B,b,k,k&&15);M+=I.svg,B+=I.height}var Y=0;o.forEach(function(_,rt){for(var lt=0;lt<r.count;lt++)Y=Math.max(Y,T(rt,lt))});var X=It(0,Y||1,4),tt=X.ticks.map(function(_){return p(_,{lang:t.lang},!0)+(c?"%":"")}),it=Math.max.apply(null,tt.map(function(_){return vt(_,10,!0)}))+10,h=m+it,U=b-it,H=w-(B-z)-20,at=U/r.count,j=function(_){return h+_*at},L=function(_){return B+H-(_-X.lo)/(X.hi-X.lo)*H};X.ticks.forEach(function(_,rt){var lt=L(_);M+='<line x1="'+a(h)+'" x2="'+a(h+U)+'" y1="'+a(lt)+'" y2="'+a(lt)+'" stroke="'+e.grid+'"'+(_===0?"":' stroke-dasharray="2 4"')+"/>"+F(h-8,lt+3.5,tt[rt],D(e,10,'text-anchor="end"'))});for(var $=[],P=0;P<=r.count;P++)$.push(p(r.edge(P),d,!0));var ft=Math.max(1,Math.ceil((Math.max.apply(null,$.map(function(_){return vt(_,10,!0)}))*1.5+8)/at));for(P=0;P<=r.count;P+=ft)M+=F(j(P),B+H+15,$[P],D(e,10,'text-anchor="'+(P===0?"start":P===r.count?"end":"middle")+'"'));o.forEach(function(_,rt){for(var lt=0;lt<r.count;lt++){var ot=T(rt,lt);if(ot){var Ft=L(ot);M+='<rect x="'+a(j(lt)+.5)+'" y="'+a(Ft)+'" width="'+a(Math.max(1,at-1))+'" height="'+a(B+H-Ft)+'" fill="'+(S[rt]||n[rt%n.length])+'"'+(f?' fill-opacity=".55"':"")+ut(t,"bzc-g",Math.min(.6,lt*.03))+"/>"}}});var et=r.edge(0),xt=r.edge(r.count)-et,yt=[];if(o.forEach(function(_,rt){R.forEach(function(lt){var ot=lt==="mean"?Tr(_):Cr(_);yt.push({x:h+(ot-et)/xt*U,c:f?n[rt%n.length]:e.fg,t:(f?v(rt)+" ":"")+lt+" "+p(ot,t)})})}),yt.length){var J=yt.map(function(_){return _.x}),N=(Math.min.apply(null,J)+Math.max.apply(null,J))/2>h+U/2,W=N?Math.min.apply(null,J)-5:Math.max.apply(null,J)+5;yt.forEach(function(_,rt){M+='<line x1="'+a(_.x)+'" x2="'+a(_.x)+'" y1="'+a(B)+'" y2="'+a(B+H)+'" stroke="'+_.c+'" stroke-width="1.5" stroke-dasharray="4 3"/>'+F(W,B+9+rt*12,_.t,D(e,10,'text-anchor="'+(N?"end":"start")+'"',f?_.c:e.fg))})}for(y=0;y<r.count;y++){var K=u(y);o.forEach(function(_,rt){K+=`
|
|
8
|
+
`+(f?v(rt)+": ":"")+r.counts[rt][y]+" ("+O(rt,y)+"%)"}),M+=St(j(y),B,at,H,K)}return M},{summary:r?(f?s+" series, ":"")+E+" values in "+r.count+" ranges from "+p(r.edge(0),d)+" to "+p(r.edge(r.count),d)+", most in "+u(x):"no data"})}Se.table=function(t){var e=nr(t),r=q(t.series);if(!e)return{head:["Range","Count"],rows:[]};for(var l=e.S.length>1||r.length>0,n=Object.assign({},t,{decimals:G(t.decimals)?t.decimals:e.dp}),i=[],o=0;o<e.count;o++){var s=[p(e.edge(o),n)+" to "+p(e.edge(o+1),n)];l?e.S.forEach(function(f,c){s.push(String(e.counts[c][o]))}):s.push(String(e.counts[0][o]),Math.round(e.counts[0][o]/e.S[0].length*100)+"%"),i.push(s)}return{head:["Range"].concat(l?e.S.map(function(f,c){return r[c]||"Series "+(c+1)}):["Count","Share"]),rows:i}};function Ar(t){var e=Math.floor(Math.log10(t)),r=+("1e"+e),l=t/r,n=l<1.4142?1:l<2.2361?2:l<3.5355?2.5:l<7.0711?5:10;return{w:n*r,dp:Math.max(0,n===10?-e-1:-e)+(n===2.5?1:0)}}function nr(t){var e=wt(t.values),r=[].concat.apply([],e);if(!r.length)return null;var l=Math.min.apply(null,r),n=Math.max.apply(null,r),i=Z(t.binWidth,0),o,s;if(i>0&&(n-l)/i<=200){var f=String(t.binWidth),c=f.indexOf(".");o=c<0?0:Math.min(6,f.length-c-1)}else{var v=Z(t.bins,0)>0?Math.round(Z(t.bins,0)):Math.ceil(Math.log2(r.length)+1);v=Math.min(Math.max(v,1),50),s=Ar(n>l?(n-l)/v:Math.abs(l)||1),i=s.w,o=s.dp}for(var d=Math.floor(l/i),u=function(R){return Number(((d+R)*i).toFixed(o+3))};u(0)>l;)d--;for(var O=Math.max(1,Math.ceil((n-u(0))/i));O>1&&u(O-1)>=n;)O--;for(;u(O)<n;)O++;var T=e.map(function(R){for(var A=[],C=0;C<O;C++)A.push(0);return R.forEach(function(S){for(var g=Math.min(O-1,Math.max(0,Math.floor((S-u(0))/i)));g>0&&S<u(g);)g--;for(;g<O-1&&S>=u(g+1);)g++;A[g]++}),A});return{S:e,edge:u,count:O,counts:T,dp:o}}function ar(t,e){var r=0;return t.counts.forEach(function(l){r+=l[e]}),r}function Tr(t){var e=0;return t.forEach(function(r){e+=r}),e/t.length}function Cr(t){var e=t.slice().sort(function(l,n){return l-n}),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}pt("histogram",Se);dt("histogram");function Ee(t,e){var r=wt(t.values),l=q(t.series),n=ct(t,e),i=r.length,o=nt(t.horizontal),s=q(t.color).length>1,f=q(t.mark).indexOf("mean")>=0,c=r.map(function(R){return ir(R,t.whiskers==="range")}),v=function(R){return l[R]||"Group "+(R+1)},d=Z(t.height,o?Math.max(120,i*36+24):200),u=function(R){return p(R,t)},O=c.map(function(R){return R.median}),T=i===1?"median "+u(c[0].median)+", middle half "+u(c[0].q1)+" to "+u(c[0].q3):i+" groups, medians from "+u(Math.min.apply(null,O))+" to "+u(Math.max.apply(null,O));return mt(t,e,d,function(R,A,C,S){if(!i)return ht(e,R,A,C,S);var g=Math.min.apply(null,c.map(function(h){return h.min})),V=Math.max.apply(null,c.map(function(h){return h.max}));G(t.goal)&&(g=Math.min(g,+t.goal),V=Math.max(V,+t.goal));var k=It(g,V,4),x="",E=k.ticks.map(function(h){return p(h,t,!0)}),y=o?Math.min(C*.4,Math.max.apply(null,r.map(function(h,U){return vt(v(U),11)}))+12):0,m=o?0:Math.max.apply(null,E.map(function(h){return vt(h,10,!0)}))+10,z=R+(o?y:m),b=C-(o?y:m),w=S-20,M=o?function(h){return z+(h-k.lo)/(k.hi-k.lo)*b}:function(h){return A+w-(h-k.lo)/(k.hi-k.lo)*w},B=(o?w:b)/i,I=Math.min(28,B*.28),Y=function(h){return(o?A:z)+B*(h+.5)},X=function(h,U){return o?[U,h]:[h,U]},tt=function(h,U,H,at,j){var L=X(h,U),$=X(H,at);return'<line x1="'+a(L[0])+'" y1="'+a(L[1])+'" x2="'+a($[0])+'" y2="'+a($[1])+'"'+j+"/>"};if(k.ticks.forEach(function(h,U){var H=M(h);x+=tt(o?A:z,H,o?A+w:z+b,H,' stroke="'+e.grid+'"'+(h===0?"":' stroke-dasharray="2 4"'))+(o?F(H,A+w+15,E[U],D(e,10,'text-anchor="middle"')):F(z-8,H+3.5,E[U],D(e,10,'text-anchor="end"')))}),c.forEach(function(h,U){var H=Y(U),at=s?n[U%n.length]:n[0],j=' stroke="'+at+'" stroke-width="1.5"';if(i>1||l.length){var L=Fr(v(U),o?y-10:B-6,o?11:10,!o);x+=o?F(R,H+4,L,D(e,11,"",e.fg)):F(H,A+w+15,L,D(e,10,'text-anchor="middle"'))}if(h.n){var $=X(H-I,M(h.q1)),P=X(H+I,M(h.q3));if(x+="<g"+ut(t,"bzc-a",Math.min(.6,U*.06))+">"+tt(H,M(h.low),H,M(h.q1),j)+tt(H,M(h.q3),H,M(h.high),j)+tt(H-I/2,M(h.low),H+I/2,M(h.low),j)+tt(H-I/2,M(h.high),H+I/2,M(h.high),j)+'<rect x="'+a(Math.min($[0],P[0]))+'" y="'+a(Math.min($[1],P[1]))+'" width="'+a(Math.abs(P[0]-$[0]))+'" height="'+a(Math.max(1,Math.abs(P[1]-$[1])))+'" rx="3" fill="'+at+'" fill-opacity=".22"'+j+"/>"+tt(H-I,M(h.median),H+I,M(h.median),' stroke="'+at+'" stroke-width="2.5"'),h.outliers.forEach(function(et){var xt=X(H,M(et));x+='<circle cx="'+a(xt[0])+'" cy="'+a(xt[1])+'" r="2.5" fill="none"'+j+"/>"}),f){var ft=X(H,M(h.mean));x+=Zt("diamond",ft[0],ft[1],4,' fill="'+(t.background||e.tile)+'"'+j)}x+="</g>"}}),G(t.goal)){var it=M(+t.goal);x+=o?tt(it,A,it,A+w,' stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="4 4"'):Ht(t,e,z,z+b,it)}return c.forEach(function(h,U){if(h.n){var H=v(U)+`
|
|
9
|
+
Median `+u(h.median)+`
|
|
10
|
+
Middle half `+u(h.q1)+" to "+u(h.q3)+`
|
|
11
|
+
`+(h.outliers.length?"Range without outliers ":"Range ")+u(h.low)+" to "+u(h.high)+(h.outliers.length?`
|
|
12
|
+
`+h.outliers.length+(h.outliers.length===1?" outlier":" outliers"):"")+(f?`
|
|
13
|
+
Mean `+u(h.mean):"")+`
|
|
14
|
+
n = `+h.n;x+=o?St(z,Y(U)-B/2,b,B,H):St(Y(U)-B/2,A,B,w,H)}}),x},{summary:i?T:"no data"})}Ee.table=function(t){var e=wt(t.values),r=q(t.series),l=q(t.mark).indexOf("mean")>=0,n=function(i){return p(i,t)};return{head:["Group","Count","Lowest","Lower quartile","Median","Upper quartile","Highest","Outliers"].concat(l?["Mean"]:[]),rows:e.map(function(i,o){var s=ir(i,t.whiskers==="range");return[r[o]||"Group "+(o+1),String(s.n),n(s.min),n(s.q1),n(s.median),n(s.q3),n(s.max),String(s.outliers.length)].concat(l?[n(s.mean)]:[])})}};function Fr(t,e,r,l){for(var n=String(t);n.length>1&&vt(n,r,l)>e;)n=qt(n,n.length-1);return n}function $e(t,e){var r=(t.length-1)*e,l=Math.floor(r);return l+1<t.length?t[l]+(r-l)*(t[l+1]-t[l]):t[l]}function ir(t,e){var r=t.slice().sort(function(d,u){return d-u}),l=r.length;if(!l)return{n:0,outliers:[]};var n=$e(r,.25),i=$e(r,.75),o=i-n,s=0,f=e?-1/0:n-1.5*o,c=e?1/0:i+1.5*o,v=r.filter(function(d){return d>=f&&d<=c});return r.forEach(function(d){s+=d}),{n:l,min:r[0],max:r[l-1],q1:n,median:$e(r,.5),q3:i,mean:s/l,low:v[0],high:v[v.length-1],outliers:r.filter(function(d){return d<f||d>c})}}pt("boxplot",Ee);dt("boxplot");function Nr(t,e){var r=Math.min(t.length,e.length);if(r<2)return null;var l=0,n=0,i;for(i=0;i<r;i++)l+=t[i],n+=e[i];l/=r,n/=r;var o=0,s=0,f=0;for(i=0;i<r;i++)o+=(t[i]-l)*(t[i]-l),s+=(e[i]-n)*(e[i]-n),f+=(t[i]-l)*(e[i]-n);if(!o)return null;var c=f/o;return{slope:c,intercept:n-c*l,r:s?f/Math.sqrt(o*s):0}}function ze(t,e){for(var r=wt(t.x),l=wt(t.y),n=q(t.series),i=q(t.labels),o=ct(t,e),s=[],f=0;f<Math.max(r.length,l.length);f++){var c=r[f]||[],v=l[f]||[],d=Math.min(c.length,v.length);s.push({xs:c.slice(0,d),ys:v.slice(0,d)})}s=s.filter(function(E){return E.xs.length});var u=s.reduce(function(E,y){return E+y.xs.length},0),O=Z(t.height,210),T=s.length>1||n.length>0,R=nt(t.trend),A=function(E){return n[E]||"Group "+(E+1)},C={decimals:t.decimals,compact:t.compact,lang:t.lang},S=Xt(t,i),g=Nt(t.markers,ae,"circle"),V=t.background||e.tile,k=function(E){var y=g?g(E):"circle";return y==="none"?"circle":y},x=g&&function(E,y,m){return Zt(k(E),y+4,m+6,4,' fill="'+o[E%o.length]+'"')};return mt(t,e,O,function(E,y,m,z){if(!u)return ht(e,E,y,m,z);var b="",w=y;if(T){var M=_t(s.map(function(N,W){return A(W)}),o,e,E,w,m,x);b+=M.svg,w+=M.height}var B=[].concat.apply([],s.map(function(N){return N.xs})),I=[].concat.apply([],s.map(function(N){return N.ys})),Y=Math.min.apply(null,I),X=Math.max.apply(null,I);G(t.goal)&&(Y=Math.min(Y,+t.goal),X=Math.max(X,+t.goal)),nt(t.zero)&&(Y=Math.min(0,Y),X=Math.max(0,X));var tt=It(Y,X,4),it=It(Math.min.apply(null,B),Math.max.apply(null,B),5),h=tt.ticks.map(function(N){return p(N,t,!0)}),U=tr(h)+(G(t.yLabel)?14:0),H=20+(G(t.xLabel)?16:0),at=E+U,j=m-U,L=z-(w-y)-H,$=function(N){return at+6+(N-it.lo)/(it.hi-it.lo)*(j-12)},P=function(N){return w+6+L-6-(N-tt.lo)/(tt.hi-tt.lo)*(L-6)};tt.ticks.forEach(function(N,W){var K=P(N);b+='<line x1="'+a(at)+'" x2="'+a(at+j)+'" y1="'+a(K)+'" y2="'+a(K)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+F(at-8,K+3.5,h[W],D(e,10,'text-anchor="end"'))});var ft=Math.max(1,Math.ceil(it.ticks.length*44/j));if(it.ticks.forEach(function(N,W){if(!(W%ft)){var K=$(N);b+='<line x1="'+a(K)+'" x2="'+a(K)+'" y1="'+a(w)+'" y2="'+a(w+L)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+F(K,w+L+15,p(N,C,!0),D(e,10,'text-anchor="middle"'))}}),G(t.xLabel)&&(b+=F(at+j/2,w+L+32,t.xLabel,D(e,10,'text-anchor="middle" font-weight="600"'))),G(t.yLabel)){var et=w+L/2;b+='<text x="'+a(E+4)+'" y="'+a(et)+'" transform="rotate(-90 '+a(E+4)+" "+a(et)+')" text-anchor="middle" '+D(e,10,'font-weight="600"')+' dominant-baseline="hanging">'+String(t.yLabel).replace(/[&<>"]/g,function(N){return{"&":"&","<":"<",">":">",'"':"""}[N]})+"</text>"}G(t.goal)&&(b+=Ht(t,e,at,at+j,P(+t.goal))),R&&s.forEach(function(N,W){var K=Nr(N.xs,N.ys);if(K){var _=Math.min.apply(null,N.xs),rt=Math.max.apply(null,N.xs),lt=K.slope*_+K.intercept,ot=K.slope*rt+K.intercept,Ft=o[W%o.length];b+='<line x1="'+a($(_))+'" y1="'+a(st(P(lt),w,w+L))+'" x2="'+a($(rt))+'" y2="'+a(st(P(ot),w,w+L))+'" stroke="'+Ft+'" stroke-width="2" stroke-dasharray="6 4" stroke-linecap="round" stroke-opacity=".9"/>',b+=F(Math.min($(rt),at+j)-2,st(P(ot),w+10,w+L)-7,"r = "+K.r.toFixed(2),D(e,10,'text-anchor="end" font-weight="600"',Ft))}});var xt=0,yt=u>150?3:4.5;s.forEach(function(N,W){var K=o[W%o.length];N.xs.forEach(function(_,rt){var lt=$(_),ot=P(N.ys[rt]),Ft=(i[xt]?i[xt]+`
|
|
15
|
+
`:T?A(W)+`
|
|
16
|
+
`:"")+(G(t.xLabel)?t.xLabel:"x")+": "+p(_,C)+`
|
|
17
|
+
`+(G(t.yLabel)?t.yLabel:"y")+": "+p(N.ys[rt],t);b+=Zt(k(W),lt,ot,yt,' fill="'+K+'" fill-opacity=".85" stroke="'+V+'" stroke-width="1.5"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Math.min(.8,xt*.012))+'s"':"")),b+=St(lt-8,ot-8,16,16,Ft),xt++})});var J=[];return s.forEach(function(N){N.xs.forEach(function(W,K){J.push([$(W),P(N.ys[K])])})}),S.forEach(function(N){var W=J[N.i];W&&(b+='<circle cx="'+a(W[0])+'" cy="'+a(W[1])+'" r="'+(yt+4)+'" fill="none" stroke="'+e.fg+'" stroke-width="1.5"/>'+F(st(W[0],at+30,at+j-30),W[1]-yt-9,N.text,D(e,10,'text-anchor="middle"',e.fg)))}),b},{summary:u+" points"+(T?" in "+s.length+" groups":"")})}ze.table=function(t){var e=wt(t.x),r=wt(t.y),l=q(t.series),n=q(t.labels),i=e.length>1||l.length>0,o={decimals:t.decimals,compact:t.compact,lang:t.lang},s=[],f=0;return e.forEach(function(c,v){for(var d=r[v]||[],u=0;u<Math.min(c.length,d.length);u++,f++)s.push([n[f]||"#"+(f+1)].concat(i?[l[v]||"Group "+(v+1)]:[],[p(c[u],o),p(d[u],t)]))}),{head:["Point"].concat(i?["Group"]:[],[G(t.xLabel)?t.xLabel:"x",G(t.yLabel)?t.yLabel:"y"]),rows:s}};pt("scatter",ze);dt("scatter");function Le(t,e){var r=gt(t.values),l=q(t.labels),n=ct(t,e),i=Z(t.max,100)||100,o=Z(t.height,140),s=!G(t.prefix)&&!G(t.suffix)&&i===100,f=function(v){return p(v,t)+(s?"%":"")},c=At(r,t,"");return mt(t,e,o,function(v,d,u,O){if(!r.length)return ht(e,v,d,u,O);var T="",R=r.length===1,A=Math.min(O,R?u:u*.55),C=R?v+u/2:v+A/2,S=d+O/2,g=R?A*.12:st(A*.42/(r.length*1.35),5,16),V=g*.38;if(r.forEach(function(y,m){var z=A/2-g/2-m*(g+V);if(!(z<=g/2)){var b=st(y/i*100,0,100),w=n[m%n.length];T+='<circle cx="'+a(C)+'" cy="'+a(S)+'" r="'+a(z)+'" fill="none" stroke="'+w+'" stroke-opacity=".16" stroke-width="'+a(g)+'"/>',b>0&&(T+='<circle cx="'+a(C)+'" cy="'+a(S)+'" r="'+a(z)+'" fill="none" stroke="'+w+'" stroke-width="'+a(g)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(C)+" "+a(S)+')" style="stroke-dasharray:'+a(b)+" 100"+(t.animate?";animation-delay:"+m*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),T+='<circle cx="'+a(C)+'" cy="'+a(S)+'" r="'+a(z+g/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+kt((l[m]||"#"+(m+1))+": "+f(y)+(s?"":" of "+p(i,t)))+'"/>'}}),R)T+=F(C,S+A*.08,f(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+Mt+'" font-size="'+a(A*.22)+'" font-weight="800"'),l[0]&&(T+=F(C,S+A*.08+16,l[0],D(e,10,'text-anchor="middle"')));else{var k=v+A+22,x=Math.min(26,O/r.length),E=S-x*r.length/2;r.forEach(function(y,m){var z=E+m*x+x/2;T+='<circle cx="'+a(k+4)+'" cy="'+a(z)+'" r="4" fill="'+n[m%n.length]+'"/>'+F(k+14,z+4,qt(l[m]||"#"+(m+1),Math.floor((v+u-k-60)/6.7)),'fill="'+e.fg+'" font-family="'+Mt+'" font-size="12"')+F(v+u,z+4,f(y),'text-anchor="end" fill="'+e.fg+'" font-family="'+Ot+'" font-size="11" font-weight="600"')})}return T},{stat:c,summary:r.map(function(v,d){return(l[d]?l[d]+" ":"")+f(v)}).join(", ")})}Le.table=function(t){var e=q(t.labels),r=Z(t.max,100)||100,l=!G(t.prefix)&&!G(t.suffix)&&r===100;return{head:["Label","Value"],rows:gt(t.values).map(function(n,i){return[e[i]||"#"+(i+1),p(n,t)+(l?"%":" of "+p(r,t))]})}};pt("ring",Le);dt("ring");function Oe(t,e){var r=gt(t.values).map(function(u){return Math.max(0,u)}),l=q(t.labels),n=ct(t,e),i=r.slice(),o=l.slice();if(i.length>6){var s=i.map(function(u,O){return O}).sort(function(u,O){return r[O]-r[u]}),f=s.slice(0,5).sort(function(u,O){return u-O});i=f.map(function(u){return r[u]}),o=f.map(function(u){return l[u]||"#"+(u+1)}),i.push(Vt(s.slice(5).map(function(u){return r[u]}))),o.push("Other")}var c=Vt(i),v=Z(t.height,150),d=At(i,t,"");return mt(t,e,v,function(u,O,T,R){if(!c)return ht(e,u,O,T,R);var A="",C=Math.min(R,T*.5),S=u+C/2,g=O+R/2,V=C*.16,k=(C-V)/2,x=0,E=i.filter(Boolean).length>1?.9:0;i.forEach(function(b,w){var M=b/c*100;if(!(M<=0)){var B=Math.max(.01,M-E);A+='<circle cx="'+a(S)+'" cy="'+a(g)+'" r="'+a(k)+'" fill="none" stroke="'+n[w%n.length]+'" stroke-width="'+a(V)+'" pathLength="100" stroke-dasharray="'+a(B)+" "+a(100-B)+'" stroke-dashoffset="'+a(-x)+'" transform="rotate(-90 '+a(S)+" "+a(g)+')"'+ut(t,"bzc-a",w*.08)+"/>",x+=M}}),A+=F(S,g+2,p(c,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+Mt+'" font-size="'+a(C*.17)+'" font-weight="800"'),A+=F(S,g+2+14,(G(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),D(e,9,'text-anchor="middle" letter-spacing="1"'));var y=u+C+22,m=Math.min(24,R/i.length),z=g-m*i.length/2;return i.forEach(function(b,w){var M=z+w*m+m/2,B=Math.round(b/c*100),I=(o[w]||"#"+(w+1))+": "+p(b,t)+" ("+B+"%)";A+='<circle cx="'+a(y+4)+'" cy="'+a(M)+'" r="4" fill="'+n[w%n.length]+'"/>'+F(y+14,M+4,qt(o[w]||"#"+(w+1),Math.floor((u+T-y-50)/6.7)),'fill="'+e.fg+'" font-family="'+Mt+'" font-size="12"')+F(u+T,M+4,B+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+Ot+'" font-size="11" font-weight="600"')+St(y,M-m/2,u+T-y,m,I)}),x=0,i.forEach(function(b,w){var M=b/c*100;M<=0||(A+='<circle cx="'+a(S)+'" cy="'+a(g)+'" r="'+a(k)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(V)+'" pathLength="100" stroke-dasharray="'+a(M)+" "+a(100-M)+'" stroke-dashoffset="'+a(-x)+'" transform="rotate(-90 '+a(S)+" "+a(g)+')" class="bzc-hit" data-skip="" data-tip="'+kt((o[w]||"#"+(w+1))+": "+p(b,t)+" ("+Math.round(M)+"%)")+'"/>',x+=M)}),A},{stat:d,summary:"total "+p(c,t)+" across "+i.length+" parts"})}Oe.table=function(t){var e=gt(t.values).map(function(n){return Math.max(0,n)}),r=q(t.labels),l=Vt(e);return{head:["Label","Value","Share"],rows:e.map(function(n,i){return[r[i]||"#"+(i+1),p(n,t),(l?Math.round(n/l*100):0)+"%"]})}};pt("donut",Oe);dt("donut");function Ae(t,e){var r=gt(t.values),l=r.length?r[0]:Z(t.value,NaN),n=q(t.labels),i=Z(t.min,0),o=Z(t.max,100),s=Z(t.height,130);o===i&&(o=i+1);var f=gt(t.zones),c=ct(t,e),v=q(t.color).filter(Boolean).length>1?c:[e.up,e.palette[3],e.down],d=c[0];if(f.length&&isFinite(l)){for(var u=0;u<f.length&&l>=f[u];)u++;d=v[Math.min(u,v.length-1)]}var O=!G(t.prefix)&&!G(t.suffix)&&i===0&&o===100,T=function(R){return p(R,t)+(O?"%":"")};return mt(t,e,s,function(R,A,C,S){if(!isFinite(l))return ht(e,R,A,C,S);var g=Math.min(C/2,S-22),V=g*.16,k=g-V/2,x=R+C/2,E=A+g,y=st((l-i)/(o-i),0,1),m=function(Y,X){var tt=Math.PI*(1-Y);return[x+X*Math.cos(tt),E-X*Math.sin(tt)]},z="M"+a(x-k)+","+a(E)+"A"+a(k)+","+a(k)+" 0 0 1 "+a(x+k)+","+a(E),b='<path d="'+z+'" fill="none" stroke="'+d+'" stroke-opacity=".16" stroke-width="'+a(V)+'" stroke-linecap="round"/>';f.length&&f.forEach(function(Y){var X=st((Y-i)/(o-i),0,1),tt=m(X,k-V/2-3),it=m(X,k-V/2-8);b+='<line x1="'+a(tt[0])+'" y1="'+a(tt[1])+'" x2="'+a(it[0])+'" y2="'+a(it[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),y>0&&(b+='<path d="'+z+'" fill="none" stroke="'+d+'" stroke-width="'+a(V)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(y*100)+' 100"'+ut(t,"bzc-s")+"/>");var w=m(y,k);if(b+='<circle cx="'+a(w[0])+'" cy="'+a(w[1])+'" r="'+a(V*.26)+'" fill="'+(t.background||e.tile)+'"'+ut(t,"bzc-a",.9)+"/>",G(t.goal)){var M=st((+t.goal-i)/(o-i),0,1),B=m(M,k+V/2+4),I=m(M,k-V/2-4);b+='<line x1="'+a(B[0])+'" y1="'+a(B[1])+'" x2="'+a(I[0])+'" y2="'+a(I[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return b+=F(x,E-g*.12,T(l),'text-anchor="middle" fill="'+e.fg+'" font-family="'+Mt+'" font-size="'+a(g*.34)+'" font-weight="800"'),n[0]&&(b+=F(x,E-g*.12+16,n[0],D(e,10,'text-anchor="middle"'))),b+=F(x-k,E+18,p(i,t,!0),D(e,10,'text-anchor="middle"'))+F(x+k,E+18,p(o,t,!0),D(e,10,'text-anchor="middle"')),b+=St(x-g,E-g,g*2,g,(n[0]?n[0]+": ":"")+T(l)+" (range "+p(i,t)+" to "+p(o,t)+")"+(G(t.goal)?`
|
|
18
|
+
Goal: `+p(+t.goal,t):"")),b},{summary:isFinite(l)?T(l)+" on a scale of "+p(i,t)+" to "+p(o,t):"no data"})}Ae.table=function(t){var e=gt(t.values),r=e.length?e[0]:Z(t.value,NaN),l=q(t.labels),n=Z(t.min,0),i=Z(t.max,100),o=!G(t.prefix)&&!G(t.suffix)&&n===0&&i===100;return isFinite(r)?{head:["Label","Value"],rows:[[l[0]||"Reading",p(r,t)+(o?"%":"")],["Lowest",p(n,t)],["Highest",p(i,t)]].concat(G(t.goal)?[["Goal",p(+t.goal,t)]]:[])}:{head:["Label","Value"],rows:[]}};pt("gauge",Ae);dt("gauge");function Te(t,e){var r=gt(t.values).map(function(C){return Math.max(0,C)}),l=q(t.labels),n=ct(t,e),i=r.length===1,o=Vt(r),s=G(t.max)?Z(t.max,100):i?100:o;s>0||(s=1);var f=!G(t.prefix)&&!G(t.suffix)&&s===100&&i,c=function(C){return p(C,t)+(f?"%":"")},v=Jt(t),d=v.w,u=0,O=[];if(!i&&r.length){var T=0;u=1,r.forEach(function(C,S){var g=l[S]||"#"+(S+1),V=14+vt(g,12)+6+vt(p(C,t),11,!0)+18;T>0&&T+V>d&&(T=0,u++),O.push({x:T,row:u-1,l:g}),T+=V})}var R=36+(u?12+u*20:0),A=At(r,t,"");return mt(t,e,R,function(C,S,g,V){if(!r.length)return ht(e,C,S,g,V);var k="",x=S+22,E=Rt("c"),y=i?c(r[0])+(f?"":" of "+p(s,t)):p(o,t)+" of "+p(s,t);i&&l[0]&&(k+=F(C,S+11,l[0],'fill="'+e.fg+'" font-family="'+Mt+'" font-size="12"')),k+=F(C+g,S+11,y,'text-anchor="end" fill="'+e.fg+'" font-family="'+Ot+'" font-size="11" font-weight="600"'),k+='<rect x="'+C+'" y="'+x+'" width="'+g+'" height="14" rx="7" fill="'+e.grid+'" fill-opacity=".7"/>',k+='<clipPath id="'+E+'"><rect x="'+C+'" y="'+x+'" width="'+g+'" height="14" rx="7"/></clipPath><g clip-path="url(#'+E+')"><g'+ut(t,"bzc-gx")+">";var m=0;if(r.forEach(function(b,w){var M=Math.min(b,Math.max(0,s-m))/s*g;M>0&&(k+='<rect x="'+a(C+m/s*g)+'" y="'+x+'" width="'+a(M)+'" height="14" fill="'+n[w%n.length]+'"/>'),w>0&&M>0&&(k+='<rect x="'+a(C+m/s*g-1)+'" y="'+x+'" width="2" height="14" fill="'+(t.background||e.tile)+'"/>'),m+=b}),k+="</g></g>",G(t.goal)){var z=C+st(+t.goal/s,0,1)*g;k+='<line x1="'+a(z)+'" x2="'+a(z)+'" y1="'+(x-4)+'" y2="'+(x+18)+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return m=0,r.forEach(function(b,w){var M=Math.min(b,Math.max(0,s-m))/s*g;M>0&&(k+=St(C+m/s*g,x-4,M,22,(l[w]||(i?"Progress":"#"+(w+1)))+": "+c(b)+(i?"":" ("+Math.round(b/s*100)+"%)"))),m+=b}),O.forEach(function(b,w){var M=C+b.x,B=x+14+12+b.row*20+8;k+='<circle cx="'+a(M+4)+'" cy="'+a(B)+'" r="4" fill="'+n[w%n.length]+'"/><text x="'+a(M+14)+'" y="'+a(B+4)+'" fill="'+e.fg+'" font-family="'+Mt+'" font-size="12">'+kt(b.l)+'<tspan dx="6" fill="'+e.muted+'" font-family="'+Ot+'" font-size="11">'+kt(p(r[w],t))+"</tspan></text>"}),k},{stat:A,summary:i?c(r[0])+(f?"":" of "+p(s,t)):p(o,t)+" of "+p(s,t)})}Te.table=function(t){var e=gt(t.values).map(function(o){return Math.max(0,o)}),r=q(t.labels),l=e.length===1,n=G(t.max)?Z(t.max,100):l?100:Vt(e);n>0||(n=1);var i=!G(t.prefix)&&!G(t.suffix)&&n===100&&l;return l?{head:["Label","Value"],rows:[[r[0]||"Progress",p(e[0],t)+(i?"%":" of "+p(n,t))]]}:{head:["Label","Value","Share"],rows:e.map(function(o,s){return[r[s]||"#"+(s+1),p(o,t),Math.round(o/n*100)+"%"]})}};pt("progress",Te);dt("progress");var lr={weekday:"short",day:"numeric",month:"short",year:"numeric"};function or(t,e){if(G(t.start)&&/^\d{4}-\d{2}-\d{2}$/.test(String(t.start)))return new Date(String(t.start)+"T00:00:00Z");var r=new Date;return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Math.max(0,e-1)*864e5)}function sr(t,e){try{return new Intl.DateTimeFormat(t,Object.assign({timeZone:"UTC"},e))}catch{return new Intl.DateTimeFormat("en-GB",Object.assign({timeZone:"UTC"},e))}}function Ce(t,e){var r=gt(t.values),l=ct(t,e)[0],n=t.lang||"en-GB",i=or(t,r.length),o=(i.getUTCDay()+6)%7,s=Math.max(1,Math.ceil((o+r.length)/7)),f=Jt(t),c=28,v=Math.max(1,Math.floor((f.w-c)/10));if(s>v){var d=(s-v)*7-o;r=r.slice(d),i=new Date(i.getTime()+d*864e5),o=0,s=v}var u=Math.min(18,(f.w-c)/s),O=u<8?1:3,T=u-O,R=16+7*u+26,A=r.length?Math.max.apply(null,r):0,C=function(x){return sr(n,x)},S=C({month:"short"}),g=C({weekday:"short"}),V=C(lr),k=At(r,t,"");return mt(t,e,R,function(x,E,y,m){if(!r.length)return ht(e,x,E,y,m);var z="",b=x+c,w=E+16,M=-99,B=[.28,.5,.75,1];u>=9&&[0,2,4].forEach(function(et){var xt=new Date(Date.UTC(2024,0,1+et));z+=F(x,w+et*u+T/2+3.5,g.format(xt),D(e,9))});for(var I=0;I<r.length;I++){var Y=o+I,X=Math.floor(Y/7),tt=Y%7,it=new Date(i.getTime()+I*864e5),h=b+X*u,U=w+tt*u;(it.getUTCDate()===1||I===0)&&h-M>30&&(z+=F(h,E+9,S.format(it),D(e,9)),M=h);var H=r[I]<=0||!A?0:Math.ceil(r[I]/A*4),at=H?l:e.grid,j=H?B[H-1]:.7;z+='<rect x="'+a(h)+'" y="'+a(U)+'" width="'+a(T)+'" height="'+a(T)+'" rx="'+a(T*.24)+'" fill="'+at+'" fill-opacity="'+j+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(X*.012)+'s"':"")+' data-tip="'+kt(V.format(it)+": "+p(r[I],t))+'"/>'}var L=w+7*u+14,$=10,P=x+y-5*($+3)-30;z+=F(x,L+8,p(Vt(r),t,!0)+" in "+r.length+" days",D(e,10)),z+=F(P-6,L+8,"Less",D(e,9,'text-anchor="end"'));for(var ft=0;ft<5;ft++)z+='<rect x="'+a(P+ft*($+3))+'" y="'+L+'" width="'+$+'" height="'+$+'" rx="2.5" fill="'+(ft?l:e.grid)+'" fill-opacity="'+(ft?B[ft-1]:.7)+'"/>';return z+=F(P+5*($+3)+3,L+8,"More",D(e,9)),z},{stat:k,summary:p(Vt(r),t)+" across "+r.length+" days"})}Ce.table=function(t){var e=gt(t.values),r=or(t,e.length),l=sr(t.lang||"en-GB",lr);return{head:["Date","Value"],rows:e.map(function(n,i){return[l.format(new Date(r.getTime()+i*864e5)),p(n,t)]})}};pt("heatmap",Ce);dt("heatmap");var Gr="1.6.0",Rr=pe.slice();return yr(Vr);})();
|