bezel-charts 1.1.1 → 1.3.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 +72 -9
- package/dist/bezel-charts.iife.js +9 -9
- package/dist/bezel-charts.js +775 -507
- package/dist/bezel-charts.min.js +9 -9
- package/dist/charts/bars.js +4 -0
- package/dist/charts/donut.js +2 -0
- package/dist/charts/gauge.js +3 -0
- package/dist/charts/heatmap.js +2 -0
- package/dist/charts/line.js +3 -0
- package/dist/charts/progress.js +2 -0
- package/dist/charts/ring.js +2 -0
- package/dist/charts/scatter.js +5 -0
- package/dist/charts/shared-L67BQ555.js +2 -0
- package/dist/charts/shared-PCFIMFLL.js +2 -0
- package/dist/charts/spark.js +2 -0
- package/package.json +12 -3
- package/src/charts/bars.js +17 -5
- package/src/charts/donut.js +9 -1
- package/src/charts/gauge.js +8 -0
- package/src/charts/heatmap.js +22 -5
- package/src/charts/line.js +28 -5
- package/src/charts/progress.js +9 -0
- package/src/charts/ring.js +7 -0
- package/src/charts/scatter.js +21 -4
- package/src/charts/spark.js +5 -0
- package/src/core/series.js +85 -0
- package/src/core/util.js +0 -32
- package/src/element.js +127 -16
- package/src/entries/bars.js +10 -0
- package/src/entries/donut.js +10 -0
- package/src/entries/gauge.js +10 -0
- package/src/entries/heatmap.js +10 -0
- package/src/entries/line.js +10 -0
- package/src/entries/progress.js +10 -0
- package/src/entries/ring.js +10 -0
- package/src/entries/scatter.js +10 -0
- package/src/entries/spark.js +10 -0
- package/src/index.js +13 -17
- package/src/render.js +27 -13
package/README.md
CHANGED
|
@@ -20,8 +20,8 @@ Bezel Charts is a set of free, open-source web components: ten chart tiles drawn
|
|
|
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
|
|
24
|
-
- **Accessible.**
|
|
23
|
+
- **Light.** About 16 kB gzipped for all ten charts, or 7 to 10 kB for a page that loads just one. No dependencies and no build step.
|
|
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
|
|
|
27
27
|
A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calendar and weather tiles.
|
|
@@ -29,10 +29,12 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
|
|
|
29
29
|
## Contents
|
|
30
30
|
|
|
31
31
|
- [Quick start](#quick-start)
|
|
32
|
+
- [Load only the charts you use](#load-only-the-charts-you-use)
|
|
32
33
|
- [The Studio](#the-studio)
|
|
33
34
|
- [The charts](#the-charts)
|
|
34
35
|
- [Options for every chart](#options-for-every-chart)
|
|
35
36
|
- [Colours and dark mode](#colours-and-dark-mode)
|
|
37
|
+
- [Accessibility](#accessibility)
|
|
36
38
|
- [Charts in a README](#charts-in-a-readme)
|
|
37
39
|
- [JavaScript API](#javascript-api)
|
|
38
40
|
- [Python](#python)
|
|
@@ -47,7 +49,7 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
|
|
|
47
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>
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
`@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.3.0` instead.
|
|
51
53
|
|
|
52
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.
|
|
53
55
|
|
|
@@ -64,6 +66,30 @@ import 'bezel-charts'; // registers every element
|
|
|
64
66
|
import { render, toSVG } from 'bezel-charts'; // draw charts as SVG strings, even in Node
|
|
65
67
|
```
|
|
66
68
|
|
|
69
|
+
## Load only the charts you use
|
|
70
|
+
|
|
71
|
+
Each chart also comes as its own file, so a page with a single chart loads less than half the full bundle. The files share their common code, so a page with two or three charts downloads that part once.
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<script type="module" src="https://cdn.jsdelivr.net/gh/ShazMoghaddam/bezel-charts@1/dist/charts/line.js"></script>
|
|
75
|
+
<script type="module" src="https://cdn.jsdelivr.net/gh/ShazMoghaddam/bezel-charts@1/dist/charts/bars.js"></script>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
import 'bezel-charts/line';
|
|
80
|
+
import 'bezel-charts/bars';
|
|
81
|
+
import { toSVG } from 'bezel-charts/line'; // render and toSVG work for every chart loaded so far
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
| Page | Gzipped |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| One sparkline, ring, donut, gauge, progress bar or heatmap | 7.2 to 7.4 kB |
|
|
87
|
+
| One line, scatter or bar chart | 9.2 to 10.1 kB |
|
|
88
|
+
| A line and a bar chart | 12.0 kB |
|
|
89
|
+
| Every chart: the full bundle | 15.9 kB |
|
|
90
|
+
|
|
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
|
+
|
|
67
93
|
## The Studio
|
|
68
94
|
|
|
69
95
|
The [Studio](https://shazmoghaddam.github.io/bezel-charts/site/#studio) is the easiest way to make a chart. No data to hand? Press one of the three sample files under **Import a file** to see a finished chart straight away, or download them from [`site/samples`](site/samples). Then pick a chart type then work through the tabs while the preview updates beside them:
|
|
@@ -135,6 +161,8 @@ One or more lines over time, with an axis, a legend and notes on key moments. Se
|
|
|
135
161
|
| `height` | chart height in px | `170` |
|
|
136
162
|
| `zero` | boolean, start the axis at zero | off |
|
|
137
163
|
| `straight` | boolean, straight lines instead of curves | off |
|
|
164
|
+
| `dash` | a line style per series: `solid`, `dashed`, `dotted`, `dashdot`. On its own, gives each series the next style | off |
|
|
165
|
+
| `markers` | a shape on each point, per series: `circle`, `square`, `triangle`, `diamond`, `none`. On its own, gives each series the next shape | off |
|
|
138
166
|
|
|
139
167
|
### `<bezel-bars>`
|
|
140
168
|
|
|
@@ -153,6 +181,7 @@ Bars, vertical or horizontal. Give it more than one series and you get **grouped
|
|
|
153
181
|
| `horizontal` | boolean, bars run left to right with labels beside them | off |
|
|
154
182
|
| `stacked` | boolean, with several series, piles them into one bar per group | off |
|
|
155
183
|
| `angle-labels` | boolean, slants labels under vertical bars when they don't fit side by side, so every one shows | off |
|
|
184
|
+
| `patterns` | with several series, a fill per series: `solid`, `stripes`, `dots`, `grid`. On its own, gives each series the next pattern | off |
|
|
156
185
|
| `highlight` | `none` to stop the highest bar standing out | on |
|
|
157
186
|
| `height` | chart height in px (vertical bars) | `140` |
|
|
158
187
|
|
|
@@ -185,6 +214,7 @@ How two measures move together. Pass matching `x` and `y` lists; separate groups
|
|
|
185
214
|
| `labels` | point names, shown in tooltips | |
|
|
186
215
|
| `x-label`, `y-label` | axis titles | |
|
|
187
216
|
| `trend` | boolean, a least-squares line per group with Pearson's r | off |
|
|
217
|
+
| `markers` | a point shape per group: `circle`, `square`, `triangle`, `diamond`. On its own, gives each group the next shape | circles |
|
|
188
218
|
| `zero` | boolean, start the y axis at zero | off |
|
|
189
219
|
| `height` | chart height in px | `210` |
|
|
190
220
|
|
|
@@ -298,7 +328,7 @@ Any of the above, picked with `type`: `<bezel-chart type="donut" values="3,2,1">
|
|
|
298
328
|
| `notes` | `point:text` pairs separated by `;`, e.g. `Jun:Launch;9:Peak`. A point is a label or, if no label matches, a position counted from 0 | |
|
|
299
329
|
| `show-values` | boolean, writes each value on the chart | off |
|
|
300
330
|
| `width` | a fixed width in px instead of filling the container | |
|
|
301
|
-
| `no-tooltips` | boolean, turns off hover and
|
|
331
|
+
| `no-tooltips` | boolean, turns off hover, tap and keyboard values, and leaves the chart out of the Tab order | off |
|
|
302
332
|
| `static` | boolean, skips the entrance animation | off |
|
|
303
333
|
|
|
304
334
|
Not every option suits every chart: `notes` works on spark, line and scatter; `show-values` on spark, line and bars; `goal-label` on spark, line, bars and scatter; `stat` on everything except the gauge and scatter. The Studio only shows what applies.
|
|
@@ -314,6 +344,36 @@ With `theme="auto"` (the default) a chart follows the viewer's light or dark set
|
|
|
314
344
|
|
|
315
345
|
Set `color` to use your own. Colours you set stay the same in both themes, so choose ones with enough contrast against both tile colours, or set `theme` to fix one.
|
|
316
346
|
|
|
347
|
+
## Accessibility
|
|
348
|
+
|
|
349
|
+
Every chart works without a mouse and without seeing it.
|
|
350
|
+
|
|
351
|
+
**Keyboard.** Press Tab to reach a chart. A focus ring shows where you are, then:
|
|
352
|
+
|
|
353
|
+
| Key | Does |
|
|
354
|
+
| --- | --- |
|
|
355
|
+
| Right or Down | The next value |
|
|
356
|
+
| Left or Up | The previous value |
|
|
357
|
+
| Home, End | The first or last value |
|
|
358
|
+
| Escape | Hides the tooltip |
|
|
359
|
+
|
|
360
|
+
The value you're on is outlined, with its tooltip showing. On a heatmap, Left and Right move a week and Up and Down move a day, following the grid. A chart keeps its place when it redraws, for example when the window resizes.
|
|
361
|
+
|
|
362
|
+
**Screen readers** hear the chart's name and summary, a hint about the arrow keys, and each value as you move, such as "Tue: 9. 2 of 7". Each chart also carries a hidden table of its data, with every value, including the small donut slices grouped as "Other" and the early weeks a narrow heatmap leaves out.
|
|
363
|
+
|
|
364
|
+
**Telling series apart.** Colour alone isn't enough for everyone, so lines can have their own dash, points their own shape, and grouped or stacked bars their own pattern. Use the attribute on its own to hand out styles in turn, or list one per series, in the same order as `color`:
|
|
365
|
+
|
|
366
|
+
```html
|
|
367
|
+
<bezel-line values="420,460,510|380,400,430" series="2026,2025" dash markers></bezel-line>
|
|
368
|
+
<bezel-bars values="4,9,6|3,7,8" series="2026,2025" labels="Q1,Q2,Q3" patterns="solid,stripes"></bezel-bars>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
The legend shows each style, so it still matches the chart in black and white.
|
|
372
|
+
|
|
373
|
+
**Fewer tab stops.** A page with many charts gets a tab stop for each. Add `no-tooltips` to a chart that doesn't need exact values, such as a decorative sparkline: it drops the tooltips and the tab stop, and keeps the name and the hidden table.
|
|
374
|
+
|
|
375
|
+
**Images.** An exported SVG is a picture, so give it alt text that says what it shows: ``. The Python package writes this for you with `chart.alt`.
|
|
376
|
+
|
|
317
377
|
## Charts in a README
|
|
318
378
|
|
|
319
379
|
GitHub doesn't run scripts in a README, but it shows SVG images. So:
|
|
@@ -323,9 +383,11 @@ GitHub doesn't run scripts in a README, but it shows SVG images. So:
|
|
|
323
383
|
3. Add it to your README:
|
|
324
384
|
|
|
325
385
|
```md
|
|
326
|
-

|
|
386
|
+

|
|
327
387
|
```
|
|
328
388
|
|
|
389
|
+
Make the alt text say what the chart shows, since that's all a screen reader gets from an image.
|
|
390
|
+
|
|
329
391
|
The SVG is self-contained: no scripts, no fonts to load, no tooltips. It uses the system font, so it looks at home on GitHub, in Notion and in slides.
|
|
330
392
|
|
|
331
393
|
## JavaScript API
|
|
@@ -363,7 +425,7 @@ bc.line(df, x="month", y=["sales", "costs"], heading="Sales", prefix="£")
|
|
|
363
425
|
bc.spark(df["signups"], heading="Signups").save("docs/signups.svg")
|
|
364
426
|
```
|
|
365
427
|
|
|
366
|
-
All ten charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. See the [Python README](python/README.md).
|
|
428
|
+
All ten 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).
|
|
367
429
|
|
|
368
430
|
## Frameworks
|
|
369
431
|
|
|
@@ -396,17 +458,18 @@ npm run test:browser # click through every Studio control in a real browser (nee
|
|
|
396
458
|
|
|
397
459
|
```
|
|
398
460
|
src/
|
|
399
|
-
core/ shared helpers, the bezel frame and the colour themes
|
|
461
|
+
core/ shared helpers, the bezel frame and the colour themes; series.js has the extras for line, bars and scatter
|
|
400
462
|
charts/ one file per chart type: options in, SVG string out
|
|
401
463
|
render.js picks the chart and returns its SVG
|
|
402
|
-
element.js the custom element: sizing, theme, tooltips and export
|
|
464
|
+
element.js the custom element: sizing, theme, tooltips, keyboard and export
|
|
465
|
+
entries/ one file per chart that registers it and defines its tag, for per-chart imports
|
|
403
466
|
site/ the website and Studio, with sample files in site/samples
|
|
404
467
|
python/ the Python package, with parity tests against the JavaScript
|
|
405
468
|
docs/ the README image and social preview, with the pages that render them
|
|
406
469
|
test/ node:test suites, plus a Playwright browser test
|
|
407
470
|
```
|
|
408
471
|
|
|
409
|
-
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 bundle has a
|
|
472
|
+
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 20 kB gzip budget and each chart file its own, checked in CI by `npm run size`. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
410
473
|
|
|
411
474
|
## Security
|
|
412
475
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! Bezel Charts v1.
|
|
2
|
-
var BezelCharts=(()=>{var le=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Pe=Object.prototype.hasOwnProperty;var Ue=(t,e)=>{for(var r in e)le(t,r,{get:e[r],enumerable:!0})},He=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of Ge(e))!Pe.call(t,l)&&l!==r&&le(t,l,{get:()=>e[l],enumerable:!(i=De(e,l))||i.enumerable});return t};var Ie=t=>He(le({},"__esModule",{value:!0}),t);var Je={};Ue(Je,{BezelChart:()=>Vt,render:()=>Yt,themes:()=>Ht,toSVG:()=>Ae,types:()=>Fe,version:()=>Qe});var Ht={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 tt="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",lt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",$e=0;function It(t){return"bzc"+t+(++$e).toString(36)+Math.random().toString(36).slice(2,6)}function ut(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[e]})}function a(t){return Math.round(t*100)/100}function X(t,e,r){return Math.max(e,Math.min(r,t))}function _(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function O(t){return t!=null&&t!==""}function ct(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):O(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function Z(t){return Array.isArray(t)?t.map(String):O(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function Ct(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(ct):[ct(t)]:O(t)?String(t).split("|").map(ct).filter(function(e){return e.length}):[]}function Lt(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 Nt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function J(t){return t===!0||t===""||t==="true"||t==="1"}function g(t,e,r){if(!isFinite(t))return"\u2013";var i=Math.abs(t),l;O(e.decimals)?l=X(parseInt(e.decimals,10)||0,0,6):l=t%1===0?0:i<10?2:i<100?1:0;var n={maximumFractionDigits:l,minimumFractionDigits:O(e.decimals)?l:0};(J(e.compact)||r)&&i>=1e4&&(n={notation:"compact",maximumFractionDigits:1});var s;try{s=new Intl.NumberFormat(e.lang||"en-GB",n).format(i)}catch{s=String(a(i))}return(t<0?"\u2212":"")+(e.prefix||"")+s+(e.suffix||"")}function Qt(t,e,r){if(t===e)if(t===0)e=1;else{var i=Math.abs(t)*.1;t-=i,e+=i}for(var l=(e-t)/(r||4),n=Math.pow(10,Math.floor(Math.log10(l))),s=l/n,o=(s<=1?1:s<=2?2:s<=5?5:10)*n,c=Math.floor(t/o)*o,A=Math.ceil(e/o)*o,x=[],y=c;y<=A+o/2;y+=o)x.push(+y.toFixed(10));return{lo:c,hi:A,ticks:x}}function jt(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),i=1;i<t.length;i++){var l=t[i-1],n=t[i];if(e)r+="L"+a(n[0])+","+a(n[1]);else{var s=(l[0]+n[0])/2;r+="C"+a(s)+","+a(l[1])+" "+a(s)+","+a(n[1])+" "+a(n[0])+","+a(n[1])}}return r}function M(t,e,r,i){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(i||"")+">"+ut(r)+"</text>"}function H(t,e,r,i){return'fill="'+(i||t.muted)+'" font-family="'+lt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function pt(t,e,r,i,l){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,i))+'" fill="#000" fill-opacity="0" data-tip="'+ut(l)+'"/>'}function ot(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function at(t,e){var r=Z(t.color).filter(Boolean);return r.length?r:e.palette}function nt(t,e,r,i,l){return M(e+i/2,r+l/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+tt+'" font-size="13"')}function $t(t,e){return O(t.notes)?String(t.notes).split(";").map(function(r){var i=r.indexOf(":");if(i<0)return null;var l=r.slice(0,i).trim(),n=r.slice(i+1).trim(),s=e.map(String).indexOf(l);return s<0&&String(parseInt(l,10))===l&&(s=parseInt(l,10)),s>=0&&n?{i:s,text:n}:null}).filter(Boolean):[]}function At(t,e,r,i,l){var n=(O(t.goalLabel)?t.goalLabel:"Goal")+" "+g(_(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(i)+'" y1="'+a(l)+'" y2="'+a(l)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+M(i,l-5,n,H(e,10,'text-anchor="end"'))}function xt(t,e,r){var i=String(O(e.stat)?e.stat:r||"").toLowerCase();if(!i||i==="none"||!t.length)return null;var l=Lt(t),n={last:t[t.length-1],total:l,sum:l,average:l/t.length,avg:l/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(i in n))return null;var s=null;return i==="last"&&t.length>1&&e.delta!=="none"&&(s=t[t.length-1]-t[0]),{val:n[i],delta:s}}function Rt(t,e,r,i,l,n){var s=i,o=l,c="";return t.forEach(function(A,x){var y=13+vt(A,12)+16;s>i&&s+y-16>i+n&&(s=i,o+=20),c+='<circle cx="'+a(s+4)+'" cy="'+a(o+6)+'" r="4" fill="'+e[x%e.length]+'"/>'+M(s+13,o+10,A,'fill="'+r.fg+'" font-family="'+tt+'" font-size="12"'),s+=y}),{svg:c,height:o-l+24}}function Ee(t){return Math.max.apply(null,t.map(function(e){return vt(e,10,!0)}))+10}function Bt(t){var e=Math.round(X(_(t.width,360),160,2400)),r=t.frame==="none"?0:4,i=t.frame==="none"?8:20;return{W:e,b:r,P:i,w:e-2*(r+i)}}var Ye=".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 it(t,e,r,i,l){var n=Bt(t),s=n.W,o=n.b,c=n.P,A=n.w,x=X(_(t.corners,22),0,60),y=o+c,u="";O(t.heading)&&(u+=M(o+c,y+10,String(t.heading).toUpperCase(),H(e,11,'font-weight="600" letter-spacing="1.3"')),y+=24);var S=l&&l.stat;if(S){if(u+=M(o+c,y+30,g(S.val,t),'fill="'+e.fg+'" font-family="'+tt+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),S.delta!=null){var F=S.delta>0,C=S.delta===0,T=t.delta==="inverse"?!F:F,k=C?e.muted:T?e.up:e.down,E=(C?"\u25CF ":F?"\u25B2 ":"\u25BC ")+g(Math.abs(S.delta),t)+" "+(O(t.deltaLabel)?t.deltaLabel:"since start");u+=M(o+c+A,y+28,E,'text-anchor="end" fill="'+k+'" font-family="'+lt+'" font-size="11" font-weight="600"')}y+=44}var f=i(o+c,y,A,r),R=Math.round(y+r+c+o),v="";t.frame!=="none"?v='<rect width="'+s+'" height="'+R+'" rx="'+x+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(R-2*o)+'" rx="'+Math.max(0,x-o)+'" fill="'+(t.background||e.tile)+'"/>':O(t.background)&&(v='<rect width="'+s+'" height="'+R+'" rx="'+x+'" fill="'+t.background+'"/>');var b=(O(t.heading)?t.heading+": ":"")+(l&&l.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+R+'" width="'+s+'" height="'+R+'" role="img" aria-label="'+ut(b)+'"><title>'+ut(b)+"</title>"+(t.animate?"<style>"+Ye+"</style>":"")+v+u+f+"</svg>"}function oe(t,e){var r=ct(t.values),i=at(t,e)[0],l=_(t.height,64),n=Z(t.labels),s=$t(t,n),o=xt(r,t,"last");return it(t,e,l,function(c,A,x,y){if(!r.length)return nt(e,c,A,x,y);var u=r.length===1?[r[0],r[0]]:r,S=Math.min.apply(null,u),F=Math.max.apply(null,u);O(t.goal)&&(S=Math.min(S,+t.goal),F=Math.max(F,+t.goal));var C=(F-S||Math.abs(F)||1)*.12;S-=C,F+=C;var T=function(m){return c+m*x/(u.length-1)},k=function(m){return A+y-(m-S)/(F-S)*y},E=u.map(function(m,h){return[T(h),k(m)]}),f=jt(E,J(t.straight)),R=It("g"),v=E[E.length-1],b='<defs><linearGradient id="'+R+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+i+'" stop-opacity=".32"/><stop offset="1" stop-color="'+i+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(m){b+='<line x1="'+c+'" x2="'+(c+x)+'" y1="'+a(A+y*m)+'" y2="'+a(A+y*m)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),b+='<path d="'+f+"L"+a(v[0])+","+(A+y)+"L"+c+","+(A+y)+'Z" fill="url(#'+R+')"'+ot(t,"bzc-a")+"/>",b+='<path d="'+f+'" fill="none" stroke="'+i+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+ot(t,"bzc-d")+"/>",O(t.goal)&&(b+=At(t,e,c,c+x,k(+t.goal))),s.forEach(function(m){if(!(m.i>=r.length)){var h=E[m.i];b+='<circle cx="'+a(h[0])+'" cy="'+a(h[1])+'" r="3.5" fill="'+e.fg+'"/>'+M(X(h[0],c+30,c+x-30),h[1]-9,m.text,H(e,10,'text-anchor="middle"',e.fg))}}),b+='<circle cx="'+a(v[0])+'" cy="'+a(v[1])+'" r="9" fill="'+i+'" fill-opacity=".25"/><circle cx="'+a(v[0])+'" cy="'+a(v[1])+'" r="4.5" fill="'+i+'"/>',J(t.showValues)&&E.forEach(function(m,h){h<r.length&&(b+=M(m[0],m[1]-8,g(r[h],t,!0),H(e,9,'text-anchor="middle"')))});var N=r.length>1?x/(r.length-1):x;return r.forEach(function(m,h){b+=pt(T(h)-N/2,A-6,N,y+12,(n[h]||"#"+(h+1))+": "+g(m,t))}),b},{stat:o,summary:r.length?"latest "+g(r[r.length-1],t):"no data"})}function se(t,e){var r=Ct(t.values),i=Z(t.series),l=Z(t.labels),n=at(t,e),s=_(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(y){return y.length}))),c=$t(t,l),A=r.length>1||i.length>0,x=xt(r[0]||[],t,"");return it(t,e,s,function(y,u,S,F){if(!o)return nt(e,y,u,S,F);var C="",T=u;if(A){var k=Rt(r.map(function(w,z){return i[z]||"Series "+(z+1)}),n,e,y,T,S);C+=k.svg,T+=k.height}var E=[].concat.apply([],r),f=Math.min.apply(null,E),R=Math.max.apply(null,E);O(t.goal)&&(f=Math.min(f,+t.goal),R=Math.max(R,+t.goal)),J(t.zero)&&(f=Math.min(0,f),R=Math.max(0,R));var v=Qt(f,R,4),b=v.ticks.map(function(w){return g(w,t,!0)}),N=Math.max.apply(null,b.map(function(w){return vt(w,10,!0)}))+10,m=l.length?20:4,h=y+N,I=S-N,p=F-(T-u)-m,D=function(w){return o===1?h+I/2:h+w*I/(o-1)},L=function(w){return T+p-(w-v.lo)/(v.hi-v.lo)*p};if(v.ticks.forEach(function(w,z){var $=L(w);C+='<line x1="'+a(h)+'" x2="'+a(h+I)+'" y1="'+a($)+'" y2="'+a($)+'" stroke="'+e.grid+'"'+(w===0?"":' stroke-dasharray="2 4"')+"/>"+M(h-8,$+3.5,b[z],H(e,10,'text-anchor="end"'))}),l.length){for(var U=Math.max(1,Math.ceil(o*(Math.max.apply(null,l.map(function(w){return vt(w,10,!0)}))+10)/I)),W=0;W<o;W+=U)if(l[W]!=null){var q=o>1&&W===0?"start":o>1&&W===o-1?"end":"middle";C+=M(D(W),T+p+15,l[W],H(e,10,'text-anchor="'+q+'"'))}}c.forEach(function(w){if(!(w.i>=o)){var z=D(w.i);C+='<line x1="'+a(z)+'" x2="'+a(z)+'" y1="'+a(T+12)+'" y2="'+a(T+p)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+M(X(z,h+30,h+I-30),T+8,w.text,H(e,10,'text-anchor="middle"',e.fg))}}),r.forEach(function(w,z){var $=n[z%n.length],G=w.map(function(mt,B){return[D(B),L(mt)]});G.length===1&&(G=[[h,G[0][1]],[h+I,G[0][1]]]);var dt=jt(G,J(t.straight));if(z===0){var ht=It("g"),et=G[G.length-1];C+='<defs><linearGradient id="'+ht+'" 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="'+dt+"L"+a(et[0])+","+a(T+p)+"L"+a(G[0][0])+","+a(T+p)+'Z" fill="url(#'+ht+')"'+ot(t,"bzc-a")+"/>"}C+='<path d="'+dt+'" fill="none" stroke="'+$+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+z*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>";var ft=G[G.length-1];C+='<circle cx="'+a(ft[0])+'" cy="'+a(ft[1])+'" r="4" fill="'+$+'" stroke="'+(t.background||e.tile)+'" stroke-width="2"/>',J(t.showValues)&&w.forEach(function(mt,B){C+=M(D(B),L(mt)-8,g(mt,t,!0),H(e,9,'text-anchor="middle"'))})}),O(t.goal)&&(C+=At(t,e,h,h+I,L(+t.goal)));for(var st=o>1?I/(o-1):I,Q=0;Q<o;Q++){var d=l[Q]||"#"+(Q+1);r.forEach(function(w,z){Q<w.length&&(d+=`
|
|
3
|
-
`+(
|
|
4
|
-
`+
|
|
5
|
-
Total: `+g(C[d],t):""):m(d)+": "+g(u[d],t)},I=Bt(t),p=c||i.length?Rt(r.map(function(d,w){return v(w)}),n,e,0,0,I.w).height:0,D=x?1:s,L=c&&!x,U=L?10:14,W=3,q=A?D*U+(D-1)*W+(L?14:16):0,st=A?p+Math.max(1,o)*q-6:_(t.height,140)+p,Q=u.indexOf(Math.max.apply(null,u.length?u:[0]));return it(t,e,st,function(d,w,z,$){if(!o)return nt(e,d,w,z,$);var G="",dt=w;p&&(G+=Rt(r.map(function(P,j){return v(j)}),n,e,d,w,z).svg,dt+=p);var ht=Math.min(0,Math.min.apply(null,f)),et=Math.max(0,R);if(O(t.goal)&&(ht=Math.min(ht,+t.goal),et=Math.max(et,+t.goal)),et===ht&&(et=ht+1),A){for(var ft=l.length?Math.min(z*.4,Math.max.apply(null,l.map(function(P){return vt(P,12)}))+10):0,mt=x?[C.map(function(P){return g(P,t)})]:r.map(function(P){return P.map(function(j){return g(j,t)})}),B=Math.max.apply(null,[].concat.apply([],mt).map(function(P){return vt(P,L?10:11,!0)}))+10,Y=d+ft,V=z-ft-B,kt=Math.max(et,0)||1,K=0;K<o;K++){var bt=dt+K*q;l[K]!=null&&(G+=M(d,bt+(q-6)/2+4,Nt(l[K],Math.floor(ft/6.7)),'fill="'+e.fg+'" font-family="'+tt+'" font-size="12"')),x?(G+=Dt(K,Y,bt+5,V,kt),G+=M(d+z,bt+5+U/2+3.8,mt[0][K],'text-anchor="end" fill="'+e.fg+'" font-family="'+lt+'" font-size="11" font-weight="600"')):r.forEach(function(P,j){if(!(K>=P.length)){var rt=P[K],yt=bt+(c?2:5)+j*(U+W),wt=Math.max(0,rt)/kt*V;c||(G+='<rect x="'+a(Y)+'" y="'+a(yt)+'" width="'+a(V)+'" height="'+U+'" rx="'+U/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),wt>0&&(G+='<rect x="'+a(Y)+'" y="'+a(yt)+'" width="'+a(Math.max(U,wt))+'" height="'+U+'" rx="'+U/2+'" fill="'+b(j,K)+'" fill-opacity="'+N(rt)+'"'+ot(t,"bzc-gx",K*.06+j*.03)+"/>"),G+=M(d+z,yt+U/2+3.8,mt[j][K],'text-anchor="end" fill="'+e.fg+'" font-family="'+lt+'" font-size="'+(c?10:11)+'" font-weight="600"')}}),G+=pt(d,bt,z,q-6,h(K))}if(O(t.goal)&&+t.goal>0){var Ot=Y+ +t.goal/kt*V;G+='<line x1="'+a(Ot)+'" x2="'+a(Ot)+'" y1="'+a(dt-2)+'" y2="'+a(w+$+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return G}function Dt(P,j,rt,yt,wt){var zt='<rect x="'+a(j)+'" y="'+a(rt)+'" width="'+a(yt)+'" height="'+U+'" rx="'+U/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',Pt=0;return r.forEach(function(qt,St){var Ut=P<qt.length?qt[P]:0,Et=Math.max(0,Ut)/wt*yt;if(!(Et<=0)){var Ft=Pt>0?1.5:0;zt+='<rect x="'+a(j+Pt+Ft)+'" y="'+a(rt)+'" width="'+a(Math.max(2,Et-Ft))+'" height="'+U+'" rx="'+a(Math.min(3,Et/2))+'" fill="'+b(St,P)+'"'+ot(t,"bzc-gx",P*.06+St*.03)+"/>",Pt+=Et}}),zt}var xe=l.length?Math.max.apply(null,l.map(function(P){return vt(P,10,!0)})):0,te=l.length?Math.max(1,Math.ceil(o*(xe+8)/z)):1,Wt=J(t.angleLabels)&&te>1,ye=Le*Math.PI/180,be=function(P){return Wt?Nt(P,Oe):P};if(Wt){var Ce=z/o,Gt=0;l.forEach(function(P,j){Gt=Math.max(Gt,Math.cos(ye)*vt(be(P),10,!0)+4-(j+.5)*Ce)}),Gt=Math.min(Gt,z*.25),d+=Gt,z-=Gt,te=1}var Me=J(t.showValues)&&ht<0?14:0,Ne=Wt?Math.ceil(Math.sin(ye)*Math.min(xe,vt("x".repeat(Oe),10,!0)))+18:20,Re=(l.length?Ne:2)+Me,ke=J(t.showValues)?16:4,ee=$-(dt-w)-Re-ke,we=dt+ke,Mt=function(P){return we+ee-(P-ht)/(et-ht)*ee},Xt=z/o,_t=Math.min(Xt*(L?.78:.62),L?s*30:56),ze=L?Math.min(3,_t/s*.15):0,Tt=x?_t:(_t-ze*(s-1))/s,Kt=Mt(0);G+='<line x1="'+d+'" x2="'+(d+z)+'" y1="'+a(Kt)+'" y2="'+a(Kt)+'" stroke="'+e.grid+'"/>';for(var gt=0;gt<o;gt++){var re=d+gt*Xt+(Xt-_t)/2;if(x?G+=Be(gt,re):r.forEach(function(P,j){if(!(gt>=P.length)){var rt=P[gt],yt=re+j*(Tt+ze),wt=Math.min(Mt(rt),Kt),zt=Math.abs(Mt(rt)-Kt);zt>.5&&(G+='<rect x="'+a(yt)+'" y="'+a(wt)+'" width="'+a(Tt)+'" height="'+a(zt)+'" rx="'+a(Math.min(6,Tt/2,zt/2))+'" fill="'+b(j,gt)+'" fill-opacity="'+N(rt)+'"'+ot(t,rt<0?"bzc-gn":"bzc-g",gt*.05+j*.03)+"/>"),J(t.showValues)&&(G+=M(yt+Tt/2,rt<0?Mt(rt)+12:Mt(rt)-5,g(rt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+lt+'" font-size="'+(c?9:10)+'" font-weight="600"'))}}),l[gt]!=null&>%te===0){var ae=re+_t/2,ne=we+ee+Me+(Wt?12:15);G+=Wt?M(ae,ne,be(l[gt]),H(e,10,'text-anchor="end" transform="rotate(-'+Le+" "+a(ae)+" "+a(ne)+')"')):M(ae,ne,l[gt],H(e,10,'text-anchor="middle"'))}G+=pt(d+gt*Xt,dt,Xt,$-(dt-w),h(gt))}return O(t.goal)&&(G+=At(t,e,d,d+z,Mt(+t.goal))),G;function Be(P,j){var rt="",yt=0,wt=0;if(r.forEach(function(Pt,qt){var St=P<Pt.length?Pt[P]:0;if(St){var Ut=St>0?yt:wt,Et=Ut+St;St>0?yt=Et:wt=Et;var Ft=Mt(Math.max(Ut,Et)),ie=Mt(Math.min(Ut,Et)),Zt=ie-Ft,Se=Ut!==0?Math.min(1.5,Zt/2):0;St>0?ie-=Se:Ft+=Se,Zt=ie-Ft,Zt>.5&&(rt+='<rect x="'+a(j)+'" y="'+a(Ft)+'" width="'+a(Tt)+'" height="'+a(Zt)+'" rx="'+a(Math.min(3,Tt/2,Zt/2))+'" fill="'+b(qt,P)+'"'+ot(t,St<0?"bzc-gn":"bzc-g",P*.05+qt*.03)+"/>")}}),J(t.showValues)){var zt=C[P];rt+=M(j+Tt/2,zt<0?Mt(k[P])+12:Mt(T[P])-5,g(zt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+lt+'" font-size="10" font-weight="600"')}return rt}},{stat:xt(u,t,""),summary:o?x?s+" series stacked across "+o+" groups":c?s+" series across "+o+" groups":"highest "+(l[Q]||"")+" "+g(u[Q],t):"no data"})}function ce(t,e){var r=ct(t.values),i=Z(t.labels),l=at(t,e),n=_(t.max,100)||100,s=_(t.height,140),o=!O(t.prefix)&&!O(t.suffix)&&n===100,c=function(x){return g(x,t)+(o?"%":"")},A=xt(r,t,"");return it(t,e,s,function(x,y,u,S){if(!r.length)return nt(e,x,y,u,S);var F="",C=r.length===1,T=Math.min(S,C?u:u*.55),k=C?x+u/2:x+T/2,E=y+S/2,f=C?T*.12:X(T*.42/(r.length*1.35),5,16),R=f*.38;if(r.forEach(function(m,h){var I=T/2-f/2-h*(f+R);if(!(I<=f/2)){var p=X(m/n*100,0,100),D=l[h%l.length];F+='<circle cx="'+a(k)+'" cy="'+a(E)+'" r="'+a(I)+'" fill="none" stroke="'+D+'" stroke-opacity=".16" stroke-width="'+a(f)+'"/>',p>0&&(F+='<circle cx="'+a(k)+'" cy="'+a(E)+'" r="'+a(I)+'" fill="none" stroke="'+D+'" stroke-width="'+a(f)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(k)+" "+a(E)+')" style="stroke-dasharray:'+a(p)+" 100"+(t.animate?";animation-delay:"+h*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),F+='<circle cx="'+a(k)+'" cy="'+a(E)+'" r="'+a(I+f/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+ut((i[h]||"#"+(h+1))+": "+c(m)+(o?"":" of "+g(n,t)))+'"/>'}}),C)F+=M(k,E+T*.08,c(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+tt+'" font-size="'+a(T*.22)+'" font-weight="800"'),i[0]&&(F+=M(k,E+T*.08+16,i[0],H(e,10,'text-anchor="middle"')));else{var v=x+T+22,b=Math.min(26,S/r.length),N=E-b*r.length/2;r.forEach(function(m,h){var I=N+h*b+b/2;F+='<circle cx="'+a(v+4)+'" cy="'+a(I)+'" r="4" fill="'+l[h%l.length]+'"/>'+M(v+14,I+4,Nt(i[h]||"#"+(h+1),Math.floor((x+u-v-60)/6.7)),'fill="'+e.fg+'" font-family="'+tt+'" font-size="12"')+M(x+u,I+4,c(m),'text-anchor="end" fill="'+e.fg+'" font-family="'+lt+'" font-size="11" font-weight="600"')})}return F},{stat:A,summary:r.map(function(x,y){return(i[y]?i[y]+" ":"")+c(x)}).join(", ")})}function ue(t,e){var r=ct(t.values).map(function(u){return Math.max(0,u)}),i=Z(t.labels),l=at(t,e),n=r.slice(),s=i.slice();if(n.length>6){var o=n.map(function(u,S){return S}).sort(function(u,S){return r[S]-r[u]}),c=o.slice(0,5).sort(function(u,S){return u-S});n=c.map(function(u){return r[u]}),s=c.map(function(u){return i[u]||"#"+(u+1)}),n.push(Lt(o.slice(5).map(function(u){return r[u]}))),s.push("Other")}var A=Lt(n),x=_(t.height,150),y=xt(n,t,"");return it(t,e,x,function(u,S,F,C){if(!A)return nt(e,u,S,F,C);var T="",k=Math.min(C,F*.5),E=u+k/2,f=S+C/2,R=k*.16,v=(k-R)/2,b=0,N=n.filter(Boolean).length>1?.9:0;n.forEach(function(p,D){var L=p/A*100;if(!(L<=0)){var U=Math.max(.01,L-N);T+='<circle cx="'+a(E)+'" cy="'+a(f)+'" r="'+a(v)+'" fill="none" stroke="'+l[D%l.length]+'" stroke-width="'+a(R)+'" pathLength="100" stroke-dasharray="'+a(U)+" "+a(100-U)+'" stroke-dashoffset="'+a(-b)+'" transform="rotate(-90 '+a(E)+" "+a(f)+')"'+ot(t,"bzc-a",D*.08)+"/>",b+=L}}),T+=M(E,f+2,g(A,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+tt+'" font-size="'+a(k*.17)+'" font-weight="800"'),T+=M(E,f+2+14,(O(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),H(e,9,'text-anchor="middle" letter-spacing="1"'));var m=u+k+22,h=Math.min(24,C/n.length),I=f-h*n.length/2;return n.forEach(function(p,D){var L=I+D*h+h/2,U=Math.round(p/A*100),W=(s[D]||"#"+(D+1))+": "+g(p,t)+" ("+U+"%)";T+='<circle cx="'+a(m+4)+'" cy="'+a(L)+'" r="4" fill="'+l[D%l.length]+'"/>'+M(m+14,L+4,Nt(s[D]||"#"+(D+1),Math.floor((u+F-m-50)/6.7)),'fill="'+e.fg+'" font-family="'+tt+'" font-size="12"')+M(u+F,L+4,U+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+lt+'" font-size="11" font-weight="600"')+pt(m,L-h/2,u+F-m,h,W)}),b=0,n.forEach(function(p,D){var L=p/A*100;L<=0||(T+='<circle cx="'+a(E)+'" cy="'+a(f)+'" r="'+a(v)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(R)+'" pathLength="100" stroke-dasharray="'+a(L)+" "+a(100-L)+'" stroke-dashoffset="'+a(-b)+'" transform="rotate(-90 '+a(E)+" "+a(f)+')" class="bzc-hit" data-tip="'+ut((s[D]||"#"+(D+1))+": "+g(p,t)+" ("+Math.round(L)+"%)")+'"/>',b+=L)}),T},{stat:y,summary:"total "+g(A,t)+" across "+n.length+" parts"})}function he(t,e){var r=ct(t.values),i=r.length?r[0]:_(t.value,NaN),l=Z(t.labels),n=_(t.min,0),s=_(t.max,100),o=_(t.height,130);s===n&&(s=n+1);var c=ct(t.zones),A=at(t,e),x=Z(t.color).filter(Boolean).length>1?A:[e.up,e.palette[3],e.down],y=A[0];if(c.length&&isFinite(i)){for(var u=0;u<c.length&&i>=c[u];)u++;y=x[Math.min(u,x.length-1)]}var S=!O(t.prefix)&&!O(t.suffix)&&n===0&&s===100,F=function(C){return g(C,t)+(S?"%":"")};return it(t,e,o,function(C,T,k,E){if(!isFinite(i))return nt(e,C,T,k,E);var f=Math.min(k/2,E-22),R=f*.16,v=f-R/2,b=C+k/2,N=T+f,m=X((i-n)/(s-n),0,1),h=function(q,st){var Q=Math.PI*(1-q);return[b+st*Math.cos(Q),N-st*Math.sin(Q)]},I="M"+a(b-v)+","+a(N)+"A"+a(v)+","+a(v)+" 0 0 1 "+a(b+v)+","+a(N),p='<path d="'+I+'" fill="none" stroke="'+y+'" stroke-opacity=".16" stroke-width="'+a(R)+'" stroke-linecap="round"/>';c.length&&c.forEach(function(q){var st=X((q-n)/(s-n),0,1),Q=h(st,v-R/2-3),d=h(st,v-R/2-8);p+='<line x1="'+a(Q[0])+'" y1="'+a(Q[1])+'" x2="'+a(d[0])+'" y2="'+a(d[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),m>0&&(p+='<path d="'+I+'" fill="none" stroke="'+y+'" stroke-width="'+a(R)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(m*100)+' 100"'+ot(t,"bzc-s")+"/>");var D=h(m,v);if(p+='<circle cx="'+a(D[0])+'" cy="'+a(D[1])+'" r="'+a(R*.26)+'" fill="'+(t.background||e.tile)+'"'+ot(t,"bzc-a",.9)+"/>",O(t.goal)){var L=X((+t.goal-n)/(s-n),0,1),U=h(L,v+R/2+4),W=h(L,v-R/2-4);p+='<line x1="'+a(U[0])+'" y1="'+a(U[1])+'" x2="'+a(W[0])+'" y2="'+a(W[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return p+=M(b,N-f*.12,F(i),'text-anchor="middle" fill="'+e.fg+'" font-family="'+tt+'" font-size="'+a(f*.34)+'" font-weight="800"'),l[0]&&(p+=M(b,N-f*.12+16,l[0],H(e,10,'text-anchor="middle"'))),p+=M(b-v,N+18,g(n,t,!0),H(e,10,'text-anchor="middle"'))+M(b+v,N+18,g(s,t,!0),H(e,10,'text-anchor="middle"')),p+=pt(b-f,N-f,f*2,f,(l[0]?l[0]+": ":"")+F(i)+" (range "+g(n,t)+" to "+g(s,t)+")"+(O(t.goal)?`
|
|
6
|
-
|
|
7
|
-
`:
|
|
8
|
-
|
|
9
|
-
`+(
|
|
1
|
+
/*! Bezel Charts v1.3.0 | MIT | github.com/ShazMoghaddam/bezel-charts */
|
|
2
|
+
var BezelCharts=(()=>{var Ae=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var ar=Object.getOwnPropertyNames;var nr=Object.prototype.hasOwnProperty;var ir=(t,e)=>{for(var r in e)Ae(t,r,{get:e[r],enumerable:!0})},lr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ar(e))!nr.call(t,i)&&i!==r&&Ae(t,i,{get:()=>e[i],enumerable:!(l=rr(e,i))||l.enumerable});return t};var or=t=>lr(Ae({},"__esModule",{value:!0}),t);var yr={};ir(yr,{BezelChart:()=>Mt,render:()=>kt,themes:()=>Wt,toSVG:()=>Ct,types:()=>br,version:()=>xr});var at="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",vt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",sr=0;function Dt(t){return"bzc"+t+(++sr).toString(36)+Math.random().toString(36).slice(2,6)}function nt(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[e]})}function a(t){return Math.round(t*100)/100}function _(t,e,r){return Math.max(e,Math.min(r,t))}function I(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function v(t){return t!=null&&t!==""}function K(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):v(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function P(t){return Array.isArray(t)?t.map(String):v(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function At(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(K):[K(t)]:v(t)?String(t).split("|").map(K).filter(function(e){return e.length}):[]}function Tt(t){return t.reduce(function(e,r){return e+r},0)}function bt(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 j(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;v(e.decimals)?i=_(parseInt(e.decimals,10)||0,0,6):i=t%1===0?0:l<10?2:l<100?1:0;var n={maximumFractionDigits:i,minimumFractionDigits:v(e.decimals)?i:0};(j(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 oe(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 S(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+nt(r)+"</text>"}function $(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+vt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function yt(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="'+nt(i)+'"/>'}function lt(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ut(t,e){var r=P(t.color).filter(Boolean);return r.length?r:e.palette}function ht(t,e,r,l,i){return S(e+l/2,r+i/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+at+'" font-size="13"')}function Kt(t,e){return v(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 Pt(t,e,r,l,i){var n=(v(t.goalLabel)?t.goalLabel:"Goal")+" "+h(I(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"/>'+S(l,i-5,n,$(e,10,'text-anchor="end"'))}function zt(t,e,r){var l=String(v(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var i=Tt(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 Yt(t){var e=Math.round(_(I(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 fr=".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,i){var n=Yt(t),s=n.W,o=n.b,c=n.P,x=n.w,g=_(I(t.corners,22),0,60),d=o+c,f="";v(t.heading)&&(f+=S(o+c,d+10,String(t.heading).toUpperCase(),$(e,11,'font-weight="600" letter-spacing="1.3"')),d+=24);var C=i&&i.stat;if(C){if(f+=S(o+c,d+30,h(C.val,t),'fill="'+e.fg+'" font-family="'+at+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),C.delta!=null){var z=C.delta>0,B=C.delta===0,F=t.delta==="inverse"?!z:z,b=B?e.muted:F?e.up:e.down,L=(B?"\u25CF ":z?"\u25B2 ":"\u25BC ")+h(Math.abs(C.delta),t)+" "+(v(t.deltaLabel)?t.deltaLabel:"since start");f+=S(o+c+x,d+28,L,'text-anchor="end" fill="'+b+'" font-family="'+vt+'" font-size="11" font-weight="600"')}d+=44}var m=l(o+c,d,x,r),A=Math.round(d+r+c+o),E="";t.frame!=="none"?E='<rect width="'+s+'" height="'+A+'" rx="'+g+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(A-2*o)+'" rx="'+Math.max(0,g-o)+'" fill="'+(t.background||e.tile)+'"/>':v(t.background)&&(E='<rect width="'+s+'" height="'+A+'" rx="'+g+'" fill="'+t.background+'"/>');var y=(v(t.heading)?t.heading+": ":"")+(i&&i.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+A+'" width="'+s+'" height="'+A+'" role="img" aria-label="'+nt(y)+'"><title>'+nt(y)+"</title>"+(t.animate?"<style>"+fr+"</style>":"")+E+f+m+"</svg>"}function se(t,e){var r=K(t.values),l=ut(t,e)[0],i=I(t.height,64),n=P(t.labels),s=Kt(t,n),o=zt(r,t,"last");return mt(t,e,i,function(c,x,g,d){if(!r.length)return ht(e,c,x,g,d);var f=r.length===1?[r[0],r[0]]:r,C=Math.min.apply(null,f),z=Math.max.apply(null,f);v(t.goal)&&(C=Math.min(C,+t.goal),z=Math.max(z,+t.goal));var B=(z-C||Math.abs(z)||1)*.12;C-=B,z+=B;var F=function(k){return c+k*g/(f.length-1)},b=function(k){return x+d-(k-C)/(z-C)*d},L=f.map(function(k,p){return[F(p),b(k)]}),m=oe(L,j(t.straight)),A=Dt("g"),E=L[L.length-1],y='<defs><linearGradient id="'+A+'" 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(k){y+='<line x1="'+c+'" x2="'+(c+g)+'" y1="'+a(x+d*k)+'" y2="'+a(x+d*k)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),y+='<path d="'+m+"L"+a(E[0])+","+(x+d)+"L"+c+","+(x+d)+'Z" fill="url(#'+A+')"'+lt(t,"bzc-a")+"/>",y+='<path d="'+m+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+lt(t,"bzc-d")+"/>",v(t.goal)&&(y+=Pt(t,e,c,c+g,b(+t.goal))),s.forEach(function(k){if(!(k.i>=r.length)){var p=L[k.i];y+='<circle cx="'+a(p[0])+'" cy="'+a(p[1])+'" r="3.5" fill="'+e.fg+'"/>'+S(_(p[0],c+30,c+g-30),p[1]-9,k.text,$(e,10,'text-anchor="middle"',e.fg))}}),y+='<circle cx="'+a(E[0])+'" cy="'+a(E[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(E[0])+'" cy="'+a(E[1])+'" r="4.5" fill="'+l+'"/>',j(t.showValues)&&L.forEach(function(k,p){p<r.length&&(y+=S(k[0],k[1]-8,h(r[p],t,!0),$(e,9,'text-anchor="middle"')))});var O=r.length>1?g/(r.length-1):g;return r.forEach(function(k,p){y+=yt(F(p)-O/2,x-6,O,d+12,(n[p]||"#"+(p+1))+": "+h(k,t))}),y},{stat:o,summary:r.length?"latest "+h(r[r.length-1],t):"no data"})}se.table=function(t){var e=P(t.labels);return{head:["Label","Value"],rows:K(t.values).map(function(r,l){return[e[l]||"#"+(l+1),h(r,t)]})}};var Wt={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 fe=["spark","line","bars","scatter","ring","donut","gauge","progress","heatmap"],ce={};function pt(t,e){ce[t]=e}var cr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function De(t,e){if(!ce[t])throw new Error(fe.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: ${fe.join(", ")}.`);let r={};for(let[l,i]of Object.entries(e))r[cr(l)]=i;return r}function kt(t,e={}){let r=De(t,e);r.animate=j(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return ce[t](r,Wt[l])}function Pe(t,e={}){return ce[t].table(De(t,e))}function Oe(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function Ct(t,e={}){return Oe(kt(t,{...e,animate:!1}))}var Ue=["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"],ur=`: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 ${vt};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}}`,hr={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},mr=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,pr=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},Te=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>Te.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var dr=typeof HTMLElement>"u"?class{}:HTMLElement,Mt=class extends dr{static get observedAttributes(){return Ue}static get themes(){return Wt}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>${ur}</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())),Te.add(this),this.#a=mr(),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(){Te.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 Ue)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=pr()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return Oe(kt(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=kt(this.chartType,r),i=Pe(this.chartType,r)}catch(c){l=`<p style="font:13px ${at};color:#d63f7c">${nt(c.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=Wt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,n.style.borderRadius=`${r.frame==="none"?4:_(+r.corners||22,0,60)}px`,this.#c.innerHTML=i&&i.rows.length?gr(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=`${_(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=hr[e.key];if(n)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(n*=7),i=i<0?n>0?0:l-1:_(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=_(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 gr(t,{head:e,rows:r}){let l=i=>i.map((n,s)=>s?`<td>${nt(n)}</td>`:`<th scope="row">${nt(n)}</th>`).join("");return`<table><caption>${nt(t||"Chart data")}</caption><thead><tr>${e.map(i=>`<th scope="col">${nt(i)}</th>`).join("")}</tr></thead><tbody>${r.map(i=>`<tr>${l(i)}</tr>`).join("")}</tbody></table>`}function dt(t){typeof customElements>"u"||typeof HTMLElement>"u"||(customElements.get(`bezel-${t}`)||customElements.define(`bezel-${t}`,class extends Mt{get chartType(){return t}}),customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends Mt{}))}pt("spark",se);dt("spark");function ie(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,c=Math.floor(t/o)*o,x=Math.ceil(e/o)*o,g=[],d=c;d<=x+o/2;d+=o)g.push(+d.toFixed(10));return{lo:c,hi:x,ticks:g}}function Xt(t,e,r,l,i,n,s,o){var c=l,x=i,g="",d=o||13;return t.forEach(function(f,C){var z=d+bt(f,12)+16;c>l&&c+z-16>l+n&&(c=l,x+=20),g+=(s?s(C,c,x):'<circle cx="'+a(c+4)+'" cy="'+a(x+6)+'" r="4" fill="'+e[C%e.length]+'"/>')+S(c+d,x+10,f,'fill="'+r.fg+'" font-family="'+at+'" font-size="12"'),c+=z}),{svg:g,height:x-i+24}}var ue={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},he=["circle","square","triangle","diamond"],Ie=["solid","stripes","dots","grid"];function _t(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:P(t).map(function(i){return e.indexOf(i)<0?r:i});return l.length?function(i){return l[i%l.length]}:null}function jt(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 qe(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 Ye(t){return Math.max.apply(null,t.map(function(e){return bt(e,10,!0)}))+10}function me(t,e){for(var r=At(t.values),l=P(t.series),i=P(t.labels),n=[],s=Math.max.apply(null,[0].concat(r.map(function(d){return d.length}))),o=0;o<s;o++){var c=[i[o]||"#"+(o+1)],x=0;r.forEach(function(d){c.push(o<d.length?h(d[o],t):""),x+=o<d.length?d[o]:0}),e&&c.push(h(x,t)),n.push(c)}var g=r.length>1||l.length?r.map(function(d,f){return l[f]||"Series "+(f+1)}):["Value"];return{head:["Label"].concat(g,e?["Total"]:[]),rows:n}}function pe(t,e){var r=At(t.values),l=P(t.series),i=P(t.labels),n=ut(t,e),s=I(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(B){return B.length}))),c=Kt(t,i),x=r.length>1||l.length>0,g=zt(r[0]||[],t,""),d=_t(t.dash,Object.keys(ue),"solid"),f=_t(t.markers,he,"none"),C=t.background||e.tile,z=(d||f)&&function(B,F,b){var L=n[B%n.length],m=d?ue[d(B)]:"",A=f?f(B):"none";return'<line x1="'+a(F)+'" x2="'+a(F+18)+'" y1="'+a(b+6)+'" y2="'+a(b+6)+'" stroke="'+L+'" stroke-width="2.5" stroke-linecap="round"'+(m?' stroke-dasharray="'+m+'"':"")+"/>"+(A!=="none"?jt(A,F+9,b+6,3.5,' fill="'+L+'" stroke="'+C+'" stroke-width="1.5"'):"")};return mt(t,e,s,function(B,F,b,L){if(!o)return ht(e,B,F,b,L);var m="",A=F;if(x){var E=Xt(r.map(function(R,u){return l[u]||"Series "+(u+1)}),n,e,B,A,b,z,z&&24);m+=E.svg,A+=E.height}var y=[].concat.apply([],r),O=Math.min.apply(null,y),k=Math.max.apply(null,y);v(t.goal)&&(O=Math.min(O,+t.goal),k=Math.max(k,+t.goal)),j(t.zero)&&(O=Math.min(0,O),k=Math.max(0,k));var p=ie(O,k,4),D=p.ticks.map(function(R){return h(R,t,!0)}),M=Math.max.apply(null,D.map(function(R){return bt(R,10,!0)}))+10,w=i.length?20:4,T=B+M,U=b-M,q=L-(A-F)-w,tt=function(R){return o===1?T+U/2:T+R*U/(o-1)},Q=function(R){return A+q-(R-p.lo)/(p.hi-p.lo)*q};if(p.ticks.forEach(function(R,u){var G=Q(R);m+='<line x1="'+a(T)+'" x2="'+a(T+U)+'" y1="'+a(G)+'" y2="'+a(G)+'" stroke="'+e.grid+'"'+(R===0?"":' stroke-dasharray="2 4"')+"/>"+S(T-8,G+3.5,D[u],$(e,10,'text-anchor="end"'))}),i.length){for(var ot=Math.max(1,Math.ceil(o*(Math.max.apply(null,i.map(function(R){return bt(R,10,!0)}))+10)/U)),Y=0;Y<o;Y+=ot)if(i[Y]!=null){var J=o>1&&Y===0?"start":o>1&&Y===o-1?"end":"middle";m+=S(tt(Y),A+q+15,i[Y],$(e,10,'text-anchor="'+J+'"'))}}c.forEach(function(R){if(!(R.i>=o)){var u=tt(R.i);m+='<line x1="'+a(u)+'" x2="'+a(u)+'" y1="'+a(A+12)+'" y2="'+a(A+q)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+S(_(u,T+30,T+U-30),A+8,R.text,$(e,10,'text-anchor="middle"',e.fg))}}),r.forEach(function(R,u){var G=n[u%n.length],N=R.map(function(X,ft){return[tt(ft),Q(X)]});N.length===1&&(N=[[T,N[0][1]],[T+U,N[0][1]]]);var et=oe(N,j(t.straight));if(u===0){var W=Dt("g"),xt=N[N.length-1];m+='<defs><linearGradient id="'+W+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+G+'" stop-opacity=".26"/><stop offset="1" stop-color="'+G+'" stop-opacity="0"/></linearGradient></defs><path d="'+et+"L"+a(xt[0])+","+a(A+q)+"L"+a(N[0][0])+","+a(A+q)+'Z" fill="url(#'+W+')"'+lt(t,"bzc-a")+"/>"}var wt=d?ue[d(u)]:"",Et=f?f(u):"none";if(m+=wt?'<path d="'+et+'" fill="none" stroke="'+G+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+wt+'"'+lt(t,"bzc-a",u*.15)+"/>":'<path d="'+et+'" fill="none" stroke="'+G+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+u*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>",Et!=="none"){var V=Math.ceil(R.length/40);R.forEach(function(X,ft){(ft%V===0||ft===R.length-1)&&(m+=jt(Et,tt(ft),Q(X),3.5,' fill="'+G+'" stroke="'+C+'" stroke-width="1.5"'+lt(t,"bzc-a",.6+u*.15)))})}else{var Z=N[N.length-1];m+='<circle cx="'+a(Z[0])+'" cy="'+a(Z[1])+'" r="4" fill="'+G+'" stroke="'+C+'" stroke-width="2"/>'}j(t.showValues)&&R.forEach(function(X,ft){m+=S(tt(ft),Q(X)-8,h(X,t,!0),$(e,9,'text-anchor="middle"'))})}),v(t.goal)&&(m+=Pt(t,e,T,T+U,Q(+t.goal)));for(var Ft=o>1?U/(o-1):U,st=0;st<o;st++){var gt=i[st]||"#"+(st+1);r.forEach(function(R,u){st<R.length&&(gt+=`
|
|
3
|
+
`+(x?(l[u]||"Series "+(u+1))+": ":"")+h(R[st],t))}),m+=yt(tt(st)-Ft/2,A,Ft,q,gt)}return m},{stat:g,summary:r.length+" series over "+o+" points"})}pe.table=function(t){return me(t)};pt("line",pe);dt("line");var We=40,Xe=24;function de(t,e){for(var r=At(t.values),l=P(t.series),i=P(t.labels),n=ut(t,e),s=r.length,o=Math.max.apply(null,[0].concat(r.map(function(u){return u.length}))),c=s>1,x=j(t.horizontal),g=c&&j(t.stacked),d=!c&&P(t.color).filter(Boolean).length>1,f=r[0]||[],C=[].concat.apply([],r),z=function(u,G){return r.reduce(function(N,et){return u<et.length&&et[u]*G>0?N+et[u]:N},0)},B=[],F=[],b=[],L=0;g&&L<o;L++)F.push(z(L,1)),b.push(z(L,-1)),B.push(F[L]+b[L]);for(var m=g?F.concat(b):C,A=m.length?Math.max.apply(null,m):0,E=function(u){return l[u]||"Series "+(u+1)},y=c?_t(t.patterns,Ie,"solid"):null,O="",k=[],p=0;y&&p<s;p++)if(y(p)!=="solid"){var D=Dt("g");O+=qe(D,y(p),n[p%n.length],t.background||e.tile),k[p]="url(#"+D+")"}var M=function(u,G){return c?k[u]||n[u%n.length]:d?n[G%n.length]:n[0]},w=y&&function(u,G,N){return'<rect x="'+a(G)+'" y="'+a(N+1)+'" width="10" height="10" rx="2" fill="'+M(u)+'"/>'},T=function(u){return c||d||t.highlight==="none"||u===A?1:.5},U=function(u){return i[u]||"#"+(u+1)},q=function(u){return c?U(u)+r.map(function(G,N){return u<G.length?`
|
|
4
|
+
`+E(N)+": "+h(G[u],t):""}).join("")+(g?`
|
|
5
|
+
Total: `+h(B[u],t):""):U(u)+": "+h(f[u],t)},tt=Yt(t),Q=c||l.length?Xt(r.map(function(u,G){return E(G)}),n,e,0,0,tt.w,w,w&&15).height:0,ot=g?1:s,Y=c&&!g,J=Y?10:14,Ft=3,st=x?ot*J+(ot-1)*Ft+(Y?14:16):0,gt=x?Q+Math.max(1,o)*st-6:I(t.height,140)+Q,R=f.indexOf(Math.max.apply(null,f.length?f:[0]));return mt(t,e,gt,function(u,G,N,et){if(!o)return ht(e,u,G,N,et);var W=O?"<defs>"+O+"</defs>":"",xt=G;Q&&(W+=Xt(r.map(function(H,rt){return E(rt)}),n,e,u,G,N,w,w&&15).svg,xt+=Q);var wt=Math.min(0,Math.min.apply(null,m)),Et=Math.max(0,A);if(v(t.goal)&&(wt=Math.min(wt,+t.goal),Et=Math.max(Et,+t.goal)),Et===wt&&(Et=wt+1),x){for(var V=i.length?Math.min(N*.4,Math.max.apply(null,i.map(function(H){return bt(H,12)}))+10):0,Z=g?[B.map(function(H){return h(H,t)})]:r.map(function(H){return H.map(function(rt){return h(rt,t)})}),X=Math.max.apply(null,[].concat.apply([],Z).map(function(H){return bt(H,Y?10:11,!0)}))+10,ft=u+V,Ot=N-V-X,$t=Math.max(Et,0)||1,it=0;it<o;it++){var Nt=xt+it*st;i[it]!=null&&(W+=S(u,Nt+(st-6)/2+4,qt(i[it],Math.floor(V/6.7)),'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')),g?(W+=Je(it,ft,Nt+5,Ot,$t),W+=S(u+N,Nt+5+J/2+3.8,Z[0][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="11" font-weight="600"')):r.forEach(function(H,rt){if(!(it>=H.length)){var ct=H[it],Lt=Nt+(c?2:5)+rt*(J+Ft),Gt=Math.max(0,ct)/$t*Ot;c||(W+='<rect x="'+a(ft)+'" y="'+a(Lt)+'" width="'+a(Ot)+'" height="'+J+'" rx="'+J/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),Gt>0&&(W+='<rect x="'+a(ft)+'" y="'+a(Lt)+'" width="'+a(Math.max(J,Gt))+'" height="'+J+'" rx="'+J/2+'" fill="'+M(rt,it)+'" fill-opacity="'+T(ct)+'"'+lt(t,"bzc-gx",it*.06+rt*.03)+"/>"),W+=S(u+N,Lt+J/2+3.8,Z[rt][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="'+(c?10:11)+'" font-weight="600"')}}),W+=yt(u,Nt,N,st-6,q(it))}if(v(t.goal)&&+t.goal>0){var Ce=ft+ +t.goal/$t*Ot;W+='<line x1="'+a(Ce)+'" x2="'+a(Ce)+'" y1="'+a(xt-2)+'" y2="'+a(G+et+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return W}function Je(H,rt,ct,Lt,Gt){var Rt='<rect x="'+a(rt)+'" y="'+a(ct)+'" width="'+a(Lt)+'" height="'+J+'" rx="'+J/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',Qt=0;return r.forEach(function(ae,Vt){var Jt=H<ae.length?ae[H]:0,Ht=Math.max(0,Jt)/Gt*Lt;if(!(Ht<=0)){var It=Qt>0?1.5:0;Rt+='<rect x="'+a(rt+Qt+It)+'" y="'+a(ct)+'" width="'+a(Math.max(2,Ht-It))+'" height="'+J+'" rx="'+a(Math.min(3,Ht/2))+'" fill="'+M(Vt,H)+'"'+lt(t,"bzc-gx",H*.06+Vt*.03)+"/>",Qt+=Ht}}),Rt}var Fe=i.length?Math.max.apply(null,i.map(function(H){return bt(H,10,!0)})):0,Me=i.length?Math.max(1,Math.ceil(o*(Fe+8)/N)):1,te=j(t.angleLabels)&&Me>1,Ne=We*Math.PI/180,Be=function(H){return te?qt(H,Xe):H};if(te){var Ke=N/o,Zt=0;i.forEach(function(H,rt){Zt=Math.max(Zt,Math.cos(Ne)*bt(Be(H),10,!0)+4-(rt+.5)*Ke)}),Zt=Math.min(Zt,N*.25),u+=Zt,N-=Zt,Me=1}var Ge=j(t.showValues)&&wt<0?14:0,je=te?Math.ceil(Math.sin(Ne)*Math.min(Fe,bt("x".repeat(Xe),10,!0)))+18:20,tr=(i.length?je:2)+Ge,Re=j(t.showValues)?16:4,we=et-(xt-G)-tr-Re,Ve=xt+Re,Bt=function(H){return Ve+we-(H-wt)/(Et-wt)*we},ee=N/o,re=Math.min(ee*(Y?.78:.62),Y?s*30:56),He=Y?Math.min(3,re/s*.15):0,Ut=g?re:(re-He*(s-1))/s,le=Bt(0);W+='<line x1="'+u+'" x2="'+(u+N)+'" y1="'+a(le)+'" y2="'+a(le)+'" stroke="'+e.grid+'"/>';for(var St=0;St<o;St++){var Se=u+St*ee+(ee-re)/2;if(g?W+=er(St,Se):r.forEach(function(H,rt){if(!(St>=H.length)){var ct=H[St],Lt=Se+rt*(Ut+He),Gt=Math.min(Bt(ct),le),Rt=Math.abs(Bt(ct)-le);Rt>.5&&(W+='<rect x="'+a(Lt)+'" y="'+a(Gt)+'" width="'+a(Ut)+'" height="'+a(Rt)+'" rx="'+a(Math.min(6,Ut/2,Rt/2))+'" fill="'+M(rt,St)+'" fill-opacity="'+T(ct)+'"'+lt(t,ct<0?"bzc-gn":"bzc-g",St*.05+rt*.03)+"/>"),j(t.showValues)&&(W+=S(Lt+Ut/2,ct<0?Bt(ct)+12:Bt(ct)-5,h(ct,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+vt+'" font-size="'+(c?9:10)+'" font-weight="600"'))}}),i[St]!=null&&St%Me===0){var ze=Se+re/2,Ee=Ve+we+Ge+(te?12:15);W+=te?S(ze,Ee,Be(i[St]),$(e,10,'text-anchor="end" transform="rotate(-'+We+" "+a(ze)+" "+a(Ee)+')"')):S(ze,Ee,i[St],$(e,10,'text-anchor="middle"'))}W+=yt(u+St*ee,xt,ee,et-(xt-G),q(St))}return v(t.goal)&&(W+=Pt(t,e,u,u+N,Bt(+t.goal))),W;function er(H,rt){var ct="",Lt=0,Gt=0;if(r.forEach(function(Qt,ae){var Vt=H<Qt.length?Qt[H]:0;if(Vt){var Jt=Vt>0?Lt:Gt,Ht=Jt+Vt;Vt>0?Lt=Ht:Gt=Ht;var It=Bt(Math.max(Jt,Ht)),Le=Bt(Math.min(Jt,Ht)),ne=Le-It,$e=Jt!==0?Math.min(1.5,ne/2):0;Vt>0?Le-=$e:It+=$e,ne=Le-It,ne>.5&&(ct+='<rect x="'+a(rt)+'" y="'+a(It)+'" width="'+a(Ut)+'" height="'+a(ne)+'" rx="'+a(Math.min(3,Ut/2,ne/2))+'" fill="'+M(ae,H)+'"'+lt(t,Vt<0?"bzc-gn":"bzc-g",H*.05+ae*.03)+"/>")}}),j(t.showValues)){var Rt=B[H];ct+=S(rt+Ut/2,Rt<0?Bt(b[H])+12:Bt(F[H])-5,h(Rt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+vt+'" font-size="10" font-weight="600"')}return ct}},{stat:zt(f,t,""),summary:o?g?s+" series stacked across "+o+" groups":c?s+" series across "+o+" groups":"highest "+(i[R]||"")+" "+h(f[R],t):"no data"})}de.table=function(t){return me(t,At(t.values).length>1&&j(t.stacked))};pt("bars",de);dt("bars");function vr(t,e){var r=Math.min(t.length,e.length);if(r<2)return null;var l=0,i=0,n;for(n=0;n<r;n++)l+=t[n],i+=e[n];l/=r,i/=r;var s=0,o=0,c=0;for(n=0;n<r;n++)s+=(t[n]-l)*(t[n]-l),o+=(e[n]-i)*(e[n]-i),c+=(t[n]-l)*(e[n]-i);if(!s)return null;var x=c/s;return{slope:x,intercept:i-x*l,r:o?c/Math.sqrt(s*o):0}}function ge(t,e){for(var r=At(t.x),l=At(t.y),i=P(t.series),n=P(t.labels),s=ut(t,e),o=[],c=0;c<Math.max(r.length,l.length);c++){var x=r[c]||[],g=l[c]||[],d=Math.min(x.length,g.length);o.push({xs:x.slice(0,d),ys:g.slice(0,d)})}o=o.filter(function(O){return O.xs.length});var f=o.reduce(function(O,k){return O+k.xs.length},0),C=I(t.height,210),z=o.length>1||i.length>0,B=j(t.trend),F=function(O){return i[O]||"Group "+(O+1)},b={decimals:t.decimals,compact:t.compact,lang:t.lang},L=Kt(t,n),m=_t(t.markers,he,"circle"),A=t.background||e.tile,E=function(O){var k=m?m(O):"circle";return k==="none"?"circle":k},y=m&&function(O,k,p){return jt(E(O),k+4,p+6,4,' fill="'+s[O%s.length]+'"')};return mt(t,e,C,function(O,k,p,D){if(!f)return ht(e,O,k,p,D);var M="",w=k;if(z){var T=Xt(o.map(function(V,Z){return F(Z)}),s,e,O,w,p,y);M+=T.svg,w+=T.height}var U=[].concat.apply([],o.map(function(V){return V.xs})),q=[].concat.apply([],o.map(function(V){return V.ys})),tt=Math.min.apply(null,q),Q=Math.max.apply(null,q);v(t.goal)&&(tt=Math.min(tt,+t.goal),Q=Math.max(Q,+t.goal)),j(t.zero)&&(tt=Math.min(0,tt),Q=Math.max(0,Q));var ot=ie(tt,Q,4),Y=ie(Math.min.apply(null,U),Math.max.apply(null,U),5),J=ot.ticks.map(function(V){return h(V,t,!0)}),Ft=Ye(J)+(v(t.yLabel)?14:0),st=20+(v(t.xLabel)?16:0),gt=O+Ft,R=p-Ft,u=D-(w-k)-st,G=function(V){return gt+6+(V-Y.lo)/(Y.hi-Y.lo)*(R-12)},N=function(V){return w+6+u-6-(V-ot.lo)/(ot.hi-ot.lo)*(u-6)};ot.ticks.forEach(function(V,Z){var X=N(V);M+='<line x1="'+a(gt)+'" x2="'+a(gt+R)+'" y1="'+a(X)+'" y2="'+a(X)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+S(gt-8,X+3.5,J[Z],$(e,10,'text-anchor="end"'))});var et=Math.max(1,Math.ceil(Y.ticks.length*44/R));if(Y.ticks.forEach(function(V,Z){if(!(Z%et)){var X=G(V);M+='<line x1="'+a(X)+'" x2="'+a(X)+'" y1="'+a(w)+'" y2="'+a(w+u)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+S(X,w+u+15,h(V,b,!0),$(e,10,'text-anchor="middle"'))}}),v(t.xLabel)&&(M+=S(gt+R/2,w+u+32,t.xLabel,$(e,10,'text-anchor="middle" font-weight="600"'))),v(t.yLabel)){var W=w+u/2;M+='<text x="'+a(O+4)+'" y="'+a(W)+'" transform="rotate(-90 '+a(O+4)+" "+a(W)+')" text-anchor="middle" '+$(e,10,'font-weight="600"')+' dominant-baseline="hanging">'+String(t.yLabel).replace(/[&<>"]/g,function(V){return{"&":"&","<":"<",">":">",'"':"""}[V]})+"</text>"}v(t.goal)&&(M+=Pt(t,e,gt,gt+R,N(+t.goal))),B&&o.forEach(function(V,Z){var X=vr(V.xs,V.ys);if(X){var ft=Math.min.apply(null,V.xs),Ot=Math.max.apply(null,V.xs),$t=X.slope*ft+X.intercept,it=X.slope*Ot+X.intercept,Nt=s[Z%s.length];M+='<line x1="'+a(G(ft))+'" y1="'+a(_(N($t),w,w+u))+'" x2="'+a(G(Ot))+'" y2="'+a(_(N(it),w,w+u))+'" stroke="'+Nt+'" stroke-width="2" stroke-dasharray="6 4" stroke-linecap="round" stroke-opacity=".9"/>',M+=S(Math.min(G(Ot),gt+R)-2,_(N(it),w+10,w+u)-7,"r = "+X.r.toFixed(2),$(e,10,'text-anchor="end" font-weight="600"',Nt))}});var xt=0,wt=f>150?3:4.5;o.forEach(function(V,Z){var X=s[Z%s.length];V.xs.forEach(function(ft,Ot){var $t=G(ft),it=N(V.ys[Ot]),Nt=(n[xt]?n[xt]+`
|
|
6
|
+
`:z?F(Z)+`
|
|
7
|
+
`:"")+(v(t.xLabel)?t.xLabel:"x")+": "+h(ft,b)+`
|
|
8
|
+
`+(v(t.yLabel)?t.yLabel:"y")+": "+h(V.ys[Ot],t);M+=jt(E(Z),$t,it,wt,' fill="'+X+'" fill-opacity=".85" stroke="'+A+'" stroke-width="1.5"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Math.min(.8,xt*.012))+'s"':"")),M+=yt($t-8,it-8,16,16,Nt),xt++})});var Et=[];return o.forEach(function(V){V.xs.forEach(function(Z,X){Et.push([G(Z),N(V.ys[X])])})}),L.forEach(function(V){var Z=Et[V.i];Z&&(M+='<circle cx="'+a(Z[0])+'" cy="'+a(Z[1])+'" r="'+(wt+4)+'" fill="none" stroke="'+e.fg+'" stroke-width="1.5"/>'+S(_(Z[0],gt+30,gt+R-30),Z[1]-wt-9,V.text,$(e,10,'text-anchor="middle"',e.fg)))}),M},{summary:f+" points"+(z?" in "+o.length+" groups":"")})}ge.table=function(t){var e=At(t.x),r=At(t.y),l=P(t.series),i=P(t.labels),n=e.length>1||l.length>0,s={decimals:t.decimals,compact:t.compact,lang:t.lang},o=[],c=0;return e.forEach(function(x,g){for(var d=r[g]||[],f=0;f<Math.min(x.length,d.length);f++,c++)o.push([i[c]||"#"+(c+1)].concat(n?[l[g]||"Group "+(g+1)]:[],[h(x[f],s),h(d[f],t)]))}),{head:["Point"].concat(n?["Group"]:[],[v(t.xLabel)?t.xLabel:"x",v(t.yLabel)?t.yLabel:"y"]),rows:o}};pt("scatter",ge);dt("scatter");function ve(t,e){var r=K(t.values),l=P(t.labels),i=ut(t,e),n=I(t.max,100)||100,s=I(t.height,140),o=!v(t.prefix)&&!v(t.suffix)&&n===100,c=function(g){return h(g,t)+(o?"%":"")},x=zt(r,t,"");return mt(t,e,s,function(g,d,f,C){if(!r.length)return ht(e,g,d,f,C);var z="",B=r.length===1,F=Math.min(C,B?f:f*.55),b=B?g+f/2:g+F/2,L=d+C/2,m=B?F*.12:_(F*.42/(r.length*1.35),5,16),A=m*.38;if(r.forEach(function(k,p){var D=F/2-m/2-p*(m+A);if(!(D<=m/2)){var M=_(k/n*100,0,100),w=i[p%i.length];z+='<circle cx="'+a(b)+'" cy="'+a(L)+'" r="'+a(D)+'" fill="none" stroke="'+w+'" stroke-opacity=".16" stroke-width="'+a(m)+'"/>',M>0&&(z+='<circle cx="'+a(b)+'" cy="'+a(L)+'" r="'+a(D)+'" fill="none" stroke="'+w+'" stroke-width="'+a(m)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(b)+" "+a(L)+')" style="stroke-dasharray:'+a(M)+" 100"+(t.animate?";animation-delay:"+p*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),z+='<circle cx="'+a(b)+'" cy="'+a(L)+'" r="'+a(D+m/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+nt((l[p]||"#"+(p+1))+": "+c(k)+(o?"":" of "+h(n,t)))+'"/>'}}),B)z+=S(b,L+F*.08,c(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+at+'" font-size="'+a(F*.22)+'" font-weight="800"'),l[0]&&(z+=S(b,L+F*.08+16,l[0],$(e,10,'text-anchor="middle"')));else{var E=g+F+22,y=Math.min(26,C/r.length),O=L-y*r.length/2;r.forEach(function(k,p){var D=O+p*y+y/2;z+='<circle cx="'+a(E+4)+'" cy="'+a(D)+'" r="4" fill="'+i[p%i.length]+'"/>'+S(E+14,D+4,qt(l[p]||"#"+(p+1),Math.floor((g+f-E-60)/6.7)),'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')+S(g+f,D+4,c(k),'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="11" font-weight="600"')})}return z},{stat:x,summary:r.map(function(g,d){return(l[d]?l[d]+" ":"")+c(g)}).join(", ")})}ve.table=function(t){var e=P(t.labels),r=I(t.max,100)||100,l=!v(t.prefix)&&!v(t.suffix)&&r===100;return{head:["Label","Value"],rows:K(t.values).map(function(i,n){return[e[n]||"#"+(n+1),h(i,t)+(l?"%":" of "+h(r,t))]})}};pt("ring",ve);dt("ring");function xe(t,e){var r=K(t.values).map(function(f){return Math.max(0,f)}),l=P(t.labels),i=ut(t,e),n=r.slice(),s=l.slice();if(n.length>6){var o=n.map(function(f,C){return C}).sort(function(f,C){return r[C]-r[f]}),c=o.slice(0,5).sort(function(f,C){return f-C});n=c.map(function(f){return r[f]}),s=c.map(function(f){return l[f]||"#"+(f+1)}),n.push(Tt(o.slice(5).map(function(f){return r[f]}))),s.push("Other")}var x=Tt(n),g=I(t.height,150),d=zt(n,t,"");return mt(t,e,g,function(f,C,z,B){if(!x)return ht(e,f,C,z,B);var F="",b=Math.min(B,z*.5),L=f+b/2,m=C+B/2,A=b*.16,E=(b-A)/2,y=0,O=n.filter(Boolean).length>1?.9:0;n.forEach(function(M,w){var T=M/x*100;if(!(T<=0)){var U=Math.max(.01,T-O);F+='<circle cx="'+a(L)+'" cy="'+a(m)+'" r="'+a(E)+'" fill="none" stroke="'+i[w%i.length]+'" stroke-width="'+a(A)+'" pathLength="100" stroke-dasharray="'+a(U)+" "+a(100-U)+'" stroke-dashoffset="'+a(-y)+'" transform="rotate(-90 '+a(L)+" "+a(m)+')"'+lt(t,"bzc-a",w*.08)+"/>",y+=T}}),F+=S(L,m+2,h(x,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+at+'" font-size="'+a(b*.17)+'" font-weight="800"'),F+=S(L,m+2+14,(v(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),$(e,9,'text-anchor="middle" letter-spacing="1"'));var k=f+b+22,p=Math.min(24,B/n.length),D=m-p*n.length/2;return n.forEach(function(M,w){var T=D+w*p+p/2,U=Math.round(M/x*100),q=(s[w]||"#"+(w+1))+": "+h(M,t)+" ("+U+"%)";F+='<circle cx="'+a(k+4)+'" cy="'+a(T)+'" r="4" fill="'+i[w%i.length]+'"/>'+S(k+14,T+4,qt(s[w]||"#"+(w+1),Math.floor((f+z-k-50)/6.7)),'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')+S(f+z,T+4,U+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+vt+'" font-size="11" font-weight="600"')+yt(k,T-p/2,f+z-k,p,q)}),y=0,n.forEach(function(M,w){var T=M/x*100;T<=0||(F+='<circle cx="'+a(L)+'" cy="'+a(m)+'" r="'+a(E)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(A)+'" pathLength="100" stroke-dasharray="'+a(T)+" "+a(100-T)+'" stroke-dashoffset="'+a(-y)+'" transform="rotate(-90 '+a(L)+" "+a(m)+')" class="bzc-hit" data-skip="" data-tip="'+nt((s[w]||"#"+(w+1))+": "+h(M,t)+" ("+Math.round(T)+"%)")+'"/>',y+=T)}),F},{stat:d,summary:"total "+h(x,t)+" across "+n.length+" parts"})}xe.table=function(t){var e=K(t.values).map(function(i){return Math.max(0,i)}),r=P(t.labels),l=Tt(e);return{head:["Label","Value","Share"],rows:e.map(function(i,n){return[r[n]||"#"+(n+1),h(i,t),(l?Math.round(i/l*100):0)+"%"]})}};pt("donut",xe);dt("donut");function be(t,e){var r=K(t.values),l=r.length?r[0]:I(t.value,NaN),i=P(t.labels),n=I(t.min,0),s=I(t.max,100),o=I(t.height,130);s===n&&(s=n+1);var c=K(t.zones),x=ut(t,e),g=P(t.color).filter(Boolean).length>1?x:[e.up,e.palette[3],e.down],d=x[0];if(c.length&&isFinite(l)){for(var f=0;f<c.length&&l>=c[f];)f++;d=g[Math.min(f,g.length-1)]}var C=!v(t.prefix)&&!v(t.suffix)&&n===0&&s===100,z=function(B){return h(B,t)+(C?"%":"")};return mt(t,e,o,function(B,F,b,L){if(!isFinite(l))return ht(e,B,F,b,L);var m=Math.min(b/2,L-22),A=m*.16,E=m-A/2,y=B+b/2,O=F+m,k=_((l-n)/(s-n),0,1),p=function(tt,Q){var ot=Math.PI*(1-tt);return[y+Q*Math.cos(ot),O-Q*Math.sin(ot)]},D="M"+a(y-E)+","+a(O)+"A"+a(E)+","+a(E)+" 0 0 1 "+a(y+E)+","+a(O),M='<path d="'+D+'" fill="none" stroke="'+d+'" stroke-opacity=".16" stroke-width="'+a(A)+'" stroke-linecap="round"/>';c.length&&c.forEach(function(tt){var Q=_((tt-n)/(s-n),0,1),ot=p(Q,E-A/2-3),Y=p(Q,E-A/2-8);M+='<line x1="'+a(ot[0])+'" y1="'+a(ot[1])+'" x2="'+a(Y[0])+'" y2="'+a(Y[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),k>0&&(M+='<path d="'+D+'" fill="none" stroke="'+d+'" stroke-width="'+a(A)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(k*100)+' 100"'+lt(t,"bzc-s")+"/>");var w=p(k,E);if(M+='<circle cx="'+a(w[0])+'" cy="'+a(w[1])+'" r="'+a(A*.26)+'" fill="'+(t.background||e.tile)+'"'+lt(t,"bzc-a",.9)+"/>",v(t.goal)){var T=_((+t.goal-n)/(s-n),0,1),U=p(T,E+A/2+4),q=p(T,E-A/2-4);M+='<line x1="'+a(U[0])+'" y1="'+a(U[1])+'" x2="'+a(q[0])+'" y2="'+a(q[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return M+=S(y,O-m*.12,z(l),'text-anchor="middle" fill="'+e.fg+'" font-family="'+at+'" font-size="'+a(m*.34)+'" font-weight="800"'),i[0]&&(M+=S(y,O-m*.12+16,i[0],$(e,10,'text-anchor="middle"'))),M+=S(y-E,O+18,h(n,t,!0),$(e,10,'text-anchor="middle"'))+S(y+E,O+18,h(s,t,!0),$(e,10,'text-anchor="middle"')),M+=yt(y-m,O-m,m*2,m,(i[0]?i[0]+": ":"")+z(l)+" (range "+h(n,t)+" to "+h(s,t)+")"+(v(t.goal)?`
|
|
9
|
+
Goal: `+h(+t.goal,t):"")),M},{summary:isFinite(l)?z(l)+" on a scale of "+h(n,t)+" to "+h(s,t):"no data"})}be.table=function(t){var e=K(t.values),r=e.length?e[0]:I(t.value,NaN),l=P(t.labels),i=I(t.min,0),n=I(t.max,100),s=!v(t.prefix)&&!v(t.suffix)&&i===0&&n===100;return isFinite(r)?{head:["Label","Value"],rows:[[l[0]||"Reading",h(r,t)+(s?"%":"")],["Lowest",h(i,t)],["Highest",h(n,t)]].concat(v(t.goal)?[["Goal",h(+t.goal,t)]]:[])}:{head:["Label","Value"],rows:[]}};pt("gauge",be);dt("gauge");function ye(t,e){var r=K(t.values).map(function(b){return Math.max(0,b)}),l=P(t.labels),i=ut(t,e),n=r.length===1,s=Tt(r),o=v(t.max)?I(t.max,100):n?100:s;o>0||(o=1);var c=!v(t.prefix)&&!v(t.suffix)&&o===100&&n,x=function(b){return h(b,t)+(c?"%":"")},g=Yt(t),d=g.w,f=0,C=[];if(!n&&r.length){var z=0;f=1,r.forEach(function(b,L){var m=l[L]||"#"+(L+1),A=14+bt(m,12)+6+bt(h(b,t),11,!0)+18;z>0&&z+A>d&&(z=0,f++),C.push({x:z,row:f-1,l:m}),z+=A})}var B=36+(f?12+f*20:0),F=zt(r,t,"");return mt(t,e,B,function(b,L,m,A){if(!r.length)return ht(e,b,L,m,A);var E="",y=L+22,O=Dt("c"),k=n?x(r[0])+(c?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t);n&&l[0]&&(E+=S(b,L+11,l[0],'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')),E+=S(b+m,L+11,k,'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="11" font-weight="600"'),E+='<rect x="'+b+'" y="'+y+'" width="'+m+'" height="14" rx="7" fill="'+e.grid+'" fill-opacity=".7"/>',E+='<clipPath id="'+O+'"><rect x="'+b+'" y="'+y+'" width="'+m+'" height="14" rx="7"/></clipPath><g clip-path="url(#'+O+')"><g'+lt(t,"bzc-gx")+">";var p=0;if(r.forEach(function(M,w){var T=Math.min(M,Math.max(0,o-p))/o*m;T>0&&(E+='<rect x="'+a(b+p/o*m)+'" y="'+y+'" width="'+a(T)+'" height="14" fill="'+i[w%i.length]+'"/>'),w>0&&T>0&&(E+='<rect x="'+a(b+p/o*m-1)+'" y="'+y+'" width="2" height="14" fill="'+(t.background||e.tile)+'"/>'),p+=M}),E+="</g></g>",v(t.goal)){var D=b+_(+t.goal/o,0,1)*m;E+='<line x1="'+a(D)+'" x2="'+a(D)+'" y1="'+(y-4)+'" y2="'+(y+18)+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return p=0,r.forEach(function(M,w){var T=Math.min(M,Math.max(0,o-p))/o*m;T>0&&(E+=yt(b+p/o*m,y-4,T,22,(l[w]||(n?"Progress":"#"+(w+1)))+": "+x(M)+(n?"":" ("+Math.round(M/o*100)+"%)"))),p+=M}),C.forEach(function(M,w){var T=b+M.x,U=y+14+12+M.row*20+8;E+='<circle cx="'+a(T+4)+'" cy="'+a(U)+'" r="4" fill="'+i[w%i.length]+'"/><text x="'+a(T+14)+'" y="'+a(U+4)+'" fill="'+e.fg+'" font-family="'+at+'" font-size="12">'+nt(M.l)+'<tspan dx="6" fill="'+e.muted+'" font-family="'+vt+'" font-size="11">'+nt(h(r[w],t))+"</tspan></text>"}),E},{stat:F,summary:n?x(r[0])+(c?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t)})}ye.table=function(t){var e=K(t.values).map(function(s){return Math.max(0,s)}),r=P(t.labels),l=e.length===1,i=v(t.max)?I(t.max,100):l?100:Tt(e);i>0||(i=1);var n=!v(t.prefix)&&!v(t.suffix)&&i===100&&l;return l?{head:["Label","Value"],rows:[[r[0]||"Progress",h(e[0],t)+(n?"%":" of "+h(i,t))]]}:{head:["Label","Value","Share"],rows:e.map(function(s,o){return[r[o]||"#"+(o+1),h(s,t),Math.round(s/i*100)+"%"]})}};pt("progress",ye);dt("progress");var _e={weekday:"short",day:"numeric",month:"short",year:"numeric"};function Ze(t,e){if(v(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 Qe(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 ke(t,e){var r=K(t.values),l=ut(t,e)[0],i=t.lang||"en-GB",n=Ze(t,r.length),s=(n.getUTCDay()+6)%7,o=Math.max(1,Math.ceil((s+r.length)/7)),c=Yt(t),x=28,g=Math.max(1,Math.floor((c.w-x)/10));if(o>g){var d=(o-g)*7-s;r=r.slice(d),n=new Date(n.getTime()+d*864e5),s=0,o=g}var f=Math.min(18,(c.w-x)/o),C=f<8?1:3,z=f-C,B=16+7*f+26,F=r.length?Math.max.apply(null,r):0,b=function(y){return Qe(i,y)},L=b({month:"short"}),m=b({weekday:"short"}),A=b(_e),E=zt(r,t,"");return mt(t,e,B,function(y,O,k,p){if(!r.length)return ht(e,y,O,k,p);var D="",M=y+x,w=O+16,T=-99,U=[.28,.5,.75,1];f>=9&&[0,2,4].forEach(function(W){var xt=new Date(Date.UTC(2024,0,1+W));D+=S(y,w+W*f+z/2+3.5,m.format(xt),$(e,9))});for(var q=0;q<r.length;q++){var tt=s+q,Q=Math.floor(tt/7),ot=tt%7,Y=new Date(n.getTime()+q*864e5),J=M+Q*f,Ft=w+ot*f;(Y.getUTCDate()===1||q===0)&&J-T>30&&(D+=S(J,O+9,L.format(Y),$(e,9)),T=J);var st=r[q]<=0||!F?0:Math.ceil(r[q]/F*4),gt=st?l:e.grid,R=st?U[st-1]:.7;D+='<rect x="'+a(J)+'" y="'+a(Ft)+'" width="'+a(z)+'" height="'+a(z)+'" rx="'+a(z*.24)+'" fill="'+gt+'" fill-opacity="'+R+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Q*.012)+'s"':"")+' data-tip="'+nt(A.format(Y)+": "+h(r[q],t))+'"/>'}var u=w+7*f+14,G=10,N=y+k-5*(G+3)-30;D+=S(y,u+8,h(Tt(r),t,!0)+" in "+r.length+" days",$(e,10)),D+=S(N-6,u+8,"Less",$(e,9,'text-anchor="end"'));for(var et=0;et<5;et++)D+='<rect x="'+a(N+et*(G+3))+'" y="'+u+'" width="'+G+'" height="'+G+'" rx="2.5" fill="'+(et?l:e.grid)+'" fill-opacity="'+(et?U[et-1]:.7)+'"/>';return D+=S(N+5*(G+3)+3,u+8,"More",$(e,9)),D},{stat:E,summary:h(Tt(r),t)+" across "+r.length+" days"})}ke.table=function(t){var e=K(t.values),r=Ze(t,e.length),l=Qe(t.lang||"en-GB",_e);return{head:["Date","Value"],rows:e.map(function(i,n){return[l.format(new Date(r.getTime()+n*864e5)),h(i,t)]})}};pt("heatmap",ke);dt("heatmap");var xr="1.3.0",br=fe.slice();return or(yr);})();
|