lintje 0.9.2 → 0.10.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 +21 -1
- package/dist-elements/actions.js +1 -1
- package/dist-elements/chunks/{addon-DoyybBuA.js → addon-D_qiELEE.js} +1 -1
- package/dist-elements/chunks/{avatar-BGJgBB9r.js → avatar-fsp2gI9x.js} +1 -1
- package/dist-elements/chunks/{axes-DfDMsu3s.js → axes-DVNd9rvA.js} +53 -53
- package/dist-elements/chunks/base-BbinwQUv.js +242 -0
- package/dist-elements/chunks/chart-styles-DYVopFQv.js +45 -0
- package/dist-elements/chunks/dialog-close-Ir9E-YQI.js +1 -0
- package/dist-elements/chunks/{disclosure-Ch2SwnkG.js → disclosure-CfMDSiGM.js} +1 -1
- package/dist-elements/chunks/{disclosure-Cr6FasjS.js → disclosure-CwyiRC_B.js} +6 -6
- package/dist-elements/chunks/{download-Bm3q8daQ.js → download-BTA_mOVO.js} +1 -1
- package/dist-elements/chunks/{focus-trap-BQMduQNN.js → focus-trap-bJm7pdpd.js} +1 -1
- package/dist-elements/chunks/frame-CWMTL0Pv.js +1 -0
- package/dist-elements/chunks/input-Ap7GDYW9.js +1 -0
- package/dist-elements/chunks/{input-D43cAS2M.js → input-B451zEPB.js} +4 -4
- package/dist-elements/chunks/menu-ku7K3tXM.js +1 -0
- package/dist-elements/chunks/{month-grid-BQKSnNLC.js → month-grid-Bu05f13h.js} +1 -1
- package/dist-elements/chunks/{other-GcjW2Nqw.js → other-Djlj_GCj.js} +1 -1
- package/dist-elements/chunks/{player-DtFr1Bf8.js → player-B_Ae6Dt2.js} +17 -17
- package/dist-elements/chunks/prose-BALGe_vb.js +1 -0
- package/dist-elements/chunks/sentence-D48K1ZTn.js +3 -0
- package/dist-elements/chunks/{stagger-CYcBlEiK.js → stagger-3qKZSgS1.js} +8 -8
- package/dist-elements/core.js +1 -1
- package/dist-elements/custom-elements.json +3612 -51
- package/dist-elements/data-types.json +81 -3
- package/dist-elements/feedback.js +1 -1
- package/dist-elements/frame.js +1 -1
- package/dist-elements/guides/dashboard.md +13 -3
- package/dist-elements/guides/loading.md +1 -1
- package/dist-elements/guides/start.md +53 -1
- package/dist-elements/guides/theming.md +69 -0
- package/dist-elements/layout.js +1 -1
- package/dist-elements/lintje.js +1068 -948
- package/dist-elements/overlays.js +1 -1
- package/dist-elements/skills/lintje/SKILL.md +3 -1
- package/dist-elements/tag/accordion.js +3 -3
- package/dist-elements/tag/activity-log.js +11 -11
- package/dist-elements/tag/ai-label.js +4 -4
- package/dist-elements/tag/announcement.js +9 -9
- package/dist-elements/tag/app-search.js +19 -19
- package/dist-elements/tag/attachment.js +24 -24
- package/dist-elements/tag/audio-player.js +39 -39
- package/dist-elements/tag/badge.js +1 -1
- package/dist-elements/tag/breadcrumbs.js +10 -10
- package/dist-elements/tag/button.js +1 -1
- package/dist-elements/tag/card-list.js +9 -9
- package/dist-elements/tag/card.js +30 -30
- package/dist-elements/tag/chart.js +542 -530
- package/dist-elements/tag/chat-answer.js +43 -43
- package/dist-elements/tag/chat-composer.js +66 -74
- package/dist-elements/tag/chat-message.js +14 -14
- package/dist-elements/tag/chat-questions.js +57 -57
- package/dist-elements/tag/chat-steps.js +20 -20
- package/dist-elements/tag/chat-strip.js +23 -23
- package/dist-elements/tag/chat-suggestions.js +6 -6
- package/dist-elements/tag/chat.js +47 -47
- package/dist-elements/tag/checkbox-group.js +11 -10
- package/dist-elements/tag/checkbox.js +7 -7
- package/dist-elements/tag/code.js +6 -6
- package/dist-elements/tag/combobox.js +20 -19
- package/dist-elements/tag/conflict-alert.js +8 -8
- package/dist-elements/tag/copy-button.js +5 -5
- package/dist-elements/tag/data-table.js +164 -163
- package/dist-elements/tag/date-input.js +11 -10
- package/dist-elements/tag/date-range.js +16 -15
- package/dist-elements/tag/description-list.js +17 -17
- package/dist-elements/tag/dialog.js +7 -7
- package/dist-elements/tag/document-viewer.js +21 -21
- package/dist-elements/tag/drawer.js +9 -9
- package/dist-elements/tag/empty-state.js +1 -1
- package/dist-elements/tag/error-page.js +11 -11
- package/dist-elements/tag/error-summary.js +12 -12
- package/dist-elements/tag/expander.js +4 -4
- package/dist-elements/tag/explainer.js +4 -4
- package/dist-elements/tag/field.js +4 -4
- package/dist-elements/tag/file-upload.js +18 -17
- package/dist-elements/tag/filter-bar.js +40 -40
- package/dist-elements/tag/filter-sheet.js +3 -3
- package/dist-elements/tag/filter-zone.js +18 -18
- package/dist-elements/tag/find.js +14 -14
- package/dist-elements/tag/footer.js +15 -15
- package/dist-elements/tag/form-actions.js +2 -2
- package/dist-elements/tag/form-section.js +3 -3
- package/dist-elements/tag/form.js +3 -3
- package/dist-elements/tag/gallery.js +11 -11
- package/dist-elements/tag/graph.js +64 -63
- package/dist-elements/tag/grid-item.js +1 -1
- package/dist-elements/tag/grid.js +1 -1
- package/dist-elements/tag/hero.js +8 -7
- package/dist-elements/tag/highlight.js +4 -4
- package/dist-elements/tag/icon-button.js +1 -1
- package/dist-elements/tag/icon.js +1 -1
- package/dist-elements/tag/job-list.js +3 -3
- package/dist-elements/tag/key.js +1 -1
- package/dist-elements/tag/kpi-row.js +4 -4
- package/dist-elements/tag/kpi.js +73 -73
- package/dist-elements/tag/language-nav.d.ts +1 -0
- package/dist-elements/tag/language-nav.js +45 -0
- package/dist-elements/tag/level-meter.js +8 -8
- package/dist-elements/tag/list.js +26 -26
- package/dist-elements/tag/log-viewer.js +72 -71
- package/dist-elements/tag/logo.js +15 -15
- package/dist-elements/tag/map.js +148 -147
- package/dist-elements/tag/menu-button.js +43 -41
- package/dist-elements/tag/modal.js +9 -9
- package/dist-elements/tag/multiselect.js +15 -14
- package/dist-elements/tag/note.js +2 -2
- package/dist-elements/tag/notifications.js +23 -23
- package/dist-elements/tag/number-input.js +19 -18
- package/dist-elements/tag/page-header.js +21 -11
- package/dist-elements/tag/pagination.js +28 -28
- package/dist-elements/tag/person-group.js +5 -5
- package/dist-elements/tag/person.js +8 -8
- package/dist-elements/tag/popover.js +1 -1
- package/dist-elements/tag/progress-bar.js +1 -1
- package/dist-elements/tag/prose.js +1 -1
- package/dist-elements/tag/qr-code.js +3 -3
- package/dist-elements/tag/radio-group.js +15 -14
- package/dist-elements/tag/range.js +17 -16
- package/dist-elements/tag/recording-status.js +9 -9
- package/dist-elements/tag/repeater.js +5 -5
- package/dist-elements/tag/segmented.js +8 -7
- package/dist-elements/tag/select.js +10 -7
- package/dist-elements/tag/shell.js +265 -248
- package/dist-elements/tag/skeleton.js +1 -1
- package/dist-elements/tag/slot-picker.js +15 -14
- package/dist-elements/tag/sortable-list.js +21 -21
- package/dist-elements/tag/spinner.js +1 -1
- package/dist-elements/tag/split-pane.js +9 -9
- package/dist-elements/tag/status-dot.js +1 -1
- package/dist-elements/tag/stepper.js +12 -12
- package/dist-elements/tag/streaming-text.js +12 -12
- package/dist-elements/tag/sub-nav.js +20 -20
- package/dist-elements/tag/tabs.js +35 -33
- package/dist-elements/tag/tag-input.js +26 -25
- package/dist-elements/tag/text-editor.js +12 -11
- package/dist-elements/tag/text-input.js +20 -19
- package/dist-elements/tag/textarea.js +11 -10
- package/dist-elements/tag/tile.js +1 -1
- package/dist-elements/tag/time-input.js +8 -7
- package/dist-elements/tag/toast.js +8 -8
- package/dist-elements/tag/toggle.js +4 -4
- package/dist-elements/tag/toggletip.js +6 -6
- package/dist-elements/tag/token-value.js +2 -2
- package/dist-elements/tag/tooltip.js +1 -1
- package/dist-elements/tag/transcript.js +22 -22
- package/dist-elements/tag/translator.js +6 -6
- package/dist-elements/tag/tree-view.js +22 -22
- package/dist-elements/tag/user-menu.js +43 -42
- package/dist-elements/tag/video-player.js +15 -15
- package/dist-elements/tokens.css +331 -11
- package/dist-elements/tokens.json +419 -19
- package/dist-elements/types/bundle/frame.d.ts +1 -0
- package/dist-elements/types/components/actions/button/button.d.ts +5 -1
- package/dist-elements/types/components/actions/menu-button/menu-button.d.ts +23 -5
- package/dist-elements/types/components/chat/chat-composer/chat-composer.d.ts +4 -2
- package/dist-elements/types/components/frame/breadcrumbs/breadcrumbs.d.ts +6 -2
- package/dist-elements/types/components/frame/footer/footer.d.ts +5 -1
- package/dist-elements/types/components/frame/hero/hero.d.ts +18 -1
- package/dist-elements/types/components/frame/language-nav/language-nav.d.ts +49 -0
- package/dist-elements/types/components/frame/page-header/page-header.d.ts +15 -1
- package/dist-elements/types/components/frame/shell/shell.d.ts +23 -3
- package/dist-elements/types/components/index.d.ts +4 -1
- package/dist-elements/types/components/inputs/shared/field-foot.d.ts +3 -2
- package/dist-elements/types/components/inputs/shared/input.d.ts +11 -0
- package/dist-elements/types/components/inputs/text-input/text-input.d.ts +1 -1
- package/dist-elements/types/components/inputs/textarea/textarea.d.ts +1 -0
- package/dist-elements/types/components/layout/expander/expander.d.ts +10 -5
- package/dist-elements/types/components/layout/tabs/tabs.d.ts +3 -0
- package/dist-elements/types/components/layout/tile/tile.d.ts +22 -2
- package/dist-elements/types/components/overlays/drawer/drawer.d.ts +5 -1
- package/dist-elements/types/components/overlays/popover/popover.d.ts +2 -0
- package/dist-elements/types/components/shared/announcement-block.d.ts +2 -0
- package/dist-elements/types/components/shared/grid-item-element.d.ts +24 -1
- package/dist-elements/types/components/shared/tone.d.ts +7 -0
- package/dist-elements/types/components/tables/list/list.d.ts +6 -0
- package/dist-elements/types/core/element.d.ts +20 -2
- package/dist-elements/types/core/styles.d.ts +4 -2
- package/dist-elements/types/icons/register.d.ts +1 -1
- package/dist-elements/types/types.d.ts +15 -0
- package/dist-icons/functioneel-cirkel-vinkje-gekleurd.svg +1 -0
- package/dist-icons/functioneel-foutmelding-gekleurd.svg +1 -0
- package/dist-icons/functioneel-info-gekleurd.svg +1 -0
- package/dist-icons/functioneel-waarschuwing-gekleurd.svg +1 -0
- package/package.json +1 -1
- package/dist-elements/chunks/base-DpZg_-sV.js +0 -226
- package/dist-elements/chunks/chart-styles-BIR87i7H.js +0 -45
- package/dist-elements/chunks/dialog-close-B0vtlJWP.js +0 -1
- package/dist-elements/chunks/frame-BMR48Vea.js +0 -1
- package/dist-elements/chunks/input-CCT6CcW1.js +0 -1
- package/dist-elements/chunks/prose-aNcSsHId.js +0 -1
- package/dist-elements/chunks/sentence-Dq2QLUs9.js +0 -3
|
@@ -1,364 +1,375 @@
|
|
|
1
|
-
import{
|
|
2
|
-
cx=${B(e,a.length,K)} cy=${Z(t,k,K)} />`},Ae=e=>
|
|
1
|
+
import{Mt as e,R as t,St as n,_ as r,d as i,f as a,fn as o,g as s,h as c,hn as l,in as u,k as d,l as f,ln as p,mn as m,nt as h,o as g,p as _,q as v,r as y,sn as b,u as x,v as S,y as C,z as w}from"../chunks/base-BbinwQUv.js";import{t as T}from"./announcement.js";import{a as E,n as D,r as O,t as k}from"../chunks/download-BTA_mOVO.js";import{C as A,D as j,E as M,F as N,I as P,L as F,M as I,N as L,O as R,P as z,R as B,S as V,_ as H,c as U,f as W,g as G,h as K,i as q,k as J,n as Y,o as ee,r as X,s as te,t as ne,u as re,v as ie,w as ae,x as oe,y as se,z as Z}from"../chunks/axes-DVNd9rvA.js";import{a as ce,i as le,n as Q,r as $,t as ue}from"../chunks/stagger-3qKZSgS1.js";import{n as de,r as fe}from"../chunks/chart-styles-DYVopFQv.js";var pe=/* @__PURE__ */ new Set([`ArrowRight`,`ArrowDown`]),me=/* @__PURE__ */ new Set([`ArrowLeft`,`ArrowUp`]);function he(e){return[`${[e.kicker,e.note?`${e.title} ${e.note}`:e.title].filter(Boolean).join(`, `)}: ${e.rows.map(e=>`${e.label} ${e.value}${e.aside?`, ${e.aside}`:``}`.trim()).join(`, `)}`,...(e.events??[]).map(e=>`Gebeurtenis ${e.number}: ${e.label}`)].join(`. `)}function ge(e){try{return e.matches(`:focus-visible`)}catch{return!0}}function _e(e,t,n){let r=(t,r)=>{let i=n(r),a=t.closest(`[data-tooltip-anchor]`),o=t.getBoundingClientRect(),s=a?.getBoundingClientRect()??o;e.hoverIndex=r,e.keyFrom=null,e.status=i.sentence??he(i.content);let c=o.left-s.left;e.showTooltipAt(c+i.x,o.top-s.top+i.y,i.content,i.side??(i.flip==null?void 0:c+i.flip))};return{keydown(n){if(n.target!==n.currentTarget||t===0)return;let i=e.hoverIndex??e.keyFrom,a=i==null?-1:Math.min(i,t-1),o;if(pe.has(n.key))o=Math.min(t-1,a+1);else if(me.has(n.key))o=Math.max(0,a-1);else if(n.key===`Home`)o=0;else if(n.key===`End`)o=t-1;else return;n.preventDefault(),r(n.currentTarget,o)},focus(n){let i=n.currentTarget;n.target===i&&t!==0&&ge(i)&&r(i,Math.min(e.hoverIndex??0,t-1))},blur(){e.keyFrom=null,(e.hoverIndex!=null||e.status)&&(e.hoverIndex=null,e.status=``,e.hideTooltip(),e.requestUpdate())}}}function ve(e){return m`<p class="visually-hidden" role="status">${e.status}</p>`}var ye=2.5;function be(e,t){let n=[],r=[];return e.forEach((e,i)=>{e==null?(r.length&&n.push(r),r=[]):r.push(t(e,i))}),r.length&&n.push(r),n}var xe=18,Se=4,Ce=8;function we(e){let t=[];return e.map(e=>{let n=t.findIndex(t=>t.every(t=>Math.abs(t-e)>=22));return n===-1&&(n=t.push([])-1),t[n].push(e),n})}function Te(e,t,n,r,i){let a=e=>Math.min(i,Math.max(0,e)),o=e.map((e,r)=>{if(r<n-1)return null;if(r===n-1)return e==null?null:{low:e,high:e};let{low:i,high:a}=K(t,r);return i==null||a==null?null:{low:i,high:a}}),s=[],c=[];return o.forEach((e,t)=>{e?c.push({...e,i:t}):c.length&&(s.push(c),c=[])}),c.length&&s.push(c),s.filter(e=>e.length>1).map(e=>{let t=e.map(e=>r(a(e.high),e.i)),n=e.map(e=>r(a(e.low),e.i)).reverse();return[...t,...n].map(e=>`${e.x},${e.y}`).join(` `)})}function Ee(t,n){let{controller:r,description:i}=n,{labels:a,axisTitle:c,unit:u,fixedMax:d,small:f=!1}=t,p=t.series.some(e=>!e.comparison)?G(t.forecastFrom,a.length):null,h=t.forecastLabel??`Raming`,_=p==null?t.asOfIndex:void 0,v=p==null?t.asOfLabel:void 0,y=p==null?t.pendingHours??0:0,b=(t.events??[]).filter(e=>Number.isInteger(e.index)&&e.index>=0&&e.index<a.length).sort((e,t)=>e.index-t.index).map((e,t)=>({...e,number:t+1})),x=r.id;r.measure({width:!0,height:n.height??(f?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let C=t.series.filter(e=>!e.comparison).length>1,w=0,T=t.series.map(e=>({...e,color:oe(e.color),symbol:C&&!e.comparison?R(e.color)?e.color:j[w++%j.length]:void 0})),E=T.filter(e=>!r.hiddenSeries.includes(e.label)),D=e=>p!=null&&!e.comparison,O=[...T.flatMap(e=>e.values),...T.flatMap(e=>D(e)?se(e.forecast):[])].filter(e=>e!=null),{max:k,ticks:A}=z(d??Math.max(...O,1)),M=L(A,r.width,{fontFamily:r.fontFamily,minimum:Math.ceil(S(a[0]??``,r.fontFamily)/2)}),N=ce(n,{left:M.width}),F=b.map(e=>Math.min(N.width-xe/2,Math.max(xe/2,B(e.index,a.length,N)))),V=we(F),U=V.length?Math.max(...V)+1:0,W=U?U*22+Ce:I.top,K=ce(n,{left:M.width,top:W+(p==null?0:16)}),q=e=>Se+V[e]*22,Y=y>6,X=_??a.length-1,ne=e=>e.comparison?`var(--color-chart-secondary)`:e.color??`var(--color-chart-default)`,le=T.filter(e=>!e.comparison),Q=E.filter(e=>!e.comparison),ue=p!=null&&Q.length>1&&Q.some(e=>e.label===r.emphasis)?r.emphasis:null,de=e=>Q.length===1?Q[0].label===e.label:e.label===ue,fe=le.length===1?ne(le[0]):`var(--color-text-muted)`,pe=[...T.map(e=>({label:e.label,color:ne(e),shape:e.comparison?`dashed`:`line`,symbol:e.symbol,hidden:r.hiddenSeries.includes(e.label),fixed:T.length<2})),...p==null?[]:[{label:h,color:fe,shape:`dotted`,fixed:!0}],...p!=null&&le.some(e=>H(e.forecast,p,a.length))?[{label:t.intervalLabel??`Marge`,color:fe,shape:`band`,fixed:!0}]:[]],me=Math.max(1,Math.ceil(a.length/8)),he=a.map((e,t)=>({label:e,x:B(t,a.length,K),i:t})).filter(e=>e.i%me===0),ge=(e,t)=>D(e)&&t>=p;function Ee(e){let t=b.filter(t=>t.index===e);return{title:a[e],...p!=null&&e>=p?{note:h.toLowerCase()}:{},rows:E.flatMap(t=>[{label:t.label,value:t.values[e]==null?`geen gegevens`:s(t.values[e]),color:ne(t),...p==null?{}:{marker:t.comparison?`dashed`:ge(t,e)?`dotted`:`line`}},...ge(t,e)&&t.forecast?[ie(t.forecast,e)]:[]]),...t.length?{events:t}:{}}}let De=e=>{let t=E.map(t=>t.values[e]).filter(e=>e!=null);return t.length?Math.max(...t):null},Oe=_e(r,a.length,e=>{let t=De(e);return{x:B(e,a.length,K),y:t==null?K.top:Z(t,k,K),content:Ee(e)}}),ke=e=>{let t=De(e);return t==null?o:l`<circle class="lintje-chart__focus-point" r="7.5"
|
|
2
|
+
cx=${B(e,a.length,K)} cy=${Z(t,k,K)} />`},Ae=e=>l`<rect class="lintje-chart__forecast-ground" x=${e} y=${K.top}
|
|
3
3
|
width=${Math.max(0,K.width-K.right-e)}
|
|
4
|
-
height=${Math.max(0,K.height-K.top-K.bottom)} />`,je=[y>0?(()=>{let e=B(X,a.length,K),t=Y?P(K)/(a.length-1):K.width-K.right-e;return
|
|
4
|
+
height=${Math.max(0,K.height-K.top-K.bottom)} />`,je=[y>0?(()=>{let e=B(X,a.length,K),t=Y?P(K)/(a.length-1):K.width-K.right-e;return l`<rect x=${e} y=${K.top} width=${Math.max(0,t)}
|
|
5
5
|
height=${K.height-K.top-K.bottom}
|
|
6
|
-
fill="url(#hatch-${
|
|
7
|
-
${b.map((e,t)=>{let n=B(e.index,a.length,K);return
|
|
6
|
+
fill="url(#hatch-${x})" />`})():o,b.length?l`<g>
|
|
7
|
+
${b.map((e,t)=>{let n=B(e.index,a.length,K);return l`<line class="lintje-chart__event-line" x1=${n} x2=${n}
|
|
8
8
|
y1=${q(t)+xe} y2=${K.height-K.bottom} />`})}
|
|
9
|
-
${b.map((e,t)=>
|
|
9
|
+
${b.map((e,t)=>l`
|
|
10
10
|
<rect class="lintje-chart__event-chip" x=${F[t]-xe/2} y=${q(t)}
|
|
11
11
|
width=${xe} height=${xe} />
|
|
12
12
|
<text class="lintje-chart__event-number" x=${F[t]} y=${q(t)+xe/2}
|
|
13
13
|
text-anchor="middle" dominant-baseline="central">${e.number}</text>
|
|
14
14
|
`)}
|
|
15
|
-
</g>`:
|
|
16
|
-
${T.map(e=>{let t=ne(e),n=e.comparison?void 0:ae(t),r=(e,t)=>({x:B(t,a.length,K),y:Z(e,k,K),i:t}),
|
|
15
|
+
</g>`:o,l`<g class="lintje-chart__reveal">
|
|
16
|
+
${T.map(e=>{let t=ne(e),n=e.comparison?void 0:ae(t),r=(e,t)=>({x:B(t,a.length,K),y:Z(e,k,K),i:t}),i=D(e),s=be(Y?e.values.slice(0,X+1):i?e.values.slice(0,p):e.values,r),c=i?be(e.values.map((e,t)=>t<p-1?null:e),r).filter(e=>e.length>1||e[0].i>=p):[],u=[...s,...c];if(u.length===0)return o;let d=u[u.length-1],f=d[d.length-1],m=K.height-K.bottom,h=i&&e.forecast?Te(e.values,e.forecast,p,r,k):[],g=!E.includes(e),_=ue!=null&&e.label!==ue;return l`
|
|
17
17
|
<g class="lintje-chart__series ${g?`is-off`:``} ${_?`is-muted`:``}">
|
|
18
|
-
${h.map(n=>
|
|
18
|
+
${h.map(n=>l`<polygon class="lintje-chart__band ${de(e)?`is-filled`:``}"
|
|
19
19
|
fill=${t} points=${n} />`)}
|
|
20
|
-
${s.map(r=>{let
|
|
21
|
-
${e.area&&!e.comparison?
|
|
22
|
-
points=${`${r[0].x},${
|
|
23
|
-
${n&&r.length>1?
|
|
24
|
-
${r.length===1?
|
|
20
|
+
${s.map(r=>{let i=r.map(e=>`${e.x},${e.y}`).join(` `);return l`
|
|
21
|
+
${e.area&&!e.comparison?l`<polygon fill=${t} fill-opacity=".14"
|
|
22
|
+
points=${`${r[0].x},${m} ${i} ${r[r.length-1].x},${m}`} />`:o}
|
|
23
|
+
${n&&r.length>1?l`<polyline class="lintje-chart__line lintje-chart__line--casing" points=${i} stroke=${n} />`:o}
|
|
24
|
+
${r.length===1?l`<circle cx=${r[0].x} cy=${r[0].y} r=${ye} fill=${t} />`:l`<polyline
|
|
25
25
|
class="lintje-chart__line"
|
|
26
|
-
points=${
|
|
26
|
+
points=${i}
|
|
27
27
|
stroke=${t}
|
|
28
|
-
stroke-dasharray=${e.comparison?`5 4`:
|
|
28
|
+
stroke-dasharray=${e.comparison?`5 4`:o}
|
|
29
29
|
opacity=${e.comparison?.9:1} />`}
|
|
30
30
|
`})}
|
|
31
|
-
${c.map(e=>{let r=e.map(e=>`${e.x},${e.y}`).join(` `);return e.length===1?
|
|
32
|
-
${n?
|
|
33
|
-
points=${r} stroke=${n} />`:
|
|
31
|
+
${c.map(e=>{let r=e.map(e=>`${e.x},${e.y}`).join(` `);return e.length===1?l`<circle cx=${e[0].x} cy=${e[0].y} r=${ye} fill=${t} />`:l`
|
|
32
|
+
${n?l`<polyline class="lintje-chart__line lintje-chart__line--casing lintje-chart__line--forecast"
|
|
33
|
+
points=${r} stroke=${n} />`:o}
|
|
34
34
|
<polyline class="lintje-chart__line lintje-chart__line--forecast" points=${r} stroke=${t} />
|
|
35
35
|
`})}
|
|
36
36
|
<!-- The line's own shape at its end; a 4 px point there at an early as-of time. -->
|
|
37
|
-
${e.symbol?
|
|
37
|
+
${e.symbol?l`<path class="lintje-chart__line-end" d=${J(e.symbol,4.5,f.x,f.y)} fill=${t} />`:Y&&!e.comparison?l`<circle cx=${f.x} cy=${f.y} r="4" fill=${t} />`:o}
|
|
38
38
|
</g>
|
|
39
39
|
`})}
|
|
40
|
-
</g>`,
|
|
41
|
-
r="4" fill=${o
|
|
40
|
+
</g>`,p==null?o:ee({mode:`forecast`,area:K,x:B(p-1,a.length,K),label:h,fontFamily:r.fontFamily}),Y&&v?ee({area:K,index:X,count:a.length,label:`peilmoment ${v}`,pendingHours:y,lastValue:(()=>{let e=E.find(e=>!e.comparison)?.values[X];return e==null?void 0:`${s(e)}${u?` ${u}`:``}`})()}):o,r.hoverIndex==null?o:E.map(e=>{let t=r.hoverIndex,n=e.values[t];if(n==null||Y&&t>X)return o;let i=ge(e,t),s=B(t,a.length,K),c=Z(n,k,K),u=i?void 0:ae(ne(e));return l`<circle class="lintje-chart__hover-point ${i?`lintje-chart__hover-point--forecast`:``}"
|
|
41
|
+
r="4" fill=${i?o:ne(e)} color=${i?ne(e):o}
|
|
42
42
|
cx=${s} cy=${c} />
|
|
43
|
-
${l
|
|
44
|
-
<rect x=${
|
|
43
|
+
${u?l`<circle class="lintje-chart__hover-casing" r="4" stroke=${u} cx=${s} cy=${c} />`:o}`}),r.hoverIndex!=null&&r.status?ke(r.hoverIndex):o,a.map((e,t)=>{let n=B(t,a.length,K),i=P(K)/Math.max(1,a.length-1);return l`
|
|
44
|
+
<rect x=${n-i/2} y=${K.top} width=${i}
|
|
45
45
|
height=${K.height-K.top-K.bottom}
|
|
46
46
|
fill="transparent"
|
|
47
|
-
@mousemove=${e=>
|
|
48
|
-
@mouseleave=${()=>
|
|
49
|
-
`})];return
|
|
47
|
+
@mousemove=${e=>r.hoverAt(t,e,Ee(t))}
|
|
48
|
+
@mouseleave=${()=>r.hoverAt(null)} />
|
|
49
|
+
`})];return m`
|
|
50
50
|
<div class="lintje-chart-wrap ${f?`lintje-chart--small`:``}"
|
|
51
|
-
${
|
|
52
|
-
${
|
|
53
|
-
@keydown=${e=>
|
|
54
|
-
${re({items:pe,onToggle:e=>
|
|
55
|
-
${te({fontFamily:
|
|
56
|
-
${b.length?
|
|
57
|
-
${b.map(e=>
|
|
51
|
+
${e({"--lintje-event-size":`${xe}px`})}
|
|
52
|
+
${g(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
53
|
+
@keydown=${e=>r.dismiss(e)}>
|
|
54
|
+
${re({items:pe,onToggle:e=>r.toggleSeries(e),onEmphasis:p!=null&&le.length>1?e=>r.emphasise(e):void 0})}
|
|
55
|
+
${te({fontFamily:r.fontFamily,id:x,ticks:A,max:k,area:K,formatTick:M.format,axisTitle:c??u,xLabels:he,underlay:p==null?o:Ae(B(p-1,a.length,K)),description:b.length?`${i} ${b.map(e=>`Gebeurtenis ${e.number}, ${a[e.index]}: ${e.label}.`).join(` `)}`:i,keys:Oe},je)}
|
|
56
|
+
${b.length?m`<ol class="lintje-chart-events" aria-label="Gebeurtenissen">
|
|
57
|
+
${b.map(e=>m`<li class="lintje-chart-events__item">
|
|
58
58
|
<span class="lintje-event-chip"><span class="lintje-event-chip__number">${e.number}</span></span>
|
|
59
59
|
<span><span class="lintje-chart-events__category">${a[e.index]}</span> ·
|
|
60
60
|
${e.label}</span>
|
|
61
61
|
</li>`)}
|
|
62
|
-
</ol>`:
|
|
63
|
-
${$(
|
|
64
|
-
${ve(
|
|
62
|
+
</ol>`:o}
|
|
63
|
+
${$(r)}
|
|
64
|
+
${ve(r)}
|
|
65
65
|
</div>
|
|
66
|
-
`}var De={clickable:!1,state:``,markId:
|
|
66
|
+
`}var De={clickable:!1,state:``,markId:o,role:o,tabIndex:o,pressed:o,label:o,click:o,keydown:o};function Oe(e,t){let n=/* @__PURE__ */ new Set;for(let e of t)e?.href&&n.add(e.id);let r=e.selectedId!=null&&n.has(e.selectedId)?e.selectedId:null,i=()=>{r!=null&&e.onClear?.(r)},a=(t,n)=>{if(t.id===r)return i();e.onSelect?.({id:t.id,label:n,href:t.href})};return{active:r,interactive:!!e.onSelect&&n.size>0,of(t,n,i){if(!t?.href||!e.onSelect)return r==null?De:{...De,state:`is-muted`};let o=t.id===r;return{clickable:!0,state:`is-clickable ${o?`is-selected`:r==null?``:`is-muted`}`,markId:t.id,role:`button`,tabIndex:0,pressed:o?`true`:`false`,label:i??n,click:r=>{v(r)?(r.preventDefault(),e.onSelect?.({id:t.id,label:n,href:t.href},!0)):r.type===`click`&&a(t,n)},keydown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(t,n))}}},escape(e){e.key===`Escape`&&r!=null&&(e.stopPropagation(),i())}}}var ke=8;function Ae(t,n){let{controller:r,description:i}=n,{labels:a,values:u,axisTitle:d,trend:f,dataLabels:p=!0,small:h=!1,links:v}=t,y=oe(t.color)??`var(--color-chart-default)`,b=G(t.forecastFrom,a.length),x=t.forecastLabel??`Raming`,S=d??`Waarde`,C=ae(y)??y,w=e=>b!=null&&e>=b,T=r.id,E=Oe(n,v??[]);r.measure({width:!0,height:n.height??(h?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let D=[...u,...b==null?[]:se(t.forecast)].filter(e=>e!=null),{max:O,ticks:k}=z(Math.max(...D,1)),A=L(k,r.width,{fontFamily:r.fontFamily}),j=ce(n,{left:A.width,...b==null?{}:{top:I.top+16}}),M=e=>{if(!w(e)||u[e]==null)return null;let{low:n,high:r}=K(t.forecast,e);if(n==null||r==null)return null;let i=e=>Z(Math.min(O,Math.max(0,e)),O,j);return{top:i(r),bottom:i(n)}},P=j.height-j.bottom,{width:F,bandWidth:R}=N(0,a.length,j),B=p&&u.every(e=>e==null||_(c(e,F),R-4)),V=e=>({title:a[e],...w(e)?{note:x.toLowerCase()}:{},rows:[{label:S,value:u[e]==null?`geen gegevens`:s(u[e]),color:y,...w(e)?{marker:`open`}:{}},...w(e)&&t.forecast?[ie(t.forecast,e)]:[]]}),U=_e(r,a.length,e=>({x:N(e,a.length,j).center,y:u[e]==null?j.top:Math.min(Z(u[e],O,j),M(e)?.top??1/0),content:V(e)})),W=b==null?null:N(b,a.length,j),q=W?W.center-W.bandWidth/2:0,J=be(f??[],(e,t)=>({x:N(t,a.length,j).center,y:Z(e,O,j)})),Y=[u.map((t,n)=>{let i=N(n,a.length,j);if(t==null)return l`<rect class="lintje-chart__missing" x=${i.x} y=${j.top} width=${i.width}
|
|
67
67
|
height=${Math.max(0,P-j.top)} fill="url(#hatch-${T})"
|
|
68
|
-
@mousemove=${e=>
|
|
69
|
-
@mouseleave=${()=>
|
|
70
|
-
<g class="lintje-chart__bar-group ${
|
|
71
|
-
${
|
|
72
|
-
@mousemove=${e=>
|
|
73
|
-
@mouseleave=${()=>
|
|
74
|
-
<rect class="lintje-chart__bar lintje-chart__mark ${
|
|
75
|
-
x=${
|
|
76
|
-
height=${Math.max(0,P-
|
|
77
|
-
stroke=${
|
|
68
|
+
@mousemove=${e=>r.showTooltip(e,V(n))}
|
|
69
|
+
@mouseleave=${()=>r.hideTooltip()} />`;let u=Z(t,O,j),d=w(n),f=M(n),p=E.of(v?.[n],a[n],`${a[n]}${d?` ${x.toLowerCase()}`:``}: ${s(t)}`),m=d?.75:0;return l`
|
|
70
|
+
<g class="lintje-chart__bar-group ${r.hoverIndex===n?`is-hovered`:``}"
|
|
71
|
+
${e(Q(n,a.length))}
|
|
72
|
+
@mousemove=${e=>r.showTooltip(e,V(n))}
|
|
73
|
+
@mouseleave=${()=>r.hideTooltip()}>
|
|
74
|
+
<rect class="lintje-chart__bar lintje-chart__mark ${d?`lintje-chart__bar--forecast`:``} ${p.state}"
|
|
75
|
+
x=${i.x+m} y=${u+m} width=${Math.max(0,i.width-2*m)}
|
|
76
|
+
height=${Math.max(0,P-u-m)} fill=${y}
|
|
77
|
+
stroke=${d?C:o}
|
|
78
78
|
data-mark-id=${p.markId} role=${p.role} tabindex=${p.tabIndex}
|
|
79
79
|
aria-pressed=${p.pressed} aria-label=${p.label}
|
|
80
80
|
@click=${p.click} @auxclick=${p.click} @keydown=${p.keydown} />
|
|
81
|
-
${f?
|
|
82
|
-
d=${`M${
|
|
83
|
-
${B?
|
|
81
|
+
${f?l`<path class="lintje-chart__interval" stroke=${C}
|
|
82
|
+
d=${`M${i.center},${f.top}V${f.bottom}M${i.center-ke/2},${f.top}h${ke}M${i.center-ke/2},${f.bottom}h${ke}`} />`:o}
|
|
83
|
+
${B?l`<text x=${i.center} y=${Math.min(u,f?.top??u)-5} text-anchor="middle"
|
|
84
84
|
class="lintje-chart__data-label">
|
|
85
|
-
${
|
|
86
|
-
</text>`:
|
|
85
|
+
${c(t,i.width)}
|
|
86
|
+
</text>`:o}
|
|
87
87
|
</g>
|
|
88
|
-
`}),J.length?
|
|
89
|
-
${J.map(e=>e.length===1?
|
|
90
|
-
fill="var(--color-chart-emphasis)" />`:
|
|
88
|
+
`}),J.length?l`<g class="lintje-chart__trend">
|
|
89
|
+
${J.map(e=>e.length===1?l`<circle cx=${e[0].x} cy=${e[0].y} r=${ye}
|
|
90
|
+
fill="var(--color-chart-emphasis)" />`:l`<polyline fill="none" stroke="var(--color-chart-emphasis)" stroke-width="1.5"
|
|
91
91
|
stroke-dasharray="5 4"
|
|
92
92
|
points=${e.map(e=>`${e.x},${e.y}`).join(` `)} />`)}
|
|
93
|
-
</g>`:
|
|
94
|
-
<div class="lintje-chart-wrap ${
|
|
95
|
-
${
|
|
96
|
-
@keydown=${e=>
|
|
97
|
-
${b==null?
|
|
98
|
-
${te({fontFamily:
|
|
93
|
+
</g>`:o,b==null?o:ee({mode:`forecast`,area:j,x:q,label:x,fontFamily:r.fontFamily})];return m`
|
|
94
|
+
<div class="lintje-chart-wrap ${h?`lintje-chart--small`:``}"
|
|
95
|
+
${g(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
96
|
+
@keydown=${e=>r.dismiss(e)||E.escape(e)}>
|
|
97
|
+
${b==null?o:re({items:[{label:S,color:y,shape:`square`,fixed:!0},{label:x,color:y,shape:`open`,fixed:!0},...H(t.forecast,b,a.length)?[{label:t.intervalLabel??`Marge`,color:y,shape:`interval`,fixed:!0}]:[]]})}
|
|
98
|
+
${te({fontFamily:r.fontFamily,id:T,ticks:k,max:O,area:j,axisTitle:d,description:i,formatTick:A.format,xLabels:a.map((e,t)=>({label:e,x:N(t,a.length,j).center})),underlay:W?l`<rect class="lintje-chart__forecast-ground" x=${q} y=${j.top}
|
|
99
99
|
width=${Math.max(0,j.width-j.right-q)}
|
|
100
|
-
height=${Math.max(0,P-j.top)} />`:
|
|
101
|
-
${$(
|
|
102
|
-
${ve(
|
|
100
|
+
height=${Math.max(0,P-j.top)} />`:o,interactive:E.interactive,keys:U},Y)}
|
|
101
|
+
${$(r)}
|
|
102
|
+
${ve(r)}
|
|
103
103
|
</div>
|
|
104
|
-
`}function je(e){return e*26+24}function Me(
|
|
105
|
-
<figure class="lintje-chart lintje-chart--rows" ${
|
|
104
|
+
`}function je(e){return e*26+24}function Me(t,n){let{controller:r,description:i}=n,{rows:a,threshold:c,thresholdLabel:u,unit:d}=t,f=oe(t.color)??`var(--color-chart-dark-yellow)`,p=oe(t.aboveThresholdColor)??`var(--color-chart-red)`,h=r.id,_=a.map(e=>e.href?{id:e.id??e.label,href:e.href}:null),v=Oe(n,_),y=je(a.length);r.measure({width:!0,height:y});let b=r.width,x=F(a.map(e=>e.label),b,{fontFamily:r.fontFamily}),{labelEnd:S,barStart:C}=x,w=Math.max(...a.map(e=>e.value),c??0)*1.15,T=e=>Math.max(40,b-C-60)*e/w,E=e=>`${s(e)}${d?` ${d}`:``}`,D=e=>{let t=a[e],n=c!=null&&t.value>c;return{title:t.label,rows:[{label:`Waarde`,value:E(t.value),color:n?p:f},...c==null?[]:[{label:`Norm`,value:E(c),color:`var(--color-chart-emphasis)`}]]}},O=_e(r,a.length,e=>({x:C+T(a[e].value),y:e*26+4,content:D(e)}));return m`
|
|
105
|
+
<figure class="lintje-chart lintje-chart--rows" ${g(r.attach)} ?data-in-view=${r.inView}
|
|
106
106
|
data-tooltip-anchor
|
|
107
|
-
@keydown=${e=>
|
|
107
|
+
@keydown=${e=>r.dismiss(e)||v.escape(e)}>
|
|
108
108
|
<svg viewBox="0 0 ${b} ${y}" class="lintje-chart__svg" role=${X(v.interactive)}
|
|
109
109
|
aria-labelledby="${h}-desc" width=${b} height=${y}
|
|
110
|
-
${
|
|
110
|
+
${e({height:`${y}px`,...q(h)})}
|
|
111
111
|
tabindex="0" @keydown=${O.keydown} @focus=${O.focus} @blur=${O.blur}>
|
|
112
|
-
<desc id="${h}-desc">${
|
|
112
|
+
<desc id="${h}-desc">${i}</desc>
|
|
113
113
|
<defs>${U(h)}</defs>
|
|
114
|
-
${
|
|
115
|
-
<line x1=${C+T(
|
|
114
|
+
${c==null?o:l`
|
|
115
|
+
<line x1=${C+T(c)} x2=${C+T(c)} y1=${4} y2=${a.length*26+2}
|
|
116
116
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="3 3" />
|
|
117
|
-
<text x=${C+T(
|
|
118
|
-
${
|
|
117
|
+
<text x=${C+T(c)+6} y=${a.length*26+16} class="lintje-chart__axis-label">
|
|
118
|
+
${u??`norm ${s(c)}`}
|
|
119
119
|
</text>
|
|
120
120
|
`}
|
|
121
|
-
${a.map((
|
|
122
|
-
<g class="lintje-chart__bar-row ${
|
|
123
|
-
@mousemove=${e=>
|
|
124
|
-
@mouseleave=${()=>
|
|
121
|
+
${a.map((t,n)=>{let i=n*26+4,o=c!=null&&t.value>c,u=T(t.value),m=v.of(_[n],t.label,`${t.label}: ${s(t.value)}${d?` ${d}`:``}`);return l`
|
|
122
|
+
<g class="lintje-chart__bar-row ${r.hoverIndex===n?`is-hovered`:``}"
|
|
123
|
+
@mousemove=${e=>r.showTooltip(e,D(n))}
|
|
124
|
+
@mouseleave=${()=>r.hideTooltip()}>
|
|
125
125
|
<!-- Hit area across the whole row, so the tooltip doesn't flicker between bars. -->
|
|
126
|
-
<rect x=${0} y=${
|
|
127
|
-
<text x=${S} y=${
|
|
128
|
-
<rect class="lintje-chart__bar lintje-chart__bar--horizontal lintje-chart__mark ${
|
|
129
|
-
${
|
|
130
|
-
x=${C} y=${
|
|
131
|
-
fill=${
|
|
132
|
-
data-mark-id=${
|
|
133
|
-
aria-pressed=${
|
|
134
|
-
@click=${
|
|
135
|
-
<text x=${C+
|
|
136
|
-
class="lintje-chart__data-label ${
|
|
137
|
-
${
|
|
126
|
+
<rect x=${0} y=${i-5} width=${b} height=${26} fill="transparent" />
|
|
127
|
+
<text x=${S} y=${i+16-3} text-anchor="end" class="lintje-chart__axis-label">${x.fit(t.label)}</text>
|
|
128
|
+
<rect class="lintje-chart__bar lintje-chart__bar--horizontal lintje-chart__mark ${m.state}"
|
|
129
|
+
${e(Q(n,a.length))}
|
|
130
|
+
x=${C} y=${i} width=${Math.max(0,u)} height=${16}
|
|
131
|
+
fill=${o?p:f}
|
|
132
|
+
data-mark-id=${m.markId} role=${m.role} tabindex=${m.tabIndex}
|
|
133
|
+
aria-pressed=${m.pressed} aria-label=${m.label}
|
|
134
|
+
@click=${m.click} @auxclick=${m.click} @keydown=${m.keydown} />
|
|
135
|
+
<text x=${C+u+6} y=${i+16-3} font-weight="700"
|
|
136
|
+
class="lintje-chart__data-label ${c==null?``:`lintje-chart__data-label--halo`}">
|
|
137
|
+
${s(t.value)}${d?` ${d}`:``}
|
|
138
138
|
</text>
|
|
139
139
|
</g>
|
|
140
140
|
`})}
|
|
141
141
|
</svg>
|
|
142
|
-
${$(
|
|
143
|
-
${ve(
|
|
142
|
+
${$(r)}
|
|
143
|
+
${ve(r)}
|
|
144
144
|
</figure>
|
|
145
|
-
`}function Ne(
|
|
146
|
-
<figure class="lintje-chart lintje-chart--rows" ${
|
|
147
|
-
data-tooltip-anchor @keydown=${e=>
|
|
148
|
-
<svg viewBox="0 0 ${
|
|
149
|
-
aria-labelledby="${
|
|
145
|
+
`}function Ne(t,n){let{controller:i,description:a}=n,{rows:o,target:s=100}=t,c=i.id,u=je(o.length);i.measure({width:!0,height:u});let d=i.width,f=F(o.map(e=>e.label),d,{fontFamily:i.fontFamily}),{labelEnd:p,barStart:h}=f,_=e=>Math.max(40,d-h-70)*e/110,v=h+_(s),y=e=>e>=s?`var(--color-chart-green)`:`var(--color-attention)`,b=e=>({title:o[e].label,rows:[{label:`Voortgang`,value:r(o[e].value),color:y(o[e].value)},{label:`Doel`,value:r(s),color:`var(--color-chart-emphasis)`}]}),x=_e(i,o.length,e=>({x:h+_(o[e].value),y:e*26+4,content:b(e)}));return m`
|
|
146
|
+
<figure class="lintje-chart lintje-chart--rows" ${g(i.attach)} ?data-in-view=${i.inView}
|
|
147
|
+
data-tooltip-anchor @keydown=${e=>i.dismiss(e)}>
|
|
148
|
+
<svg viewBox="0 0 ${d} ${u}" class="lintje-chart__svg" role="img"
|
|
149
|
+
aria-labelledby="${c}-desc" width=${d} height=${u} ${e({height:`${u}px`})}
|
|
150
150
|
tabindex="0" @keydown=${x.keydown} @focus=${x.focus} @blur=${x.blur}>
|
|
151
|
-
<desc id="${
|
|
152
|
-
${
|
|
153
|
-
<g class="lintje-chart__bar-row ${
|
|
154
|
-
@mousemove=${e=>
|
|
155
|
-
@mouseleave=${()=>
|
|
156
|
-
<rect x=${0} y=${
|
|
157
|
-
<text x=${
|
|
158
|
-
<rect class="lintje-chart__bar lintje-chart__bar--horizontal" ${
|
|
159
|
-
x=${h} y=${
|
|
160
|
-
<text x=${
|
|
161
|
-
text-anchor=${
|
|
162
|
-
class="lintje-chart__data-label ${
|
|
151
|
+
<desc id="${c}-desc">${a}</desc>
|
|
152
|
+
${o.map((t,n)=>{let a=n*26+4,c=_(t.value),u=y(t.value),m=h+c+46>d,g=t.value>=s?`lintje-chart__data-label--inside`:`lintje-chart__data-label--inside-light`;return l`
|
|
153
|
+
<g class="lintje-chart__bar-row ${i.hoverIndex===n?`is-hovered`:``}"
|
|
154
|
+
@mousemove=${e=>i.showTooltip(e,b(n))}
|
|
155
|
+
@mouseleave=${()=>i.hideTooltip()}>
|
|
156
|
+
<rect x=${0} y=${a-5} width=${d} height=${26} fill="transparent" />
|
|
157
|
+
<text x=${p} y=${a+16-3} text-anchor="end" class="lintje-chart__axis-label">${f.fit(t.label)}</text>
|
|
158
|
+
<rect class="lintje-chart__bar lintje-chart__bar--horizontal" ${e(Q(n,o.length))}
|
|
159
|
+
x=${h} y=${a} width=${Math.max(0,c)} height=${16} fill=${u} />
|
|
160
|
+
<text x=${m?h+c-6:h+c+6} y=${a+16-3}
|
|
161
|
+
text-anchor=${m?`end`:`start`}
|
|
162
|
+
class="lintje-chart__data-label ${m?g:``}" font-weight="700">${r(t.value)}</text>
|
|
163
163
|
</g>
|
|
164
164
|
`})}
|
|
165
|
-
<line x1=${v} x2=${v} y1=${0} y2=${
|
|
165
|
+
<line x1=${v} x2=${v} y1=${0} y2=${o.length*26+2}
|
|
166
166
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="3 3" />
|
|
167
|
-
<text x=${v+6} y=${
|
|
167
|
+
<text x=${v+6} y=${o.length*26+16} class="lintje-chart__axis-label">norm ${s}</text>
|
|
168
168
|
</svg>
|
|
169
|
-
${$(
|
|
170
|
-
${ve(
|
|
169
|
+
${$(i)}
|
|
170
|
+
${ve(i)}
|
|
171
171
|
</figure>
|
|
172
|
-
`}var Pe=/* @__PURE__ */ new WeakMap;function Fe(e,t){return e.duration>0?Math.min(1,(t-e.start)/e.duration):1}function Ie(e,t){let n=Fe(e,t);if(n>=1)return e.to;let r=e.ease(n);return e.to.map((t,n)=>e.from[n]+(t-e.from[n])*r)}function Le(e,t,n){let
|
|
173
|
-
<g class="lintje-chart__bar-group ${
|
|
174
|
-
${
|
|
175
|
-
@mousemove=${e=>
|
|
176
|
-
@mouseleave=${()=>
|
|
177
|
-
${
|
|
172
|
+
`}var Pe=/* @__PURE__ */ new WeakMap;function Fe(e,t){return e.duration>0?Math.min(1,(t-e.start)/e.duration):1}function Ie(e,t){let n=Fe(e,t);if(n>=1)return e.to;let r=e.ease(n);return e.to.map((t,n)=>e.from[n]+(t-e.from[n])*r)}function Le(e,t,n){let r=performance.now(),o=Pe.get(e);if(!o||o.key!==t){let i={key:t,from:n,to:n,start:r,duration:0,ease:e=>e,element:o?.element,attach:e=>{i.element=e}};return Pe.set(e,i),n}if(o.to.some((e,t)=>e!==n[t])){let t=o.element,s=!t||a();if(o.from=s?n:Ie(o,r),o.to=n,o.start=r,o.duration=s?0:x(t,`--dur-layer`),o.ease=t?i(t,`--ease-in-motion`):e=>e,o.frame==null&&o.duration>0){let t=o,n=()=>{t.frame=void 0;let r=Fe(t,performance.now())>=1;e.requestUpdate(),r||(t.frame=requestAnimationFrame(n))};t.frame=requestAnimationFrame(n)}}return Ie(o,r)}function Re(e){return Pe.get(e)}function ze(t,n){let{controller:r,description:i}=n,{labels:a,axisTitle:u,small:d=!1}=t,f=r.id;r.measure({width:!0,height:n.height??(d?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let p=t.series.map((e,t)=>({...e,color:oe(e.color)??(t===0?`var(--color-chart-default)`:`var(--color-chart-secondary)`),hidden:r.hiddenSeries.includes(e.label)})),h=p.filter(e=>!e.hidden),v=Oe(n,h.flatMap(e=>e.links??[])),{max:y,ticks:b}=z(Math.max(...p.flatMap(e=>e.values),1)),x=L(b,r.width,{fontFamily:r.fontFamily}),S=ce(n,{left:x.width}),C=S.height-S.bottom,w=N(0,a.length,S).width/Math.max(1,h.length),T=Le(r,p.map(e=>e.label).join(`\0`),p.map(e=>+!e.hidden)),E=Re(r),D=N(0,a.length,S).width/Math.max(1,T.reduce((e,t)=>e+t,0)),O=T.map((e,t)=>T.slice(0,t).reduce((e,t)=>e+t,0)*D),k=h.every(e=>e.values.every(e=>_(c(e,w),w-2))),A=p.map(e=>({label:e.label,color:e.color,shape:`square`,hidden:e.hidden,fixed:p.length<2})),j=e=>({title:a[e],rows:h.map(t=>({label:t.label,value:s(t.values[e]),color:t.color}))}),M=_e(r,a.length,e=>({x:N(e,a.length,S).center,y:Z(Math.max(0,...h.map(t=>t.values[e])),y,S),content:j(e)})),P=a.map((t,n)=>{let i=N(n,a.length,S);return l`
|
|
173
|
+
<g class="lintje-chart__bar-group ${r.hoverIndex===n?`is-hovered`:``}"
|
|
174
|
+
${e(Q(n,a.length))}
|
|
175
|
+
@mousemove=${e=>r.showTooltip(e,j(n))}
|
|
176
|
+
@mouseleave=${()=>r.hideTooltip()}>
|
|
177
|
+
${p.map((e,r)=>{let a=e.values[n],u=Z(a,y,S),d=i.x+O[r],f=Math.max(0,T[r]*D-2),p=e.hidden?void 0:v.of(e.links?.[n],`${t} · ${e.label}`,`${t}, ${e.label}: ${s(a)}`);return l`
|
|
178
178
|
<g>
|
|
179
179
|
<rect class="lintje-chart__bar lintje-chart__mark ${p?.state??``}"
|
|
180
|
-
x=${
|
|
181
|
-
height=${Math.max(0,C-
|
|
182
|
-
data-mark-id=${p?.markId??
|
|
183
|
-
tabindex=${p?.tabIndex??
|
|
184
|
-
aria-label=${p?.label??
|
|
185
|
-
@click=${p?.click??
|
|
180
|
+
x=${d} y=${u} width=${f}
|
|
181
|
+
height=${Math.max(0,C-u)} fill=${e.color}
|
|
182
|
+
data-mark-id=${p?.markId??o} role=${p?.role??o}
|
|
183
|
+
tabindex=${p?.tabIndex??o} aria-pressed=${p?.pressed??o}
|
|
184
|
+
aria-label=${p?.label??o} aria-hidden=${p?o:`true`}
|
|
185
|
+
@click=${p?.click??o} @auxclick=${p?.click??o} @keydown=${p?.keydown??o} />
|
|
186
186
|
<!-- Every label keeps its node and fades, so one that fits after a switch does not
|
|
187
187
|
draw in again. -->
|
|
188
|
-
<g class="lintje-chart__series ${!
|
|
189
|
-
<text x=${
|
|
190
|
-
class="lintje-chart__data-label">${
|
|
188
|
+
<g class="lintje-chart__series ${!e.hidden&&k?``:`is-off`}">
|
|
189
|
+
<text x=${d+f/2} y=${u-4} text-anchor="middle"
|
|
190
|
+
class="lintje-chart__data-label">${c(a,w)}</text>
|
|
191
191
|
</g>
|
|
192
192
|
</g>
|
|
193
193
|
`})}
|
|
194
194
|
</g>
|
|
195
|
-
`});return
|
|
196
|
-
<div class="lintje-chart-wrap ${
|
|
197
|
-
${
|
|
198
|
-
@keydown=${e=>
|
|
199
|
-
${re({items:A,onToggle:e=>
|
|
200
|
-
${te({fontFamily:
|
|
201
|
-
${$(
|
|
202
|
-
${ve(
|
|
195
|
+
`});return m`
|
|
196
|
+
<div class="lintje-chart-wrap ${d?`lintje-chart--small`:``}"
|
|
197
|
+
${g(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
198
|
+
@keydown=${e=>r.dismiss(e)||v.escape(e)}>
|
|
199
|
+
${re({items:A,onToggle:e=>r.toggleSeries(e)})}
|
|
200
|
+
${te({fontFamily:r.fontFamily,id:f,ticks:b,max:y,area:S,axisTitle:u,description:i,formatTick:x.format,xLabels:a.map((e,t)=>({label:e,x:N(t,a.length,S).center})),interactive:v.interactive,keys:M},l`<g ${g(E.attach)}>${P}</g>`)}
|
|
201
|
+
${$(r)}
|
|
202
|
+
${ve(r)}
|
|
203
203
|
</div>
|
|
204
|
-
`}var Be=[[1],[1,4],[1,2,4],[1,2,3,4],[1,2,3,4,5]];function Ve(e){return e<1?[]:Be[Math.min(e,Be.length)-1]}function He(e,t){let n=Ve(e);return
|
|
205
|
-
<g class="lintje-chart__bar-group ${
|
|
206
|
-
${
|
|
207
|
-
@mousemove=${e=>
|
|
208
|
-
@mouseleave=${()=>
|
|
204
|
+
`}var Be=[[1],[1,4],[1,2,4],[1,2,3,4],[1,2,3,4,5]];function Ve(e){return e<1?[]:Be[Math.min(e,Be.length)-1]}function He(e,t){let n=Ve(e);return y(t)?n.map(e=>e===1?`var(--color-chart-${t})`:`var(--color-chart-${t}-tint-${e})`):n.map(e=>`var(--color-chart-tint-${e})`)}function Ue(t,n){let{controller:i,description:a}=n,{labels:u,axisTitle:d,normalized:f=!1,totalOnTop:p=!0,small:h=!1}=t,v=i.id;i.measure({width:!0,height:n.height??(h?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let y=t.series.map((e,t)=>({...e,j:t,color:oe(e.color),hidden:i.hiddenSeries.includes(e.label)})),b=y.filter(e=>!e.hidden),x=Oe(n,b.flatMap(e=>e.links??[])),S=u.map((e,t)=>y.reduce((e,n)=>e+n.values[t],0)),C=u.map((e,t)=>b.reduce((e,n)=>e+n.values[t],0)),w=(e,t)=>e/(S[t]||1)*100,T=Le(i,y.map(e=>e.label).join(`\0`),y.map(e=>+!e.hidden)),E=Re(i),{max:D,ticks:O}=f?{max:100,ticks:[0,25,50,75,100]}:z(Math.max(...S,1)),k=L(O,i.width,{fontFamily:i.fontFamily}),j=ce(n,{left:k.width}),M=j.height-j.bottom,{width:P,bandWidth:F}=N(0,u.length,j),I=p&&!f,R=I&&C.every(e=>_(c(e,F),F-4)),B=He(y.length),H=(e,t)=>e.color??B[Math.min(t,B.length-1)],U=Ve(y.length),W=e=>{let n=t.series[e].color;if(n===`remainder`)return`lintje-chart__data-label--inside-text`;let r=A(n,n==null?U[Math.min(e,U.length-1)]:1);return r?V(r):null},G=e=>({title:u[e],rows:b.map(t=>({label:t.label,value:f?r(w(t.values[e],e)):s(t.values[e]),color:H(t,t.j)}))}),K=_e(i,u.length,e=>({x:N(e,u.length,j).center,y:Z(f?w(C[e],e):C[e],D,j),content:G(e)})),q=y.map(e=>({label:e.label,color:H(e,e.j),shape:`square`,hidden:e.hidden,fixed:y.length<2})),J=u.map((t,n)=>{let a=N(n,u.length,j),d=0,p=y.map(e=>{let{j:t}=e,r=e.values[n],i=f?w(r,n):r,a=Z(d,D,j);d+=i*T[t];let o=Z(d,D,j);return{row:e,j:t,value:i,y1:o,height:Math.max(0,a-o)}}),m=Z(d,D,j);return l`
|
|
205
|
+
<g class="lintje-chart__bar-group ${i.hoverIndex===n?`is-hovered`:``}"
|
|
206
|
+
${e(Q(n,u.length))}
|
|
207
|
+
@mousemove=${e=>i.showTooltip(e,G(n))}
|
|
208
|
+
@mouseleave=${()=>i.hideTooltip()}>
|
|
209
209
|
<!-- The hit area under the whole column, so the tooltip also follows the empty
|
|
210
210
|
space above the stack. It lies *under* the segments: on top it swallowed
|
|
211
211
|
every click on a segment that drills. -->
|
|
212
212
|
<rect x=${a.x} y=${j.top} width=${a.width} height=${M-j.top} fill="transparent" />
|
|
213
213
|
<!-- The segments in one group, so the column lifts on hover as a whole. -->
|
|
214
214
|
<g class="lintje-chart__bar">
|
|
215
|
-
${p.map(
|
|
215
|
+
${p.map(e=>{let r=e.row.hidden?void 0:x.of(e.row.links?.[n],`${t} · ${e.row.label}`,`${t}, ${e.row.label}: ${s(e.row.values[n])}`);return l`
|
|
216
216
|
<rect class="lintje-chart__mark lintje-chart__segment ${r?.state??``}"
|
|
217
|
-
x=${a.x} y=${
|
|
218
|
-
fill=${H(
|
|
219
|
-
data-mark-id=${r?.markId??
|
|
220
|
-
tabindex=${r?.tabIndex??
|
|
221
|
-
aria-label=${r?.label??
|
|
222
|
-
@click=${r?.click??
|
|
217
|
+
x=${a.x} y=${e.y1} width=${a.width} height=${e.height}
|
|
218
|
+
fill=${H(e.row,e.j)}
|
|
219
|
+
data-mark-id=${r?.markId??o} role=${r?.role??o}
|
|
220
|
+
tabindex=${r?.tabIndex??o} aria-pressed=${r?.pressed??o}
|
|
221
|
+
aria-label=${r?.label??o} aria-hidden=${r?o:`true`}
|
|
222
|
+
@click=${r?.click??o} @auxclick=${r?.click??o} @keydown=${r?.keydown??o} />
|
|
223
223
|
`})}
|
|
224
224
|
</g>
|
|
225
225
|
<!-- Percentages inside the segments when they are >= 16 px tall and fit the width. Each
|
|
226
226
|
keeps its node and fades, so a switch does not draw it in again. -->
|
|
227
|
-
${f?p.map(e=>
|
|
228
|
-
<g class="lintje-chart__series ${!e.row.hidden&&W(e.j)&&e.height>=16&&
|
|
227
|
+
${f?p.map(e=>l`
|
|
228
|
+
<g class="lintje-chart__series ${!e.row.hidden&&W(e.j)&&e.height>=16&&_(r(e.value),P-4)?``:`is-off`}">
|
|
229
229
|
<text x=${a.center} y=${e.y1+e.height/2+4} text-anchor="middle"
|
|
230
|
-
class="lintje-chart__data-label ${W(e.j)??``}">${
|
|
231
|
-
</g>`):
|
|
232
|
-
${I?
|
|
230
|
+
class="lintje-chart__data-label ${W(e.j)??``}">${r(e.value)}</text>
|
|
231
|
+
</g>`):o}
|
|
232
|
+
${I?l`<g class="lintje-chart__series ${R?``:`is-off`}">
|
|
233
233
|
<text x=${a.center} y=${m-5} text-anchor="middle"
|
|
234
|
-
class="lintje-chart__data-label" font-weight="700">${
|
|
235
|
-
</g>`:
|
|
234
|
+
class="lintje-chart__data-label" font-weight="700">${c(C[n],a.bandWidth)}</text>
|
|
235
|
+
</g>`:o}
|
|
236
236
|
</g>
|
|
237
|
-
`});return
|
|
238
|
-
<div class="lintje-chart-wrap ${
|
|
239
|
-
${
|
|
240
|
-
@keydown=${e=>
|
|
241
|
-
${re({items:q,onToggle:e=>
|
|
242
|
-
${te({fontFamily:
|
|
243
|
-
${$(
|
|
244
|
-
${ve(
|
|
237
|
+
`});return m`
|
|
238
|
+
<div class="lintje-chart-wrap ${h?`lintje-chart--small`:``}"
|
|
239
|
+
${g(i.attach)} ?data-in-view=${i.inView} data-tooltip-anchor
|
|
240
|
+
@keydown=${e=>i.dismiss(e)||x.escape(e)}>
|
|
241
|
+
${re({items:q,onToggle:e=>i.toggleSeries(e)})}
|
|
242
|
+
${te({fontFamily:i.fontFamily,id:v,ticks:O,max:D,area:j,axisTitle:d,description:a,formatTick:k.format,xLabels:u.map((e,t)=>({label:e,x:N(t,u.length,j).center})),interactive:x.interactive,keys:K},l`<g ${g(E.attach)}>${J}</g>`)}
|
|
243
|
+
${$(i)}
|
|
244
|
+
${ve(i)}
|
|
245
245
|
</div>
|
|
246
|
-
`}var We=`geen gegevens`;function Ge(e,t){let{controller:n,description:r}=t,{labels:
|
|
247
|
-
${e.segments.map(e=>
|
|
246
|
+
`}var We=`geen gegevens`;function Ge(e,t){let{controller:n,description:r}=t,{labels:i,axisTitle:a,unit:c,small:u=!1}=e,d=n.id,f=i.length;n.measure({width:!0,height:t.height??(u?`--chart-h-small`:`--chart-h-main`),fit:!!t.expanded&&!t.mobile});let p=He(e.series.length,e.color),h=e.series.map((e,t)=>({...e,color:p[Math.min(t,p.length-1)],hidden:n.hiddenSeries.includes(e.label)})),_=h.filter(e=>!e.hidden),v=Le(n,h.map(e=>e.label).join(`\0`),h.map(e=>+!e.hidden)),y=v.some((e,t)=>e!==+!h[t].hidden),b=Re(n),x=h.map(()=>i.map(()=>!1)),C=h.map(()=>i.map(()=>0)),w=h.map(()=>i.map(()=>0)),T=i.map(()=>!1);i.forEach((e,t)=>{let n=0;h.forEach((e,r)=>{if(v[r]===0)return;let i=e.values[t];T[t]||i==null?T[t]=!0:(x[r][t]=!0,C[r][t]=n,n+=i*v[r],w[r][t]=n)})});let E=v.some(e=>e>0),D=i.map((e,t)=>h.map(e=>e.values[t]).filter(e=>e!=null)).filter(e=>e.length>0).map(e=>e.reduce((e,t)=>e+t,0)),{max:O,ticks:k}=z(Math.max(...D,1)),A=L(k,n.width,{fontFamily:n.fontFamily,minimum:Math.ceil(S(i[0]??``,n.fontFamily)/2)}),j=ce(t,{left:A.width}),M=j.height-j.bottom,N=e=>B(e,f,j),F=e=>Z(e,O,j),I=e=>{let t=[];return i.forEach((n,r)=>{if(!e(r))return;let i=t[t.length-1];i&&i[i.length-1]===r-1?i.push(r):t.push([r])}),t},R=i.map((e,t)=>{let n=0;for(let e of _){let r=e.values[t];if(r==null)return{level:n,complete:!1};n+=r}return{level:n,complete:_.length>0}}),V=h.map(e=>({label:e.label,color:e.color,shape:`square`,hidden:e.hidden,fixed:h.length<2})),H=Math.max(1,Math.ceil(f/8)),U=i.map((e,t)=>({label:e,x:N(t),i:t})).filter(e=>e.i%H===0),W=_.length<h.length?`Totaal getoond`:`Totaal`;function G(e){return{title:i[e],rows:[...[..._].reverse().map(t=>({label:t.label,value:t.values[e]==null?We:s(t.values[e]),color:t.color})),..._.length>0?[{label:W,value:R[e].complete?s(R[e].level):We,divider:!0}]:[]]}}let K=_e(n,f,e=>({x:N(e),y:R[e].level>0?F(R[e].level):j.top,content:G(e)})),q=e=>{let t=[0,0];return h.forEach((n,r)=>{x[r][e]&&x[r][e+1]&&(t=[w[r][e],w[r][e+1]])}),t},J=(E?I(e=>T[e]):[]).map(e=>{let t=Math.max(0,e[0]-1),r=Math.min(f-1,e[e.length-1]+1),i=Array.from({length:r-t},(e,n)=>t+n).map(e=>{let[t,n]=q(e);return{k:e,left:F(t),right:F(n)}}),a=N(t),o=N(r)-a,s=Math.min(M,...i.flatMap(e=>[e.left,e.right]));return{segments:i,from:a,width:o,ceiling:s,fits:S(We,n.fontFamily)+8<=o&&s-j.top>=20}}),Y=(e,t)=>t.map(t=>`${N(t)},${F(e[t])}`),ee=[J.map(e=>l`
|
|
247
|
+
${e.segments.map(e=>l`<polygon fill="url(#hatch-${d})"
|
|
248
248
|
points=${`${N(e.k)},${j.top} ${N(e.k+1)},${j.top} ${N(e.k+1)},${e.right} ${N(e.k)},${e.left}`} />`)}
|
|
249
|
-
${e.fits?
|
|
249
|
+
${e.fits?l`<text x=${e.from+e.width/2} y=${(j.top+e.ceiling)/2+4}
|
|
250
250
|
text-anchor="middle"
|
|
251
|
-
class="lintje-chart__as-of-note lintje-chart__data-label--halo">${We}</text>`:
|
|
252
|
-
`),
|
|
253
|
-
${h.map((e,t)=>{let n=I(e=>
|
|
254
|
-
${n.map(n=>n.length===1?
|
|
251
|
+
class="lintje-chart__as-of-note lintje-chart__data-label--halo">${We}</text>`:o}
|
|
252
|
+
`),l`<g class="lintje-chart__reveal" ${g(b.attach)}>
|
|
253
|
+
${h.map((e,t)=>{let n=I(e=>x[t][e]);return l`<g>
|
|
254
|
+
${n.map(n=>n.length===1?l`<circle cx=${N(n[0])} cy=${F(w[t][n[0]])} r="2.5" fill=${e.color} />`:l`<polygon fill=${e.color}
|
|
255
255
|
points=${[...Y(w[t],n),...Y(C[t],n).reverse()].join(` `)} />`)}
|
|
256
256
|
</g>`})}
|
|
257
257
|
<!-- Between two parts a 1 px line in the surface: along each part's lower edge, not the floor. -->
|
|
258
|
-
${h.map((e,t)=>I(e=>
|
|
259
|
-
</g>`,n.hoverIndex!=null&&!y?h.map((e,t)=>
|
|
260
|
-
cx=${N(n.hoverIndex)} cy=${F(w[t][n.hoverIndex])} />`:
|
|
258
|
+
${h.map((e,t)=>I(e=>x[t][e]&&C[t][e]>0).filter(e=>e.length>1).map(e=>l`<polyline class="lintje-chart__segment" fill="none" points=${Y(C[t],e).join(` `)} />`))}
|
|
259
|
+
</g>`,n.hoverIndex!=null&&!y?h.map((e,t)=>x[t][n.hoverIndex]?l`<circle class="lintje-chart__hover-point" r="4" fill=${e.color}
|
|
260
|
+
cx=${N(n.hoverIndex)} cy=${F(w[t][n.hoverIndex])} />`:o):o,i.map((e,t)=>{let r=P(j)/Math.max(1,f-1);return l`
|
|
261
261
|
<rect x=${N(t)-r/2} y=${j.top} width=${r}
|
|
262
262
|
height=${M-j.top}
|
|
263
263
|
fill="transparent"
|
|
264
264
|
@mousemove=${e=>n.hoverAt(t,e,G(t))}
|
|
265
265
|
@mouseleave=${()=>n.hoverAt(null)} />
|
|
266
|
-
`})];return
|
|
267
|
-
<div class="lintje-chart-wrap ${
|
|
268
|
-
${
|
|
266
|
+
`})];return m`
|
|
267
|
+
<div class="lintje-chart-wrap ${u?`lintje-chart--small`:``}"
|
|
268
|
+
${g(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
269
269
|
@keydown=${e=>n.dismiss(e)}>
|
|
270
270
|
${re({items:V,onToggle:e=>n.toggleSeries(e)})}
|
|
271
|
-
${te({fontFamily:n.fontFamily,id:
|
|
271
|
+
${te({fontFamily:n.fontFamily,id:d,ticks:k,max:O,area:j,formatTick:A.format,axisTitle:a??c,xLabels:U,description:r,keys:K},ee)}
|
|
272
272
|
${$(n)}
|
|
273
273
|
${ve(n)}
|
|
274
274
|
</div>
|
|
275
|
-
`}var Ke=5,qe=e=>{let t=e.label.toLowerCase();return t.startsWith(`overig`)||t===`rest`},Je=e=>!e.remainder&&!qe(e);function Ye(e){let t=e.filter(Je).sort((e,t)=>t.value-e.value),n=e.filter(e=>!e.remainder&&qe(e)),r=e.filter(e=>e.remainder);if(t.length>Ke){let e=t.splice(4).reduce((e,t)=>e+t.value,0);if(n.length>0){let[t]=n;n[0]={label:t.label,value:t.value+e,color:t.color}}else n.push({label:`Overig`,value:e})}return[...t,...n,...r]}function Xe(
|
|
275
|
+
`}var Ke=5,qe=e=>{let t=e.label.toLowerCase();return t.startsWith(`overig`)||t===`rest`},Je=e=>!e.remainder&&!qe(e);function Ye(e){let t=e.filter(Je).sort((e,t)=>t.value-e.value),n=e.filter(e=>!e.remainder&&qe(e)),r=e.filter(e=>e.remainder);if(t.length>Ke){let e=t.splice(4).reduce((e,t)=>e+t.value,0);if(n.length>0){let[t]=n;n[0]={label:t.label,value:t.value+e,color:t.color}}else n.push({label:`Overig`,value:e})}return[...t,...n,...r]}function Xe(t,n){let{controller:i,description:a}=n,{donut:c=!1,centerValue:u,centerLabel:d,legendTable:f=!0,labelHeader:p=`Categorie`}=t,h=i.id,_=Ye(t.segments).map(e=>({...e,color:oe(e.color)})),v=_.map(e=>e.href?{id:e.id??e.label,href:e.href}:null),y=Oe(n,v),b=e=>{let t=y.of(v[e],_[e].label,_[e].label).state;return t.includes(`is-selected`)?`is-selected`:t.includes(`is-muted`)?`is-muted`:``},x=!!n.expanded;i.measure(x?{width:!0,height:`--chart-h-main`,fit:!f}:{});let S=x?Math.max(240,Math.min(560,i.height-24)):t.size??200,C=_.reduce((e,t)=>e+t.value,0),w=S/2,T=c?w*.62:0,E=He(_.filter(Je).length,t.color),D=-1,O=_.map(e=>(Je(e)&&(D+=1),e.color??(e.remainder?`var(--color-chart-remainder)`:qe(e)?`var(--color-chart-other)`:E[Math.min(D,E.length-1)]))),k=(e,t)=>[w+t*Math.cos(e*Math.PI/180),w+t*Math.sin(e*Math.PI/180)],A=-90,j=_.map((e,t)=>{let n=e.value/C,r=A,i=A+n*360;A=i;let a=+(n>.5),[o,s]=k(r,w),[l,u]=k(i,w);return{segment:e,i:t,d:c?(()=>{let[e,t]=k(i,T),[n,c]=k(r,T);return`M ${o} ${s} A ${w} ${w} 0 ${a} 1 ${l} ${u} L ${e} ${t} A ${T} ${T} 0 ${a} 0 ${n} ${c} Z`})():`M ${w} ${w} L ${o} ${s} A ${w} ${w} 0 ${a} 1 ${l} ${u} Z`,color:O[t],middle:(r+i)/2}}),M=i.hoverIndex,N=M==null?void 0:j[M],P=e=>{i.hoverIndex=e,i.requestUpdate()},F=e=>`${s(e.value)} · ${r(e.value/C*100)}`,I=e=>({title:_[e].label,rows:[{label:`Aantal`,value:F(_[e]),color:O[e]}]}),L=_e(i,j.length,e=>{let[t,n]=k(j[e].middle,(w+T)/2);return{x:t,y:n,content:I(e)}});return m`
|
|
276
276
|
<div class="lintje-pie-chart ${x?`lintje-pie-chart--expanded`:``} ${f?``:`lintje-pie-chart--legend`}"
|
|
277
|
-
${
|
|
278
|
-
@keydown=${e=>
|
|
279
|
-
${f?
|
|
277
|
+
${g(i.attach)} ?data-in-view=${i.inView} data-tooltip-anchor
|
|
278
|
+
@keydown=${e=>i.dismiss(e)||y.escape(e)}>
|
|
279
|
+
${f?o:re({items:_.map((e,t)=>({label:e.label,color:O[t],key:String(t)})),onEmphasis:e=>P(e==null?null:Number(e))})}
|
|
280
280
|
<svg viewBox="0 0 ${S} ${S}" width=${S} height=${S} role=${X(y.interactive)}
|
|
281
|
-
class="lintje-pie-chart__svg" aria-labelledby="${h}-desc" ${
|
|
281
|
+
class="lintje-pie-chart__svg" aria-labelledby="${h}-desc" ${e(q(h))}
|
|
282
282
|
tabindex="0" @keydown=${L.keydown} @focus=${L.focus} @blur=${L.blur}>
|
|
283
283
|
<desc id="${h}-desc">${a}</desc>
|
|
284
|
-
<defs
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
284
|
+
<defs>
|
|
285
|
+
${U(h)}
|
|
286
|
+
<!-- The draw-in: a ring as wide as the pie, its dash swept from twelve o'clock clockwise,
|
|
287
|
+
as the slices run. Past the edge, so a lifted slice is never cut off. -->
|
|
288
|
+
<mask id="${h}-sweep" maskUnits="userSpaceOnUse" x=${-w} y=${-w} width=${S*2} height=${S*2}>
|
|
289
|
+
<circle class="lintje-pie-chart__sweep" cx=${w} cy=${w} r=${w*.55}
|
|
290
|
+
fill="none" stroke="white" stroke-width=${w*1.1} pathLength="1"
|
|
291
|
+
transform="rotate(-90 ${w} ${w})" />
|
|
292
|
+
</mask>
|
|
293
|
+
</defs>
|
|
294
|
+
<g mask="url(#${h}-sweep)">
|
|
295
|
+
${j.map(({segment:t,i:n,d:r,color:a})=>{let o=y.of(v[n],t.label,`${t.label}: ${F(t)}`);return l`
|
|
296
|
+
<path d=${r} fill=${a}
|
|
297
|
+
class="lintje-pie-chart__segment lintje-chart__mark lintje-chart__segment ${M===n?`is-hovered`:``} ${o.state}"
|
|
298
|
+
${e({"transform-origin":`${w}px ${w}px`})}
|
|
299
|
+
data-mark-id=${o.markId} role=${o.role} tabindex=${o.tabIndex}
|
|
300
|
+
aria-pressed=${o.pressed} aria-label=${o.label}
|
|
301
|
+
@click=${o.click} @auxclick=${o.click} @keydown=${o.keydown}
|
|
302
|
+
@mousemove=${e=>{i.hoverIndex=n,i.showTooltip(e,I(n))}}
|
|
303
|
+
@mouseleave=${()=>{i.hoverIndex=null,i.hideTooltip(),i.requestUpdate()}} />
|
|
294
304
|
`})}
|
|
305
|
+
</g>
|
|
295
306
|
<!-- The hovered segment once more on top, lifted with a light shadow: in place, the
|
|
296
307
|
next segment would cover that shadow on one side (user test 13 Sep). -->
|
|
297
|
-
${N?
|
|
298
|
-
${
|
|
299
|
-
${
|
|
300
|
-
<text x=${w} y=${w+2} text-anchor="middle" class="lintje-pie-chart__center">${
|
|
301
|
-
${
|
|
302
|
-
`:
|
|
308
|
+
${N?l`<path d=${N.d} fill=${N.color} class="lintje-pie-chart__lift lintje-chart__segment"
|
|
309
|
+
${e({"transform-origin":`${w}px ${w}px`})} aria-hidden="true" />`:o}
|
|
310
|
+
${c&&u?l`
|
|
311
|
+
<text x=${w} y=${w+2} text-anchor="middle" class="lintje-pie-chart__center">${u}</text>
|
|
312
|
+
${d?l`<text x=${w} y=${w+20} text-anchor="middle" class="lintje-chart__axis-label">${d}</text>`:o}
|
|
313
|
+
`:o}
|
|
303
314
|
</svg>
|
|
304
315
|
|
|
305
|
-
${f?
|
|
316
|
+
${f?m`
|
|
306
317
|
<table class="lintje-pie-chart__table">
|
|
307
318
|
<caption class="visually-hidden">Legenda: ${a}</caption>
|
|
308
319
|
<thead>
|
|
309
320
|
<tr>
|
|
310
|
-
<th scope="col" class="lintje-pie-chart__column-label">${
|
|
321
|
+
<th scope="col" class="lintje-pie-chart__column-label">${p}</th>
|
|
311
322
|
<th scope="col" class="lintje-pie-chart__column-label lintje-pie-chart__column-label--numeric">aantal</th>
|
|
312
323
|
<th scope="col" class="lintje-pie-chart__column-label lintje-pie-chart__column-label--numeric">%</th>
|
|
313
324
|
</tr>
|
|
314
325
|
</thead>
|
|
315
326
|
<tbody>
|
|
316
|
-
${_.map((
|
|
327
|
+
${_.map((t,n)=>m`
|
|
317
328
|
<tr class="lintje-pie-chart__row ${M===n?`is-hovered`:``} ${b(n)}"
|
|
318
329
|
@mouseenter=${()=>P(n)} @mouseleave=${()=>P(null)}>
|
|
319
330
|
<th scope="row" class="lintje-pie-chart__label">
|
|
320
331
|
<span class="lintje-pie-chart__label-inner">
|
|
321
|
-
<span class="lintje-pie-chart__marker" ${
|
|
332
|
+
<span class="lintje-pie-chart__marker" ${e({background:O[n]})}></span>${t.label}
|
|
322
333
|
</span>
|
|
323
334
|
</th>
|
|
324
|
-
<td class="lintje-pie-chart__value">${
|
|
325
|
-
<td class="lintje-pie-chart__value">${t
|
|
335
|
+
<td class="lintje-pie-chart__value">${s(t.value)}</td>
|
|
336
|
+
<td class="lintje-pie-chart__value">${r(t.value/C*100)}</td>
|
|
326
337
|
</tr>
|
|
327
338
|
`)}
|
|
328
339
|
</tbody>
|
|
329
340
|
<tfoot>
|
|
330
341
|
<tr>
|
|
331
342
|
<th scope="row" class="lintje-pie-chart__total-label">Totaal</th>
|
|
332
|
-
<td class="lintje-pie-chart__total">${
|
|
343
|
+
<td class="lintje-pie-chart__total">${s(C)}</td>
|
|
333
344
|
<td class="lintje-pie-chart__total"></td>
|
|
334
345
|
</tr>
|
|
335
346
|
</tfoot>
|
|
336
347
|
</table>
|
|
337
|
-
`:
|
|
338
|
-
${$(
|
|
339
|
-
${ve(
|
|
348
|
+
`:o}
|
|
349
|
+
${$(i)}
|
|
350
|
+
${ve(i)}
|
|
340
351
|
</div>
|
|
341
|
-
`}function Ze(
|
|
342
|
-
<div class="lintje-chart-wrap ${
|
|
343
|
-
${
|
|
344
|
-
@keydown=${e=>
|
|
345
|
-
${re({items:A,onToggle:e=>
|
|
352
|
+
`}function Ze(t,n){let{controller:r,description:i}=n,{labels:a,threshold:c,thresholdLabel:u,small:d=!1,pendingHours:f=0}=t,p={...t.left,color:oe(t.left.color)},h={...t.right,color:oe(t.right.color)},_=r.id;r.measure({width:!0,height:n.height??(d?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let v=p.color??`var(--color-chart-default)`,y=h.color??`var(--color-chart-dark-yellow)`,b=z(Math.max(...p.values.filter(e=>e!=null),1)),x=z(Math.max(...h.values.filter(e=>e!=null),c??0,1)),S=L(b.ticks,r.width,{fontFamily:r.fontFamily}),C=L(x.ticks,r.width,{fontFamily:r.fontFamily}),w=ce(n,{left:S.width,right:C.width}),T=w.height-w.bottom,E=r.hiddenSeries.includes(`left`),D=r.hiddenSeries.includes(`right`),O=r.hiddenSeries.includes(Y),k=e=>`lintje-chart__series ${e?`is-off`:``}`,A=[{key:`left`,label:`${p.label} (linkeras)`,color:v,shape:`square`,hidden:E},{key:`right`,label:`${h.label} (rechteras)`,color:y,shape:`line`,hidden:D},...c==null?[]:[{key:Y,label:u??`Norm ${c}`,color:`var(--color-chart-emphasis)`,shape:`dashed`,hidden:O}]],j=Math.max(1,Math.ceil(a.length/8)),M=r.hoverIndex,P=ae(y),F=[[]];h.values.forEach((e,t)=>{e==null?F[F.length-1].length&&F.push([]):F[F.length-1].push(`${N(t,a.length,w).center},${Z(e,x.max,w)}`)});let I=(e,t)=>e==null?`geen gegevens`:`${s(e)}${t?` ${t}`:``}`,R=e=>({title:a[e],rows:[...E?[]:[{label:p.label,value:I(p.values[e],p.unit),color:v}],...D?[]:[{label:h.label,value:I(h.values[e],h.unit),color:y}]]}),B=_e(r,a.length,e=>({x:N(e,a.length,w).center,y:Math.min(E||p.values[e]==null?T:Z(p.values[e],b.max,w),D||h.values[e]==null?T:Z(h.values[e],x.max,w)),content:R(e)}));return m`
|
|
353
|
+
<div class="lintje-chart-wrap ${d?`lintje-chart--small`:``}"
|
|
354
|
+
${g(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
355
|
+
@keydown=${e=>r.dismiss(e)}>
|
|
356
|
+
${re({items:A,onToggle:e=>r.toggleSeries(e)})}
|
|
346
357
|
<figure class="lintje-chart">
|
|
347
358
|
<svg viewBox="0 0 ${w.width} ${w.height}" class="lintje-chart__svg" role=${X(!1)}
|
|
348
359
|
aria-labelledby="${_}-desc" width=${w.width} height=${w.height}
|
|
349
360
|
tabindex="0" @keydown=${B.keydown} @focus=${B.focus} @blur=${B.blur}>
|
|
350
|
-
<desc id="${_}-desc">${
|
|
361
|
+
<desc id="${_}-desc">${i}</desc>
|
|
351
362
|
<defs>
|
|
352
363
|
<pattern id="hatch-${_}" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
|
353
364
|
<line x1="0" y1="0" x2="0" y2="6" stroke="var(--color-chart-hatch)" stroke-width="2" />
|
|
354
365
|
</pattern>
|
|
355
366
|
</defs>
|
|
356
367
|
<!-- Incomplete hours at the end: hatched, never drawn as zero. -->
|
|
357
|
-
${f>0?(()=>{let e=N(a.length-f,a.length,w);return
|
|
368
|
+
${f>0?(()=>{let e=N(a.length-f,a.length,w);return l`<rect x=${e.x-(e.bandWidth-e.width)/2} y=${w.top}
|
|
358
369
|
width=${w.width-w.right-e.x+(e.bandWidth-e.width)/2}
|
|
359
|
-
height=${T-w.top} fill="url(#hatch-${_})" />`})():
|
|
370
|
+
height=${T-w.top} fill="url(#hatch-${_})" />`})():o}
|
|
360
371
|
|
|
361
|
-
${b.ticks.map(e=>{let t=Z(e,b.max,w),n=e===0;return
|
|
372
|
+
${b.ticks.map(e=>{let t=Z(e,b.max,w),n=e===0;return l`
|
|
362
373
|
<g>
|
|
363
374
|
<line x1=${w.left} x2=${w.width-w.right} y1=${t} y2=${t}
|
|
364
375
|
stroke=${n?`var(--color-chart-zero)`:`var(--color-chart-grid)`}
|
|
@@ -368,7 +379,7 @@ import{R as e,_ as t,cn as n,d as r,dn as i,f as a,g as o,h as s,jt as c,k as l,
|
|
|
368
379
|
</text>
|
|
369
380
|
</g>
|
|
370
381
|
`})}
|
|
371
|
-
${x.ticks.map(e=>
|
|
382
|
+
${x.ticks.map(e=>l`
|
|
372
383
|
<text x=${w.width-w.right+8} y=${Z(e,x.max,w)+4}
|
|
373
384
|
class="lintje-chart__axis-label" fill=${`var(--color-chart-dark-yellow-text)`}>${C.format(e)}</text>
|
|
374
385
|
`)}
|
|
@@ -381,139 +392,139 @@ import{R as e,_ as t,cn as n,d as r,dn as i,f as a,g as o,h as s,jt as c,k as l,
|
|
|
381
392
|
<!-- Bars grow in one after another; the hit areas below sit on top, so hover comes
|
|
382
393
|
from hoverIndex rather than :hover. -->
|
|
383
394
|
<g class=${k(E)}>
|
|
384
|
-
${
|
|
385
|
-
height=${Math.max(0,T-w.top)} fill="url(#hatch-${_})" />`;let
|
|
386
|
-
<g class="lintje-chart__bar-group ${M===
|
|
387
|
-
${
|
|
388
|
-
<rect class="lintje-chart__bar" x=${
|
|
389
|
-
height=${Math.max(0,T-
|
|
395
|
+
${p.values.map((t,n)=>{let r=N(n,a.length,w);if(t==null)return l`<rect class="lintje-chart__missing" x=${r.x} y=${w.top} width=${r.width}
|
|
396
|
+
height=${Math.max(0,T-w.top)} fill="url(#hatch-${_})" />`;let i=Z(t,b.max,w);return l`
|
|
397
|
+
<g class="lintje-chart__bar-group ${M===n?`is-hovered`:``}"
|
|
398
|
+
${e(Q(n,a.length))}>
|
|
399
|
+
<rect class="lintje-chart__bar" x=${r.x} y=${i} width=${r.width}
|
|
400
|
+
height=${Math.max(0,T-i)} fill=${v} />
|
|
390
401
|
</g>
|
|
391
402
|
`})}
|
|
392
403
|
</g>
|
|
393
404
|
|
|
394
|
-
${
|
|
395
|
-
y1=${Z(
|
|
405
|
+
${c==null?o:l`<line class=${k(O)} x1=${w.left} x2=${w.width-w.right}
|
|
406
|
+
y1=${Z(c,x.max,w)} y2=${Z(c,x.max,w)}
|
|
396
407
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="4 3" />`}
|
|
397
408
|
|
|
398
409
|
<g class=${k(D)}>
|
|
399
410
|
<g class="lintje-chart__reveal">
|
|
400
|
-
${F.filter(e=>e.length>0).map(e=>{let t=e.join(` `),[n,r]=e[0].split(`,`);return
|
|
401
|
-
${P&&e.length>1?
|
|
402
|
-
stroke=${P} points=${t} />`:
|
|
403
|
-
${e.length===1?
|
|
411
|
+
${F.filter(e=>e.length>0).map(e=>{let t=e.join(` `),[n,r]=e[0].split(`,`);return l`
|
|
412
|
+
${P&&e.length>1?l`<polyline class="lintje-chart__line lintje-chart__line--casing"
|
|
413
|
+
stroke=${P} points=${t} />`:o}
|
|
414
|
+
${e.length===1?l`<circle cx=${n} cy=${r} r="2.5" fill=${y} />`:l`<polyline class="lintje-chart__line" stroke=${y} points=${t} />`}
|
|
404
415
|
`})}
|
|
405
416
|
</g>
|
|
406
417
|
</g>
|
|
407
418
|
|
|
408
|
-
${a.filter((e,t)=>t%j===0).map((e,t)=>
|
|
419
|
+
${a.filter((e,t)=>t%j===0).map((e,t)=>l`
|
|
409
420
|
<text x=${N(t*j,a.length,w).center} y=${w.height-8}
|
|
410
421
|
text-anchor="middle" class="lintje-chart__axis-label">${e}</text>
|
|
411
422
|
`)}
|
|
412
423
|
|
|
413
424
|
<!-- Hover point on the right-axis line; no point for a missing value. -->
|
|
414
|
-
${M!=null&&!D&&h.values[M]!=null?
|
|
425
|
+
${M!=null&&!D&&h.values[M]!=null?l`<circle class="lintje-chart__hover-point" r="4" fill=${y}
|
|
415
426
|
cx=${N(M,a.length,w).center}
|
|
416
427
|
cy=${Z(h.values[M],x.max,w)} />
|
|
417
|
-
${ae(y)?
|
|
428
|
+
${ae(y)?l`<circle class="lintje-chart__hover-casing" r="4" stroke=${ae(y)}
|
|
418
429
|
cx=${N(M,a.length,w).center}
|
|
419
|
-
cy=${Z(h.values[M],x.max,w)} />`:
|
|
420
|
-
${a.map((e,t)=>{let
|
|
421
|
-
<rect x=${
|
|
430
|
+
cy=${Z(h.values[M],x.max,w)} />`:o}`:o}
|
|
431
|
+
${a.map((e,t)=>{let n=N(t,a.length,w);return l`
|
|
432
|
+
<rect x=${n.x} y=${w.top} width=${n.bandWidth} height=${T-w.top}
|
|
422
433
|
fill="transparent"
|
|
423
|
-
@mousemove=${e=>
|
|
424
|
-
@mouseleave=${()=>
|
|
434
|
+
@mousemove=${e=>r.hoverAt(t,e,R(t))}
|
|
435
|
+
@mouseleave=${()=>r.hoverAt(null)} />
|
|
425
436
|
`})}
|
|
426
437
|
</svg>
|
|
427
438
|
</figure>
|
|
428
|
-
${$(
|
|
429
|
-
${ve(
|
|
439
|
+
${$(r)}
|
|
440
|
+
${ve(r)}
|
|
430
441
|
</div>
|
|
431
|
-
`}var Qe=4.5,$e=5.5,et=44,tt=8,nt=(e,t)=>e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom;function rt(e,t,n,r){let i=5.5,a=[];for(let[o,s]of e.entries()){if(!t.includes(s.label))continue;let c=
|
|
442
|
+
`}var Qe=4.5,$e=5.5,et=44,tt=8,nt=(e,t)=>e.left<t.right&&t.left<e.right&&e.top<t.bottom&&t.top<e.bottom;function rt(e,t,n,r){let i=5.5,a=[];for(let[o,s]of e.entries()){if(!t.includes(s.label))continue;let c=S(s.label,r,700),l=s.y-9,u=l-12,d=l+3,f=[{anchor:`end`,x:s.x-tt,left:s.x-tt-c},{anchor:`start`,x:s.x+tt,left:s.x+tt}].map(e=>({...e,right:e.left+c,top:u,bottom:d})).find(t=>t.left>=n.left&&t.right<=n.width-n.right&&t.top>=0&&a.every(e=>!nt(t,e))&&e.every((e,n)=>n===o||!nt(t,{left:e.x-i,right:e.x+i,top:e.y-i,bottom:e.y+i})));if(!f)return[];a.push({...f,label:s.label,y:l})}return a.map(({label:e,x:t,y:n,anchor:r})=>({label:e,x:t,y:n,anchor:r}))}var it=e=>e.charAt(0).toUpperCase()+e.slice(1),at=(e,t)=>`${s(e)}${t?` ${t}`:``}`;function ot(e){let t=new Set(e.series.map(e=>e.color).filter(R)),n=j.filter(e=>!t.has(e)),r=0;return e.series.map(e=>{let t=R(e.color)?e.color:n[r++%n.length];return{color:oe(e.color??t),symbol:t}})}function st(t,n){let{controller:r,description:i}=n,{axisTitle:a,unit:c,xTitle:u,xUnit:d,threshold:p,thresholdLabel:h,small:_=!1}=t,v=r.id;r.measure({width:!0,height:n.height??(_?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let y=ot(t),b=t.series.map((e,t)=>({...e,...y[t]})),x=e=>r.hiddenSeries.includes(e.label),S=b.flatMap((e,t)=>e.points.map((n,r)=>({point:n,row:e,key:`${t}:${r}`})).filter(e=>e.point.x!=null&&e.point.y!=null)).sort((e,t)=>e.point.x-t.point.x||e.point.y-t.point.y),C=S.filter(({row:e})=>!x(e)),T=new Map(C.map((e,t)=>[e.key,t])),E=r.hiddenSeries.includes(Y),D=z(Math.max(...S.map(({point:e})=>e.x),1),n.mobile?3:6),O=z(Math.max(...S.map(({point:e})=>e.y),p??0,1)),k=L(O.ticks,r.width,{fontFamily:r.fontFamily}),A=ce(n,{left:k.width,bottom:et}),j=e=>A.left+P(A)*e/D.max,M=D.ticks.map((e,t)=>({label:s(e),x:j(e),anchor:t===D.ticks.length-1?`end`:`middle`})),N=[...b.map(e=>({label:e.label,color:e.color,shape:`point`,symbol:e.symbol,hidden:x(e),fixed:b.length<2&&p==null})),...p==null?[]:[{key:Y,label:h??`Norm`,color:`var(--color-chart-emphasis)`,shape:`dashed`,hidden:E}]];function F(e){let{point:t,row:n}=C[e];return{title:t.label,rows:[{label:n.label,value:``,color:n.color,symbol:n.symbol},{label:it(u),value:at(t.x,d)},{label:it(a),value:at(t.y,c)}]}}let I=e=>({x:j(e.x),y:Z(e.y,O.max,A)}),R=e=>I(C[e].point),B=_e(r,C.length,e=>({...R(e),content:F(e)})),V=C.map(({point:e,row:t})=>e.href?{id:e.id??`${t.label} · ${e.label}`,href:e.href}:null),H=Oe(n,V),U=C.map(({point:e},t)=>H.of(V[t],e.label,he(F(t)))),W=rt(C.map((e,t)=>({label:e.point.label,...R(t)})),t.dataLabels??[],A,r.fontFamily),G=p==null?0:Z(p,O.max,A),K=r.hoverIndex==null?void 0:C[r.hoverIndex],q=e=>{let t=e.target.closest?.(`[data-point]`);if(t)return Number(t.getAttribute(`data-point`));let n=e.currentTarget,r=n.ownerSVGElement?.getBoundingClientRect(),i=r&&r.width>0?A.width/r.width:1,a=(e.clientX-(r?.left??0))*i,o=(e.clientY-(r?.top??0))*i,s=w(n,`--h-target`,48)/2,c=null,l=s;return C.forEach((e,t)=>{let{x:n,y:r}=R(t),i=Math.hypot(n-a,r-o);i<=l&&(c=t,l=i)}),c},ee=e=>{let t=q(e);t==null?(r.hoverIndex!=null||r.tooltip)&&r.hoverAt(null):r.hoverAt(t,e,F(t))},X=e=>{let t=q(e),n=t==null?null:U[t];n?.clickable&&n.click!==o&&n.click(e)},ne=K!=null&&U[r.hoverIndex]?.clickable,ie=[p==null?o:l`
|
|
432
443
|
<g class="lintje-chart__series ${E?`is-off`:``}">
|
|
433
444
|
<g class="lintje-chart__reference">
|
|
434
445
|
<line x1=${A.left} x2=${A.width-A.right} y1=${G} y2=${G}
|
|
435
446
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="3 3" />
|
|
436
447
|
<text x=${A.left+6} y=${G-6}
|
|
437
448
|
class="lintje-chart__axis-label lintje-chart__axis-label--halo">
|
|
438
|
-
${h??`norm ${at(
|
|
449
|
+
${h??`norm ${at(p,c)}`}
|
|
439
450
|
</text>
|
|
440
451
|
</g>
|
|
441
452
|
</g>
|
|
442
|
-
`,
|
|
453
|
+
`,l`<g @mousemove=${ee} @mouseleave=${()=>r.hoverAt(null)} @click=${X} @auxclick=${X}>
|
|
443
454
|
<rect class="lintje-chart__hit ${ne?`is-clickable`:``}"
|
|
444
455
|
x="0" y="0" width=${A.width} height=${A.height} />
|
|
445
456
|
<g>
|
|
446
|
-
${
|
|
447
|
-
<path class="lintje-chart__point lintje-chart__mark ${
|
|
448
|
-
${
|
|
449
|
-
d=${J(
|
|
450
|
-
stroke=${
|
|
451
|
-
data-point=${
|
|
452
|
-
data-mark-id=${
|
|
453
|
-
tabindex=${
|
|
454
|
-
aria-pressed=${
|
|
455
|
-
@keydown=${
|
|
457
|
+
${f(S,e=>e.key,({point:t,row:n,key:r},i)=>{let{x:a,y:s}=I(t),c=ae(n.color),u=T.get(r),d=u==null?void 0:U[u];return l`
|
|
458
|
+
<path class="lintje-chart__point lintje-chart__mark ${c?``:`lintje-chart__segment`} ${d?.state??`is-off`}"
|
|
459
|
+
${e(Q(i,S.length))}
|
|
460
|
+
d=${J(n.symbol,Qe,a,s)} fill=${n.color}
|
|
461
|
+
stroke=${c??o} stroke-width=${c?1:o}
|
|
462
|
+
data-point=${u??o}
|
|
463
|
+
data-mark-id=${d?.markId??o} role=${d?.role??o}
|
|
464
|
+
tabindex=${d?.tabIndex??o}
|
|
465
|
+
aria-pressed=${d?.pressed??o} aria-label=${d?.label??o}
|
|
466
|
+
@keydown=${d?.keydown??o} />
|
|
456
467
|
`})}
|
|
457
468
|
</g>
|
|
458
469
|
|
|
459
|
-
${W.map(e=>
|
|
470
|
+
${W.map(e=>l`
|
|
460
471
|
<text x=${e.x} y=${e.y} text-anchor=${e.anchor}
|
|
461
472
|
class="lintje-chart__data-label lintje-chart__data-label--halo">${e.label}</text>
|
|
462
473
|
`)}
|
|
463
474
|
|
|
464
475
|
<!-- The point under the pointer or the keyboard, raised with a ring in the surface. -->
|
|
465
|
-
${K?(()=>{let{x:e,y:t}=R(
|
|
466
|
-
<path class="lintje-chart__hover-point" d=${
|
|
467
|
-
${
|
|
468
|
-
`})():
|
|
469
|
-
</g>`];return
|
|
476
|
+
${K?(()=>{let{x:e,y:t}=R(r.hoverIndex),n=ae(K.row.color),i=J(K.row.symbol,$e,e,t);return l`
|
|
477
|
+
<path class="lintje-chart__hover-point" d=${i} fill=${K.row.color} />
|
|
478
|
+
${n?l`<path class="lintje-chart__hover-casing" d=${i} stroke=${n} />`:o}
|
|
479
|
+
`})():o}
|
|
480
|
+
</g>`];return m`
|
|
470
481
|
<div class="lintje-chart-wrap ${_?`lintje-chart--small`:``}"
|
|
471
|
-
${
|
|
472
|
-
@keydown=${e=>
|
|
473
|
-
${re({items:N,onToggle:e=>
|
|
474
|
-
${te({fontFamily:
|
|
475
|
-
${$(
|
|
476
|
-
${ve(
|
|
482
|
+
${g(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
483
|
+
@keydown=${e=>r.dismiss(e)||H.escape(e)}>
|
|
484
|
+
${re({items:N,onToggle:e=>r.toggleSeries(e)})}
|
|
485
|
+
${te({fontFamily:r.fontFamily,id:v,ticks:O.ticks,max:O.max,area:A,formatTick:k.format,axisTitle:a,xLabels:M,xTitle:u,description:i,interactive:H.interactive,keys:B},ie)}
|
|
486
|
+
${$(r)}
|
|
487
|
+
${ve(r)}
|
|
477
488
|
</div>
|
|
478
|
-
`}var ct=[`var(--color-chart-seq-1)`,`var(--color-chart-seq-2)`,`var(--color-chart-seq-3)`,`var(--color-chart-seq-4)`,`var(--color-chart-seq-5)`],lt=ct.length,ut=[1,2,2.5,5,10];function dt(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=10**Math.floor(Math.log10(e)),r=0,i=1/0;for(let a of ut){let o=a*n;if(t&&!Number.isInteger(o))continue;let s=Math.abs(Math.log(o/e));s<i&&(i=s,r=o)}return r||(t?1:n)}function ft(e,t){let n=Math.max(0,Math.min(10,-Math.floor(Math.log10(t))+1));return Number(e.toFixed(n))}function pt(e){let t=[];for(let n of e)for(let e of n??[])e!=null&&Number.isFinite(e)&&t.push(e);if(t.length===0)return[];let n=Math.min(...t),r=Math.max(...t);if(n===r)return[];let i=t.every(Number.isInteger),a=dt((r-n)/lt,i),o=Math.floor(n/a)*a,s=[];for(let e=1;e<lt;e+=1){let t=ft(o+e*a,a);if(t>r)break;s.push(t)}return s}function mt(e,t,n=0){let r=
|
|
479
|
-
<div class="lintje-heatmap" ${
|
|
489
|
+
`}var ct=[`var(--color-chart-seq-1)`,`var(--color-chart-seq-2)`,`var(--color-chart-seq-3)`,`var(--color-chart-seq-4)`,`var(--color-chart-seq-5)`],lt=ct.length,ut=[1,2,2.5,5,10];function dt(e,t){if(!(e>0)||!Number.isFinite(e))return 1;let n=10**Math.floor(Math.log10(e)),r=0,i=1/0;for(let a of ut){let o=a*n;if(t&&!Number.isInteger(o))continue;let s=Math.abs(Math.log(o/e));s<i&&(i=s,r=o)}return r||(t?1:n)}function ft(e,t){let n=Math.max(0,Math.min(10,-Math.floor(Math.log10(t))+1));return Number(e.toFixed(n))}function pt(e){let t=[];for(let n of e)for(let e of n??[])e!=null&&Number.isFinite(e)&&t.push(e);if(t.length===0)return[];let n=Math.min(...t),r=Math.max(...t);if(n===r)return[];let i=t.every(Number.isInteger),a=dt((r-n)/lt,i),o=Math.floor(n/a)*a,s=[];for(let e=1;e<lt;e+=1){let t=ft(o+e*a,a);if(t>r)break;s.push(t)}return s}function mt(e,t,n=0){let r=s(e,n),i=t?.trim()??``;return i?i===`%`?`${r}%`:`${r} ${i}`:r}function ht(e){let t=0;for(let n of e){let e=String(n),r=e.indexOf(`.`);r>=0&&(t=Math.max(t,e.length-r-1))}return Math.min(t,4)}function gt(e,t={}){let n=(t.bounds?.length?t.bounds.slice(0,lt-1):null)??pt(e),r=ht(n),i=e=>mt(e,t.unit,r),a=e=>s(e,r);if(n.length===0){let e=ct.length-1;return[{limit:1/0,color:ct[e],label:`alle waarden`,ramp:e}]}return[{limit:n[0],color:ct[0],label:`< ${i(n[0])}`,ramp:0},...n.slice(1).map((e,t)=>({limit:e,color:ct[t+1],label:`${a(n[t])}–${i(e)}`,ramp:t+1})),{limit:1/0,color:ct[n.length],label:`≥ ${i(n[n.length-1])}`,ramp:n.length}]}function _t(e,t){let n=e.findIndex(e=>t<e.limit);return n===-1?e.length-1:n}function vt(e,t,n){return Array.from({length:n},(n,r)=>Array.from({length:t},(t,n)=>e?.[n]?.[r]))}function yt(e){if(e.mobile)return e.mobile;let t=e.rowLabels.length,n=e.columnLabels.length;if(!(n<=t))return{columnLabels:e.rowLabels,rowLabels:e.columnLabels,values:vt(e.values,t,n),links:e.links?vt(e.links,t,n):void 0}}function bt(t,n){let{controller:r,description:i,mobile:a=!1}=n,c=a?yt(t):void 0,l=c?.columnLabels??t.columnLabels,u=c?.rowLabels??t.rowLabels,d=c?.values??t.values,f=c?c.links:t.links,p=c?!0:t.compact??!1,{unit:h}=t,_=Oe(n,(f??[]).flat()),v=gt(d,{bounds:t.bounds,unit:h}),y=e=>_t(v,e);r.measure({});let b=r.selectedCell,x=e=>`class-${e}`,S=e=>r.hiddenSeries.includes(x(v[e].ramp));return m`
|
|
490
|
+
<div class="lintje-heatmap" ${g(r.attach)} ?data-in-view=${r.inView}
|
|
480
491
|
data-tooltip-anchor @keydown=${_.escape}>
|
|
481
|
-
${re({items:v.map(e=>({key:x(e.ramp),label:e.label,color:e.color,shape:`square`,hidden:
|
|
482
|
-
<table class="lintje-heatmap__grid ${
|
|
483
|
-
<caption class="visually-hidden">${
|
|
492
|
+
${re({items:v.map(e=>({key:x(e.ramp),label:e.label,color:e.color,shape:`square`,hidden:r.hiddenSeries.includes(x(e.ramp)),fixed:v.length<2})),onToggle:e=>r.toggleSeries(e)})}
|
|
493
|
+
<table class="lintje-heatmap__grid ${p?`is-compact`:``}">
|
|
494
|
+
<caption class="visually-hidden">${i}</caption>
|
|
484
495
|
<thead>
|
|
485
496
|
<tr>
|
|
486
497
|
<td></td>
|
|
487
|
-
${l.map(e=>
|
|
498
|
+
${l.map(e=>m`<th scope="col" class="lintje-heatmap__column-label">${e}</th>`)}
|
|
488
499
|
</tr>
|
|
489
500
|
</thead>
|
|
490
501
|
<tbody>
|
|
491
|
-
${u.map((
|
|
502
|
+
${u.map((t,n)=>m`
|
|
492
503
|
<tr>
|
|
493
|
-
<th scope="row" class="lintje-heatmap__row-label" title=${
|
|
494
|
-
<span class="lintje-heatmap__row-label-text">${
|
|
504
|
+
<th scope="row" class="lintje-heatmap__row-label" title=${t}>
|
|
505
|
+
<span class="lintje-heatmap__row-label-text">${t}</span>
|
|
495
506
|
</th>
|
|
496
|
-
${l.map((
|
|
507
|
+
${l.map((i,a)=>{let o=d[n]?.[a];if(o==null)return m`
|
|
497
508
|
<td class="lintje-heatmap__slot">
|
|
498
509
|
<div class="lintje-heatmap__cell is-empty"
|
|
499
|
-
title="${
|
|
510
|
+
title="${t} · ${l[a]}: geen meting">
|
|
500
511
|
<span class="visually-hidden">geen meting</span>
|
|
501
512
|
</div>
|
|
502
513
|
</td>
|
|
503
|
-
`;let
|
|
514
|
+
`;let c=y(o),g=_.of(f?.[n]?.[a],`${t} · ${l[a]}`),x=!g.clickable&&b?.row===n&&b?.column===a;return m`
|
|
504
515
|
<td class="lintje-heatmap__slot">
|
|
505
516
|
<button
|
|
506
517
|
type="button"
|
|
507
|
-
class="lintje-heatmap__cell lintje-heatmap__cell--class-${v[
|
|
508
|
-
data-mark-id=${
|
|
509
|
-
${
|
|
510
|
-
@click=${
|
|
511
|
-
@auxclick=${
|
|
512
|
-
@mousemove=${
|
|
513
|
-
@mouseleave=${
|
|
514
|
-
aria-pressed=${
|
|
515
|
-
aria-label="${
|
|
516
|
-
>${o
|
|
518
|
+
class="lintje-heatmap__cell lintje-heatmap__cell--class-${v[c].ramp} ${x?`is-selected`:``} ${S(c)?`is-dimmed`:``} ${g.state}"
|
|
519
|
+
data-mark-id=${g.markId}
|
|
520
|
+
${e({"--lintje-cell":v[c].color,...ue(a,n,l.length,u.length)})}
|
|
521
|
+
@click=${g.clickable?g.click:()=>{r.selectedCell=x?null:{row:n,column:a},r.requestUpdate()}}
|
|
522
|
+
@auxclick=${g.click}
|
|
523
|
+
@mousemove=${p?void 0:e=>r.showTooltip(e,{title:`${t} · ${l[a]}`,rows:[{label:`klasse ${v[c].label}`,value:mt(o,h),color:v[c].color}]})}
|
|
524
|
+
@mouseleave=${p?void 0:()=>r.hideTooltip()}
|
|
525
|
+
aria-pressed=${g.clickable?g.pressed:x}
|
|
526
|
+
aria-label="${t} ${l[a]}: ${mt(o,h)}, klasse ${v[c].label}"
|
|
527
|
+
>${s(o)}</button>
|
|
517
528
|
</td>
|
|
518
529
|
`})}
|
|
519
530
|
</tr>
|
|
@@ -522,66 +533,66 @@ import{R as e,_ as t,cn as n,d as r,dn as i,f as a,g as o,h as s,jt as c,k as l,
|
|
|
522
533
|
</table>
|
|
523
534
|
|
|
524
535
|
<!-- Selected cell: a 48 px line with day, block, value, class. -->
|
|
525
|
-
${b&&d[b.row]?.[b.column]!=null?
|
|
536
|
+
${b&&d[b.row]?.[b.column]!=null?m`
|
|
526
537
|
<p class="lintje-heatmap__selection">
|
|
527
538
|
<b>${u[b.row]} ${l[b.column]}</b> ·
|
|
528
539
|
${mt(d[b.row][b.column],h)} · klasse
|
|
529
540
|
${v[y(d[b.row][b.column])].label}
|
|
530
541
|
</p>
|
|
531
|
-
`:
|
|
542
|
+
`:o}
|
|
532
543
|
|
|
533
|
-
${$(
|
|
544
|
+
${$(r)}
|
|
534
545
|
</div>
|
|
535
|
-
`}var xt=16,St=56,Ct=8,wt=18;function Tt(e){return
|
|
536
|
-
height=${Math.max(0,A-k.top)} fill="url(#hatch-${b})" />`;let
|
|
537
|
-
<g class="lintje-chart__bar-group" ${
|
|
538
|
-
<rect class="lintje-chart__bar lintje-chart__segment" x=${
|
|
539
|
-
height=${Math.max(0,A-
|
|
546
|
+
`}var xt=16,St=56,Ct=8,wt=18;function Tt(e){return s(e,+!Number.isInteger(e))}function Et(e,t){let n=t?` ${t}`:``;return e.to==null?`${Tt(e.from)}${n} of meer`:`${Tt(e.from)} tot ${Tt(e.to)}${n}`}function Dt(e,t,n=``){let r=t.width,i=e.map(e=>{let t=S(e.text,n,e.bold?700:400),i=e.x+6+t<=r;return{x:i?e.x+6:e.x-6,anchor:i?`start`:`end`,left:i?e.x+6:e.x-6-t,right:i?e.x+6+t:e.x-6}}),a=i.length===2?+(e[1].x>=e[0].x):-1,o=i.length===2&&i[0].left<i[1].right+Ct&&i[1].left<i[0].right+Ct;return i.map((e,n)=>({x:e.x,y:t.top+12+(o&&n===a?wt:0),anchor:e.anchor}))}function Ot(t,n){let{controller:i,description:a}=n,{bins:c,axisTitle:u,xTitle:d,unit:f,median:p,threshold:h,small:_=!1}=t,v=t.label??`Aantal`,y=oe(t.color)??`var(--color-chart-default)`,b=i.id,x=e=>f?`${e} ${f}`:e;i.measure({width:!0,height:n.height??(_?`--chart-h-small`:`--chart-h-main`),fit:!!n.expanded&&!n.mobile});let C=c.map(e=>e.count).filter(e=>e!=null),w=C.length===c.length?C.reduce((e,t)=>e+t,0):null,{max:T,ticks:E}=z(Math.max(...C,1)),D=L(E,i.width,{fontFamily:i.fontFamily}),O=ce(n),k=ce(n,{left:D.width,bottom:O.bottom+(d?xt:0)}),A=k.height-k.bottom,j=k.width-k.right,M=c[0]?.from??0,N=c[c.length-1],P=c.length>1?c[c.length-1].from-c[c.length-2].from:1,F=N?N.to??N.from+P:1,I=e=>k.left+(e-M)/Math.max(F-M,2**-52)*(j-k.left),R=c.map(e=>{let t=I(e.from),n=I(e.to??F)-t;return{x:t,width:n,center:t+n/2}}),B=e=>i.hiddenSeries.includes(e),V=B(v),H=e=>{let t=c[e].count;return{title:Et(c[e],f),rows:V?[]:[{label:v,value:t==null?`geen gegevens`:s(t),color:y},...t!=null&&w!=null&&w>0?[{label:`Aandeel`,value:r(t/w*100,1),color:y}]:[]]}},U=_e(i,c.length,e=>({x:R[e].center,y:c[e].count==null?k.top:Z(c[e].count,T,k),content:H(e)})),G=N?.to==null&&c.length>0,K=[...c.slice(0,G?-1:void 0).map(e=>e.from),...G?[]:N?[N.to]:[]].map(e=>({label:Tt(e),x:I(e)})),q=G?{label:`${Tt(N.from)}+`,x:R[R.length-1].center}:null,J=K.length>1?(K[K.length-1].x-K[0].x)/(K.length-1):1,ee=Math.max(1,Math.ceil(St/J)),X=W(K.filter((e,t)=>t%ee===0),i.fontFamily),ie=(e,t)=>Math.abs(t.x-e.x)<(S(e.label,i.fontFamily)+S(t.label,i.fontFamily))/2+Ct,ae=G?q:K[K.length-1];ae&&!X.includes(ae)&&(X.length&&ie(X[X.length-1],ae)&&(X=X.slice(0,-1)),G||(X=[...X,ae]));let se=G?N.from:F,le=e=>e!=null&&e>=M&&e<=se,ue=[...le(p)?[{key:ne,x:I(p),text:t.medianLabel??x(`mediaan ${Tt(p)}`),bold:!0,dashed:!1}]:[],...le(h)?[{key:Y,x:I(h),text:t.thresholdLabel??x(`norm ${Tt(h)}`),bold:!1,dashed:!0}]:[]],de=Dt(ue,k,i.fontFamily),fe=e=>e.charAt(0).toUpperCase()+e.slice(1),pe=[{label:v,color:y,shape:`square`,fixed:ue.length===0,hidden:V},...le(p)?[{label:fe(t.medianLabel??`Mediaan`),color:`var(--color-chart-emphasis)`,shape:`line`,key:ne,hidden:B(ne)}]:[],...le(h)?[{label:fe(t.thresholdLabel??`Norm`),color:`var(--color-chart-emphasis)`,shape:`dashed`,key:Y,hidden:B(Y)}]:[]],me=t=>{let n=R[t],r=c[t].count;if(r==null)return l`<rect class="lintje-chart__missing" x=${n.x} y=${k.top} width=${n.width}
|
|
547
|
+
height=${Math.max(0,A-k.top)} fill="url(#hatch-${b})" />`;let i=Z(r,T,k);return l`
|
|
548
|
+
<g class="lintje-chart__bar-group" ${e(Q(t,c.length))}>
|
|
549
|
+
<rect class="lintje-chart__bar lintje-chart__segment" x=${n.x} y=${i} width=${n.width}
|
|
550
|
+
height=${Math.max(0,A-i)} fill=${y} />
|
|
540
551
|
</g>
|
|
541
|
-
`},he=
|
|
552
|
+
`},he=i.hoverIndex,ge=he==null?null:c[he]?.count,ye=[l`<g class="lintje-chart__series ${V?`is-off`:``}">${c.map((e,t)=>me(t))}</g>`,he!=null&&ge!=null&&!V?l`<rect class="lintje-chart__bar lintje-chart__bar--lifted lintje-chart__segment"
|
|
542
553
|
x=${R[he].x} y=${Z(ge,T,k)} width=${R[he].width}
|
|
543
|
-
height=${Math.max(0,A-Z(ge,T,k))} fill=${y} />`:
|
|
554
|
+
height=${Math.max(0,A-Z(ge,T,k))} fill=${y} />`:o,X.map(e=>l`
|
|
544
555
|
<line x1=${e.x} x2=${e.x} y1=${A} y2=${A+4}
|
|
545
556
|
stroke="var(--color-chart-zero)" stroke-width="1" />
|
|
546
557
|
<text x=${e.x} y=${A+20} text-anchor="middle" class="lintje-chart__axis-label">${e.label}</text>
|
|
547
|
-
`),q?
|
|
558
|
+
`),q?l`<text x=${q.x} y=${A+20} text-anchor="middle" class="lintje-chart__axis-label">${q.label}</text>`:o,ue.map((e,t)=>{let n=de[t];return l`
|
|
548
559
|
<g class="lintje-chart__series ${B(e.key)?`is-off`:``}">
|
|
549
560
|
<g class="lintje-chart__reference">
|
|
550
561
|
<line x1=${e.x} x2=${e.x} y1=${k.top} y2=${A}
|
|
551
562
|
stroke="var(--color-chart-emphasis)" stroke-width=${e.dashed?1:1.5}
|
|
552
|
-
stroke-dasharray=${e.dashed?`3 3`:
|
|
563
|
+
stroke-dasharray=${e.dashed?`3 3`:o} />
|
|
553
564
|
<text x=${n.x} y=${n.y} text-anchor=${n.anchor}
|
|
554
565
|
class=${e.bold?`lintje-chart__data-label lintje-chart__data-label--halo`:`lintje-chart__axis-label lintje-chart__axis-label--halo`}>${e.text}</text>
|
|
555
566
|
</g>
|
|
556
567
|
</g>
|
|
557
|
-
`}),R.map((e,t)=>
|
|
568
|
+
`}),R.map((e,t)=>l`
|
|
558
569
|
<rect x=${e.x} y=${k.top} width=${e.width} height=${Math.max(0,A-k.top)}
|
|
559
570
|
fill="transparent"
|
|
560
|
-
@mousemove=${e=>
|
|
561
|
-
@mouseleave=${()=>
|
|
562
|
-
`)];return
|
|
571
|
+
@mousemove=${e=>i.hoverAt(t,e,H(t))}
|
|
572
|
+
@mouseleave=${()=>i.hoverAt(null)} />
|
|
573
|
+
`)];return m`
|
|
563
574
|
<div class="lintje-chart-wrap ${_?`lintje-chart--small`:``}"
|
|
564
|
-
${
|
|
565
|
-
@keydown=${e=>
|
|
566
|
-
${re({items:pe,onToggle:e=>
|
|
567
|
-
${te({fontFamily:
|
|
568
|
-
${$(
|
|
569
|
-
${ve(
|
|
575
|
+
${g(i.attach)} ?data-in-view=${i.inView} data-tooltip-anchor
|
|
576
|
+
@keydown=${e=>i.dismiss(e)}>
|
|
577
|
+
${re({items:pe,onToggle:e=>i.toggleSeries(e)})}
|
|
578
|
+
${te({fontFamily:i.fontFamily,id:b,ticks:E,max:T,area:k,axisTitle:u,xTitle:d,description:a,formatTick:D.format,keys:U},ye)}
|
|
579
|
+
${$(i)}
|
|
580
|
+
${ve(i)}
|
|
570
581
|
</div>
|
|
571
|
-
`}var kt=16,At=6,jt=18,Mt=16,Nt=3,Pt=4,Ft=8,It=40,Lt=.7,Rt=420,zt=12,Bt=2;function Vt(e){let t=new Set(e.series.map(e=>e.color).filter(R)),n=j.filter(e=>!t.has(e)),r=0;return e.series.map(t=>{let i=e.axes.map((e,n)=>t.values[n]??null);if(t.comparison)return{label:t.label,values:i,comparison:!0,color:`var(--color-chart-secondary)`};let a=R(t.color)?t.color:n[r++%n.length];return{label:t.label,values:i,comparison:!1,color:oe(t.color??a),symbol:a}})}function Ht(e){let t=e.length,n=e.findIndex(e=>e==null);if(n===-1)return{closed:!0,runs:[e.map((e,t)=>t)]};let r=[],i=[];for(let a=1;a<=t;a++){let o=(n+a)%t;e[o]==null?(i.length&&r.push(i),i=[]):i.push(o)}return i.length&&r.push(i),{closed:!1,runs:r}}function Ut(e,t=e/5){let n=[];for(let r=1;r*t<e-t*1e-6;r++)n.push(Math.round(r*t*1e6)/1e6);return[...n,e]}var Wt=e=>Number.isInteger(e)?0:String(e).split(`.`)[1]?.length??0;function Gt(e,t,n){let r=e.area??`emphasis`,i=t.filter(e=>!e.comparison);return new Set(i.filter(e=>e.complete&&r!==`never`&&(r===`always`||i.length===1||e.label===n)).map(e=>e.label))}function Kt(
|
|
582
|
+
`}var kt=16,At=6,jt=18,Mt=16,Nt=3,Pt=4,Ft=8,It=40,Lt=.7,Rt=420,zt=12,Bt=2;function Vt(e){let t=new Set(e.series.map(e=>e.color).filter(R)),n=j.filter(e=>!t.has(e)),r=0;return e.series.map(t=>{let i=e.axes.map((e,n)=>t.values[n]??null);if(t.comparison)return{label:t.label,values:i,comparison:!0,color:`var(--color-chart-secondary)`};let a=R(t.color)?t.color:n[r++%n.length];return{label:t.label,values:i,comparison:!1,color:oe(t.color??a),symbol:a}})}function Ht(e){let t=e.length,n=e.findIndex(e=>e==null);if(n===-1)return{closed:!0,runs:[e.map((e,t)=>t)]};let r=[],i=[];for(let a=1;a<=t;a++){let o=(n+a)%t;e[o]==null?(i.length&&r.push(i),i=[]):i.push(o)}return i.length&&r.push(i),{closed:!1,runs:r}}function Ut(e,t=e/5){let n=[];for(let r=1;r*t<e-t*1e-6;r++)n.push(Math.round(r*t*1e6)/1e6);return[...n,e]}var Wt=e=>Number.isInteger(e)?0:String(e).split(`.`)[1]?.length??0;function Gt(e,t,n){let r=e.area??`emphasis`,i=t.filter(e=>!e.comparison);return new Set(i.filter(e=>e.complete&&r!==`never`&&(r===`always`||i.length===1||e.label===n)).map(e=>e.label))}function Kt(t,n){let{controller:r,description:i,mobile:a=!1}=n,{axes:o,unit:c,threshold:l,small:u=!1}=t,d=o.length,f=Vt(t),p=e=>r.hiddenSeries.includes(e.label),h=r.hiddenSeries.includes(Y),_=f.length<2&&l==null,v=f.filter(e=>!p(e)),y=f.filter(e=>!e.comparison),b=v.filter(e=>!e.comparison),x=Math.min(2,Math.max(0,...f.flatMap(e=>e.values.filter(e=>e!=null)).map(Wt),...l==null?[]:[Wt(l)])),S=e=>s(e,x),C=e=>`${S(e)}${c?` ${c}`:``}`,w=e=>{let t=Math.round(e*10**x)/10**x;return t===0?S(0):`${t>0?`+`:`−`}${S(Math.abs(t))}`},T=b.length>1&&b.some(e=>e.label===r.emphasis)?r.emphasis:null,E=Gt(t,v.map(e=>({...e,complete:e.values.every(e=>e!=null)})),T),D=o.map((e,t)=>f.some(e=>e.values[t]==null)),O=t.dataLabels!==!1&&y.length===1,k=O&&!p(y[0]),A=[...f.map(e=>e.comparison?{label:e.label,color:e.color,shape:`line`,hidden:p(e),fixed:_}:{label:e.label,color:e.color,shape:`line`,symbol:e.symbol,hidden:p(e),fixed:_}),...l==null?[]:[{key:Y,label:t.thresholdLabel??`Norm ${C(l)}`,color:`var(--color-chart-emphasis)`,shape:`dashed`,hidden:h}],...D.some(Boolean)?[{label:`Geen gegevens`,shape:`hatch`,fixed:!0}]:[]];function j(e){let n=v.map(t=>{let n=t.values[e];return{label:t.label,value:n==null?`geen gegevens`:C(n),color:t.color,symbol:t.symbol,marker:t.comparison?`line`:void 0}});l!=null&&!h&&n.push({label:t.thresholdLabel??`Norm`,value:C(l),color:`var(--color-chart-emphasis)`,marker:`dashed`});let[r]=b,i=b.length===1?r.values[e]:null;if(i!=null){let t=v.find(e=>e.comparison),r=t?.values[e];t&&r!=null&&n.push({label:`t.o.v. ${t.label}`,value:w(i-r),divider:!0}),l!=null&&!h&&n.push({label:`t.o.v. norm`,value:w(i-l),divider:!(t&&r!=null)})}return{title:o[e],rows:n}}let{width:M,height:N,body:P,at:F}=(a?Jt:qt)({spec:t,controller:r,options:n,layers:f,shown:v,fills:E,emphasis:T,missing:D,reserve:O,labelled:k,hidden:p,normOff:h,format:S,contentAt:j}),I=_e(r,d,e=>({...F(e),content:j(e)}));return m`
|
|
572
583
|
<div class="lintje-chart-wrap ${u?`lintje-chart--small`:``}"
|
|
573
|
-
${
|
|
574
|
-
@keydown=${e=>
|
|
575
|
-
${re({items:A,onToggle:e=>
|
|
584
|
+
${g(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
585
|
+
@keydown=${e=>r.dismiss(e)}>
|
|
586
|
+
${re({items:A,onToggle:e=>r.toggleSeries(e),onEmphasis:y.length>1?e=>r.emphasise(e):void 0})}
|
|
576
587
|
<figure class="lintje-chart">
|
|
577
588
|
<svg viewBox="0 0 ${M} ${N}" width=${M} height=${N}
|
|
578
|
-
class="lintje-chart__svg lintje-radar ${
|
|
579
|
-
${
|
|
580
|
-
role=${X(!1)} aria-labelledby="${
|
|
589
|
+
class="lintje-chart__svg lintje-radar ${a?`lintje-radar--rows`:``}"
|
|
590
|
+
${e({height:`${N}px`})}
|
|
591
|
+
role=${X(!1)} aria-labelledby="${r.id}-desc" tabindex="0"
|
|
581
592
|
@keydown=${I.keydown} @focus=${I.focus} @blur=${I.blur}>
|
|
582
|
-
<desc id="${
|
|
593
|
+
<desc id="${r.id}-desc">${i}</desc>
|
|
583
594
|
<defs>
|
|
584
|
-
<pattern id="hatch-${
|
|
595
|
+
<pattern id="hatch-${r.id}" width="6" height="6" patternUnits="userSpaceOnUse"
|
|
585
596
|
patternTransform="rotate(45)">
|
|
586
597
|
<line x1="0" y1="0" x2="0" y2="6" stroke="var(--color-chart-hatch)" stroke-width="2" />
|
|
587
598
|
</pattern>
|
|
@@ -589,109 +600,109 @@ import{R as e,_ as t,cn as n,d as r,dn as i,f as a,g as o,h as s,jt as c,k as l,
|
|
|
589
600
|
${P}
|
|
590
601
|
</svg>
|
|
591
602
|
</figure>
|
|
592
|
-
${$(
|
|
593
|
-
${ve(
|
|
603
|
+
${$(r)}
|
|
604
|
+
${ve(r)}
|
|
594
605
|
</div>
|
|
595
|
-
`}function qt({spec:
|
|
596
|
-
<text x=${
|
|
597
|
-
${f?
|
|
598
|
-
<text x=${
|
|
599
|
-
class="lintje-chart__data-label lintje-radar__value ${
|
|
600
|
-
${
|
|
601
|
-
</g>`:
|
|
602
|
-
`}),q=(e,t)=>{let n=`lintje-chart__series ${m(e)?`is-off`:``}`,r=e.values.map((e,t)=>e==null?null:F(t,I(e)));if(t===`area`)return e.comparison||r.some(e=>e==null)?
|
|
603
|
-
<polygon class="lintje-radar__area ${
|
|
606
|
+
`}function qt({spec:t,controller:n,options:r,layers:i,shown:a,fills:c,emphasis:u,missing:d,reserve:f,labelled:p,hidden:m,normOff:h,format:g,contentAt:_}){let{axes:v,max:y,threshold:b,small:x=!1}=t,C=v.length,w=x?`--chart-h-small`:`--chart-h-main`;n.measure({width:!0,height:r.height??w,fit:!!r.expanded});let T=n.width,E=r.height??(r.expanded||x?n.height:Math.max(n.height,Math.min(Rt,Math.round(T*Lt)))),D=e=>-Math.PI/2+2*Math.PI*e/C,O=n.fontFamily,k=e=>S(e,O)*14/12,A=Math.max(0,...v.map((e,t)=>Math.abs(Math.cos(D(t)))<.1?0:k(e)+At+2)),j=24+(f?Mt:0),M=Math.max(It,Math.min(T/2-A-kt,E/2-j-kt)),N=T/2,P=E/2,F=(e,t)=>({x:N+t*Math.cos(D(e)),y:P+t*Math.sin(D(e))}),I=e=>Math.max(0,Math.min(e,y))/y*M,L=e=>e.map(e=>`${e.x},${e.y}`).join(` `),R=e=>L(v.map((t,n)=>F(n,I(e)))),z=Ut(y,t.step),B=Math.max(0,...z.map(Wt)),V=n.hoverIndex,H=e=>{let t=a.map(t=>t.values[e]).filter(e=>e!=null);return F(e,t.length?I(Math.max(...t)):M/2)},U=[...i.filter(e=>e.comparison),...i.filter(e=>!e.comparison)],W=e=>u!=null&&e.label!==u,G=e({"transform-origin":`${N}px ${P}px`}),K=v.map((e,t)=>{let n=Math.cos(D(t)),r=Math.sin(D(t)),a=F(t,M+kt+At),s=Math.abs(n)<.1,c=s?`middle`:n>0?`start`:`end`,u;u=s&&r<0?a.y-4-(f?Mt:0):s?a.y+12:f?a.y-2:a.y+5;let d=f?i.find(e=>!e.comparison)?.values[t]:void 0;return l`
|
|
607
|
+
<text x=${a.x} y=${u} text-anchor=${c} class="lintje-radar__name">${e}</text>
|
|
608
|
+
${f?l`<g class="lintje-chart__series ${p?``:`is-off`}">
|
|
609
|
+
<text x=${a.x} y=${u+Mt} text-anchor=${c}
|
|
610
|
+
class="lintje-chart__data-label lintje-radar__value ${d==null?`lintje-radar__no-value`:``}">
|
|
611
|
+
${d==null?`geen gegevens`:g(d)}</text>
|
|
612
|
+
</g>`:o}
|
|
613
|
+
`}),q=(e,t)=>{let n=`lintje-chart__series ${m(e)?`is-off`:``}`,r=e.values.map((e,t)=>e==null?null:F(t,I(e)));if(t===`area`)return e.comparison||r.some(e=>e==null)?o:l`<g class=${n}><g class="lintje-radar__layer" ${G}>
|
|
614
|
+
<polygon class="lintje-radar__area ${c.has(e.label)?`is-filled`:``}"
|
|
604
615
|
points=${L(r)} fill=${e.color} />
|
|
605
|
-
</g></g>`;let{closed:
|
|
606
|
-
${
|
|
607
|
-
<polyline class="lintje-chart__line" points=${
|
|
608
|
-
`}),
|
|
609
|
-
stroke=${
|
|
610
|
-
${
|
|
611
|
-
</g></g>`},Y=e=>{let t=M+kt,n=Math.PI/C,r=e=>`${N+t*Math.cos(e)},${P+t*Math.sin(e)}`;return`${N},${P} ${r(D(e)-n)} ${r(D(e))} ${r(D(e)+n)}`};return{width:T,height:E,body:[z.map(e=>
|
|
612
|
-
points=${`${N+
|
|
613
|
-
x1=${N} y1=${P} x2=${n.x} y2=${n.y} />`}),z.map(e=>{let t=F(0,I(e));return
|
|
614
|
-
class="lintje-chart__axis-label lintje-chart__axis-label--halo">${
|
|
616
|
+
</g></g>`;let{closed:i,runs:a}=Ht(e.values),s=e.comparison?void 0:ae(e.color),u=a.map(t=>{let n=t.map(e=>r[e]),a=L(i?[...n,n[0]]:n);return n.length===1?e.comparison?l`<circle cx=${n[0].x} cy=${n[0].y} r="2.5" fill=${e.color} />`:o:l`
|
|
617
|
+
${s?l`<polyline class="lintje-chart__line lintje-chart__line--casing" points=${a} stroke=${s} />`:o}
|
|
618
|
+
<polyline class="lintje-chart__line" points=${a} stroke=${e.color} />
|
|
619
|
+
`}),d=e.symbol?r.map(t=>t?l`<path d=${J(e.symbol,Nt,t.x,t.y)} fill=${e.color}
|
|
620
|
+
stroke=${s??o} stroke-width=${s?1:o} />`:o):o;return t===`lift`?l`<g class="lintje-radar__lift" aria-hidden="true">${u}${d}</g>`:l`<g class=${n}><g class="lintje-radar__layer ${W(e)?`is-muted`:``}" ${G}>
|
|
621
|
+
${u}${d}
|
|
622
|
+
</g></g>`},Y=e=>{let t=M+kt,n=Math.PI/C,r=e=>`${N+t*Math.cos(e)},${P+t*Math.sin(e)}`;return`${N},${P} ${r(D(e)-n)} ${r(D(e))} ${r(D(e)+n)}`};return{width:T,height:E,body:[z.map(e=>l`<polygon class="lintje-radar__ring" points=${R(e)} />`),d.map((e,t)=>{if(!e)return o;let r=D(t),i=-Math.sin(r)*5,a=Math.cos(r)*5,s=F(t,M);return l`<polygon class="lintje-radar__gap" fill="url(#hatch-${n.id})"
|
|
623
|
+
points=${`${N+i},${P+a} ${s.x+i},${s.y+a} ${s.x-i},${s.y-a} ${N-i},${P-a}`} />`}),v.map((e,t)=>{let n=F(t,M+kt);return l`<line class="lintje-radar__spoke ${V===t?`is-active`:``}"
|
|
624
|
+
x1=${N} y1=${P} x2=${n.x} y2=${n.y} />`}),z.map(e=>{let t=F(0,I(e));return l`<text x=${t.x+Ft/2} y=${t.y+4}
|
|
625
|
+
class="lintje-chart__axis-label lintje-chart__axis-label--halo">${s(e,B)}</text>`}),b==null?o:l`<g class="lintje-chart__series ${h?`is-off`:``}">
|
|
615
626
|
<polygon class="lintje-chart__reference lintje-radar__norm" points=${R(b)} />
|
|
616
|
-
</g>`,U.map(e=>q(e,`area`)),U.map(e=>q(e,`line`)),
|
|
617
|
-
<path class="lintje-chart__hover-point" d=${
|
|
618
|
-
${r?
|
|
619
|
-
`}),
|
|
620
|
-
${v.map((e,
|
|
621
|
-
@mousemove=${e=>
|
|
622
|
-
</g>`],at:H}}function Jt({spec:
|
|
623
|
-
<g class="lintje-radar__row ${A===
|
|
624
|
-
<text x="0" y=${
|
|
625
|
-
${a?
|
|
626
|
-
class="lintje-chart__data-label lintje-radar__value ${h==null?`lintje-radar__no-value`:``}">${y}</text></g>`:
|
|
627
|
-
${w?
|
|
628
|
-
class="lintje-chart__axis-label lintje-radar__value">onder norm</text></g>`:
|
|
629
|
-
${b.map(({layer:
|
|
630
|
-
fill="url(#hatch-${
|
|
631
|
-
width=${Math.max(0,E(
|
|
632
|
-
${
|
|
633
|
-
<line class="lintje-radar__zero" x1="0.5" x2="0.5" y1=${
|
|
634
|
-
${g==null?
|
|
627
|
+
</g>`,U.map(e=>q(e,`area`)),U.map(e=>q(e,`line`)),u==null?o:q(i.find(e=>e.label===u),`lift`),K,V==null?o:a.map(e=>{let t=e.values[V];if(t==null)return o;let n=F(V,I(t)),r=e.comparison?void 0:ae(e.color),i=J(e.symbol,Pt,n.x,n.y);return l`
|
|
628
|
+
<path class="lintje-chart__hover-point" d=${i} fill=${e.color} />
|
|
629
|
+
${r?l`<path class="lintje-chart__hover-casing" d=${i} stroke=${r} />`:o}
|
|
630
|
+
`}),l`<g @mouseleave=${()=>n.hoverAt(null)}>
|
|
631
|
+
${v.map((e,t)=>l`<polygon class="lintje-chart__hit" points=${Y(t)}
|
|
632
|
+
@mousemove=${e=>n.hoverAt(t,e,_(t))} />`)}
|
|
633
|
+
</g>`],at:H}}function Jt({spec:t,controller:n,layers:r,shown:i,reserve:a,labelled:c,hidden:u,normOff:d,format:f,contentAt:p}){let{axes:m,max:h,threshold:g}=t;n.measure({width:!0});let _=n.width,v=_-1,y=r.filter(e=>!e.comparison),b=[...y.map(e=>({layer:e,size:y.length===1?8:6})),...r.filter(e=>e.comparison).map(e=>({layer:e,size:4}))],x=b.reduce((e,t)=>e+t.size,0)+Bt*Math.max(0,b.length-1),C=22+x+zt,w=m.length*C,T=w+16,E=e=>.5+Math.max(0,Math.min(e,h))/h*v,D=n.fontFamily,O=r.find(e=>!e.comparison),k=i.find(e=>!e.comparison),A=n.hoverIndex,j=e=>{let t=k?.values[e];return{x:t==null?_/2:E(t),y:e*C+jt+4}},M=m.map((t,r)=>{let i=r*C,s=i+jt+4,h=a?O?.values[r]:void 0,y=a?h==null?`geen gegevens`:f(h):``,w=a&&h!=null&&g!=null&&h<g,T=`lintje-chart__series ${c?``:`is-off`}`,k=s;return l`
|
|
634
|
+
<g class="lintje-radar__row ${A===r?`is-active`:``}">
|
|
635
|
+
<text x="0" y=${i+14} class="lintje-radar__name">${t}</text>
|
|
636
|
+
${a?l`<g class=${T}><text x=${_} y=${i+14} text-anchor="end"
|
|
637
|
+
class="lintje-chart__data-label lintje-radar__value ${h==null?`lintje-radar__no-value`:``}">${y}</text></g>`:o}
|
|
638
|
+
${w?l`<g class=${T}><text x=${_-S(y,D,700)-6} y=${i+14} text-anchor="end"
|
|
639
|
+
class="lintje-chart__axis-label lintje-radar__value">onder norm</text></g>`:o}
|
|
640
|
+
${b.map(({layer:t,size:i})=>{let a=k;k+=i+Bt;let o=t.values[r],s=u(t)?`is-off`:``;return o==null?l`<rect class="lintje-radar__bar lintje-chart__series ${s}" x="0.5" y=${a} width=${v} height=${i}
|
|
641
|
+
fill="url(#hatch-${n.id})" />`:l`<rect class="lintje-chart__bar lintje-chart__bar--horizontal lintje-radar__bar lintje-chart__series ${s}" x="0.5" y=${a}
|
|
642
|
+
width=${Math.max(0,E(o)-.5)} height=${i} fill=${t.color}
|
|
643
|
+
${e(Q(r,m.length))} />`})}
|
|
644
|
+
<line class="lintje-radar__zero" x1="0.5" x2="0.5" y1=${s-2} y2=${s+x+2} />
|
|
645
|
+
${g==null?o:l`<g class="lintje-chart__series ${d?`is-off`:``}">
|
|
635
646
|
<line class="lintje-chart__reference lintje-radar__norm" x1=${E(g)} x2=${E(g)}
|
|
636
|
-
y1=${
|
|
647
|
+
y1=${s-3} y2=${s+x+3} />
|
|
637
648
|
</g>`}
|
|
638
|
-
<rect class="lintje-chart__hit" x="0" y=${
|
|
639
|
-
@mousemove=${e=>
|
|
649
|
+
<rect class="lintje-chart__hit" x="0" y=${i} width=${_} height=${C}
|
|
650
|
+
@mousemove=${e=>n.hoverAt(r,e,p(r))} />
|
|
640
651
|
</g>
|
|
641
|
-
`}),N=[0,...Ut(h,
|
|
652
|
+
`}),N=[0,...Ut(h,t.step)],P=Math.max(0,...N.map(Wt)),F=N.map((e,t)=>l`<text x=${E(e)} y=${w+12}
|
|
642
653
|
text-anchor=${t===0?`start`:t===N.length-1?`end`:`middle`}
|
|
643
|
-
class="lintje-chart__axis-label">${
|
|
644
|
-
<line class="lintje-chart__reference lintje-dumbbell__norm" x1=${
|
|
654
|
+
class="lintje-chart__axis-label">${s(e,P)}</text>`);return{width:_,height:T,body:l`<g @mouseleave=${()=>n.hoverAt(null)}>${M}</g>${F}`,at:j}}var Yt=`moment:from`,Xt=`moment:to`,Zt=28,Qt=44,$t=24,en=24,tn=14,nn=6,rn=4,an=2,on=5,sn=3,cn=10,ln=8,un=`geen gegevens`,dn=`buiten de as`;function fn(e,t=!1){return $t+e*(t?Qt:Zt)+en}var pn=e=>Number.isInteger(e)?0:String(e).split(`.`)[1]?.length??0;function mn(e){return Math.max(0,...e.flatMap(e=>[e.from,e.to]).filter(e=>e!=null).map(pn))}function hn(e,t){return e.from==null||e.to==null?null:Number((e.to-e.from).toFixed(t))||0}function gn(e){let t=e.rows.flatMap(e=>[e.from,e.to]).filter(e=>e!=null),n=z(Math.max(0,...t,e.threshold??0));if(e.min==null&&e.max==null)return{min:0,...n};let r=e.min??0,i=e.max!=null&&e.max>r?e.max:Math.max(n.max,r+1),a=z(i-r,5),o=a.ticks[1]-a.ticks[0],s=[];for(let e=Math.ceil(r/o-1e-9)*o;e<=i+1e-9;e+=o)s.push(Number(e.toFixed(6)));return{min:r,max:i,ticks:s}}function _n(e,t,n){let r=e.x+e.side*(t+an),i=r+e.side*on;return`M${r} ${n-sn}L${i} ${n}L${r} ${n+sn}Z`}function vn(t,n){let{controller:r,description:i,mobile:a=!1}=n,{rows:c,fromLabel:u,toLabel:d,threshold:f,unit:p}=t,h=r.id,_=oe(t.color)??`var(--color-chart-default)`,v=ae(_),y=!r.hiddenSeries.includes(Yt),b=!r.hiddenSeries.includes(Xt),x=f!=null&&!r.hiddenSeries.includes(`reference:threshold`),w=mn(c),T=Math.max(w,f==null?0:pn(f)),E=e=>s(e,w),D=e=>`${E(e)}${p?` ${p}`:``}`,O=(e,t=w)=>e===0?s(0,t):`${e>0?`+`:`−`}${s(Math.abs(e),t)}`,k=e=>Number((e-f).toFixed(T))||0,A=c.map(e=>hn(e,w)),j=fn(c.length,a);r.measure({width:!0,height:j});let M=r.width,N=r.fontFamily,P=a?Qt:Zt,{min:I,max:L,ticks:R}=gn(t),z=Math.max(0,...R.map(pn)),B=F(c.map(e=>e.label),M,{fontFamily:N}),V=Math.ceil(Math.max(S(`Verschil`,N),S(un,N),...A.map(e=>e==null?0:S(O(e),N,700)))),H=a?tn:B.barStart+tn,U=Math.max(H+40,M-V-ln-tn),W=e=>H+(Math.min(L,Math.max(I,e))-I)/(L-I)*(U-H),G=e=>e==null?null:{value:e,x:W(e),side:e<I?-1:+(e>L)},K=c.map(e=>({from:G(e.from),to:G(e.to)})),q=e=>$t+e*P+(a?31:Zt/2),J=$t+c.length*P,ee=c.map(e=>e.href?{id:e.id??e.label,href:e.href}:null),te=Oe(n,ee),ne=c.some(e=>e.from==null||e.to==null),ie=K.some(({from:e,to:t})=>e!=null&&e.side!==0||t!=null&&t.side!==0),se=[{key:Yt,label:u,shape:`ring`,color:`var(--color-chart-secondary)`,hidden:!y},{key:Xt,label:d,shape:`dot`,color:_,hidden:!b},...f==null?[]:[{key:Y,label:t.thresholdLabel??`Norm ${s(f,T)}`,color:`var(--color-chart-emphasis)`,shape:`dashed`,hidden:!x}],...ne?[{label:`Geen gegevens`,shape:`hatch`,fixed:!0}]:[],...ie?[{label:`Buiten de as`,shape:`off-axis`,color:`var(--color-text-muted)`,fixed:!0}]:[]],Z=(e,t,n,r,i)=>({label:e,value:t==null?un:D(t),marker:r,color:i,aside:n!=null&&n.side!==0?dn:void 0}),ce=e=>{let t=c[e],n=[];y&&n.push(Z(u,t.from,K[e].from,`ring`,`var(--color-chart-secondary)`)),b&&n.push(Z(d,t.to,K[e].to,`dot`,_));let r=y&&b?A[e]:null;return r!=null&&n.push({label:`Verschil`,value:O(r),divider:!0}),x&&b&&t.to!=null&&n.push({label:`t.o.v. norm`,value:O(k(t.to),T),divider:r==null}),{title:t.label,rows:n}},le=e=>{let t=[y?K[e].from:null,b?K[e].to:null].filter(e=>e!=null),n=t.length?t.map(e=>e.x):[H],r=a?0:2;return{x:Math.max(...n)+r,flip:Math.min(...n)-r,y:a?$t+(e+1)*P+12:q(e),content:ce(e)}},ue=_e(r,c.length,le),de=(e,t)=>{let n=e.currentTarget.ownerSVGElement,i=n?.closest(`[data-tooltip-anchor]`);if(!n||!i)return;let a=n.getBoundingClientRect(),o=a.left-i.getBoundingClientRect().left,s=le(t);r.hoverIndex=t,r.showTooltipAt(o+s.x,a.top-i.getBoundingClientRect().top+s.y,s.content,o+s.flip)},fe=f!=null&&f>=I&&f<=L?(()=>{let e=W(f),n=t.thresholdLabel??`norm ${s(f,T)}`,r=e+6+S(n,N)<=U+tn;return l`<g class="lintje-chart__series ${x?``:`is-off`}">
|
|
655
|
+
<line class="lintje-chart__reference lintje-dumbbell__norm" x1=${e} x2=${e}
|
|
645
656
|
y1=${20} y2=${J} />
|
|
646
|
-
<text x=${r?
|
|
657
|
+
<text x=${r?e+6:e-6} y=${15} text-anchor=${r?`start`:`end`}
|
|
647
658
|
class="lintje-chart__axis-label lintje-chart__reference">${n}</text>
|
|
648
|
-
</g>`})():
|
|
649
|
-
class="lintje-chart__axis-label">${
|
|
650
|
-
<g class="lintje-dumbbell__row ${
|
|
659
|
+
</g>`})():o,pe=[R.map(e=>l`<line class="lintje-dumbbell__grid" x1=${W(e)} x2=${W(e)} y1=${$t} y2=${J} />`),I<=0&&L>=0?l`<line class="lintje-dumbbell__zero" x1=${W(0)} x2=${W(0)} y1=${$t} y2=${J} />`:o,R.map(e=>l`<text x=${W(e)} y=${J+16} text-anchor="middle"
|
|
660
|
+
class="lintje-chart__axis-label">${s(e,z)}</text>`),l`<text x=${M} y=${15} text-anchor="end" class="lintje-chart__axis-label">Verschil</text>`,fe,l`<g @mouseleave=${()=>r.hoverAt(null)}>${c.map((t,n)=>{let{from:i,to:s}=K[n],u=$t+n*P,d=q(n),f=A[n],p=y&&b&&i!=null&&s!=null&&i.side!==0&&i.side===s.side,m=te.of(ee[n],t.label,he(ce(n))),g=b&&s?s:y&&i?i:null;return l`
|
|
661
|
+
<g class="lintje-dumbbell__row ${r.hoverIndex===n?`is-hovered`:``} ${m.state}"
|
|
651
662
|
data-mark-id=${m.markId} role=${m.role} tabindex=${m.tabIndex}
|
|
652
663
|
aria-pressed=${m.pressed} aria-label=${m.label}
|
|
653
664
|
@click=${m.click} @keydown=${m.keydown}>
|
|
654
|
-
${
|
|
655
|
-
height="10" fill="url(#hatch-${h})" />`:
|
|
656
|
-
${a?
|
|
657
|
-
class="lintje-chart__axis-label lintje-dumbbell__name">${B.fit(
|
|
658
|
-
${
|
|
659
|
-
<line class="lintje-dumbbell__link" x1=${
|
|
660
|
-
${
|
|
661
|
-
</g>`:
|
|
662
|
-
${
|
|
663
|
-
<circle class="lintje-dumbbell__ring" cx=${
|
|
664
|
-
${
|
|
665
|
-
fill="var(--color-chart-secondary)" />`:
|
|
665
|
+
${i==null||s==null?l`<rect class="lintje-dumbbell__gap" x=${H} y=${d-5} width=${U-H}
|
|
666
|
+
height="10" fill="url(#hatch-${h})" />`:o}
|
|
667
|
+
${a?l`<text x="0" y=${u+14} class="lintje-dumbbell__name lintje-dumbbell__name--above">${C(t.label,M*12/14,N)}</text>`:l`<text x=${B.labelEnd} y=${d+4} text-anchor="end"
|
|
668
|
+
class="lintje-chart__axis-label lintje-dumbbell__name">${B.fit(t.label)}</text>`}
|
|
669
|
+
${i!=null&&s!=null&&!p?l`<g class="lintje-chart__series ${y&&b?``:`is-off`}">
|
|
670
|
+
<line class="lintje-dumbbell__link" x1=${i.x} x2=${s.x} y1=${d} y2=${d}
|
|
671
|
+
${e({...Q(n,c.length),"--lintje-dumbbell-from":`${i.x}px`})} />
|
|
672
|
+
</g>`:o}
|
|
673
|
+
${i==null?o:l`<g class="lintje-chart__series ${y?``:`is-off`}">
|
|
674
|
+
<circle class="lintje-dumbbell__ring" cx=${i.x} cy=${d} r=${nn} />
|
|
675
|
+
${i.side!==0&&!p?l`<path class="lintje-chart__off-axis" d=${_n(i,7,d)}
|
|
676
|
+
fill="var(--color-chart-secondary)" />`:o}
|
|
666
677
|
</g>`}
|
|
667
|
-
${
|
|
668
|
-
<circle class="lintje-dumbbell__dot" cx=${
|
|
669
|
-
stroke=${v??
|
|
670
|
-
${
|
|
671
|
-
${
|
|
672
|
-
fill=${_} stroke=${v??
|
|
678
|
+
${s==null?o:l`<g class="lintje-chart__series ${b?``:`is-off`}">
|
|
679
|
+
<circle class="lintje-dumbbell__dot" cx=${s.x} cy=${d} r=${rn} fill=${_}
|
|
680
|
+
stroke=${v??o} stroke-width=${v?1:o}
|
|
681
|
+
${e({...Q(n,c.length),"--lintje-dumbbell-shift":`${i==null?0:i.x-s.x}px`})} />
|
|
682
|
+
${s.side===0?o:l`<path class="lintje-chart__off-axis" d=${_n(s,p?7:rn,d)}
|
|
683
|
+
fill=${_} stroke=${v??o} stroke-width=${v?1:o} />`}
|
|
673
684
|
</g>`}
|
|
674
|
-
${g?
|
|
685
|
+
${g?l`<circle class="lintje-dumbbell__focus" cx=${g.x} cy=${d} r=${cn} />`:o}
|
|
675
686
|
<g class="lintje-chart__series ${y&&b?``:`is-off`}">
|
|
676
|
-
<text x=${M} y=${
|
|
687
|
+
<text x=${M} y=${d+4} text-anchor="end"
|
|
677
688
|
class="lintje-chart__data-label lintje-dumbbell__difference ${f==null?`lintje-dumbbell__no-value`:``}">${f==null?un:O(f)}</text>
|
|
678
689
|
</g>
|
|
679
690
|
<!-- The whole row answers, so the tooltip does not flicker between ring and dot. -->
|
|
680
|
-
<rect class="lintje-chart__hit" x="0" y=${
|
|
681
|
-
@mouseenter=${e=>de(e,
|
|
691
|
+
<rect class="lintje-chart__hit" x="0" y=${u} width=${M} height=${P}
|
|
692
|
+
@mouseenter=${e=>de(e,n)} />
|
|
682
693
|
</g>
|
|
683
|
-
`})}</g>`];return
|
|
684
|
-
<div class="lintje-chart-wrap" ${
|
|
694
|
+
`})}</g>`];return m`
|
|
695
|
+
<div class="lintje-chart-wrap" ${g(r.attach)} ?data-in-view=${r.inView}
|
|
685
696
|
data-tooltip-anchor
|
|
686
|
-
@keydown=${e=>
|
|
687
|
-
${re({items:se,onToggle:e=>
|
|
697
|
+
@keydown=${e=>r.dismiss(e)||te.escape(e)}>
|
|
698
|
+
${re({items:se,onToggle:e=>r.toggleSeries(e)})}
|
|
688
699
|
<figure class="lintje-chart">
|
|
689
700
|
<svg viewBox="0 0 ${M} ${j}" width=${M} height=${j}
|
|
690
701
|
class="lintje-chart__svg lintje-dumbbell ${a?`lintje-dumbbell--rows`:``}"
|
|
691
|
-
${
|
|
702
|
+
${e({height:`${j}px`})}
|
|
692
703
|
role=${X(te.interactive)} aria-labelledby="${h}-desc" tabindex="0"
|
|
693
704
|
@keydown=${ue.keydown} @focus=${ue.focus} @blur=${ue.blur}>
|
|
694
|
-
<desc id="${h}-desc">${
|
|
705
|
+
<desc id="${h}-desc">${i}</desc>
|
|
695
706
|
<defs>
|
|
696
707
|
<pattern id="hatch-${h}" width="6" height="6" patternUnits="userSpaceOnUse"
|
|
697
708
|
patternTransform="rotate(45)">
|
|
@@ -701,144 +712,144 @@ import{R as e,_ as t,cn as n,d as r,dn as i,f as a,g as o,h as s,jt as c,k as l,
|
|
|
701
712
|
${pe}
|
|
702
713
|
</svg>
|
|
703
714
|
</figure>
|
|
704
|
-
${$(
|
|
705
|
-
${ve(
|
|
715
|
+
${$(r)}
|
|
716
|
+
${ve(r)}
|
|
706
717
|
</div>
|
|
707
|
-
`}function yn(e,t){let n=e.reduce((e,t)=>e+t,0),r=Math.max(...e),i=Math.min(...e),a=t*t;return Math.max(a*r/(n*n),n*n/(a*i))}function bn(e,t){let n=()=>({x:t.x,y:t.y,width:0,height:0}),r=e.reduce((e,t)=>t>0?e+t:e,0),i=e.map(n);if(r<=0||t.width<=0||t.height<=0)return i;let a=t.width*t.height/r,o=e.flatMap((e,t)=>e>0?[{index:t,area:e*a}]:[]),{x:s,y:c,width:l,height:u}=t,d=0;for(;d<o.length;){let e=Math.min(l,u),t=d+1;for(;t<o.length&&yn(o.slice(d,t+1).map(e=>e.area),e)<=yn(o.slice(d,t).map(e=>e.area),e);)t+=1;let n=o.slice(d,t),r=t===o.length,a=n.reduce((e,t)=>e+t.area,0);if(l>=u){let e=r?l:a/u,t=c;for(let[r,a]of n.entries()){let o=r===n.length-1?c+u-t:a.area/e;i[a.index]={x:s,y:t,width:e,height:o},t+=o}s+=e,l-=e}else{let e=r?u:a/l,t=s;for(let[r,a]of n.entries()){let o=r===n.length-1?s+l-t:a.area/e;i[a.index]={x:t,y:c,width:o,height:e},t+=o}c+=e,u-=e}d=t}return i}var xn={14:18,12:16},Sn=3,Cn=4,wn=`…`;function Tn(e,t,n,r,i){let a=[];for(let o of e.split(/\s+/).filter(Boolean)){let e=a.at(-1);if(e!=null&&i(`${e} ${o}`,n,r)<=t)a[a.length-1]=`${e} ${o}`;else if(i(o,n,r)<=t)a.push(o);else return null}return a.length>0&&a.length<=Sn?a.map(e=>({text:e,size:n,bold:r})):null}function En(e,t,n,r){if(r(e,12,n)<=t)return{text:e,size:12,bold:n};for(let i=e.length-1;i>=Cn;i--){let a=`${e.slice(0,i).trimEnd()}${wn}`;if(r(a,12,n)<=t)return{text:a,size:12,bold:n}}return null}var Dn=e=>e.reduce((e,t)=>e+xn[t.size],0);function On(e,t,n){let r=t.width-16,i=t.height-16,a=e=>e!=null&&Dn(e)<=i&&e.every(e=>n(e.text,e.size,e.bold)<=r),o=e.share!=null,s={text:e.amount,size:12,bold:!o},c={text:`${e.amount} · ${e.share}`,size:12,bold:!1},l=t=>Tn(e.name,r,t,o,n),u=o?[kn(l(14),c),kn(l(12),c),kn(l(12),s),l(12)]:[kn(l(12),s),l(12)];for(let e of u)if(a(e))return e;let d=En(e.name,r,o,n);return d?a([d,s])?[d,s]:a([d])?[d]:[]:[]}function kn(e,t){return e?[...e,t]:null}var An=.01,jn=e=>Number.isInteger(e)?0:Math.min(4,String(e).split(`.`)[1]?.length??0),Mn=e=>Array.isArray(e.parts)&&e.parts.length>0;function Nn(e){return Mn(e)?e.parts.reduce((e,t)=>e+Math.max(0,t.value??0),0):Math.max(0,e.value??0)}function Pn(e){return Mn(e)?e.parts.every(e=>e.value==null):e.value==null}var Fn=e=>[...e].sort((e,t)=>t.value-e.value);function In(e,t,n){let r=e.filter(e=>e.value<t);if(r.length<2)return{items:e,folded:!1};let i=r.map(({label:e,value:t})=>({label:e,value:t}));return{items:[...e.filter(e=>e.value>=t),n(i)],folded:!0}}var Ln=e=>e.reduce((e,t)=>e+t.value,0);function Rn(e){let t=e.parts??[],n=t.reduce((e,t)=>e+Nn(t),0),r=n*An,i=t.flatMap(e=>Mn(e)?e.parts.map(e=>e.value):[e.value]),a=Math.max(0,...i.filter(e=>typeof e==`number`).map(jn)),o=t.flatMap(e=>Pn(e)?[e.label]:Mn(e)?e.parts.filter(e=>e.value==null).map(e=>e.label):[]),s=!1,c=In(Fn(t.filter(e=>Nn(e)>0).map(e=>{let t=Nn(e),n=[];if(Mn(e)){let t=In(Fn(e.parts.filter(e=>(e.value??0)>0).map(e=>({label:e.label,value:e.value,other:!1,folded:[]}))),r,e=>({label:`Overig`,value:Ln(e),other:!0,folded:e}));n=t.items,s||=t.folded}return{label:e.label,value:t,id:e.id??e.label,href:e.href,other:!1,folded:[],areas:n,missing:Mn(e)?e.parts.filter(e=>e.value==null).map(e=>e.label):[],rank:0}})),r,e=>({label:`Overig`,value:Ln(e),id:`Overig`,other:!0,folded:e,areas:[],missing:[],rank:-1})),l=0;return{groups:c.items.map(e=>e.other?e:{...e,rank:l++}),total:n,decimals:a,missing:o,folded:s||c.folded,nested:t.some(Mn)}}function zn(e){let{total:t,nested:n}=Rn(e),r=e.parts??[],i=(e,t)=>[...Fn(e.filter(e=>t(e)>0).map(e=>({item:e,value:t(e)}))).map(({item:e})=>e),...e.filter(e=>!(t(e)>0))],a=e=>e==null?null:e<0||t<=0?``:Number((e/t*100).toFixed(1)),o=e.label??`Waarde`;return[[e.labelHeader??`Deel`,...n?[`Onderdeel`]:[],e.unit?`${o} (${e.unit})`:o,`Aandeel in het totaal (%)`],...i(r,Nn).flatMap(e=>{if(!Mn(e)){let t=e.value??null;return[[e.label,...n?[``]:[],t,a(t)]]}return i(e.parts,e=>e.value??0).map(t=>[e.label,t.label,t.value??null,a(t.value)])})]}var Bn=28,Vn=2,Hn=4;function Un(e,
|
|
718
|
+
`}function yn(e,t){let n=e.reduce((e,t)=>e+t,0),r=Math.max(...e),i=Math.min(...e),a=t*t;return Math.max(a*r/(n*n),n*n/(a*i))}function bn(e,t){let n=()=>({x:t.x,y:t.y,width:0,height:0}),r=e.reduce((e,t)=>t>0?e+t:e,0),i=e.map(n);if(r<=0||t.width<=0||t.height<=0)return i;let a=t.width*t.height/r,o=e.flatMap((e,t)=>e>0?[{index:t,area:e*a}]:[]),{x:s,y:c,width:l,height:u}=t,d=0;for(;d<o.length;){let e=Math.min(l,u),t=d+1;for(;t<o.length&&yn(o.slice(d,t+1).map(e=>e.area),e)<=yn(o.slice(d,t).map(e=>e.area),e);)t+=1;let n=o.slice(d,t),r=t===o.length,a=n.reduce((e,t)=>e+t.area,0);if(l>=u){let e=r?l:a/u,t=c;for(let[r,a]of n.entries()){let o=r===n.length-1?c+u-t:a.area/e;i[a.index]={x:s,y:t,width:e,height:o},t+=o}s+=e,l-=e}else{let e=r?u:a/l,t=s;for(let[r,a]of n.entries()){let o=r===n.length-1?s+l-t:a.area/e;i[a.index]={x:t,y:c,width:o,height:e},t+=o}c+=e,u-=e}d=t}return i}var xn={14:18,12:16},Sn=3,Cn=4,wn=`…`;function Tn(e,t,n,r,i){let a=[];for(let o of e.split(/\s+/).filter(Boolean)){let e=a.at(-1);if(e!=null&&i(`${e} ${o}`,n,r)<=t)a[a.length-1]=`${e} ${o}`;else if(i(o,n,r)<=t)a.push(o);else return null}return a.length>0&&a.length<=Sn?a.map(e=>({text:e,size:n,bold:r})):null}function En(e,t,n,r){if(r(e,12,n)<=t)return{text:e,size:12,bold:n};for(let i=e.length-1;i>=Cn;i--){let a=`${e.slice(0,i).trimEnd()}${wn}`;if(r(a,12,n)<=t)return{text:a,size:12,bold:n}}return null}var Dn=e=>e.reduce((e,t)=>e+xn[t.size],0);function On(e,t,n){let r=t.width-16,i=t.height-16,a=e=>e!=null&&Dn(e)<=i&&e.every(e=>n(e.text,e.size,e.bold)<=r),o=e.share!=null,s={text:e.amount,size:12,bold:!o},c={text:`${e.amount} · ${e.share}`,size:12,bold:!1},l=t=>Tn(e.name,r,t,o,n),u=o?[kn(l(14),c),kn(l(12),c),kn(l(12),s),l(12)]:[kn(l(12),s),l(12)];for(let e of u)if(a(e))return e;let d=En(e.name,r,o,n);return d?a([d,s])?[d,s]:a([d])?[d]:[]:[]}function kn(e,t){return e?[...e,t]:null}var An=.01,jn=e=>Number.isInteger(e)?0:Math.min(4,String(e).split(`.`)[1]?.length??0),Mn=e=>Array.isArray(e.parts)&&e.parts.length>0;function Nn(e){return Mn(e)?e.parts.reduce((e,t)=>e+Math.max(0,t.value??0),0):Math.max(0,e.value??0)}function Pn(e){return Mn(e)?e.parts.every(e=>e.value==null):e.value==null}var Fn=e=>[...e].sort((e,t)=>t.value-e.value);function In(e,t,n){let r=e.filter(e=>e.value<t);if(r.length<2)return{items:e,folded:!1};let i=r.map(({label:e,value:t})=>({label:e,value:t}));return{items:[...e.filter(e=>e.value>=t),n(i)],folded:!0}}var Ln=e=>e.reduce((e,t)=>e+t.value,0);function Rn(e){let t=e.parts??[],n=t.reduce((e,t)=>e+Nn(t),0),r=n*An,i=t.flatMap(e=>Mn(e)?e.parts.map(e=>e.value):[e.value]),a=Math.max(0,...i.filter(e=>typeof e==`number`).map(jn)),o=t.flatMap(e=>Pn(e)?[e.label]:Mn(e)?e.parts.filter(e=>e.value==null).map(e=>e.label):[]),s=!1,c=In(Fn(t.filter(e=>Nn(e)>0).map(e=>{let t=Nn(e),n=[];if(Mn(e)){let t=In(Fn(e.parts.filter(e=>(e.value??0)>0).map(e=>({label:e.label,value:e.value,other:!1,folded:[]}))),r,e=>({label:`Overig`,value:Ln(e),other:!0,folded:e}));n=t.items,s||=t.folded}return{label:e.label,value:t,id:e.id??e.label,href:e.href,other:!1,folded:[],areas:n,missing:Mn(e)?e.parts.filter(e=>e.value==null).map(e=>e.label):[],rank:0}})),r,e=>({label:`Overig`,value:Ln(e),id:`Overig`,other:!0,folded:e,areas:[],missing:[],rank:-1})),l=0;return{groups:c.items.map(e=>e.other?e:{...e,rank:l++}),total:n,decimals:a,missing:o,folded:s||c.folded,nested:t.some(Mn)}}function zn(e){let{total:t,nested:n}=Rn(e),r=e.parts??[],i=(e,t)=>[...Fn(e.filter(e=>t(e)>0).map(e=>({item:e,value:t(e)}))).map(({item:e})=>e),...e.filter(e=>!(t(e)>0))],a=e=>e==null?null:e<0||t<=0?``:Number((e/t*100).toFixed(1)),o=e.label??`Waarde`;return[[e.labelHeader??`Deel`,...n?[`Onderdeel`]:[],e.unit?`${o} (${e.unit})`:o,`Aandeel in het totaal (%)`],...i(r,Nn).flatMap(e=>{if(!Mn(e)){let t=e.value??null;return[[e.label,...n?[``]:[],t,a(t)]]}return i(e.parts,e=>e.value??0).map(t=>[e.label,t.label,t.value??null,a(t.value)])})]}var Bn=28,Vn=2,Hn=4;function Un(e,t){let n=Rn(e),{groups:i,total:a,decimals:c}=n,l=i.filter(e=>!e.other).length,u=He(l,e.color),d=Ve(l),f=y(e.color)?e.color:void 0,p=i.map(e=>e.other?`var(--color-chart-other)`:u[Math.min(e.rank,u.length-1)]),h=i.map(t=>{if(t.other||e.dataLabels===!1)return null;let n=A(f,d[Math.min(t.rank,d.length-1)]);return n?V(n):null}),_=i.map(e=>e.href&&!e.other?{id:e.id,href:e.href}:null),v=Oe(t,_),b=e=>s(e,c),x=t=>`${b(t)}${e.unit?` ${e.unit}`:``}`,S=(e,t=a)=>r(t>0?e/t*100:0,1),C=i.map((e,t)=>v.of(_[t],e.label,`${e.label}: ${x(e.value)} · ${S(e.value)}`)),w=[...n.folded?[{label:`Overig: posten onder 1 % samen`,color:`var(--color-chart-other)`,shape:`square`,fixed:!0}]:[],...n.missing.length?[{label:`Geen gegevens: ${n.missing.join(`, `)}`,shape:`hatch`,fixed:!0}]:[]],T=`totaal ${x(a)}${n.missing.length?`, zonder ${n.missing.join(`, `)}`:``}`,E={spec:e,model:n,options:t,colors:p,inks:h,marks:C,format:b,withUnit:x,share:S,legend:w,totalLine:T},{controller:D}=t;return m`
|
|
708
719
|
<div class="lintje-chart-wrap lintje-treemap ${e.small?`lintje-chart--small`:``}"
|
|
709
|
-
${
|
|
710
|
-
@keydown=${e=>D.dismiss(e)||
|
|
711
|
-
${w.length?re({items:w}):
|
|
720
|
+
${g(D.attach)} ?data-in-view=${D.inView} data-tooltip-anchor
|
|
721
|
+
@keydown=${e=>D.dismiss(e)||v.escape(e)}>
|
|
722
|
+
${w.length?re({items:w}):o}
|
|
712
723
|
<p class="lintje-treemap__total">${T}</p>
|
|
713
|
-
${
|
|
724
|
+
${t.mobile?Xn(E):Yn(E,v.interactive)}
|
|
714
725
|
${$(D)}
|
|
715
726
|
${ve(D)}
|
|
716
727
|
</div>
|
|
717
|
-
`}function Wn(e,t,n,r,i){let{spec:a,withUnit:o,share:s}=e,c=i?t.label:void 0;if(n.other)return{kicker:c,title:n.label,rows:[...n.folded.map(e=>({label:e.label,value:o(e.value)})),{label:`Samen`,value:o(n.value),color:r,divider:!0}]};let l=[{label:a.label??`Waarde`,value:o(n.value),color:r},...i?[{label:`Aandeel in ${t.label}`,value:s(n.value,t.value)}]:[],{label:`Aandeel in het totaal`,value:s(n.value)}];return i&&t.missing.length&&l.push({label:`${t.label}, zonder ${t.missing.join(`, `)}`,value:o(t.value),divider:!0}),{kicker:c,title:n.label,rows:l}}function Gn(e,t,n){let r=n;return e.map(e=>{let n={text:e.text,x:t,y:r+e.size,line:e};return r+=xn[e.size],n})}var Kn=e=>e.reduce((e,t)=>e+xn[t.size],0);function qn(e,t,n,r){let{model:i,colors:a,inks:o,format:s,share:c}=e,l=(e,t,n)=>
|
|
718
|
-
class="lintje-chart__data-label lintje-treemap__label lintje-treemap__label--${a.size} ${a.bold?`lintje-treemap__label--bold`:``} ${n?`lintje-treemap__label--muted`:t}">${e}</text>`)}function Yn(
|
|
719
|
-
width=${e.rect.width} height=${e.rect.height} fill=${e.color} />`,D=(e,t)=>
|
|
728
|
+
`}function Wn(e,t,n,r,i){let{spec:a,withUnit:o,share:s}=e,c=i?t.label:void 0;if(n.other)return{kicker:c,title:n.label,rows:[...n.folded.map(e=>({label:e.label,value:o(e.value)})),{label:`Samen`,value:o(n.value),color:r,divider:!0}]};let l=[{label:a.label??`Waarde`,value:o(n.value),color:r},...i?[{label:`Aandeel in ${t.label}`,value:s(n.value,t.value)}]:[],{label:`Aandeel in het totaal`,value:s(n.value)}];return i&&t.missing.length&&l.push({label:`${t.label}, zonder ${t.missing.join(`, `)}`,value:o(t.value),divider:!0}),{kicker:c,title:n.label,rows:l}}function Gn(e,t,n){let r=n;return e.map(e=>{let n={text:e.text,x:t,y:r+e.size,line:e};return r+=xn[e.size],n})}var Kn=e=>e.reduce((e,t)=>e+xn[t.size],0);function qn(e,t,n,r){let{model:i,colors:a,inks:o,format:s,share:c}=e,l=(e,t,n)=>S(e,r,n?700:400)*t/12,u=bn(i.groups.map(e=>e.value),{x:0,y:0,width:t,height:n});return i.groups.flatMap((t,n)=>{let r=u[n],i=a[n],d=o[n]!=null;if(!t.areas.length){let a=d&&!t.other?On({name:t.label,amount:s(t.value),share:c(t.value)},r,l):[];return[{group:n,rect:r,color:i,label:t.label,value:t.value,other:t.other,lines:Gn(a,r.x+8,r.y+8),content:Wn(e,t,t,i,!1)}]}let f=bn(t.areas.map(e=>e.value),r);return t.areas.map((r,a)=>{let o=f[a],u=[];if(d&&!r.other){let e=a===0?On({name:t.label,amount:s(t.value),share:c(t.value)},o,l):[],n=e.length?Kn(e)+Hn:0,i=On({name:r.label,amount:s(r.value)},{width:o.width,height:o.height-n},l);u=[...Gn(e,o.x+8,o.y+8),...Gn(i,o.x+8,o.y+8+n)]}return{group:n,rect:o,color:r.other?`var(--color-chart-other)`:i,label:r.label,value:r.value,other:r.other,lines:u,content:Wn(e,t,r,r.other?`var(--color-chart-other)`:i,!0)}})})}function Jn(e,t,n){return!t||!e.lines.length?o:e.lines.map(({text:e,x:r,y:i,line:a})=>l`<text x=${r} y=${i}
|
|
729
|
+
class="lintje-chart__data-label lintje-treemap__label lintje-treemap__label--${a.size} ${a.bold?`lintje-treemap__label--bold`:``} ${n?`lintje-treemap__label--muted`:t}">${e}</text>`)}function Yn(t,n){let{spec:r,model:i,options:a,inks:s,marks:c}=t,{controller:u,description:d}=a,f=u.id;u.measure({width:!0,height:a.height??(r.small?`--chart-h-small`:`--chart-h-main`),fit:!!a.expanded});let p=u.width,g=u.height,_=qn(t,p,g,u.fontFamily),v=bn(i.groups.map(e=>e.value),{x:0,y:0,width:p,height:g}),y=e=>c[e].state.includes(`is-muted`),b=e=>{let{rect:t,content:n}=_[e],r=t.x+t.width/2<p/2;return{x:r?t.x+t.width:t.x,y:t.y+t.height/2,content:n,side:r?void 0:`left`}},x=_e(u,_.length,b),S=e=>{let t=u.hoverIndex;if((e.key===`Enter`||e.key===` `)&&e.target===e.currentTarget){let n=t==null?void 0:_[t],r=n?c[n.group].keydown:void 0;typeof r==`function`&&r(e)}else x.keydown(e)},C=(e,t)=>{if(u.hoverIndex===t&&u.tooltip)return;let n=e.currentTarget.ownerSVGElement;if(!n)return;let r=b(t),i=n.closest(`[data-tooltip-anchor]`),a=n.getBoundingClientRect(),o=i?.getBoundingClientRect()??a;u.hoverIndex=t,u.showTooltipAt(a.left-o.left+r.x,a.top-o.top+r.y,r.content,r.side)},w=()=>{u.hoverIndex!=null&&u.hoverAt(null)},T=u.hoverIndex==null?void 0:_[u.hoverIndex],E=(e,t=``)=>l`<rect class="lintje-treemap__area lintje-chart__segment ${t}" x=${e.rect.x} y=${e.rect.y}
|
|
730
|
+
width=${e.rect.width} height=${e.rect.height} fill=${e.color} />`,D=(e,t)=>l`
|
|
720
731
|
<g class="${t} ${y(e.group)?`is-muted`:``}" aria-hidden="true">
|
|
721
732
|
<rect class="lintje-treemap__ground" x=${e.rect.x} y=${e.rect.y}
|
|
722
733
|
width=${e.rect.width} height=${e.rect.height} />
|
|
723
|
-
${E(e)}${Jn(e,
|
|
724
|
-
</g>`,O=
|
|
734
|
+
${E(e)}${Jn(e,s[e.group],y(e.group))}
|
|
735
|
+
</g>`,O=i.groups.findIndex((e,t)=>c[t].state.includes(`is-selected`)),k=JSON.stringify(r.parts);return m`
|
|
725
736
|
<figure class="lintje-chart">
|
|
726
|
-
<svg viewBox="0 0 ${
|
|
727
|
-
class="lintje-chart__svg lintje-treemap__svg" ${
|
|
728
|
-
role=${X(
|
|
737
|
+
<svg viewBox="0 0 ${p} ${g}" width=${p} height=${g}
|
|
738
|
+
class="lintje-chart__svg lintje-treemap__svg" ${e({height:`${g}px`,...q(f)})}
|
|
739
|
+
role=${X(n)} aria-labelledby="${f}-desc" tabindex="0"
|
|
729
740
|
@keydown=${S} @focus=${x.focus} @blur=${x.blur} @mouseleave=${w}>
|
|
730
|
-
<desc id="${
|
|
731
|
-
<defs>${U(
|
|
732
|
-
${
|
|
733
|
-
<g class="lintje-treemap__group ${
|
|
734
|
-
${
|
|
735
|
-
role=${
|
|
736
|
-
${
|
|
741
|
+
<desc id="${f}-desc">${d}</desc>
|
|
742
|
+
<defs>${U(f)}</defs>
|
|
743
|
+
${h(k,l`${i.groups.map((t,n)=>{let r=c[n],a=_.filter(e=>e.group===n);return l`
|
|
744
|
+
<g class="lintje-treemap__group ${r.state}" data-part-id=${t.id}
|
|
745
|
+
${e(Q(n,i.groups.length))}
|
|
746
|
+
role=${r.role} aria-pressed=${r.pressed} aria-label=${r.label} @click=${r.click}>
|
|
747
|
+
${a.map(e=>l`<rect class="lintje-treemap__area lintje-chart__segment" x=${e.rect.x} y=${e.rect.y}
|
|
737
748
|
width=${e.rect.width} height=${e.rect.height} fill=${e.color}
|
|
738
749
|
@mousemove=${t=>C(t,_.indexOf(e))} />`)}
|
|
739
750
|
</g>`})}
|
|
740
751
|
<!-- The labels apart from the parts: a part's name as a button is its own sentence. -->
|
|
741
752
|
<g class="lintje-treemap__labels" aria-hidden="true">
|
|
742
|
-
${_.map(e=>Jn(e,
|
|
753
|
+
${_.map(e=>Jn(e,s[e.group],y(e.group)))}
|
|
743
754
|
</g>`)}
|
|
744
755
|
<!-- The line between parts, on their border, over the areas on both sides of it. -->
|
|
745
756
|
<g class="lintje-treemap__edges" aria-hidden="true">
|
|
746
|
-
${v.map(e=>
|
|
757
|
+
${v.map(e=>l`<rect class="lintje-treemap__edge" x=${e.x} y=${e.y} width=${e.width} height=${e.height} />`)}
|
|
747
758
|
</g>
|
|
748
|
-
${O>=0?
|
|
759
|
+
${O>=0?l`<rect class="lintje-chart__mark is-selected lintje-treemap__outline" aria-hidden="true"
|
|
749
760
|
x=${v[O].x+3} y=${v[O].y+3}
|
|
750
|
-
width=${Math.max(0,v[O].width-6)} height=${Math.max(0,v[O].height-6)} />`:
|
|
751
|
-
${T?D(T,`lintje-treemap__lift`):
|
|
752
|
-
${T?D(T,`lintje-treemap__focus`):
|
|
761
|
+
width=${Math.max(0,v[O].width-6)} height=${Math.max(0,v[O].height-6)} />`:o}
|
|
762
|
+
${T?D(T,`lintje-treemap__lift`):o}
|
|
763
|
+
${T?D(T,`lintje-treemap__focus`):o}
|
|
753
764
|
</svg>
|
|
754
765
|
</figure>
|
|
755
|
-
`}function Xn(
|
|
756
|
-
fill=${
|
|
757
|
-
<span class="lintje-treemap__track ${
|
|
758
|
-
<span class="lintje-treemap__bar" ${
|
|
759
|
-
</span>`,T=
|
|
760
|
-
<span class="lintje-treemap__swatch" ${
|
|
761
|
-
<span class="lintje-treemap__name">${
|
|
762
|
-
<span class="lintje-treemap__amount">${
|
|
763
|
-
<span class="lintje-treemap__share">${
|
|
764
|
-
${w(
|
|
765
|
-
<li class="lintje-treemap__row ${
|
|
766
|
-
${
|
|
767
|
-
aria-controls=${
|
|
768
|
-
@click=${()=>
|
|
769
|
-
${
|
|
770
|
-
</button>`:
|
|
771
|
-
${
|
|
772
|
-
@click=${
|
|
773
|
-
${
|
|
774
|
-
${
|
|
775
|
-
<span class="lintje-treemap__name">${
|
|
776
|
-
<span class="lintje-treemap__amount">${
|
|
777
|
-
<span class="lintje-treemap__share">${
|
|
778
|
-
${w(
|
|
766
|
+
`}function Xn(t){let{spec:r,model:i,options:a,colors:s,marks:c,format:u,share:d}=t,{controller:f,description:p}=a,g=f.id;f.measure({width:!0});let _=f.width,v=oe(r.color)??`var(--color-chart-default)`,y=Math.max(0,...i.groups.map(e=>e.value)),b=e=>`${y>0?e/y*100:0}%`,x=Math.max(0,_-Vn*Math.max(0,i.groups.length-1)),S=0,C=i.groups.map((t,n)=>{let r=i.total>0?t.value/i.total*x:0,a=l`<rect class="lintje-treemap__piece" x=${S} y="0" width=${r} height=${Bn}
|
|
767
|
+
fill=${s[n]} ${e(Q(n,i.groups.length))} />`;return S+=r+Vn,a}),w=(t,n,r=!1)=>m`
|
|
768
|
+
<span class="lintje-treemap__track ${r?`lintje-treemap__track--sub`:``}" aria-hidden="true">
|
|
769
|
+
<span class="lintje-treemap__bar" ${e({width:b(t),background:n})}></span>
|
|
770
|
+
</span>`,T=i.groups.map((t,r)=>{let a=c[r],l=f.openParts.includes(t.id),p=`${g}-parts-${r}`,h=t.areas.length>0,_=t.other?`var(--color-chart-other)`:v,y=m`
|
|
771
|
+
<span class="lintje-treemap__swatch" ${e({background:s[r]})} aria-hidden="true"></span>
|
|
772
|
+
<span class="lintje-treemap__name">${t.label}${t.other?m`<span class="lintje-treemap__count"> · ${t.folded.length} posten</span>`:o}</span>
|
|
773
|
+
<span class="lintje-treemap__amount">${u(t.value)}</span>
|
|
774
|
+
<span class="lintje-treemap__share">${d(t.value)}</span>
|
|
775
|
+
${w(t.value,_)}`;return m`
|
|
776
|
+
<li class="lintje-treemap__row ${t.other?`lintje-treemap__row--other`:``} ${a.state}">
|
|
777
|
+
${h?m`<button type="button" class="lintje-treemap__toggle" aria-expanded=${l?`true`:`false`}
|
|
778
|
+
aria-controls=${p} aria-label="Onderdelen van ${t.label}"
|
|
779
|
+
@click=${()=>f.toggleOpen(t.id)}>
|
|
780
|
+
${n(l?`functioneel-delta-omlaag`:`functioneel-delta-rechts`,{size:16})}
|
|
781
|
+
</button>`:i.nested?m`<span class="lintje-treemap__toggle-space" aria-hidden="true"></span>`:o}
|
|
782
|
+
${a.clickable?m`<button type="button" class="lintje-treemap__part lintje-treemap__part--button" aria-pressed=${a.pressed}
|
|
783
|
+
@click=${a.click}>${y}</button>`:m`<div class="lintje-treemap__part">${y}</div>`}
|
|
784
|
+
${h&&l?m`<ul class="lintje-treemap__subs" id=${p}>
|
|
785
|
+
${t.areas.map(e=>m`<li class="lintje-treemap__sub ${e.other?`lintje-treemap__sub--other`:``}">
|
|
786
|
+
<span class="lintje-treemap__name">${e.label}${e.other?m`<span class="lintje-treemap__count"> · ${e.folded.length} posten</span>`:o}</span>
|
|
787
|
+
<span class="lintje-treemap__amount">${u(e.value)}</span>
|
|
788
|
+
<span class="lintje-treemap__share">${d(e.value,t.value)}</span>
|
|
789
|
+
${w(e.value,e.other?`var(--color-chart-other)`:v,!0)}
|
|
779
790
|
</li>`)}
|
|
780
|
-
${
|
|
791
|
+
${t.missing.map(e=>m`<li class="lintje-treemap__sub">
|
|
781
792
|
<span class="lintje-treemap__name">${e}</span>
|
|
782
793
|
<span class="lintje-treemap__amount lintje-treemap__amount--none">geen gegevens</span>
|
|
783
794
|
</li>`)}
|
|
784
|
-
</ul>`:
|
|
785
|
-
</li>`}),E=
|
|
795
|
+
</ul>`:o}
|
|
796
|
+
</li>`}),E=r.parts.filter(Pn).map(e=>m`
|
|
786
797
|
<li class="lintje-treemap__row lintje-treemap__row--missing">
|
|
787
|
-
${
|
|
798
|
+
${i.nested?m`<span class="lintje-treemap__toggle-space" aria-hidden="true"></span>`:o}
|
|
788
799
|
<div class="lintje-treemap__part">
|
|
789
800
|
<span class="lintje-treemap__swatch lintje-treemap__swatch--hatch" aria-hidden="true"></span>
|
|
790
801
|
<span class="lintje-treemap__name">${e.label}</span>
|
|
791
802
|
<span class="lintje-treemap__amount lintje-treemap__amount--none">geen gegevens</span>
|
|
792
803
|
</div>
|
|
793
|
-
</li>`);return
|
|
794
|
-
<svg viewBox="0 0 ${
|
|
795
|
-
class="lintje-chart__svg lintje-treemap__strip" ${
|
|
796
|
-
role="img" aria-labelledby="${
|
|
797
|
-
<desc id="${
|
|
798
|
-
${
|
|
804
|
+
</li>`);return m`
|
|
805
|
+
<svg viewBox="0 0 ${_} ${Bn}" width=${_} height=${Bn}
|
|
806
|
+
class="lintje-chart__svg lintje-treemap__strip" ${e({height:`${Bn}px`})}
|
|
807
|
+
role="img" aria-labelledby="${g}-desc">
|
|
808
|
+
<desc id="${g}-desc">${p}</desc>
|
|
809
|
+
${h(JSON.stringify(r.parts),l`${C}`)}
|
|
799
810
|
</svg>
|
|
800
|
-
<ul class="lintje-treemap__rows ${
|
|
801
|
-
`}var Zn=12,Qn=14,$n=96,er=32,tr=6,nr=36,rr=24,ir=2,ar=28,or=4,sr=8,cr=e=>e.reduce((e,t)=>e+(t.value??0),0);function lr(e){let t=/* @__PURE__ */ new Map,n=e.steps.map((e,n)=>({label:e.label,nodes:e.nodes.map((e,r)=>{let i={id:e.id,label:e.label,href:e.href,value:e.value,step:n,index:r,size:0,unknown:!1,atLeast:!1,inflow:[],outflow:[],stub:0,rest:0};return t.has(e.id)||t.set(e.id,i),i})})),r=e.flows.flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);return!n||!r||r.step!==n.step+1?[]:[{id:e.id??`${e.from}→${e.to}`,from:n,to:r,value:e.value,href:e.href}]});for(let e of r)e.from.outflow.push(e),e.to.inflow.push(e);let i=[],a=n.length-1;for(let e of n)for(let t of e.nodes){t.outflow.sort((e,t)=>e.to.index-t.to.index),t.inflow.sort((e,t)=>e.from.index-t.from.index);let e=cr(t.inflow),n=cr(t.outflow),r=t.outflow.some(e=>e.value==null),o=[...t.inflow,...t.outflow].some(e=>e.value!=null);t.value==null?(t.size=Math.max(e,n),t.unknown=!o,t.atLeast=!t.unknown&&t.inflow.some(e=>e.value==null),r&&t.inflow.length===0?(t.atLeast=!t.unknown,i.push(`node "${t.id}" has a missing flow out of it and no value`)):r&&(t.stub=Math.max(0,e-n))):t.value<n?(t.size=n,i.push(`node "${t.id}" has a value below the known flows out of it`)):(t.size=t.value,r&&(t.stub=t.value-n)),t.rest=t.step<a?Math.max(0,t.size-n-t.stub):0}return{steps:n,flows:r,total:(n[0]?.nodes??[]).reduce((e,t)=>e+t.size,0),problems:i}}function ur(e){let t=Math.max(1,...e.steps.map(e=>e.nodes.length));return rr+t*nr+(t-1)*Qn}function dr(e){let t=[];for(let n of e.steps)for(let e of n.nodes){t.push({kind:`node`,node:e});let n=!1;for(let r of e.outflow)r.value==null?(e.stub>0&&!n&&t.push({kind:`stub`,node:e}),n=!0):r.value>0&&t.push({kind:`flow`,flow:r})}return t}function fr(e,t){let{width:n,height:r,nameWidth:i,valueWidth:a}=t,{steps:o}=e,s=o.length,c=(e,t)=>Math.max(0,...(o[e]?.nodes??[]).map(e=>Math.max(i(e),t?a(e):0))),l=e=>{let t=c(0,e)+tr,r=n-(s>1?c(s-1,e)+tr:0)-Zn,i=s>1?(r-t)/(s-1):0;return{columns:o.map((e,n)=>t+i*n),run:i-Zn}},u=o.slice(1,-1).flatMap(e=>e.nodes),d=l(!0),f=d.run>=(s>2?$n:0)+er&&u.every(e=>a(e)<=88),{columns:p,run:m}=f?d:l(!1);if(s>1&&m<er){let e=(s-1)*44+Zn,t=Math.max(0,Math.min(p[0],n-e));p=o.map((e,n)=>t+n*44),m=er}let h=s>2?Math.max(0,Math.min($n,m-er)):0,g=r-rr,_=(e,t)=>t.reduce((t,n)=>t+Math.max(n.size*e,nr),0)+Qn*Math.max(0,t.length-1),v=e=>o.every(t=>_(e,t.nodes)<=g+1e-6),y=Math.max(0,...o.flatMap(e=>e.nodes.map(e=>e.size))),b=0;if(y>0){let e=0,t=g/y;if(v(t))e=t;else for(let n=0;n<48;n++){let n=(e+t)/2;v(n)?e=n:t=n}b=e}let x=/* @__PURE__ */ new Map;o.forEach((e,t)=>{let n=rr+Math.max(0,(g-_(b,e.nodes))/2);for(let r of e.nodes){let e=r.size*b,i=Math.max(e,nr);x.set(r,{x:p[t],y:n+(i-e)/2,h:e,slot:i,slotTop:n}),n+=i+Qn}});let S=/* @__PURE__ */ new Map,C=/* @__PURE__ */ new Map,w=/* @__PURE__ */ new Map;for(let e of x.keys()){let t=x.get(e),n=t.y;for(let r of e.outflow)if(r.value!=null)S.set(r,n),n+=r.value*b;else if(e.stub>0&&!w.has(e)){let r=e.stub*b;w.set(e,{x:t.x+Zn,y:n,h:Math.max(ir,r)}),n+=r}n=t.y;for(let t of e.inflow)t.value!=null&&(C.set(t,n),n+=t.value*b)}let T=/* @__PURE__ */ new Map;for(let t of e.flows){if(t.value==null||t.value<=0)continue;let e=t.value*b,n=Math.max(ir,e),r=(e-n)/2,i=x.get(t.from).x+Zn;T.set(t,{a:S.get(t)+r,b:C.get(t)+r,thickness:n,x0:i,xs:i+(t.from.step>0?h:0),x1:x.get(t.to).x})}return{width:n,height:r,scale:b,columns:p,strip:h,values:f,node:x,band:T,stub:w}}function pr({a:e,b:t,thickness:n,x0:r,xs:i,x1:a}){let o=(i+a)/2;return[`M${r},${e}`,`H${i}`,`C${o},${e} ${o},${t} ${a},${t}`,`V${t+n}`,`C${o},${t+n} ${o},${e+n} ${i},${e+n}`,`H${r}`,`Z`].join(` `)}function mr({a:e,b:t,thickness:n,x0:r,xs:i,x1:a}){let o=(i+a)/2;return`M${r},${e+n/2} H${i} C${o},${e+n/2} ${o},${t+n/2} ${a},${t+n/2}`}var hr=/* @__PURE__ */ new WeakSet;function gr(e){if(e.kind===`flow`)return{flows:/* @__PURE__ */ new Set([e.flow]),nodes:/* @__PURE__ */ new Set([e.flow.from,e.flow.to]),stubs:/* @__PURE__ */ new Set};let{node:t}=e;if(e.kind===`stub`){let e=t.outflow.filter(e=>e.value==null);return{flows:/* @__PURE__ */ new Set,nodes:/* @__PURE__ */ new Set([t,...e.map(e=>e.to)]),stubs:/* @__PURE__ */ new Set([t])}}let n=[...t.inflow,...t.outflow];return{flows:new Set(n),nodes:/* @__PURE__ */ new Set([t,...n.map(e=>e.from),...n.map(e=>e.to)]),stubs:/* @__PURE__ */ new Set([t])}}function _r(e,
|
|
802
|
-
<path d=${pr(t)} fill=${
|
|
803
|
-
class="lintje-chart__mark lintje-sankey__band ${Y(
|
|
804
|
-
data-mark-id=${
|
|
805
|
-
aria-pressed=${
|
|
806
|
-
@click=${
|
|
807
|
-
${t.thickness<sr?
|
|
808
|
-
d=${mr(t)} @click=${
|
|
809
|
-
</g>`}),
|
|
811
|
+
<ul class="lintje-treemap__rows ${i.nested?``:`lintje-treemap__rows--flat`}">${T}${E}</ul>
|
|
812
|
+
`}var Zn=12,Qn=14,$n=96,er=32,tr=6,nr=36,rr=24,ir=2,ar=28,or=4,sr=8,cr=e=>e.reduce((e,t)=>e+(t.value??0),0);function lr(e){let t=/* @__PURE__ */ new Map,n=e.steps.map((e,n)=>({label:e.label,nodes:e.nodes.map((e,r)=>{let i={id:e.id,label:e.label,href:e.href,value:e.value,step:n,index:r,size:0,unknown:!1,atLeast:!1,inflow:[],outflow:[],stub:0,rest:0};return t.has(e.id)||t.set(e.id,i),i})})),r=e.flows.flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);return!n||!r||r.step!==n.step+1?[]:[{id:e.id??`${e.from}→${e.to}`,from:n,to:r,value:e.value,href:e.href}]});for(let e of r)e.from.outflow.push(e),e.to.inflow.push(e);let i=[],a=n.length-1;for(let e of n)for(let t of e.nodes){t.outflow.sort((e,t)=>e.to.index-t.to.index),t.inflow.sort((e,t)=>e.from.index-t.from.index);let e=cr(t.inflow),n=cr(t.outflow),r=t.outflow.some(e=>e.value==null),o=[...t.inflow,...t.outflow].some(e=>e.value!=null);t.value==null?(t.size=Math.max(e,n),t.unknown=!o,t.atLeast=!t.unknown&&t.inflow.some(e=>e.value==null),r&&t.inflow.length===0?(t.atLeast=!t.unknown,i.push(`node "${t.id}" has a missing flow out of it and no value`)):r&&(t.stub=Math.max(0,e-n))):t.value<n?(t.size=n,i.push(`node "${t.id}" has a value below the known flows out of it`)):(t.size=t.value,r&&(t.stub=t.value-n)),t.rest=t.step<a?Math.max(0,t.size-n-t.stub):0}return{steps:n,flows:r,total:(n[0]?.nodes??[]).reduce((e,t)=>e+t.size,0),problems:i}}function ur(e){let t=Math.max(1,...e.steps.map(e=>e.nodes.length));return rr+t*nr+(t-1)*Qn}function dr(e){let t=[];for(let n of e.steps)for(let e of n.nodes){t.push({kind:`node`,node:e});let n=!1;for(let r of e.outflow)r.value==null?(e.stub>0&&!n&&t.push({kind:`stub`,node:e}),n=!0):r.value>0&&t.push({kind:`flow`,flow:r})}return t}function fr(e,t){let{width:n,height:r,nameWidth:i,valueWidth:a}=t,{steps:o}=e,s=o.length,c=(e,t)=>Math.max(0,...(o[e]?.nodes??[]).map(e=>Math.max(i(e),t?a(e):0))),l=e=>{let t=c(0,e)+tr,r=n-(s>1?c(s-1,e)+tr:0)-Zn,i=s>1?(r-t)/(s-1):0;return{columns:o.map((e,n)=>t+i*n),run:i-Zn}},u=o.slice(1,-1).flatMap(e=>e.nodes),d=l(!0),f=d.run>=(s>2?$n:0)+er&&u.every(e=>a(e)<=88),{columns:p,run:m}=f?d:l(!1);if(s>1&&m<er){let e=(s-1)*44+Zn,t=Math.max(0,Math.min(p[0],n-e));p=o.map((e,n)=>t+n*44),m=er}let h=s>2?Math.max(0,Math.min($n,m-er)):0,g=r-rr,_=(e,t)=>t.reduce((t,n)=>t+Math.max(n.size*e,nr),0)+Qn*Math.max(0,t.length-1),v=e=>o.every(t=>_(e,t.nodes)<=g+1e-6),y=Math.max(0,...o.flatMap(e=>e.nodes.map(e=>e.size))),b=0;if(y>0){let e=0,t=g/y;if(v(t))e=t;else for(let n=0;n<48;n++){let n=(e+t)/2;v(n)?e=n:t=n}b=e}let x=/* @__PURE__ */ new Map;o.forEach((e,t)=>{let n=rr+Math.max(0,(g-_(b,e.nodes))/2);for(let r of e.nodes){let e=r.size*b,i=Math.max(e,nr);x.set(r,{x:p[t],y:n+(i-e)/2,h:e,slot:i,slotTop:n}),n+=i+Qn}});let S=/* @__PURE__ */ new Map,C=/* @__PURE__ */ new Map,w=/* @__PURE__ */ new Map;for(let e of x.keys()){let t=x.get(e),n=t.y;for(let r of e.outflow)if(r.value!=null)S.set(r,n),n+=r.value*b;else if(e.stub>0&&!w.has(e)){let r=e.stub*b;w.set(e,{x:t.x+Zn,y:n,h:Math.max(ir,r)}),n+=r}n=t.y;for(let t of e.inflow)t.value!=null&&(C.set(t,n),n+=t.value*b)}let T=/* @__PURE__ */ new Map;for(let t of e.flows){if(t.value==null||t.value<=0)continue;let e=t.value*b,n=Math.max(ir,e),r=(e-n)/2,i=x.get(t.from).x+Zn;T.set(t,{a:S.get(t)+r,b:C.get(t)+r,thickness:n,x0:i,xs:i+(t.from.step>0?h:0),x1:x.get(t.to).x})}return{width:n,height:r,scale:b,columns:p,strip:h,values:f,node:x,band:T,stub:w}}function pr({a:e,b:t,thickness:n,x0:r,xs:i,x1:a}){let o=(i+a)/2;return[`M${r},${e}`,`H${i}`,`C${o},${e} ${o},${t} ${a},${t}`,`V${t+n}`,`C${o},${t+n} ${o},${e+n} ${i},${e+n}`,`H${r}`,`Z`].join(` `)}function mr({a:e,b:t,thickness:n,x0:r,xs:i,x1:a}){let o=(i+a)/2;return`M${r},${e+n/2} H${i} C${o},${e+n/2} ${o},${t+n/2} ${a},${t+n/2}`}var hr=/* @__PURE__ */ new WeakSet;function gr(e){if(e.kind===`flow`)return{flows:/* @__PURE__ */ new Set([e.flow]),nodes:/* @__PURE__ */ new Set([e.flow.from,e.flow.to]),stubs:/* @__PURE__ */ new Set};let{node:t}=e;if(e.kind===`stub`){let e=t.outflow.filter(e=>e.value==null);return{flows:/* @__PURE__ */ new Set,nodes:/* @__PURE__ */ new Set([t,...e.map(e=>e.to)]),stubs:/* @__PURE__ */ new Set([t])}}let n=[...t.inflow,...t.outflow];return{flows:new Set(n),nodes:/* @__PURE__ */ new Set([t,...n.map(e=>e.from),...n.map(e=>e.to)]),stubs:/* @__PURE__ */ new Set([t])}}function _r(e,t){let n=lr(e);n.problems.length&&!hr.has(e)&&(hr.add(e),console.warn(`lintje-chart (sankey): ${n.problems.join(`; `)}`));let i=e.label??`Aantal`,a=oe(e.color)??`var(--color-chart-default)`,o=e.share!==!1,c=t=>`${s(t)}${e.unit?` ${e.unit}`:``}`,l=(e,t)=>r(t>0?e/t*100:0),u=e=>e.unknown?`geen gegevens`:`${e.atLeast?`≥ `:``}${s(e.size)}`,d=e=>e.unknown?`geen gegevens`:`${e.atLeast?`≥ `:``}${c(e.size)}`,f=e=>e.unknown||e.atLeast||n.total<=0?null:l(e.size,n.total),p=Oe(t,[...n.steps.flatMap(e=>e.nodes.map(e=>e.href?{id:e.id,href:e.href}:null)),...n.flows.map(e=>e.href?{id:e.id,href:e.href}:null)]);return t.mobile?br(e,t,n,p,{count:u,pct:l}):yr(e,t,n,p,{name:i,color:a,showShare:o,withUnit:c,pct:l,count:u,countWithUnit:d,nodeShare:f,small:e.small??!1})}function vr(e,t,n,r){return e.of(t.href?{id:t.id,href:t.href}:null,n,r)}function yr(t,n,r,i,a){let{controller:s,description:c}=n,{name:u,color:d,showShare:f,withUnit:p,pct:h,count:_,countWithUnit:v,nodeShare:y}=a,b=s.id,x=a.small?`--chart-h-small`:`--chart-h-main`;s.measure({width:!0,height:n.height??x,fit:!!n.expanded});let C=s.width,w=n.height??Math.max(s.height,ur(t)),T=s.fontFamily,E=e=>{let t=f?y(e):null;return{count:_(e),share:t==null?``:` · ${t}`}},D=fr(r,{width:C,height:w,nameWidth:e=>S(e.label,T)*14/12,valueWidth:e=>{let t=E(e);return S(t.count,T,700)+S(t.share,T)}}),O=dr(r),k=r.steps.length-1,A=e=>{let t=y(e),n=[{label:u,value:v(e),color:d}];t!=null&&n.push({label:`van het totaal`,value:t});let i=e.step===k?e.inflow.map(e=>({label:`uit ${e.from.label}`,value:e.value})):e.outflow.map(e=>({label:`→ ${e.to.label}`,value:e.value}));return i.forEach((e,t)=>n.push({label:e.label,value:e.value==null?`geen gegevens`:p(e.value),divider:t===0})),e.rest>0&&n.push({label:`eindigt hier`,value:p(e.rest),divider:!i.length}),{title:`${e.label} (${r.steps[e.step].label})`,rows:n}},j=e=>({title:`${e.from.label} → ${e.to.label}`,rows:[{label:u,value:p(e.value??0),color:d},{label:`van ${e.from.label}`,value:h(e.value??0,e.from.size)},{label:`van het totaal`,value:h(e.value??0,r.total)}]}),M=e=>`${e.label} zonder ${r.steps[e.step+1]?.label??``}`.trim(),N=e=>e.outflow.filter(e=>e.value==null),P=e=>({title:`Geen gegevens`,rows:[{label:M(e),value:p(e.stub)},...N(e).map((e,t)=>({label:`→ ${e.to.label}`,value:``,divider:t===0}))]}),F=e=>{if(e.kind===`flow`){let{flow:t}=e;return`${t.from.label} → ${t.to.label}: ${p(t.value??0)} (${h(t.value??0,t.from.size)} van ${t.from.label})`}let{node:t}=e;if(e.kind===`stub`){let e=N(t).map(e=>e.to.label);return`${M(t)}: ${p(t.stub)}, geen gegevens over ${e.join(` en `)}`}let n=y(t);return`${t.label} (${r.steps[t.step].label}): ${v(t)}${n==null?``:` (${n} van het totaal)`}`},I=e=>e.kind===`flow`?j(e.flow):e.kind===`stub`?P(e.node):A(e.node),L=e=>{let t=O[e],n=I(t),r=F(t);if(t.kind===`flow`){let e=D.band.get(t.flow),i=(e.xs+e.x1)/2;return{x:i,y:(e.a+e.b)/2+e.thickness/2,content:n,sentence:r,side:i>C/2?`left`:void 0}}if(t.kind===`stub`){let e=D.stub.get(t.node);return{x:e.x+ar,y:e.y+e.h/2,content:n,sentence:r}}let i=D.node.get(t.node),a=i.slotTop+i.slot/2;return t.node.step===0?{x:i.x+Zn,y:a,content:n,sentence:r}:{x:i.x,y:a,content:n,sentence:r,side:`left`}},R=_e(s,O.length,L),z=(e,t)=>{if(s.hoverIndex===t&&s.tooltip&&!s.status)return;let n=e.currentTarget.closest(`svg`),r=n?.closest(`[data-tooltip-anchor]`);if(!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=L(t);s.hoverIndex=t,s.status=``,s.showTooltipAt(i.left-a.left+o.x,i.top-a.top+o.y,o.content,o.side)},B=/* @__PURE__ */ new Map;O.forEach((e,t)=>B.set(e.kind===`flow`?e.flow:e.kind===`stub`?`stub:${e.node.id}`:e.node,t));let V=i.active==null?void 0:O.find(e=>e.kind===`flow`?e.flow.id===i.active:e.kind===`node`&&e.node.id===i.active),H=(s.hoverIndex==null?void 0:O[s.hoverIndex])??V,W=H?gr(H):null,G=!!s.status,K=e=>G&&e!=null&&e===s.hoverIndex?`is-current`:``,J=e=>W&&!e?`is-dimmed`:``,Y=e=>`${e.clickable?`is-clickable`:``} ${e.pressed===`true`?`is-selected`:``}`,ee=`url(#hatch-${b})`,te=r.steps.slice(0,-1).map((t,n)=>{let a=r.flows.filter(e=>e.from.step===n&&D.band.has(e)).map(e=>{let t=D.band.get(e),n=B.get(e),r=vr(i,e,`${e.from.label} → ${e.to.label}`,F({kind:`flow`,flow:e})),a=W?.flows.has(e)??!1;return l`<g @mousemove=${e=>n!=null&&z(e,n)}>
|
|
813
|
+
<path d=${pr(t)} fill=${d}
|
|
814
|
+
class="lintje-chart__mark lintje-sankey__band ${Y(r)} ${a?`is-active`:``} ${J(a)} ${K(n)}"
|
|
815
|
+
data-mark-id=${r.markId} role=${r.role} tabindex=${r.tabIndex}
|
|
816
|
+
aria-pressed=${r.pressed} aria-label=${r.label}
|
|
817
|
+
@click=${r.click} @keydown=${r.keydown} />
|
|
818
|
+
${t.thickness<sr?l`<path class="lintje-sankey__hit lintje-sankey__hit--line ${r.clickable?`is-clickable`:``}"
|
|
819
|
+
d=${mr(t)} @click=${r.click} />`:o}
|
|
820
|
+
</g>`}),s=t.nodes.map(e=>{let t=D.stub.get(e);if(!t)return o;let n=B.get(`stub:${e.id}`);return l`<rect class="lintje-sankey__stub ${J(W?.stubs.has(e)??!1)} ${K(n)}"
|
|
810
821
|
x=${t.x} y=${t.y} width=${ar} height=${t.h} fill=${ee}
|
|
811
|
-
@mousemove=${e=>n!=null&&z(e,n)} />`});return
|
|
812
|
-
${a}${
|
|
813
|
-
</g>`}),ne=
|
|
814
|
-
<rect class="lintje-sankey__hit ${
|
|
815
|
-
x=${t.x-or} y=${t.y+t.h/2-
|
|
816
|
-
width=${20} height=${
|
|
817
|
-
${t.h>0?
|
|
818
|
-
x=${t.x} y=${t.y} width=${Zn} height=${t.h} fill=${
|
|
819
|
-
data-mark-id=${
|
|
820
|
-
aria-pressed=${
|
|
821
|
-
@click=${
|
|
822
|
-
</g>`})),ie=
|
|
823
|
-
<text x=${
|
|
822
|
+
@mousemove=${e=>n!=null&&z(e,n)} />`});return l`<g class="lintje-sankey__flows" ${e(Q(n,Math.max(1,r.steps.length-1)))}>
|
|
823
|
+
${a}${s}
|
|
824
|
+
</g>`}),ne=r.steps.flatMap(e=>e.nodes.map(e=>{let t=D.node.get(e),n=B.get(e),r=vr(i,e,e.label,F({kind:`node`,node:e})),a=Math.max(t.h,sr);return l`<g @mousemove=${e=>n!=null&&z(e,n)}>
|
|
825
|
+
<rect class="lintje-sankey__hit ${r.clickable?`is-clickable`:``}"
|
|
826
|
+
x=${t.x-or} y=${t.y+t.h/2-a/2}
|
|
827
|
+
width=${20} height=${a} @click=${r.click} />
|
|
828
|
+
${t.h>0?l`<rect class="lintje-chart__mark lintje-sankey__node ${Y(r)} ${J(W?.nodes.has(e)??!1)} ${K(n)}"
|
|
829
|
+
x=${t.x} y=${t.y} width=${Zn} height=${t.h} fill=${d}
|
|
830
|
+
data-mark-id=${r.markId} role=${r.role} tabindex=${r.tabIndex}
|
|
831
|
+
aria-pressed=${r.pressed} aria-label=${r.label}
|
|
832
|
+
@click=${r.click} @keydown=${r.keydown} />`:o}
|
|
833
|
+
</g>`})),ie=r.steps.flatMap((e,t)=>e.nodes.map(e=>{let n=D.node.get(e),r=t===0,i=r?n.x-tr:n.x+Zn+tr,a=r?`end`:`start`,s=n.slotTop+n.slot/2,c=E(e),u=t>0&&t<k&&e.outflow.some(e=>W?.flows.has(e));return l`<g class="lintje-sankey__label ${u?`is-emphasised`:``}">
|
|
834
|
+
<text x=${i} y=${D.values?s-3:s+5} text-anchor=${a}
|
|
824
835
|
class="lintje-sankey__name">${e.label}</text>
|
|
825
|
-
${D.values?
|
|
836
|
+
${D.values?l`<text x=${i} y=${s+14} text-anchor=${a}
|
|
826
837
|
class="lintje-chart__data-label lintje-sankey__value">${c.count}<tspan
|
|
827
|
-
class="lintje-sankey__share">${c.share}</tspan></text>`:
|
|
828
|
-
</g>`})),ae=
|
|
838
|
+
class="lintje-sankey__share">${c.share}</tspan></text>`:o}
|
|
839
|
+
</g>`})),ae=r.steps.map((e,t)=>l`<text x=${t===0?D.columns[0]+Zn:D.columns[t]} y="12"
|
|
829
840
|
text-anchor=${t===0?`end`:`start`}
|
|
830
|
-
class="lintje-chart__axis-label">${e.label}</text>`),oe=
|
|
841
|
+
class="lintje-chart__axis-label">${e.label}</text>`),oe=r.flows.some(e=>e.value==null),se=[{label:u,color:d,shape:`square`,fixed:!0},{label:`Stroom: de breedte is het aantal`,color:d,shape:`flow`,fixed:!0},...oe?[{label:`Geen gegevens`,shape:`hatch`,fixed:!0}]:[]],Z=[ae,l`<g @mouseleave=${()=>s.hoverAt(null)}>${te}${ne}</g>`,ie];return m`
|
|
831
842
|
<div class="lintje-chart-wrap ${a.small?`lintje-chart--small`:``}"
|
|
832
|
-
${
|
|
833
|
-
@keydown=${e=>
|
|
843
|
+
${g(s.attach)} ?data-in-view=${s.inView} data-tooltip-anchor
|
|
844
|
+
@keydown=${e=>s.dismiss(e)||i.escape(e)}>
|
|
834
845
|
${re({items:se})}
|
|
835
846
|
<figure class="lintje-chart">
|
|
836
847
|
<svg viewBox="0 0 ${C} ${w}" width=${C} height=${w}
|
|
837
848
|
class="lintje-chart__svg lintje-sankey"
|
|
838
|
-
${
|
|
839
|
-
role=${X(
|
|
849
|
+
${e({height:`${w}px`,...q(b)})}
|
|
850
|
+
role=${X(i.interactive)} aria-labelledby="${b}-desc" tabindex="0"
|
|
840
851
|
@keydown=${R.keydown} @focus=${R.focus} @blur=${R.blur}>
|
|
841
|
-
<desc id="${b}-desc">${
|
|
852
|
+
<desc id="${b}-desc">${c}</desc>
|
|
842
853
|
<defs>
|
|
843
854
|
<pattern id="hatch-${b}" width="6" height="6" patternUnits="userSpaceOnUse"
|
|
844
855
|
patternTransform="rotate(45)">
|
|
@@ -849,78 +860,79 @@ import{R as e,_ as t,cn as n,d as r,dn as i,f as a,g as o,h as s,jt as c,k as l,
|
|
|
849
860
|
${Z}
|
|
850
861
|
</svg>
|
|
851
862
|
</figure>
|
|
852
|
-
${$(
|
|
853
|
-
${ve(
|
|
863
|
+
${$(s)}
|
|
864
|
+
${ve(s)}
|
|
854
865
|
</div>
|
|
855
|
-
`}function br(
|
|
856
|
-
<p class="lintje-sankey__heading">${
|
|
857
|
-
${
|
|
866
|
+
`}function br(t,n,r,i,a){let{controller:c,description:l}=n,{count:u,pct:d}=a;c.measure({width:!0});let f=c.width,p=c.fontFamily,h=y(t.color)?t.color:void 0,_=c.id,v=e=>e.charAt(0).toLowerCase()+e.slice(1),b=r.steps.slice(0,-1).map((t,n)=>{let a=r.steps[n+1],c=He(a.nodes.length,h),l=e=>Math.min(e.index,c.length-1),g=t.nodes.filter(e=>e.outflow.length>0||e.size>0);return m`<section class="lintje-sankey__transition">
|
|
867
|
+
<p class="lintje-sankey__heading">${t.label} → ${v(a.label)}</p>
|
|
868
|
+
${g.map(t=>{let n=[],r=!1;for(let e of t.outflow)if(e.value==null)!r&&t.stub>0&&n.push({weight:t.stub,fill:``,kind:`missing`}),r=!0;else if(e.value>0){let r=l(e.to);n.push({weight:e.value,fill:c[r],kind:M(h,r)?`white`:`ink`,share:d(e.value,t.size)})}t.rest>0&&n.push({weight:t.rest,fill:``,kind:`rest`,share:d(t.rest,t.size)});let a=Math.max(0,f-2*Math.max(0,n.length-1)),g=n.reduce((e,t)=>e+t.weight,0)||1,_=vr(i,t,t.label,`${t.label}: ${u(t)}`);return m`<div class="lintje-sankey__source">
|
|
858
869
|
<p class="lintje-sankey__source-head ${_.state}" data-mark-id=${_.markId}
|
|
859
870
|
role=${_.role} tabindex=${_.tabIndex} aria-pressed=${_.pressed}
|
|
860
871
|
aria-label=${_.label} @click=${_.click} @keydown=${_.keydown}>
|
|
861
|
-
<span>${
|
|
872
|
+
<span>${t.label}</span><span>${u(t)}</span>
|
|
862
873
|
</p>
|
|
863
874
|
<div class="lintje-sankey__bar" aria-hidden="true">
|
|
864
|
-
${
|
|
865
|
-
${
|
|
866
|
-
>${t
|
|
875
|
+
${n.map(t=>{let n=t.share!=null&&S(t.share,p,700)+8<=a*t.weight/g;return m`<span class="lintje-sankey__piece lintje-sankey__piece--${t.kind}"
|
|
876
|
+
${e({"--lintje-weight":String(t.weight),background:t.fill||void 0})}
|
|
877
|
+
>${n?t.share:o}</span>`})}
|
|
867
878
|
</div>
|
|
868
879
|
<ul class="lintje-sankey__rows">
|
|
869
|
-
${
|
|
870
|
-
<span class="lintje-sankey__row-mark ${
|
|
871
|
-
role=${
|
|
872
|
-
aria-label=${
|
|
873
|
-
<span class="lintje-sankey__swatch ${
|
|
874
|
-
${
|
|
875
|
-
<span class="lintje-sankey__row-name">${
|
|
876
|
-
${
|
|
877
|
-
<span class="lintje-sankey__row-share">${d(
|
|
880
|
+
${t.outflow.map(n=>{let r=n.href?n:n.to,a=n.value==null?`${n.to.label}: geen gegevens`:`${n.to.label}: ${s(n.value)}, ${d(n.value,t.size)} van ${t.label}`,o=vr(i,r,n.to.label,a);return m`<li class="lintje-sankey__row">
|
|
881
|
+
<span class="lintje-sankey__row-mark ${o.state}" data-mark-id=${o.markId}
|
|
882
|
+
role=${o.role} tabindex=${o.tabIndex} aria-pressed=${o.pressed}
|
|
883
|
+
aria-label=${o.label} @click=${o.click} @keydown=${o.keydown}>
|
|
884
|
+
<span class="lintje-sankey__swatch ${n.value==null?`lintje-sankey__swatch--missing`:``}"
|
|
885
|
+
${e({background:n.value==null?void 0:c[l(n.to)]})}></span>
|
|
886
|
+
<span class="lintje-sankey__row-name">${n.to.label}</span>
|
|
887
|
+
${n.value==null?m`<span class="lintje-sankey__row-share">geen gegevens</span>`:m`<span class="lintje-sankey__row-count">${s(n.value)}</span>
|
|
888
|
+
<span class="lintje-sankey__row-share">${d(n.value,t.size)}</span>`}
|
|
878
889
|
</span>
|
|
879
890
|
</li>`})}
|
|
880
|
-
${
|
|
891
|
+
${t.rest>0?m`<li class="lintje-sankey__row">
|
|
881
892
|
<span class="lintje-sankey__row-mark">
|
|
882
893
|
<span class="lintje-sankey__swatch lintje-sankey__swatch--rest"></span>
|
|
883
894
|
<span class="lintje-sankey__row-name">eindigt hier</span>
|
|
884
|
-
<span class="lintje-sankey__row-count">${
|
|
885
|
-
<span class="lintje-sankey__row-share">${d(
|
|
895
|
+
<span class="lintje-sankey__row-count">${s(t.rest)}</span>
|
|
896
|
+
<span class="lintje-sankey__row-share">${d(t.rest,t.size)}</span>
|
|
886
897
|
</span>
|
|
887
|
-
</li>`:
|
|
898
|
+
</li>`:o}
|
|
888
899
|
</ul>
|
|
889
900
|
</div>`})}
|
|
890
|
-
</section>`});return
|
|
891
|
-
<div class="lintje-chart-wrap" ${
|
|
892
|
-
data-tooltip-anchor @keydown=${e=>
|
|
901
|
+
</section>`});return m`
|
|
902
|
+
<div class="lintje-chart-wrap" ${g(c.attach)} ?data-in-view=${c.inView}
|
|
903
|
+
data-tooltip-anchor @keydown=${e=>i.escape(e)}>
|
|
893
904
|
<figure class="lintje-chart lintje-sankey lintje-sankey--rows" aria-labelledby="${_}-desc">
|
|
894
905
|
<figcaption id="${_}-desc" class="visually-hidden">${l}</figcaption>
|
|
895
906
|
${b}
|
|
896
907
|
</figure>
|
|
897
908
|
</div>
|
|
898
|
-
`}function xr(e,t){switch(t.controller.follow(e),e.kind){case`line`:return Ee(e,t);case`bar`:return Ae(e,t);case`horizontal-bar`:return Me(e,t);case`target-progress`:return Ne(e,t);case`grouped-bar`:return ze(e,t);case`stacked-bar`:return Ue(e,t);case`stacked-area`:return Ge(e,t);case`pie`:return Xe(e,t);case`dual-axis`:return Ze(e,t);case`scatter`:return st(e,t);case`heatmap`:return bt(e,t);case`histogram`:return Ot(e,t);case`radar`:return Kt(e,t);case`dumbbell`:return vn(e,t);case`treemap`:return Un(e,t);case`sankey`:return _r(e,t)}}var Sr=`.lintje-chart__svg, .lintje-pie-chart__svg`;function Cr(e){return(e??``).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`grafiek`}function wr(e){switch(e.kind){case`line`:case`stacked-area`:case`dual-axis`:case`scatter`:return`line`;case`pie`:return e.donut?`donut`:`pie`;case`radar`:return`pie`;case`heatmap`:return`heatmap`;case`treemap`:return`treemap`;default:return`bar`}}function Tr(e,t){switch(e.kind){case`horizontal-bar`:case`target-progress`:return e.rows.length?`${je(e.rows.length)}px`:void 0;case`dumbbell`:return e.rows.length?`${fn(e.rows.length,t)}px`:void 0;case`pie`:case`heatmap`:return;case`sankey`:return`max(${ur(e)}px, var(${e.small?`--chart-h-small`:`--chart-h-main`}))`;default:return e.small?`var(--chart-h-small)`:void 0}}function Er(e){let t=e.kind===`bar`||e.series.some(e=>!e.comparison)?G(e.forecastFrom,e.labels.length):null,n=(e.forecastLabel??`Raming`).toLowerCase();return{from:t,bounds:(e,n)=>{if(t==null||n<t)return[``,``];let{low:r,high:i}=K(e,n);return[r,i]},kind:e=>t==null?[]:[e<t?`gemeten`:n],kindHeader:t==null?[]:[`Soort`]}}function Dr(e){switch(e.kind){case`line`:{let t=e.events??[],n=e=>t.filter(t=>t.index===e).map(e=>e.label).join(`; `),r=Er(e),i=e=>r.from!=null&&!e.comparison&&e.forecast!=null;return[[``,...e.series.flatMap(e=>[e.label,...i(e)?[`${e.label} ondergrens`,`${e.label} bovengrens`]:[]]),...t.length?[`Gebeurtenis`]:[],...r.kindHeader],...e.labels.map((a,o)=>[a,...e.series.flatMap(e=>[e.values[o],...i(e)?r.bounds(e.forecast,o):[]]),...t.length?[n(o)]:[],...r.kind(o)])]}case`bar`:{let t=Er(e),n=t.from!=null&&e.forecast!=null;return[[``,e.axisTitle??`Waarde`,...n?[`Ondergrens`,`Bovengrens`]:[],...e.trend?[`Trend`]:[],...t.kindHeader],...e.labels.map((r,i)=>[r,e.values[i],...n?t.bounds(e.forecast,i):[],...e.trend?[e.trend[i]]:[],...t.kind(i)])]}case`horizontal-bar`:return[[``,e.unit?`Waarde (${e.unit})`:`Waarde`],...e.rows.map(e=>[e.label,e.value])];case`target-progress`:return[[``,`Voortgang (%)`,`Doel (%)`],...e.rows.map(t=>[t.label,t.value,e.target??100])];case`grouped-bar`:case`stacked-bar`:return[[``,...e.series.map(e=>e.label)],...e.labels.map((t,n)=>[t,...e.series.map(e=>e.values[n])])];case`stacked-area`:return[[``,...e.series.map(e=>e.label),`Totaal`],...e.labels.map((t,n)=>{let r=e.series.map(e=>e.values[n]),i=r.some(e=>e==null)?null:Number(r.reduce((e,t)=>e+t,0).toFixed(Or(r)));return[t,...r,i]})];case`pie`:return[[``,`Aantal`],...e.segments.map(e=>[e.label,e.value])];case`dual-axis`:{let t=e=>e.unit?`${e.label} (${e.unit})`:e.label;return[[``,t(e.left),t(e.right)],...e.labels.map((t,n)=>[t,e.left.values[n],e.right.values[n]])]}case`scatter`:{let t=(e,t)=>{let n=e.charAt(0).toUpperCase()+e.slice(1);return t?`${n} (${t})`:n};return[[`Reeks`,`Naam`,t(e.xTitle,e.xUnit),t(e.axisTitle,e.unit)],...e.series.flatMap(e=>e.points.map(t=>[e.label,t.label,t.x,t.y]))]}case`heatmap`:return[[``,...e.columnLabels],...e.rowLabels.map((t,n)=>[t,...e.values[n]??[]])];case`radar`:{let t=e.threshold==null?[]:[e.thresholdLabel??`Norm`];return[[``,...e.series.map(e=>e.label),...t],...e.axes.map((t,n)=>[t,...e.series.map(e=>e.values[n]??null),...e.threshold==null?[]:[e.threshold]])]}case`dumbbell`:{let t=mn(e.rows),n=e.threshold==null?[]:[e.thresholdLabel??`Norm`];return[[``,e.fromLabel,e.toLabel,`Verschil`,...n],...e.rows.map(n=>[n.label,n.from,n.to,hn(n,t),...e.threshold==null?[]:[e.threshold]])]}case`histogram`:{let t=t=>e.unit?`${t} (${e.unit})`:t;return[[`Klasse`,t(`Van`),t(`Tot`),`Aantal`],...e.bins.map(t=>[Et(t,e.unit),t.from,t.to??``,t.count])]}case`treemap`:return zn(e);case`sankey`:{let{flows:t}=lr(e);return[[`Van`,`Naar`,e.unit?`Aantal (${e.unit})`:`Aantal`,`Aandeel van de bron (%)`],...t.map(e=>[e.from.label,e.to.label,e.value,e.value==null||e.from.size<=0?null:Math.round(e.value/e.from.size*100)])]}}}function Or(e){return e.reduce((e,t)=>{if(typeof t!=`number`||Number.isInteger(t))return e;let n=String(t).split(`.`)[1]??``;return Math.max(e,n.length)},0)}var kr=class extends E{static{this.styles=[
|
|
899
|
-
id=${r??
|
|
900
|
-
span=${e.span??
|
|
901
|
-
heading=${e.title??
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
909
|
+
`}function xr(e,t){switch(t.controller.follow(e),e.kind){case`line`:return Ee(e,t);case`bar`:return Ae(e,t);case`horizontal-bar`:return Me(e,t);case`target-progress`:return Ne(e,t);case`grouped-bar`:return ze(e,t);case`stacked-bar`:return Ue(e,t);case`stacked-area`:return Ge(e,t);case`pie`:return Xe(e,t);case`dual-axis`:return Ze(e,t);case`scatter`:return st(e,t);case`heatmap`:return bt(e,t);case`histogram`:return Ot(e,t);case`radar`:return Kt(e,t);case`dumbbell`:return vn(e,t);case`treemap`:return Un(e,t);case`sankey`:return _r(e,t)}}var Sr=`.lintje-chart__svg, .lintje-pie-chart__svg`;function Cr(e){return(e??``).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`grafiek`}function wr(e){switch(e.kind){case`line`:case`stacked-area`:case`dual-axis`:case`scatter`:return`line`;case`pie`:return e.donut?`donut`:`pie`;case`radar`:return`pie`;case`heatmap`:return`heatmap`;case`treemap`:return`treemap`;default:return`bar`}}function Tr(e,t){switch(e.kind){case`horizontal-bar`:case`target-progress`:return e.rows.length?`${je(e.rows.length)}px`:void 0;case`dumbbell`:return e.rows.length?`${fn(e.rows.length,t)}px`:void 0;case`pie`:case`heatmap`:return;case`sankey`:return`max(${ur(e)}px, var(${e.small?`--chart-h-small`:`--chart-h-main`}))`;default:return e.small?`var(--chart-h-small)`:void 0}}function Er(e){let t=e.kind===`bar`||e.series.some(e=>!e.comparison)?G(e.forecastFrom,e.labels.length):null,n=(e.forecastLabel??`Raming`).toLowerCase();return{from:t,bounds:(e,n)=>{if(t==null||n<t)return[``,``];let{low:r,high:i}=K(e,n);return[r,i]},kind:e=>t==null?[]:[e<t?`gemeten`:n],kindHeader:t==null?[]:[`Soort`]}}function Dr(e){switch(e.kind){case`line`:{let t=e.events??[],n=e=>t.filter(t=>t.index===e).map(e=>e.label).join(`; `),r=Er(e),i=e=>r.from!=null&&!e.comparison&&e.forecast!=null;return[[``,...e.series.flatMap(e=>[e.label,...i(e)?[`${e.label} ondergrens`,`${e.label} bovengrens`]:[]]),...t.length?[`Gebeurtenis`]:[],...r.kindHeader],...e.labels.map((a,o)=>[a,...e.series.flatMap(e=>[e.values[o],...i(e)?r.bounds(e.forecast,o):[]]),...t.length?[n(o)]:[],...r.kind(o)])]}case`bar`:{let t=Er(e),n=t.from!=null&&e.forecast!=null;return[[``,e.axisTitle??`Waarde`,...n?[`Ondergrens`,`Bovengrens`]:[],...e.trend?[`Trend`]:[],...t.kindHeader],...e.labels.map((r,i)=>[r,e.values[i],...n?t.bounds(e.forecast,i):[],...e.trend?[e.trend[i]]:[],...t.kind(i)])]}case`horizontal-bar`:return[[``,e.unit?`Waarde (${e.unit})`:`Waarde`],...e.rows.map(e=>[e.label,e.value])];case`target-progress`:return[[``,`Voortgang (%)`,`Doel (%)`],...e.rows.map(t=>[t.label,t.value,e.target??100])];case`grouped-bar`:case`stacked-bar`:return[[``,...e.series.map(e=>e.label)],...e.labels.map((t,n)=>[t,...e.series.map(e=>e.values[n])])];case`stacked-area`:return[[``,...e.series.map(e=>e.label),`Totaal`],...e.labels.map((t,n)=>{let r=e.series.map(e=>e.values[n]),i=r.some(e=>e==null)?null:Number(r.reduce((e,t)=>e+t,0).toFixed(Or(r)));return[t,...r,i]})];case`pie`:return[[``,`Aantal`],...e.segments.map(e=>[e.label,e.value])];case`dual-axis`:{let t=e=>e.unit?`${e.label} (${e.unit})`:e.label;return[[``,t(e.left),t(e.right)],...e.labels.map((t,n)=>[t,e.left.values[n],e.right.values[n]])]}case`scatter`:{let t=(e,t)=>{let n=e.charAt(0).toUpperCase()+e.slice(1);return t?`${n} (${t})`:n};return[[`Reeks`,`Naam`,t(e.xTitle,e.xUnit),t(e.axisTitle,e.unit)],...e.series.flatMap(e=>e.points.map(t=>[e.label,t.label,t.x,t.y]))]}case`heatmap`:return[[``,...e.columnLabels],...e.rowLabels.map((t,n)=>[t,...e.values[n]??[]])];case`radar`:{let t=e.threshold==null?[]:[e.thresholdLabel??`Norm`];return[[``,...e.series.map(e=>e.label),...t],...e.axes.map((t,n)=>[t,...e.series.map(e=>e.values[n]??null),...e.threshold==null?[]:[e.threshold]])]}case`dumbbell`:{let t=mn(e.rows),n=e.threshold==null?[]:[e.thresholdLabel??`Norm`];return[[``,e.fromLabel,e.toLabel,`Verschil`,...n],...e.rows.map(n=>[n.label,n.from,n.to,hn(n,t),...e.threshold==null?[]:[e.threshold]])]}case`histogram`:{let t=t=>e.unit?`${t} (${e.unit})`:t;return[[`Klasse`,t(`Van`),t(`Tot`),`Aantal`],...e.bins.map(t=>[Et(t,e.unit),t.from,t.to??``,t.count])]}case`treemap`:return zn(e);case`sankey`:{let{flows:t}=lr(e);return[[`Van`,`Naar`,e.unit?`Aantal (${e.unit})`:`Aantal`,`Aandeel van de bron (%)`],...t.map(e=>[e.from.label,e.to.label,e.value,e.value==null||e.from.size<=0?null:Math.round(e.value/e.from.size*100)])]}}}function Or(e){return e.reduce((e,t)=>{if(typeof t!=`number`||Number.isInteger(t))return e;let n=String(t).split(`.`)[1]??``;return Math.max(e,n.length)},0)}var kr=class extends E{static{this.styles=[t,p(T),p(d),...de]}static{this.properties={data:{attribute:!1}}}#e=new le(()=>this.requestUpdate());#t=null;#n=new u(this);get dataSettings(){return this.data??void 0}willUpdate(e){super.willUpdate(e)}disconnectedCallback(){this.#e.detach(),this.#t?.detach(),this.#t=null,super.disconnectedCallback()}get ready(){return(this.data?.state??`ready`)===`ready`}get expandable(){return this.data?.expandable!==!1}get downloadName(){let e=this.data?.download;return e===!1?null:e?.filename??Cr(this.data?.title)}csv(){let e=this.data,t=this.downloadName;e&&t!==null&&D(t,Dr(e.chart))}png(){let e=this.data;if(!e)return;let t=this.renderRoot.querySelector(this.expanded?`lintje-modal`:`lintje-tile`),n=t?.querySelector(Sr);for(;n&&n.parentElement!==t;)n=n.parentElement;if(!n)return;let r=this.#n.matches&&e.mobileSubtitle?e.mobileSubtitle:e.subtitle,i=k(n,{title:e.title,subtitle:r,footnote:e.footnote});O(this.downloadName??Cr(e.title),i)}expandChanged(e){e?this.#t??=new le(()=>this.requestUpdate()):(this.#t?.detach(),this.#t=null)}render(){let e=this.data;if(!e)return o;let t=this.ready,n=this.#n.matches&&e.mobileSubtitle?e.mobileSubtitle:e.subtitle,r=this.id?`${this.id}-tile`:void 0;return m`<lintje-tile
|
|
910
|
+
id=${r??o}
|
|
911
|
+
span=${e.span??o}
|
|
912
|
+
heading=${e.title??o}
|
|
913
|
+
?collapsed-mobile=${!!e.collapsedMobile}
|
|
914
|
+
icon=${e.icon??o}
|
|
915
|
+
subtitle=${n??o}
|
|
916
|
+
intro=${e.intro??o}
|
|
917
|
+
footnote=${e.footnote??o}
|
|
906
918
|
?legend-below=${!!e.legendBelow}
|
|
907
919
|
?expandable=${this.expandable&&t}
|
|
908
920
|
?download=${this.downloadName!==null&&t}
|
|
909
921
|
state=${e.state??`ready`}
|
|
910
|
-
message=${e.message??
|
|
911
|
-
last-known=${e.lastKnown??
|
|
912
|
-
content-height=${Tr(e.chart,this.#n.matches)??
|
|
922
|
+
message=${e.message??o}
|
|
923
|
+
last-known=${e.lastKnown??o}
|
|
924
|
+
content-height=${Tr(e.chart,this.#n.matches)??o}
|
|
913
925
|
@lintje-tile-expand=${e=>{e.stopPropagation(),this.expand(!0)}}
|
|
914
926
|
@lintje-tile-download=${e=>{e.stopPropagation(),this.csv()}}
|
|
915
927
|
>
|
|
916
|
-
${e.notice?
|
|
928
|
+
${e.notice?m`<lintje-announcement
|
|
917
929
|
slot="notice"
|
|
918
930
|
compact
|
|
919
931
|
.data=${e.notice}
|
|
920
|
-
></lintje-announcement>`:
|
|
932
|
+
></lintje-announcement>`:o}
|
|
921
933
|
${this.content()}
|
|
922
934
|
</lintje-tile>
|
|
923
935
|
|
|
924
|
-
${this.renderExpandModal(this.expanded&&this.#t?xr(e.chart,{...this.chartOptions(this.#t),expanded:!0}):
|
|
936
|
+
${this.renderExpandModal(this.expanded&&this.#t?xr(e.chart,{...this.chartOptions(this.#t),expanded:!0}):o,{heading:e.title,subtitle:n,footnote:e.footnote,csv:()=>this.csv(),png:()=>this.png()})}`}content(){let e=this.data;switch(e.state??`ready`){case`loading`:return m`<div slot="loading">
|
|
925
937
|
${fe({kind:wr(e.chart),height:Tr(e.chart,this.#n.matches),status:!1})}
|
|
926
|
-
</div>`;case`empty`:case`error`:return
|
|
938
|
+
</div>`;case`empty`:case`error`:return o;default:return xr(e.chart,this.chartOptions(this.#e))}}select(e,t=!1){t?e.href&&this.followLink(e.href,void 0,void 0,{newTab:!0}):this.emit(`lintje-mark-select`,e)&&e.href&&this.followLink(e.href)}async focusMark(e){await this.updateComplete;let t=this.renderRoot.querySelector(this.expanded?`lintje-modal`:`lintje-tile`),n=t?.querySelector(`[data-mark-id="${CSS.escape(e)}"]`)??t?.querySelector(`${Sr}, .lintje-heatmap, .lintje-sankey--rows`);n&&!n.hasAttribute(`tabindex`)&&n.setAttribute(`tabindex`,`-1`),n?.focus()}chartOptions(e){return{controller:e,description:this.data?.description??``,mobile:this.#n.matches,selectedId:this.data?.selectedId??null,onSelect:({id:e,label:t,href:n},r)=>this.select({id:e,label:t,href:n},r),onClear:e=>{this.select({id:null,label:null,href:this.data?.clearHref}),this.focusMark(e)}}}};b(`lintje-chart`,kr);export{kr as LintjeChart};
|